> ## 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 Task Note

> Appends a note to an existing task in the provider's EMR system.

<Note>
  This endpoint appends a note to a task that already exists in the EMR. To find a task's `emr_task_id`, perform a live fetch with `POST /v1/patients/fetch` and `include: ["tasks"]` — each task in the response carries its `emr_task_id`.
</Note>

### Request Parameters

* **emr\_task\_id** (string, required): The EMR ID of the task to append the note to. Obtain this from the `tasks[]` array returned by `POST /v1/patients/fetch` with `include: ["tasks"]`.
* **note** (string, required): The note body content.

### Example Request

```bash theme={null}
curl -X POST https://api.usecobalt.com/v1/tasks/notes \
-H 'Content-Type: application/json' \
-H 'client_id: ci_live_198908HJDKJSH98789OHKJL' \
-H 'client_secret: cs_live_9827hofdsklOYYHJLJh' \
-H 'access_token: 493JKLHIU98789hLKH9HHJH' \
-d '{
    "emr_task_id": "9bef4113-e9ce-4895-9a17-2c18cd625116",
    "note": "Patient called back, scheduled for next week."
}'
```

### Example Response

```json theme={null}
{
    "success": true,
    "message": "Task note processing. A webhook event will be sent upon completion.",
    "task_note_id": "abc123def456789012345678",
    "job_id": 12345
}
```

The response includes:

* **task\_note\_id**: Unique identifier for the created task note record
* **job\_id**: Job execution identifier for tracking the async operation

### Error Responses

#### Missing Required Field

```json theme={null}
{
    "success": false,
    "message": "Missing required field: emr_task_id"
}
```

#### Unexpected Field

Only `emr_task_id` and `note` are accepted. Any other field returns a `400`:

```json theme={null}
{
    "success": false,
    "message": "Unexpected fields in request body: subject"
}
```

### Webhook Notifications

When the task note processing is complete, we will send a webhook to your registered endpoint.

#### Success

```json theme={null}
{
    "id": "evt_1J9X2q2eZvKYlo2CluR9g9gV",
    "access_token_reference_id": "user_1J9X2q2eZvKYlo2Cxyz",
    "object": "event",
    "created": "2026-06-15T12:02:40Z",
    "type": "task_note.created",
    "job_id": "12345",
    "data": {
        "task_note_id": "abc123def456789012345678",
        "emr_note_id": "f862b0a0-d820-418c-9e30-412bb62bde34",
        "emr_task_id": "9bef4113-e9ce-4895-9a17-2c18cd625116",
        "note": "Patient called back, scheduled for next week."
    }
}
```

#### Failure

```json theme={null}
{
    "id": "evt_1J9X2q2eZvKYlo2CluR9g9gW",
    "access_token_reference_id": "user_1J9X2q2eZvKYlo2Cxyz",
    "object": "event",
    "created": "2026-06-15T12:05:00Z",
    "type": "task_note.failed",
    "job_id": "12345",
    "data": {
        "task_note_id": "abc123def456789012345678",
        "failure_reason": "Failed to create task note"
    }
}
```


## OpenAPI

````yaml POST /tasks/notes
openapi: 3.0.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
security:
  - ClientCredentials: []
    ClientSecret: []
    AccessToken: []
paths:
  /tasks/notes:
    post:
      summary: Create Task Note
      description: >-
        Appends a note to an existing task in the provider's EMR system. This is
        an asynchronous operation that returns immediately with a job_id, and
        sends a webhook notification upon completion.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - emr_task_id
                - note
              properties:
                emr_task_id:
                  type: string
                  description: >-
                    The EMR ID of the task to append the note to. Obtain this
                    from the tasks[] array returned by POST /v1/patients/fetch
                    with include: ["tasks"].
                note:
                  type: string
                  description: The note body content.
      responses:
        '200':
          description: Task note queued successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                  message:
                    type: string
                  task_note_id:
                    type: string
                    description: Unique identifier for the created task note record
                  job_id:
                    type: integer
                    description: Job execution identifier for tracking the async operation
        '400':
          description: Bad request - Missing or invalid parameters
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                  message:
                    type: string
        '404':
          description: User not found
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                  message:
                    type: string
                    example: User not found.
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                  message:
                    type: string
components:
  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

````