# Create Subject V2

Creates and returns the subject.

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

## Header parameters:

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

## Request fields (application/json):

  - `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)

  - `options` (object)

  - `options.initiateEhrQuery` (boolean)
    When true, initiates an EHR query for the subject 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: "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"}]

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

  - `cohortNames` (array)

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

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

  - `tags` (array)

## Response 400 fields (application/json):

  - `status` (number)

  - `title` (string)

  - `detail` (string)


## Response 401 fields
