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

# Send Messages

> This endpoint sends push notifications to one or more user devices.

## Error Responses

### 400 Bad Request

Returned when the request contains invalid push notification parameters.

Returns a plain text error message:

```
Invalid push notification parameters
```

### 401 Unauthorized

Authentication failed or invalid API key.


## OpenAPI

````yaml POST /api/v1/messages:send
openapi: 3.1.0
info:
  title: clix/external/v1/clix.proto
  version: version not set
servers:
  - url: https://api.clix.so
security:
  - ProjectIdAuth: []
    ApiKeyAuth: []
tags:
  - name: ClixExternalService
paths:
  /api/v1/messages:send:
    post:
      tags:
        - ClixExternalService
      summary: Send push notifications to user devices.
      description: This endpoint sends push notifications to one or more user devices.
      operationId: ClixExternalService_SendPushNotifications
      requestBody:
        required: true
        description: Request body containing the push notifications to send.
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/v1SendPushNotificationsRequest'
      responses:
        '200':
          description: >-
            A successful response containing the delivery results for each push
            notification.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/v1SendPushNotificationsResponse'
        '400':
          description: Bad request - invalid parameters
          content:
            text/plain:
              schema:
                type: string
                example: Invalid push notification parameters
components:
  schemas:
    v1SendPushNotificationsRequest:
      type: object
      description: Request schema for sending push notifications.
      properties:
        push_notifications:
          type: array
          description: >-
            List of push notifications to send. (We recommend sending up to 500
            push notifications.)
          items:
            $ref: '#/components/schemas/clixexternalv1PushNotification'
            type: object
    v1SendPushNotificationsResponse:
      type: object
      description: >-
        Response schema containing the delivery results for each push
        notification.
      properties:
        delivery_results:
          type: array
          description: List of delivery results for each push notification.
          items:
            $ref: '#/components/schemas/clixexternalv1DeliveryResult'
            type: object
    clixexternalv1PushNotification:
      type: object
      description: A push notification to be sent to a user device.
      properties:
        target:
          $ref: '#/components/schemas/clixexternalv1PushNotificationTarget'
          description: Target device and/or user for the push notification.
        title:
          type: string
          description: Title of the push notification.
        body:
          type: string
          description: Body content of the push notification.
        image_url:
          type: string
          description: URL of the image to display in the push notification (optional).
        landing_url:
          type: string
          description: URL to open when the notification is clicked (optional).
    clixexternalv1DeliveryResult:
      type: object
      description: Result of a push notification delivery attempt.
      properties:
        message_id:
          type: string
          description: Unique ID of the push notification message.
        status:
          $ref: '#/components/schemas/clixexternalv1DeliveryResultStatus'
          description: Delivery status of the push notification.
        additional_params:
          $ref: '#/components/schemas/clixexternalv1DeliveryResultAdditionalParams'
          description: Additional parameters related to the delivery result.
    clixexternalv1PushNotificationTarget:
      type: object
      description: >-
        Target information for the push notification. Only one of
        project_user_id, device_id, or user_id should be present.
      oneOf:
        - properties:
            project_user_id:
              type: string
              description: Project-specific user ID for targeting.
          required:
            - project_user_id
        - properties:
            device_id:
              type: string
              description: ID of the target device.
          required:
            - device_id
        - properties:
            user_id:
              type: string
              description: ID of the target user.
          required:
            - user_id
    clixexternalv1DeliveryResultStatus:
      type: string
      enum:
        - DELIVERY_RESULT_STATUS_SUCCEED
        - DELIVERY_RESULT_STATUS_FAILED
    clixexternalv1DeliveryResultAdditionalParams:
      type: object
      properties:
        device_id:
          type: string
        fcm_message_id:
          type: string
        failure_reason:
          type: string
  securitySchemes:
    ProjectIdAuth:
      type: apiKey
      in: header
      name: X-Clix-Project-ID
      description: Project ID for authentication
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-Clix-API-Key
      description: API Key for authentication

````