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

# Start a conversation

> Creates a conversation with the customer's first message. Name the customer with `customerId`.

Send an `idempotencyKey` so a retry does not start a second conversation.

Required scope: `conversations:write`.




## OpenAPI

````yaml /openapi.yaml post /conversations
openapi: 3.1.0
info:
  title: Cerium API
  version: 1.0.0
  description: |
    Send your customers and their conversations to Cerium from your own backend.
    Every request is authenticated with an API key.
servers:
  - url: https://api.usecerium.com/v1
    description: Production
security:
  - apiKey: []
tags:
  - name: Customers
  - name: Conversations
  - name: Messages
paths:
  /conversations:
    post:
      tags:
        - Conversations
      summary: Start a conversation
      description: >
        Creates a conversation with the customer's first message. Name the
        customer with `customerId`.


        Send an `idempotencyKey` so a retry does not start a second
        conversation.


        Required scope: `conversations:write`.
      operationId: startConversation
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/StartConversation'
            example:
              customerId: prt_8271
              body: Hi, I was charged twice for order 1042.
              idempotencyKey: order-1042-first-message
      responses:
        '200':
          description: >-
            This `idempotencyKey` was already used. The first message is
            returned and nothing new is added.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MessageResponse'
        '201':
          description: The conversation was started. `data` is its first message.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MessageResponse'
              example:
                message: Message received.
                status: success
                data:
                  id: msg_5d1c
                  conversationId: thr_01k9z3m4q8
                  from: customer
                  senderType: customer
                  senderName: Ada Obi
                  body: Hi, I was charged twice for order 1042.
                  attachments: []
                  status: sent
                  sentAt: '2026-11-20T09:15:00.000Z'
        '400':
          $ref: '#/components/responses/Invalid'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          description: No customer has that `customerId`.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                code: participant_not_found
                message: No customer has that id.
        '422':
          description: The customer is blocked and cannot start conversations.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                code: contact_blocked
                message: This contact is blocked.
        '429':
          $ref: '#/components/responses/RateLimited'
components:
  schemas:
    StartConversation:
      allOf:
        - $ref: '#/components/schemas/SendMessage'
        - type: object
          required:
            - customerId
          properties:
            customerId:
              type: string
              maxLength: 40
              description: The customer the conversation is with.
              example: prt_8271
    MessageResponse:
      type: object
      properties:
        message:
          type: string
          example: Message received.
        status:
          type: string
          example: success
        data:
          $ref: '#/components/schemas/Message'
    Error:
      type: object
      description: >
        `message` is always present. `code` is a stable identifier for specific
        errors you may want to handle in code.

        A validation error has a `message` that is a list of everything to fix.
      properties:
        code:
          type: string
          description: A stable identifier you can match on.
        message:
          oneOf:
            - type: string
            - type: array
              items:
                type: string
        statusCode:
          type: integer
        error:
          type: string
      required:
        - message
    SendMessage:
      type: object
      required:
        - body
      properties:
        body:
          type: string
          minLength: 1
          maxLength: 20000
        idempotencyKey:
          type: string
          minLength: 1
          maxLength: 64
          description: >-
            A unique key for this attempt. Sending it again returns the first
            message instead of adding another.
          example: order-1042-msg-1
        attachments:
          type: array
          maxItems: 10
          items:
            $ref: '#/components/schemas/Attachment'
    Message:
      type: object
      properties:
        id:
          type: string
          example: msg_5d1c
        conversationId:
          type: string
          example: thr_01k9z3m4q8
        from:
          type: string
          enum:
            - customer
            - agent
          description: Which side wrote it. AI replies and system notices are `agent`.
        senderType:
          type: string
          enum:
            - customer
            - agent
            - ai
            - system
        senderName:
          type:
            - string
            - 'null'
          example: Ada Obi
        body:
          type: string
        attachments:
          type: array
          items:
            $ref: '#/components/schemas/Attachment'
        status:
          type: string
          example: sent
        sentAt:
          type: string
          format: date-time
    Attachment:
      type: object
      required:
        - url
      properties:
        url:
          type: string
          format: uri
          maxLength: 2048
          description: An https address the team can open.
        fileName:
          type:
            - string
            - 'null'
          maxLength: 255
        mimeType:
          type:
            - string
            - 'null'
          maxLength: 100
        size:
          type:
            - integer
            - 'null'
          minimum: 0
          description: Size in bytes.
  responses:
    Invalid:
      description: The request is not valid. `message` says what to fix.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            statusCode: 400
            error: Bad Request
            message:
              - email must be an email
    Unauthorized:
      description: The key is missing or not valid.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            statusCode: 401
            message: Authentication token is missing.
    Forbidden:
      description: The key does not have the scope this call needs.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            statusCode: 403
            message: This key cannot do that.
    RateLimited:
      description: Too many requests. Wait, then try again.
      headers:
        Retry-After:
          description: Seconds to wait before trying again.
          schema:
            type: integer
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  securitySchemes:
    apiKey:
      type: http
      scheme: bearer
      description: >
        Your API key, sent as `Authorization: Bearer <key>`. Create keys in the
        Cerium dashboard.

        Keep them on your servers only.

````