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

# Set a patient's external ID for a given type



## OpenAPI

````yaml https://api.getsolum.com/openapi.json put /v1/patients/{patient_id}/external-ids/{external_id_type_id}
openapi: 3.1.0
info:
  title: Solum Health API
  description: '## Solum Health Backend API '
  version: 1.0.0
servers: []
security: []
paths:
  /v1/patients/{patient_id}/external-ids/{external_id_type_id}:
    put:
      tags:
        - Patient External IDs
      summary: Set a patient's external ID for a given type
      operationId: >-
        upsert_patient_external_id_v1_patients__patient_id__external_ids__external_id_type_id__put
      parameters:
        - name: patient_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            description: Patient UUID
            title: Patient Id
          description: Patient UUID
        - name: external_id_type_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            description: External ID type UUID
            title: External Id Type Id
          description: External ID type UUID
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ExternalIdValueUpsertRequest'
      responses:
        '200':
          description: Updated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ExternalIdValueResponse'
        '201':
          description: Created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ExternalIdValueResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                type: object
                properties:
                  type:
                    type: string
                    example: validation_error
                  code:
                    type: string
                    example: invalid_parameter
                  message:
                    type: string
                    example: Field validation failed
                  param:
                    type: string
                    example: phone_number
                required:
                  - type
                  - code
                  - message
      security:
        - APIKeyHeader: []
        - HTTPBearer: []
components:
  schemas:
    ExternalIdValueUpsertRequest:
      properties:
        value:
          type: string
          maxLength: 500
          minLength: 1
          title: Value
      additionalProperties: false
      type: object
      required:
        - value
      title: ExternalIdValueUpsertRequest
      description: PUT body — only `value` is mutable.
    ExternalIdValueResponse:
      properties:
        id:
          type: string
          format: uuid
          title: Id
        patient_id:
          type: string
          format: uuid
          title: Patient Id
        value:
          type: string
          title: Value
        external_id_type:
          $ref: '#/components/schemas/ExternalIdTypeSummary'
        created_at:
          type: string
          format: date-time
          title: Created At
        updated_at:
          type: string
          format: date-time
          title: Updated At
      additionalProperties: false
      type: object
      required:
        - id
        - patient_id
        - value
        - external_id_type
        - created_at
        - updated_at
      title: ExternalIdValueResponse
      description: >-
        Response shape for the patient external-ids endpoints AND for the
        embedded

        `external_id_values` field on PatientResponse.
    ExternalIdTypeSummary:
      properties:
        id:
          type: string
          format: uuid
          title: Id
        name:
          type: string
          title: Name
        created_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Created At
      additionalProperties: false
      type: object
      required:
        - id
        - name
      title: ExternalIdTypeSummary
      description: >-
        Read-only summary of an external_id_types row.


        Used embedded in `ExternalIdValueResponse` (where `created_at` stays
        None)

        and as the body of `GET /v1/external-id-types` (where it's populated).
  securitySchemes:
    APIKeyHeader:
      type: apiKey
      in: header
      name: X-API-Key
    HTTPBearer:
      type: http
      scheme: bearer

````