# Create Subjects

Creates all the subjects defined in the array. Maximum of 10 subjects allowed.

Endpoint: POST /api/v1/patient-registry/subject
Version: V1
Security: bearer

## Header parameters:

  - `ProjectId` (string, required)
    Example: "e6b01018-a333-4732-917e-fe38e91b0fdf"

## Request fields (application/json):

  - `body` (Array of CreateSubject (objects) or CreateSubjectBatch (object), required) — one of:
    - CreateSubject:
      - `id` (string, required)
        Example: "3fa85f64-5717-4562-b3fc-2c963f66afa6"
      - `firstName` (string, required)
        Example: "David"
      - `lastName` (string, required)
        Example: "Mann"
      - `email` (string)
        Example: "david.mann@example.com"
      - `birthDate` (string)
        Example: "2023-05-26"
      - `deathDate` (string)
        Example: "2023-05-26"
      - `gender` (string)
        For guaranteed long term compatibility we recommend using the single character gender identifiers. We will optimistically accept other formats like 'male' and 'female'.
        Enum: "M", "F", null
      - `addressLine1` (string)
        Example: "123 Main St."
      - `addressLine2` (string)
        Example: "Apt 4B"
      - `addressCity` (string)
        Example: "Minneapolis"
      - `addressState` (string)
        Two letter state code
        Example: "MN"
      - `addressPostalCode` (string)
        5 or 9 digit postal code
        Example: "55401"
      - `phoneNumber` (string)
        Example: "123-456-7890"
      - `externalIdentifiers` (array)
        Example: [{"externalIdentifier":"12345","externalSystem":"Hospital A"}]
      - `externalIdentifiers.externalIdentifier` (string, required)
      - `externalIdentifiers.externalSystem` (string, required)
      - `labels` (array)
        Example: ["label_1","Label 2"]
      - `additionalNames` (array)
        Example: [{"first":"Dave","last":"Mann"}]
      - `additionalNames.first` (string)
        At least one of 'first' and 'last' must be provided.
      - `additionalNames.last` (string)
        At least one of 'first' and 'last' must be provided.
      - `additionalAddresses` (array)
        Example: [{"addressLine1":"456 Other St.","addressCity":"Saint Paul","addressState":"MN","addressPostalCode":"55101"}]
      - `additionalAddresses.addressLine1` (string)
      - `additionalAddresses.addressLine2` (string)
      - `additionalAddresses.addressCity` (string)
      - `additionalAddresses.addressState` (string)
      - `additionalAddresses.addressPostalCode` (string)
      - `tags` (array)
    - CreateSubjectBatch:
      - `subjects` (array, required)
      - `subjects.id` (string, required)
        Example: "3fa85f64-5717-4562-b3fc-2c963f66afa6"
      - `subjects.firstName` (string, required)
        Example: "David"
      - `subjects.lastName` (string, required)
        Example: "Mann"
      - `subjects.email` (string)
        Example: "david.mann@example.com"
      - `subjects.birthDate` (string)
        Example: "2023-05-26"
      - `subjects.deathDate` (string)
        Example: "2023-05-26"
      - `subjects.gender` (string)
        For guaranteed long term compatibility we recommend using the single character gender identifiers. We will optimistically accept other formats like 'male' and 'female'.
        Enum: same as `gender` in "CreateSubject" (3 values)
      - `subjects.addressLine1` (string)
        Example: "123 Main St."
      - `subjects.addressLine2` (string)
        Example: "Apt 4B"
      - `subjects.addressCity` (string)
        Example: "Minneapolis"
      - `subjects.addressState` (string)
        Two letter state code
        Example: "MN"
      - `subjects.addressPostalCode` (string)
        5 or 9 digit postal code
        Example: "55401"
      - `subjects.phoneNumber` (string)
        Example: "123-456-7890"
      - `subjects.externalIdentifiers` (array)
        Example: [{"externalIdentifier":"12345","externalSystem":"Hospital A"}]
      - `subjects.externalIdentifiers.externalIdentifier` (string, required)
      - `subjects.externalIdentifiers.externalSystem` (string, required)
      - `subjects.labels` (array)
        Example: ["label_1","Label 2"]
      - `subjects.additionalNames` (array)
        Example: [{"first":"Dave","last":"Mann"}]
      - `subjects.additionalNames.first` (string)
        At least one of 'first' and 'last' must be provided.
      - `subjects.additionalNames.last` (string)
        At least one of 'first' and 'last' must be provided.
      - `subjects.additionalAddresses` (array)
        Example: [{"addressLine1":"456 Other St.","addressCity":"Saint Paul","addressState":"MN","addressPostalCode":"55101"}]
      - `subjects.additionalAddresses.addressLine1` (string)
      - `subjects.additionalAddresses.addressLine2` (string)
      - `subjects.additionalAddresses.addressCity` (string)
      - `subjects.additionalAddresses.addressState` (string)
      - `subjects.additionalAddresses.addressPostalCode` (string)
      - `subjects.tags` (array)
      - `options` (object)
      - `options.initiateEhrQueries` (boolean)
        When true, initiates EHR queries for all subjects in the batch after creation. Defaults to true when omitted.

