# Create Query

Create a new query by providing the necessary details. The query will be stored and can be used for further operations.

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

## Header parameters:

  - `ProjectId` (string, required)

## Request fields (application/json):

  - `subjectId` (string, required)
    The ID of the subject for whom the query is being created.
    Example: 1782b464-ab03-4c03-9810-83d42b86e587

  - `organizationIds` (array)
    A list of organization IDs associated with the query.
    Example: ["2.16.840.1.113883.3.3126.2.3.32103.16"]

## Response 201 fields (application/json):

  - `id` (string, required)

  - `subjectId` (string, required)

  - `created` (string, required)

  - `fhirStatus` (string, required)
    Enum: "delayed", "initiated", "pending", "inProgress", "completed", "exhausted", "error"

  - `ccdaStatus` (string, required)
    Enum: "delayed", "initiated", "pending", "inProgress", "completed", "exhausted", "error"

  - `userId` (string, required)

  - `externalPatientId` (string, required)

  - `externalQueryId` (string, required)

  - `queryAttempts` (array, required)

