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

# Update Case Contacts

> Replace the contacts for a specific case. This will replace all existing contacts with the provided contacts.

Add or modify contacts in a case.


## OpenAPI

````yaml POST /cases/{id}/contacts
openapi: 3.0.0
info:
  title: Penbox API
  version: '1.0'
  description: >-
    The Penbox API provides programmatic access to Penbox's form management,
    case management, and document processing capabilities. Authenticate using
    Bearer tokens created at https://app.penbox.io/workspace/settings/api
servers:
  - url: https://connect.penbox.io/v1
    description: Production
  - url: https://connect.aiboov.com/v1
    description: Staging
security:
  - BearerAuth: []
paths:
  /cases/{id}/contacts:
    post:
      summary: Update Case Contacts
      description: >-
        Replace the contacts for a specific case. This will replace all existing
        contacts with the provided contacts.
      operationId: update-case-contacts
      parameters:
        - name: id
          in: path
          required: true
          description: The unique identifier of the case
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - contacts
              properties:
                contacts:
                  type: array
                  minItems: 1
                  items:
                    $ref: '#/components/schemas/CaseContactInput'
      responses:
        '200':
          description: Contacts added successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CaseDetailed'
components:
  schemas:
    CaseContactInput:
      type: object
      required:
        - key
        - email
      properties:
        key:
          type: string
          description: >-
            Unique identifier for this contact within the case context. Use
            'main' for the main contact.
        name:
          type: string
          description: The role played by this contact within the case
        email:
          type: string
          format: email
          description: Contact's email address
        given_name:
          type: string
          description: First name
        family_name:
          type: string
          description: Last name
        phone:
          type: string
          description: Contact's phone number
    CaseDetailed:
      allOf:
        - $ref: '#/components/schemas/Case'
        - type: object
          properties:
            steps:
              type: array
              description: Array of step objects representing the case workflow
              items:
                type: object
                properties:
                  id:
                    type: string
                    description: Step identifier
                  title:
                    type: string
                    description: Step title
                  status:
                    type: string
                    description: Step status
                  data:
                    type: object
                    description: Step data
            schema:
              type: array
              description: Array of data fields with their current values
              items:
                type: object
                properties:
                  key:
                    type: string
                    description: Field key
                  type:
                    type: string
                    description: Field type
                  value:
                    description: Field value
                  name:
                    type: string
                    description: Field display name
    Case:
      type: object
      properties:
        id:
          type: string
          format: uuid
          description: Case UUID
        created_at:
          type: string
          format: date-time
          description: Creation timestamp
        updated_at:
          type: string
          format: date-time
          description: Last update timestamp
        title:
          type: string
          description: Case title
        description:
          type: string
          nullable: true
          description: Case description
        locale:
          type: string
          nullable: true
          description: Language/locale code
        reference:
          type: string
          nullable: true
          description: Custom reference number
        status:
          type: string
          nullable: true
          description: Custom status value
        parent_status:
          type: string
          enum:
            - draft
            - pending
            - in_progress
            - closed
          description: Parent status
        waiting_for:
          type: string
          enum:
            - none
            - owner
            - contact
          description: Who the case is waiting for
        archived_at:
          type: string
          format: date-time
          nullable: true
          description: Timestamp when archived
        contacts:
          type: array
          description: Array of contact objects
          items:
            type: object
            properties:
              id:
                type: string
                format: uuid
                description: Contact UUID
              key:
                type: string
                description: Contact identifier
              name:
                type: string
                description: Contact role/name
              email:
                type: string
                format: email
                description: Contact email
              given_name:
                type: string
                description: First name
              family_name:
                type: string
                description: Last name
              phone:
                type: string
                description: Phone number
            additionalProperties: true
        template:
          type: string
          nullable: true
          description: Template reference
        owner:
          type: object
          nullable: true
          description: Case owner information
          properties:
            id:
              type: string
              format: uuid
            email:
              type: string
              format: email
            given_name:
              type: string
            family_name:
              type: string
      required:
        - id
        - title
        - parent_status
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: token
      description: >-
        API token (starts with pnbx_). Create at
        https://app.penbox.io/workspace/settings/api. Include as: Authorization:
        Bearer {token}

````