## Response 201 fields (application/json):

  - `id` (string, required)
    Example: "3fa85f64-5717-4562-b3fc-2c963f66afa6"

  - `created` (string, required)
    Example: "2025-05-26T23:30:40.912Z"

  - `updated` (string, required)
    Example: "2025-05-26T23:30:40.912Z"

  - `identifier` (string, required)
    A human-readable, randomly generated, 6 character alpha-numeric identifier for the subject.
    Example: "ABCD12"

  - `firstName` (string, required)
    Example: "David"

  - `lastName` (string, required)
    Example: "Mann"

  - `deleted` (string)
    Example: "2025-05-26T23:30:40.912Z"

  - `email` (string)
    Example: "david.mann@example.com"

  - `birthDate` (string)
    Example: "2023-05-26"

  - `deathDate` (string)
    Example: "2023-05-26"

  - `gender` (string)
    For guaranteed long term compatibility we recommend using the single character gender identifiers. We will optimistically accept other formats like 'male' and 'female'.
    Enum: same as `gender` in "CreateSubject" (3 values)

  - `addressLine1` (string)
    Example: "123 Main St."

  - `addressLine2` (string)
    Example: "Apt 4B"

  - `addressCity` (string)
    Example: "Minneapolis"

  - `addressState` (string)
    Two letter state code
    Example: "MN"

  - `addressPostalCode` (string)
    5 or 9 digit postal code
    Example: "55401"

  - `phoneNumber` (string)
    Example: "123-456-7890"

  - `externalIdentifiers` (array)
    Example: [{"externalIdentifier":"12345","externalSystem":"Hospital A"}]

  - `externalIdentifiers.externalIdentifier` (string, required)

  - `externalIdentifiers.externalSystem` (string, required)

  - `labels` (array)
    Example: ["label_1","Label 2"]

  - `cohortNames` (array)

  - `additionalNames` (array)
    Example: [{"first":"Dave","last":"Mann"}]

  - `additionalNames.first` (string)
    At least one of 'first' and 'last' must be provided.

  - `additionalNames.last` (string)
    At least one of 'first' and 'last' must be provided.

  - `additionalAddresses` (array)
    Example: [{"addressLine1":"456 Other St.","addressCity":"Saint Paul","addressState":"MN","addressPostalCode":"55101"}]

  - `additionalAddresses.addressLine1` (string)

  - `additionalAddresses.addressLine2` (string)

  - `additionalAddresses.addressCity` (string)

  - `additionalAddresses.addressState` (string)

  - `additionalAddresses.addressPostalCode` (string)

  - `tags` (array)

  - `failureReason` (string)


## Response 400 fields

## Response 401 fields

## Response 403 fields

## Response 409 fields

## Response 429 fields
