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

# Send Message

> Sends a message to the specified provider.

### Example Request

```bash theme={null}
curl -X POST https://api.usecobalt.com/v1/messages \
-H 'Content-Type: application/json' \
-H 'client_id: ci_live_198908HJDKJSH98789OHKJL' \
-H 'client_secret: cs_live_9827hofdsklOYYHJLJh' \
-H 'access_token: 493JKLHIU98789hLKH9HHJH' \
-d '{
    "provider": "123456789",
    "subject": "Test Message",
    "message": "This is a test message content."
}'
```

### Example Response

```json theme={null}
{
    "success": true,
    "message": "Message processing. A webhook event will be sent upon completion.",
    "message_id": "msg_123456789",
    "job_id": 15550942
}
```

### Request Parameters

The `/messages` endpoint requires the following fields:

* **provider** (required): The EHR provider ID to send the message to
* **subject** (required): The subject line for the message
* **message** (required): The content of the message to be sent


## OpenAPI

````yaml POST /messages
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:
  /messages:
    post:
      summary: Send Message
      description: Sends a message to the specified provider.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - provider
                - subject
                - message
              properties:
                provider:
                  type: string
                  description: The EHR provider ID to send the message to
                subject:
                  type: string
                  description: The subject line of the message
                message:
                  type: string
                  description: The content of the message
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                  message:
                    type: string
                  message_id:
                    type: string
                  job_id:
                    type: integer
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

````