> ## Documentation Index
> Fetch the complete documentation index at: https://docs.usecobalt.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Update Order

> Updates an existing order's dates, assignee, or priority.

Order updates are processed asynchronously: a valid request returns immediately with a `202`, and an `order.updated` webhook is sent when processing completes. If the update fails terminally, an `order.update_failed` webhook is sent instead.

Updating orders is only supported for eClinicalWorks.

### Request Parameters

All fields are optional; send only the fields you want to change.

* **result\_date** (string, optional): Result date (ISO 8601, YYYY-MM-DD).
* **collected\_date** (string, optional): Specimen collection date (ISO 8601, YYYY-MM-DD).
* **collection\_time** (string, optional): Specimen collection time, e.g. `"12:58 PM"`.
* **performed\_date** (string, optional): Performed date (ISO 8601, YYYY-MM-DD). Diagnostic imaging.
* **assigned\_to\_id** (string, optional): EMR staff id to assign the order to.
* **high\_priority** (boolean, optional): Flag the order high priority.
* **callback\_urls** (string\[], optional): URLs to receive the `order.updated` webhook, in addition to the account webhook.

### Example Request

```bash theme={null}
curl -X PATCH https://api.usecobalt.com/v1/orders/ord_123456 \
-H 'Content-Type: application/json' \
-H 'client_id: ci_live_198908HJDKJSH98789OHKJL' \
-H 'client_secret: cs_live_9827hofdsklOYYHJLJh' \
-H 'access_token: 493JKLHIU98789hLKH9HHJH' \
-d '{
    "collected_date": "2026-03-16",
    "collection_time": "09:15 AM",
    "assigned_to_id": "staff_101",
    "high_priority": true
}'
```

### Example Response

```json theme={null}
{
  "success": true,
  "status": "queued",
  "message": "Order update queued. An order.updated webhook will be sent when it completes.",
  "job_id": 12345
}
```

### Webhook Notifications

When processing completes, we send a webhook to your registered endpoint.

#### Success

```json theme={null}
{
  "id": "evt_1J9X2q2eZvKYlo2CluR9g9gV",
  "access_token_reference_id": "user_1J9X2q2eZvKYlo2Cxyz",
  "object": "event",
  "created": "2025-10-09T10:30:00Z",
  "type": "order.updated",
  "job_id": "12345",
  "data": {
    "emr_order_id": "998877",
    "emr_encounter_id": "445566",
    "patient_mrn": "12345"
  }
}
```

#### Failure

```json theme={null}
{
  "id": "evt_1J9X2q2eZvKYlo2CluR9g9gW",
  "access_token_reference_id": "user_1J9X2q2eZvKYlo2Cxyz",
  "object": "event",
  "created": "2025-10-09T10:35:00Z",
  "type": "order.update_failed",
  "job_id": "12345",
  "data": {
    "patient_mrn": "12345",
    "failure_reason": "Order update failed after multiple attempts. Please try again later or contact support."
  }
}
```


## OpenAPI

````yaml PATCH /orders/{id}
openapi: 3.1.0
info:
  title: Cobalt API
  version: 1.0.1
  description: API for interacting with Cobalt's EHR integration services
servers:
  - url: https://api.usecobalt.com/v1
    description: Production
security:
  - ClientCredentials: []
    ClientSecret: []
    AccessToken: []
paths:
  /orders/{id}:
    patch:
      tags:
        - Orders
      summary: Update an order
      description: Queues an update to an existing order (dates, assignee, priority).
      operationId: updateOrder
      parameters:
        - name: id
          in: path
          description: Cobalt order ID.
          schema:
            type: string
          required: true
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                result_date:
                  type: string
                  x-supported-emrs:
                    - eClinicalWorks
                  description: Result date (ISO 8601, YYYY-MM-DD).
                collected_date:
                  type: string
                  x-supported-emrs:
                    - eClinicalWorks
                  description: Specimen collection date (ISO 8601, YYYY-MM-DD).
                collection_time:
                  type: string
                  x-supported-emrs:
                    - eClinicalWorks
                  description: Specimen collection time, e.g. "12:58 PM".
                performed_date:
                  type: string
                  x-supported-emrs:
                    - eClinicalWorks
                  description: Performed date (ISO 8601, YYYY-MM-DD). Diagnostic imaging.
                assigned_to_id:
                  type: string
                  x-supported-emrs:
                    - eClinicalWorks
                  description: EMR staff id to assign the order to.
                high_priority:
                  type: boolean
                  x-supported-emrs:
                    - eClinicalWorks
                  description: Flag the order high priority.
                callback_urls:
                  type: array
                  items:
                    type: string
                  x-supported-emrs:
                    - eClinicalWorks
                  description: >-
                    URLs to receive the order.updated webhook, in addition to
                    the account webhook.
      responses:
        '202':
          description: Queued for processing
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                  status:
                    type: string
                  message:
                    type: string
                  job_id:
                    anyOf:
                      - type: string
                      - type: number
                required:
                  - success
                  - status
                  - message
                  - job_id
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '500':
          $ref: '#/components/responses/InternalServerError'
components:
  responses:
    BadRequest:
      description: Bad request — missing or invalid parameters
      content:
        application/json:
          schema:
            type: object
            properties:
              success:
                type: boolean
                enum:
                  - false
              message:
                type: string
            required:
              - success
              - message
    Unauthorized:
      description: Unauthorized — missing or invalid credentials
      content:
        application/json:
          schema:
            type: object
            properties:
              success:
                type: boolean
                enum:
                  - false
              message:
                type: string
            required:
              - success
              - message
    InternalServerError:
      description: Internal server error
      content:
        application/json:
          schema:
            type: object
            properties:
              success:
                type: boolean
                enum:
                  - false
              message:
                type: string
            required:
              - success
              - message
  securitySchemes:
    ClientCredentials:
      type: apiKey
      in: header
      name: client_id
    ClientSecret:
      type: apiKey
      in: header
      name: client_secret
    AccessToken:
      type: apiKey
      in: header
      name: access_token

````