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

# Create a sent case

> Creates a case owned by the caller's firm. If referentFirmId is provided the case is SENT; otherwise it is created as a DRAFT. Pass routingRuleId + roundRobinPosition (from GET /routing/evaluate) to advance the round-robin pointer. Requires STANDARD tier.



## OpenAPI

````yaml /api-reference/openapi.yml post /sent-cases
openapi: 3.0.3
info:
  title: CaseXchange Public API
  version: 1.0.0
  description: >-
    The CaseXchange Public API enables law firms to integrate referral
    management

    directly into their own systems.


    ## Authentication

    All requests must include an `X-API-Key` header containing a valid API key

    (format: `cxp_<hex>`). Keys are scoped to a firm and an access tier.


    ## Access Tiers

    | Tier | Description |

    |------|-------------|

    | `read_only` | GET endpoints — read data without mutation |

    | `standard` | read_only + create/update case referrals |

    | `full` | standard + delete, routing rules, bulk import, firm mutation |


    ## Rate Limiting

    Rate limits are enforced per API key. Exceeded limits return `429 Too Many
    Requests`.


    ## Pagination

    List endpoints accept `page` (default 1) and `limit` (default 20, max 100)
    query params.


    ## Response Format

    Successful responses are wrapped in `{ data: T, meta: { requestId, timestamp
    } }`.

    Errors are wrapped in `{ error: { code, message }, meta: { requestId,
    timestamp } }`.
  contact:
    name: CaseXchange API Support
    url: https://casexchange.com
servers:
  - url: https://api.casexchange.com/api/public/v1
    description: Production Public API base path
  - url: /api/public/v1
    description: Relative base path (for proxied docs/local environments)
security: []
tags:
  - name: Reference Data
    description: Case types, jurisdictions, and counties
  - name: Firms
    description: Firm directory and profile management
  - name: Cases
    description: Case referral lifecycle and actions
  - name: Sent Cases
    description: 'Sender-side case management: create, track, and refer/route cases you own'
  - name: Documents
    description: Document upload, download, and management
  - name: Users
    description: User management within the caller's firm
  - name: Routing
    description: Referral routing rules
  - name: Analytics
    description: Dashboard and case analytics
  - name: Notifications
    description: Notification preferences and email management
  - name: Med Cases
    description: Med Xchange cases and their nested referrals to medical providers
  - name: MedEx Documents
    description: Med Xchange case document listing and download
  - name: Import
    description: Bulk case import/update via CSV
  - name: Salesforce
    description: Org-facing endpoints consumed by the CaseXchange managed package
