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

# Get Messages

> Retrieve SMS, email, and other messages for a candidate.

Retrieve messages exchanged with a candidate over SMS, email, WhatsApp and LinkedIn. Results are paginated: `limit` defaults to 50 (max 100). Messages are oldest first by default; pass `order=desc` for newest first. Filter by time with `start_date` and `end_date` (ISO-8601).

Each message carries a stable `id` to dedupe on re-sync. `sender_type` says who sent it: `user` is a recruiter in the Classet inbox, `ai_recruiter` is the AI recruiter, `auto` is a message automation, and `candidate` is the candidate. `smart_connect` appears only on historical messages. `automated` is `true` when no person typed the message. `delivery_status` is the carrier or provider delivery state, and is `null` while a message is in flight or when the provider reported nothing.

```bash cURL theme={null}
curl -X GET "https://api.classet.ai/v2/candidates/Xk3pQ9vT2mLr8bNc4Hd1s/messages" \
  -H "X-API-KEY: your-api-key"
```

```json 200 theme={null}
{
  "data": [
    {
      "id": 918271,
      "direction": "outbound",
      "sender_type": "ai_recruiter",
      "automated": true,
      "text": "Hi John, we'd like to schedule a phone screen for the Electrician Apprentice position. Are you available this week?",
      "timestamp": "2026-04-01T16:00:00.000Z",
      "message_type": "sms",
      "delivery_status": "delivered"
    },
    {
      "id": 918272,
      "direction": "inbound",
      "sender_type": "candidate",
      "automated": false,
      "text": "Yes, I'm available any day after 2pm.",
      "timestamp": "2026-04-01T16:15:00.000Z",
      "message_type": "sms",
      "delivery_status": null
    },
    {
      "id": 918273,
      "direction": "outbound",
      "sender_type": "user",
      "automated": false,
      "text": "Great! We've sent you a link to complete your AI phone screen at your convenience.",
      "timestamp": "2026-04-01T16:20:00.000Z",
      "message_type": "sms",
      "delivery_status": "delivered"
    }
  ],
  "meta": {
    "page": 1,
    "limit": 50,
    "total": 3
  }
}
```


## OpenAPI

````yaml GET /v2/candidates/{candidateId}/messages
openapi: 3.1.0
info:
  title: Classet API
  version: 2.0.3
  description: >-
    AI-powered recruiting and phone screening API.


    **API key scopes.** `read` covers every GET; any other method needs `write`
    (403 `insufficient_scope`); starting or stopping an interview also needs
    `interviews:send`. A branch-limited key sees and writes only jobs in its
    branches (not jobs with no branch) and their candidates, applications and
    calls; anything outside is a 404. An organization-group key is read-only
    across every organization in its group. Branch-limited and group keys cannot
    use organization configuration (scripts, knowledge, webhooks, message
    automations, agent settings, AI generation, organization): 403
    `restricted_key_unsupported`. `GET /v2/me` reports what the calling key can
    do.
servers:
  - url: https://api.classet.ai
    description: Production
  - url: http://localhost:8081
    description: Local development
security:
  - ApiKeyAuth: []
