Skip to main content
PATCH
/
providers
/
ehr
/
{ehr_id}
Update Provider by EMR ID
curl --request PATCH \
  --url https://api.usecobalt.com/v1/providers/ehr/{ehr_id} \
  --header 'Content-Type: application/json' \
  --header 'access_token: <api-key>' \
  --header 'client_id: <api-key>' \
  --header 'client_secret: <api-key>' \
  --data '
{
  "status": "active",
  "hours": [
    {
      "day": "Monday",
      "shifts": [
        {
          "start": "T08:00:00",
          "end": "T17:00:00",
          "facility_id": "<string>",
          "set_start_date": "2025-11-13T00:00:00",
          "set_end_date": "2026-11-13T00:00:00",
          "set_recur": {
            "rec_start_date": "2025-11-13T00:00:00",
            "rec_end_date": "2026-11-13T00:00:00",
            "recur_interval_type": "days",
            "recur_interval_amount": 1,
            "recur_interval_description": "Every 1 week."
          }
        }
      ]
    }
  ]
}
'
{
  "success": true,
  "message": "<string>",
  "provider_id": "<string>"
}

Example Request

curl -X PATCH https://api.usecobalt.com/v1/providers/ehr/12345 \
-H 'Content-Type: application/json' \
-H 'client_id: ci_live_198908HJDKJSH98789OHKJL' \
-H 'client_secret: cs_live_9827hofdsklOYYHJLJh' \
-H 'access_token: 493JKLHIU98789hLKH9HHJH' \
-d '{
    "status": "active",
    "hours": [
        {
            "day": "Monday",
            "shifts": [
                {
                    "start": "T09:00:00",
                    "end": "T18:00:00",
                    "facility_id": "095f8067-d3fc-4e13-b771-32f87cd0c3f2",
                    "set_start_date": "2025-11-13T00:00:00",
                    "set_end_date": "2026-11-13T00:00:00"
                }
            ]
        },
                {
            "day": "Tuesday",
            "shifts": [
                {
                    "start": "T08:00:00",
                    "end": "T17:00:00",
                    "facility_id": "095f8067-d3fc-4e13-b771-32f87cd0c3f2",
                    "set_start_date": "2025-11-13T00:00:00",
                    "set_end_date": "2026-11-13T00:00:00"
                }
            ]
        }
    ]
}'
Response:
{
    "success": true,
    "message": "Provider status and hours updated successfully.",
    "provider_id": "abc123def4567890abcdef1234567890"
}

Notes

  • EMR ID: Use the ehr_id field from GET /v1/providers response (not the id field)
  • Use Case: This endpoint is designed for customers who primarily work with EMR IDs (e.g., when creating appointments). It eliminates the need to maintain a mapping between ehr_id and Cobalt’s internal id.
  • Status Updates: Status is case-insensitive (“active”, “Active”, “ACTIVE” are all accepted)
  • Hours Validation:
    • The facility_id must exist in your organization’s locations
    • The facility_name will be automatically enriched from the database
    • Time format must be THH:MM:SS (e.g., T08:00:00)
    • Dates must be in ISO 8601 format (e.g., 2025-11-13T00:00:00)
    • Days must be capitalized day names (Monday, Tuesday, etc.)
  • At Least One Field: You must provide either status, hours, or both
  • Error Handling:
    • Invalid or non-existent EMR IDs return a 404 error with message: "Provider with EMR ID '{ehr_id}' not found for this organization."
    • Validation errors return 400

Choosing Between Endpoints

Use PATCH /v1/providers/{id} when:
  • You’re working within Cobalt’s system and have the internal provider ID readily available
  • You’re building internal tooling or admin interfaces
Use PATCH /v1/providers/ehr/{ehr_id} when:
  • You’re working with EMR IDs from appointment data or other EMR operations
  • You want to avoid maintaining a mapping table between id and ehr_id
  • Your workflow primarily involves EMR identifiers

Authorizations

client_id
string
header
required
client_secret
string
header
required
access_token
string
header
required

Path Parameters

ehr_id
string
required

The provider's EMR ID (ehr_id from GET /providers)

Body

application/json
status
enum<string>
Available options:
active,
inactive
hours
object[]

Response

Successful response

success
boolean
message
string
provider_id
string