paths:
  /sent-cases:
    post:
      tags:
        - Sent Cases
      summary: Create a sent case
      description: >-
        Creates a case owned by the caller's firm. If referentFirmId is provided
        the case is SENT; otherwise it is created as a DRAFT. Pass routingRuleId
        + roundRobinPosition (from GET /routing/evaluate) to advance the
        round-robin pointer. Requires STANDARD tier.
      operationId: createSentCase
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - title
                - caseType
                - jurisdiction
                - clientFirstName
                - clientLastName
              properties:
                title:
                  type: string
                  minLength: 1
                description:
                  type: string
                caseType:
                  type: string
                  minLength: 1
                jurisdiction:
                  type: string
                  minLength: 1
                county:
                  type: string
                  nullable: true
                clientFirstName:
                  type: string
                  minLength: 1
                clientLastName:
                  type: string
                  minLength: 1
                clientEmail:
                  type: string
                  format: email
                clientPhone:
                  type: string
                clientDateOfBirth:
                  type: string
                  format: date
                  nullable: true
                incidentDate:
                  type: string
                  format: date
                  nullable: true
                tier:
                  type: integer
                  minimum: 1
                  maximum: 5
                  nullable: true
                source:
                  type: string
                notes:
                  type: string
                referentFirmId:
                  type: string
                  format: uuid
                  description: Receiving firm. Omit to create a DRAFT.
                routingRuleId:
                  type: string
                  format: uuid
                  description: >-
                    Optional. Routing rule this send was chosen from (from GET
                    /routing/evaluate). Ignored (with a server-side warning) if
                    it is not a live rule owned by your firm.
                roundRobinPosition:
                  type: integer
                  minimum: 0
                  description: >-
                    Optional. The roundRobinPosition from GET /routing/evaluate.
                    Requires routingRuleId; advances the rule's round-robin
                    pointer.
                isRetainerSigned:
                  type: boolean
                  default: false
                salesforceId:
                  type: string
                salesforceObjectType:
                  type: string
                externalSystem:
                  type: string
                  enum:
                    - cloudlex
                    - morgan_morgan
                externalId:
                  type: string
      responses:
        '201':
          description: Created sent case
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    $ref: '#/components/schemas/SentCase'
                  meta:
                    type: object
                    properties:
                      requestId:
                        type: string
                        example: req_f2dbe1d3f6ad4a7bb5b4c9f2
                      timestamp:
                        type: string
                        format: date-time
                    required:
                      - requestId
                      - timestamp
                required:
                  - data
                  - meta
        '400':
          description: Request validation failed
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: object
                    properties:
                      code:
                        type: string
                      message:
                        type: string
                    required:
                      - code
                      - message
                  meta:
                    type: object
                    properties:
                      requestId:
                        type: string
                        example: req_f2dbe1d3f6ad4a7bb5b4c9f2
                      timestamp:
                        type: string
                        format: date-time
                    required:
                      - requestId
                      - timestamp
                required:
                  - error
                  - meta
        '401':
          description: Invalid or missing API key
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: object
                    properties:
                      code:
                        type: string
                      message:
                        type: string
                    required:
                      - code
                      - message
                  meta:
                    type: object
                    properties:
                      requestId:
                        type: string
                        example: req_f2dbe1d3f6ad4a7bb5b4c9f2
                      timestamp:
                        type: string
                        format: date-time
                    required:
                      - requestId
                      - timestamp
                required:
                  - error
                  - meta
        '403':
          description: API key tier does not permit this action
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: object
                    properties:
                      code:
                        type: string
                      message:
                        type: string
                    required:
                      - code
                      - message
                  meta:
                    type: object
                    properties:
                      requestId:
                        type: string
                        example: req_f2dbe1d3f6ad4a7bb5b4c9f2
                      timestamp:
                        type: string
                        format: date-time
                    required:
                      - requestId
                      - timestamp
                required:
                  - error
                  - meta
        '409':
          description: A referral for this Salesforce record already exists
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: object
                    properties:
                      code:
                        type: string
                      message:
                        type: string
                    required:
                      - code
                      - message
                  meta:
                    type: object
                    properties:
                      requestId:
                        type: string
                        example: req_f2dbe1d3f6ad4a7bb5b4c9f2
                      timestamp:
                        type: string
                        format: date-time
                    required:
                      - requestId
                      - timestamp
                required:
                  - error
                  - meta
      security:
        - apiKeyAuth: []
components:
  schemas:
    SentCase:
      type: object
      description: >-
        A case from the sender (owning firm) perspective, with all of its
        referrals.
      properties:
        id:
          type: string
          format: uuid
        referenceNumber:
          type: string
          nullable: true
          example: ABC-0001
        salesforceId:
          type: string
          nullable: true
        salesforceObjectType:
          type: string
          nullable: true
        title:
          type: string
          nullable: true
        description:
          type: string
          nullable: true
        caseType:
          type: string
          nullable: true
        jurisdiction:
          type: string
          nullable: true
        county:
          type: string
          nullable: true
        clientFirstName:
          type: string
          nullable: true
        clientLastName:
          type: string
          nullable: true
        clientEmail:
          type: string
          format: email
          nullable: true
        clientPhone:
          type: string
          nullable: true
        clientDateOfBirth:
          type: string
          format: date
          nullable: true
        incidentDate:
          type: string
          format: date
          nullable: true
        tier:
          type: integer
          nullable: true
        source:
          type: string
          nullable: true
        status:
          type: string
          description: CaseStatus enum value
        closingStatus:
          type: string
          nullable: true
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
        referrals:
          type: array
          description: All referrals on this case, most recent first.
          items:
            type: object
  securitySchemes:
    apiKeyAuth:
      type: apiKey
      in: header
      name: X-API-Key
      description: Public API key (starts with cxp_). Required on every request.

````