paths:
  /v2/candidates/{candidateId}/messages:
    get:
      tags:
        - Candidates
      summary: List candidate messages
      description: Retrieve SMS, email, and other messages for a candidate.
      parameters:
        - schema:
            type: string
          required: true
          name: candidateId
          in: path
          description: The unique identifier of the candidate.
        - schema:
            type: string
            default: '1'
            example: '1'
            description: Page number (1-based). Defaults to 1.
          required: false
          description: Page number (1-based). Defaults to 1.
          name: page
          in: query
        - schema:
            type: string
            default: '50'
            example: '50'
            description: Results per page. Defaults to 50, maximum 100.
          required: false
          description: Results per page. Defaults to 50, maximum 100.
          name: limit
          in: query
        - schema:
            type: string
            format: date-time
            example: '2026-06-01T00:00:00Z'
            description: Only messages created at or after this timestamp.
          required: false
          description: Only messages created at or after this timestamp.
          name: start_date
          in: query
        - schema:
            type: string
            format: date-time
            example: '2026-07-01T00:00:00Z'
            description: Only messages created at or before this timestamp.
          required: false
          description: Only messages created at or before this timestamp.
          name: end_date
          in: query
        - schema:
            type: string
            enum:
              - asc
              - desc
            default: asc
            description: Sort by created_at. Defaults to asc (oldest first), matching v1.
          required: false
          description: Sort by created_at. Defaults to asc (oldest first), matching v1.
          name: order
          in: query
      responses:
        '200':
          description: Paginated messages
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/Message'
                  meta:
                    type: object
                    properties:
                      page:
                        type: integer
                        example: 1
                      limit:
                        type: integer
                        example: 20
                      total:
                        type: integer
                        example: 42
                        description: >-
                          Estimated, not exact. Do not page until page * limit
                          >= total — follow meta.next_cursor instead.
                      next_cursor:
                        type: string
                        nullable: true
                        description: >-
                          Present when the request used ?cursor=. Pass back to
                          fetch the next page.
                    required:
                      - page
                      - limit
                      - total
                required:
                  - data
                  - meta
        '404':
          description: Not found
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                    example: Resource not found
                  code:
                    type: string
                    enum:
                      - not_found
                      - validation_error
                      - unauthorized
                      - forbidden
                      - insufficient_scope
                      - restricted_key_unsupported
                      - branch_out_of_scope
                      - key_misconfigured
                      - quota_exceeded
                      - rate_limited
                      - rate_limit_unavailable
                      - conflict
                      - idempotency_key_reuse
                      - candidate_opted_out
                      - recently_contacted
                      - request_in_progress
                      - unprocessable
                      - bad_request
                      - payload_too_large
                      - internal_error
                      - service_unavailable
                    example: not_found
                    description: Stable machine-readable error code.
                  request_id:
                    type: string
                    example: 9f2c1d7e-4a3b-4c8d-9e0f-1a2b3c4d5e6f
                    description: >-
                      Request ID, also echoed in the X-Request-Id response
                      header. Include it when reporting issues.
                required:
                  - error
        '500':
          description: Server error
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                    example: Resource not found
                  code:
                    type: string
                    enum:
                      - not_found
                      - validation_error
                      - unauthorized
                      - forbidden
                      - insufficient_scope
                      - restricted_key_unsupported
                      - branch_out_of_scope
                      - key_misconfigured
                      - quota_exceeded
                      - rate_limited
                      - rate_limit_unavailable
                      - conflict
                      - idempotency_key_reuse
                      - candidate_opted_out
                      - recently_contacted
                      - request_in_progress
                      - unprocessable
                      - bad_request
                      - payload_too_large
                      - internal_error
                      - service_unavailable
                    example: not_found
                    description: Stable machine-readable error code.
                  request_id:
                    type: string
                    example: 9f2c1d7e-4a3b-4c8d-9e0f-1a2b3c4d5e6f
                    description: >-
                      Request ID, also echoed in the X-Request-Id response
                      header. Include it when reporting issues.
                required:
                  - error
      security:
        - ApiKeyAuth: []
components:
  schemas:
    Message:
      type: object
      properties:
        id:
          type: integer
          example: 918273
          description: Stable message id. Use it to dedupe on re-sync.
        direction:
          type: string
          enum:
            - outbound
            - inbound
          description: >-
            Either `"outbound"` (sent to candidate) or `"inbound"` (received
            from candidate).
        sender_type:
          type: string
          enum:
            - user
            - candidate
            - auto
            - smart_connect
            - ai_recruiter
          example: ai_recruiter
          description: >-
            Who sent it. `user` is a human recruiter in the Classet inbox,
            `ai_recruiter` is Joy, `auto` is a message automation, `candidate`
            is the candidate. `smart_connect` is retired and appears only on
            historical rows.
        automated:
          type: boolean
          example: true
          description: >-
            True when no human typed this message — i.e. sender_type is not
            `user` or `candidate`.
        text:
          type: string
          description: The message content.
        timestamp:
          type: string
          description: ISO 8601 timestamp of when the message was sent or received.
        message_type:
          type: string
          enum:
            - sms
            - email
            - whatsapp
            - linkedin
          description: >-
            The channel used. One of `"sms"`, `"email"`, `"whatsapp"`, or
            `"linkedin"`.
        delivery_status:
          type: string
          nullable: true
          example: delivered
          description: >-
            Carrier or provider delivery state, from the channel that carried
            the message. Null while in flight or when the provider reported
            nothing.
      required:
        - id
        - direction
        - sender_type
        - automated
        - text
        - timestamp
        - message_type
        - delivery_status
      description: Candidate message
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-API-KEY
      description: Your Classet API key. Create and rotate keys in Settings → API.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.