> ## 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.

# Create Claim

> Creates a claim for a given appointment in the connected EMR system.

<Note>
  This is an async operation. The endpoint returns `202 Accepted` immediately after queuing the claim, and a webhook event is sent to your registered endpoint once the claim has been created (or has failed) in the EMR. Currently supported for `eClinicalWorks`.
</Note>

### Request Parameters

#### Required Fields

* **appointment\_id** (string, required): The Cobalt appointment ID to create a claim for. The appointment must belong to the authenticated user and have an associated EMR appointment ID.

### Example Request

```bash theme={null}
curl -X POST https://api.usecobalt.com/v1/claims \
-H 'Content-Type: application/json' \
-H 'client_id: ci_live_198908HJDKJSH98789OHKJL' \
-H 'client_secret: cs_live_9827hofdsklOYYHJLJh' \
-H 'access_token: 493JKLHIU98789hLKH9HHJH' \
-d '{
    "appointment_id": "a1b2c3d4e5f64g7h8i9jk0l1m2n3o4p5"
}'
```

### Example Response

```json theme={null}
{
    "success": true,
    "message": "Claim creation queued. A webhook event will be sent upon completion.",
    "claim_id": "f4g5h6i7j8k9l0m1n2o3p4q5r6s7t8u9",
    "appointment_id": "a1b2c3d4e5f64g7h8i9jk0l1m2n3o4p5",
    "job_id": 12345
}
```

The response includes:

* **claim\_id**: Unique identifier for the queued claim record. Use this to correlate the eventual webhook event.
* **appointment\_id**: Echo of the appointment the claim was queued against.
* **job\_id**: Job execution identifier for tracking the async operation.

### Error Responses

#### Missing Required Field

```json theme={null}
{
    "success": false,
    "message": "'appointment_id' is required."
}
```

#### Invalid Appointment ID Format

```json theme={null}
{
    "success": false,
    "message": "Invalid 'appointment_id' format. Please provide a valid UUID."
}
```

#### Appointment Missing EMR ID

Returned if the appointment exists but has not yet been synced with an `emr_appointment_id`.

```json theme={null}
{
    "success": false,
    "message": "Appointment is missing emr_appointment_id; cannot create claim."
}
```

#### Appointment Not Found

```json theme={null}
{
    "success": false,
    "message": "Appointment not found."
}
```

#### Duplicate Claim

Returned if a claim for this appointment is already in-flight (`pending_create`) or has already been completed. Failed claims do not block retries.

```json theme={null}
{
    "success": false,
    "message": "A claim for this appointment is already pending or completed."
}
```

### Webhook Notifications

When the claim creation is complete, we will send a webhook to your registered endpoint. Here are examples of what those webhook payloads will look like:

#### Success

```json theme={null}
{
    "id": "evt_1J9X2q2eZvKYlo2CluR9g9gV",
    "access_token_reference_id": "user_1J9X2q2eZvKYlo2Cxyz",
    "object": "event",
    "created": "2026-05-22T10:30:00Z",
    "type": "claim.created",
    "job_id": "12345",
    "data": {
        "claim_id": "f4g5h6i7j8k9l0m1n2o3p4q5r6s7t8u9",
        "appointment_id": "a1b2c3d4e5f64g7h8i9jk0l1m2n3o4p5",
        "patient_mrn": "MRN-12345",
        "emr_claim_id": "100234",
        "emr_appointment_id": "500100",
        "emr_patient_id": "40210"
    }
}
```

#### Failure

```json theme={null}
{
    "id": "evt_1J9X2q2eZvKYlo2CluR9g9gW",
    "access_token_reference_id": "user_1J9X2q2eZvKYlo2Cxyz",
    "object": "event",
    "created": "2026-05-22T10:35:00Z",
    "type": "claim.failed",
    "job_id": "12345",
    "data": {
        "claim_id": "f4g5h6i7j8k9l0m1n2o3p4q5r6s7t8u9",
        "appointment_id": "a1b2c3d4e5f64g7h8i9jk0l1m2n3o4p5",
        "patient_mrn": "MRN-12345",
        "failure_reason": "Failed to create claim"
    }
}
```
