---
title: "Create a patient"
---

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

# Create a patient

Path: Oficlinic API › Patients

`POST /v1/oficlinic/patients`

Create one new patient in e-Oficlinic using the clinic-confirmed legal identity, contact and classification fields. Use only with verified authority to register this person and explicit confirmation of their details. Requires confirm true; repeating the identical request answers the recorded outcome, with no idempotency key needed. An existing patient is never changed. An uncertain result must be checked with lookup_patient and must not be sent again. The result contains no patient data. Verify the saved patient with lookup_patient before attempting a booking. The submission follows the live-verified Cardiología scheduling form. agentMode true answers concise Spanish text instead.

- **Scope:** `oficlinic:patients:write`
- **Credentials:** an API key, a client-credentials token or a person's access token
- **Effect:** writes; not idempotent: check the outcome before you retry
- **Limits:** request body up to 8 KB, response up to 64 KB
- **CLI:** `arbol oficlinic patients create` · **MCP tool:** `oficlinic_patients_create`

## Authentication

Requires one of the following:

- `arbolHuman`, oauth2, scopes: `oficlinic:patients:write`
- `arbolMachine`, oauth2, scopes: `oficlinic:patients:write`
- `arbolApiKey`, http, header `Authorization`

## Request body

_Required._

- `documentType` (`oficlinic.patients.create.documentType`; string, required) — Colombian citizenship card. Other document types are not verified against the provider yet.
- `documentNumber` (`oficlinic.patients.create.documentNumber`; string, required) — The document number, digits only.
  - pattern `^[0-9]{3,15}$`
- `firstGivenName` (`oficlinic.patients.create.firstGivenName`; string, required) — First legal given name.
  - minLength 1; maxLength 64; pattern `^(?!\s*$)[^\u0000-\u001f\u007f¬]+$`
- `firstFamilyName` (`oficlinic.patients.create.firstFamilyName`; string, required) — First legal surname.
  - minLength 1; maxLength 64; pattern `^(?!\s*$)[^\u0000-\u001f\u007f¬]+$`
- `birthDate` (`oficlinic.patients.create.birthDate`; string, required) — The confirmed birth date in YYYY-MM-DD.
  - format `date`
- `genderId` (`oficlinic.patients.create.genderId`; string, required) — The confirmed code from the provider's gender catalog.
  - pattern `^[0-9A-Za-z._-]{1,32}$`
- `municipalityId` (`oficlinic.patients.create.municipalityId`; string, required) — The confirmed municipality code from the provider's catalog.
  - pattern `^[0-9A-Za-z._-]{1,32}$`
- `zoneId` (`oficlinic.patients.create.zoneId`; string, required) — The confirmed code from the provider's residence zone catalog.
  - pattern `^[0-9A-Za-z._-]{1,32}$`
- `address` (`oficlinic.patients.create.address`; string, required) — The confirmed residence address.
  - minLength 1; maxLength 160; pattern `^(?!\s*$)[^\u0000-\u001f\u007f¬]+$`
- `phone` (`oficlinic.patients.create.phone`; string, required) — The confirmed contact phone.
  - pattern `^\+?[0-9]{7,15}$`
- `regimeId` (`oficlinic.patients.create.regimeId`; string, required) — The clinic-confirmed regime code.
  - pattern `^[0-9A-Za-z._-]{1,32}$`
- `affiliateTypeId` (`oficlinic.patients.create.affiliateTypeId`; string, required) — The clinic-confirmed affiliate type code for this regime.
  - pattern `^[0-9A-Za-z._-]{1,32}$`
- `salaryRangeId` (`oficlinic.patients.create.salaryRangeId`; string, required) — The clinic-confirmed salary range code for this regime.
  - pattern `^[0-9A-Za-z._-]{1,32}$`
- `confirm` (`oficlinic.patients.create.confirm`; boolean, required) — The authorized person confirmed the patient's identity and the details to save.
- `connectionId` (`oficlinic.patients.create.connectionId`; string, optional) — An Account connection id of the caller's organization.
  - pattern `^con_[0-9A-Za-z]{26}$`
- `secondGivenName` (`oficlinic.patients.create.secondGivenName`; string, optional) — Other legal given names, if any.
  - minLength 1; maxLength 64; pattern `^(?!\s*$)[^\u0000-\u001f\u007f¬]+$`
- `secondFamilyName` (`oficlinic.patients.create.secondFamilyName`; string, optional) — Other legal surnames, if any.
  - minLength 1; maxLength 64; pattern `^(?!\s*$)[^\u0000-\u001f\u007f¬]+$`
- `relationshipId` (`oficlinic.patients.create.relationshipId`; string, optional) — The provider relationship code, required when the affiliate type is neither C nor N.
  - pattern `^[0-9A-Za-z._-]{1,32}$`
- `idempotencyKey` (`oficlinic.patients.create.idempotencyKey`; string, optional) — Optional. Without it the service derives the key from the request itself, so repeating the identical request answers the recorded outcome and never writes again. A caller that retries with changed values can choose one key per intended write, such as a UUID; another request with it answers IDEMPOTENCY_KEY_REUSED.
  - minLength 8; maxLength 64; pattern `^[A-Za-z0-9_-]+$`
- `agentMode` (`oficlinic.patients.create.agentMode`; boolean, optional) — true answers { text }: concise Spanish facts for a messaging or voice agent, with the short ids and the cursor needed to continue. false, the default, answers the structured object.
  - default `false`

## Example request

```json
{
  "connectionId": "string",
  "documentType": "CC",
  "documentNumber": "string",
  "firstGivenName": "string",
  "secondGivenName": "string",
  "firstFamilyName": "string",
  "secondFamilyName": "string",
  "birthDate": "2019-08-24",
  "genderId": "string",
  "municipalityId": "string",
  "zoneId": "string",
  "address": "string",
  "phone": "string",
  "regimeId": "string",
  "affiliateTypeId": "string",
  "relationshipId": "string",
  "salaryRangeId": "string",
  "confirm": true,
  "idempotencyKey": "stringst",
  "agentMode": false
}
```

## Code samples

### cURL

```bash
curl https://api.getarbol.com/v1/oficlinic/patients \
  --request POST \
  --header "Authorization: Bearer $ARBOL_API_KEY" \
  --header "Content-Type: application/json" \
  --data '{
  "documentType": "CC",
  "documentNumber": "<documentNumber>",
  "firstGivenName": "<firstGivenName>",
  "firstFamilyName": "<firstFamilyName>",
  "birthDate": "2026-12-01",
  "genderId": "<genderId>",
  "municipalityId": "<municipalityId>",
  "zoneId": "<zoneId>",
  "address": "<address>",
  "phone": "<phone>",
  "regimeId": "<regimeId>",
  "affiliateTypeId": "<affiliateTypeId>",
  "salaryRangeId": "<salaryRangeId>",
  "confirm": true
}'
```

### TypeScript

```typescript
import { createClient } from "@arbol-ai/sdk";

const arbol = createClient({
  baseUrl: "https://api.getarbol.com",
  token: process.env.ARBOL_API_KEY!,
});

const { data } = await arbol.oficlinic.patients.create({
  documentType: "CC",
  documentNumber: "<documentNumber>",
  firstGivenName: "<firstGivenName>",
  firstFamilyName: "<firstFamilyName>",
  birthDate: Temporal.PlainDate.from("2026-12-01"),
  genderId: "<genderId>",
  municipalityId: "<municipalityId>",
  zoneId: "<zoneId>",
  address: "<address>",
  phone: "<phone>",
  regimeId: "<regimeId>",
  affiliateTypeId: "<affiliateTypeId>",
  salaryRangeId: "<salaryRangeId>",
  confirm: true,
});
```

### Rust

```rust
use arbol_sdk::{types, Client, Credential};

let arbol = Client::new(Credential::ApiKey(std::env::var("ARBOL_API_KEY")?))?;

let input: types::OficlinicPatientsCreateInput = serde_json::from_value(serde_json::json!({
    "documentType": "CC",
    "documentNumber": "<documentNumber>",
    "firstGivenName": "<firstGivenName>",
    "firstFamilyName": "<firstFamilyName>",
    "birthDate": "2026-12-01",
    "genderId": "<genderId>",
    "municipalityId": "<municipalityId>",
    "zoneId": "<zoneId>",
    "address": "<address>",
    "phone": "<phone>",
    "regimeId": "<regimeId>",
    "affiliateTypeId": "<affiliateTypeId>",
    "salaryRangeId": "<salaryRangeId>",
    "confirm": true
}))?;
let data = arbol.oficlinic().patients().create(&input).await?;
```

### CLI

```bash
arbol oficlinic patients create --document-type CC --document-number '<documentNumber>' --first-given-name '<firstGivenName>' --first-family-name '<firstFamilyName>' --birth-date 2026-12-01 --gender-id '<genderId>' --municipality-id '<municipalityId>' --zone-id '<zoneId>' --address '<address>' --phone '<phone>' --regime-id '<regimeId>' --affiliate-type-id '<affiliateTypeId>' --salary-range-id '<salaryRangeId>' --confirm true
```

### MCP

```json
{
  "name": "oficlinic_patients_create",
  "arguments": {
    "documentType": "CC",
    "documentNumber": "<documentNumber>",
    "firstGivenName": "<firstGivenName>",
    "firstFamilyName": "<firstFamilyName>",
    "birthDate": "2026-12-01",
    "genderId": "<genderId>",
    "municipalityId": "<municipalityId>",
    "zoneId": "<zoneId>",
    "address": "<address>",
    "phone": "<phone>",
    "regimeId": "<regimeId>",
    "affiliateTypeId": "<affiliateTypeId>",
    "salaryRangeId": "<salaryRangeId>",
    "confirm": true
  }
}
```

## Responses

### 201

Successful operation.

#### Example

```json
{
  "success": true,
  "data": {
    "status": "created",
    "verification": "provider_acknowledgement"
  },
  "error": null,
  "metadata": {
    "requestId": "string"
  }
}
```

- `success` (`oficlinic.patients.create.response.201.success`; boolean, required)
  - one of `true`
- `data` (`oficlinic.patients.create.response.201.data`; OficlinicCreatePatientResult, required)
  - any of: `OficlinicPatientRegistration`, `OficlinicAgentText`
- `error` (`oficlinic.patients.create.response.201.error`; unknown, required)
- `metadata` (`oficlinic.patients.create.response.201.metadata`; object, required) — What every answer carries besides its data or error.
  - `requestId` (`oficlinic.patients.create.response.201.metadata.requestId`; string, required) — Request correlation identifier, also sent as X-Request-Id.

### 400

`INVALID_INPUT`: The request does not match the published schema.

#### Example

```json
{
  "success": false,
  "data": null,
  "error": {
    "code": "INVALID_INPUT",
    "message": "string",
    "retryable": false,
    "data": {
      "issues": [
        {
          "path": "string",
          "message": "string"
        }
      ]
    }
  },
  "metadata": {
    "requestId": "string"
  }
}
```

- `success` (`oficlinic.patients.create.response.400.success`; boolean, required)
  - one of `false`
- `data` (`oficlinic.patients.create.response.400.data`; unknown, required)
- `error` (`oficlinic.patients.create.response.400.error`; object, required) — The request does not match the published schema.
  - `code` (`oficlinic.patients.create.response.400.error.code`; string, required) — The failure code, stable across releases.
    - one of `"INVALID_INPUT"`
  - `message` (`oficlinic.patients.create.response.400.error.message`; string, required) — What went wrong, for people; it never contains input values.
  - `retryable` (`oficlinic.patients.create.response.400.error.retryable`; boolean, required) — Whether repeating the same request may succeed.
    - one of `false`
  - `data` (`oficlinic.patients.create.response.400.error.data`; object, required)
    - `issues` (`oficlinic.patients.create.response.400.error.data.issues`; array<object>, optional)
      - `path` (`oficlinic.patients.create.response.400.error.data.issues.path`; string, required) — RFC 6901 JSON Pointer to the refused field; empty for the whole input.
        - maxLength 256
      - `message` (`oficlinic.patients.create.response.400.error.data.issues.message`; string, required)
        - maxLength 256
- `metadata` (`oficlinic.patients.create.response.400.metadata`; object, required) — What every answer carries besides its data or error.
  - `requestId` (`oficlinic.patients.create.response.400.metadata.requestId`; string, required) — Request correlation identifier, also sent as X-Request-Id.

### 401

`UNAUTHORIZED`: A valid access token is required.

#### Example

```json
{
  "success": false,
  "data": null,
  "error": {
    "code": "UNAUTHORIZED",
    "message": "string",
    "retryable": false,
    "data": {}
  },
  "metadata": {
    "requestId": "string"
  }
}
```

- `success` (`oficlinic.patients.create.response.401.success`; boolean, required)
  - one of `false`
- `data` (`oficlinic.patients.create.response.401.data`; unknown, required)
- `error` (`oficlinic.patients.create.response.401.error`; object, required) — A valid access token is required.
  - `code` (`oficlinic.patients.create.response.401.error.code`; string, required) — The failure code, stable across releases.
    - one of `"UNAUTHORIZED"`
  - `message` (`oficlinic.patients.create.response.401.error.message`; string, required) — What went wrong, for people; it never contains input values.
  - `retryable` (`oficlinic.patients.create.response.401.error.retryable`; boolean, required) — Whether repeating the same request may succeed.
    - one of `false`
  - `data` (`oficlinic.patients.create.response.401.error.data`; object, required) — No fields.
- `metadata` (`oficlinic.patients.create.response.401.metadata`; object, required) — What every answer carries besides its data or error.
  - `requestId` (`oficlinic.patients.create.response.401.metadata.requestId`; string, required) — Request correlation identifier, also sent as X-Request-Id.

### 403

`FORBIDDEN`: The token does not authorize this operation.

#### Example

```json
{
  "success": false,
  "data": null,
  "error": {
    "code": "FORBIDDEN",
    "message": "string",
    "retryable": false,
    "data": {}
  },
  "metadata": {
    "requestId": "string"
  }
}
```

- `success` (`oficlinic.patients.create.response.403.success`; boolean, required)
  - one of `false`
- `data` (`oficlinic.patients.create.response.403.data`; unknown, required)
- `error` (`oficlinic.patients.create.response.403.error`; object, required) — The token does not authorize this operation.
  - `code` (`oficlinic.patients.create.response.403.error.code`; string, required) — The failure code, stable across releases.
    - one of `"FORBIDDEN"`
  - `message` (`oficlinic.patients.create.response.403.error.message`; string, required) — What went wrong, for people; it never contains input values.
  - `retryable` (`oficlinic.patients.create.response.403.error.retryable`; boolean, required) — Whether repeating the same request may succeed.
    - one of `false`
  - `data` (`oficlinic.patients.create.response.403.error.data`; object, required) — No fields.
- `metadata` (`oficlinic.patients.create.response.403.metadata`; object, required) — What every answer carries besides its data or error.
  - `requestId` (`oficlinic.patients.create.response.403.metadata.requestId`; string, required) — Request correlation identifier, also sent as X-Request-Id.

### 404

`CONNECTION_NOT_FOUND`: The connection does not exist in this organization.

#### Example

```json
{
  "success": false,
  "data": null,
  "error": {
    "code": "CONNECTION_NOT_FOUND",
    "message": "string",
    "retryable": false,
    "data": {}
  },
  "metadata": {
    "requestId": "string"
  }
}
```

- `success` (`oficlinic.patients.create.response.404.success`; boolean, required)
  - one of `false`
- `data` (`oficlinic.patients.create.response.404.data`; unknown, required)
- `error` (`oficlinic.patients.create.response.404.error`; object, required) — The connection does not exist in this organization.
  - `code` (`oficlinic.patients.create.response.404.error.code`; string, required) — The failure code, stable across releases.
    - one of `"CONNECTION_NOT_FOUND"`
  - `message` (`oficlinic.patients.create.response.404.error.message`; string, required) — What went wrong, for people; it never contains input values.
  - `retryable` (`oficlinic.patients.create.response.404.error.retryable`; boolean, required) — Whether repeating the same request may succeed.
    - one of `false`
  - `data` (`oficlinic.patients.create.response.404.error.data`; object, required) — No fields.
- `metadata` (`oficlinic.patients.create.response.404.metadata`; object, required) — What every answer carries besides its data or error.
  - `requestId` (`oficlinic.patients.create.response.404.metadata.requestId`; string, required) — Request correlation identifier, also sent as X-Request-Id.

### 409

- `CONNECTION_REQUIRED`: The organization has several active connections: select one.
- `CONNECTION_NOT_ACTIVE`: The connection is not active.
- `CONNECTION_BUSY`: Another operation is using this connection or signing in for the organization.
- `REAUTHENTICATION_REQUIRED`: Provider sign-in is stopped for this connection. Verify the connection again.
- `PATIENT_ALREADY_REGISTERED`: A patient with this document is already registered.
- `IDEMPOTENCY_KEY_REUSED`: The idempotency key was already used for a different request.
- `WRITE_TARGET_UNRESOLVED`: An earlier write to this slot or appointment has no final outcome, so no other write to it is sent. Staff must check the provider's appointments.

#### Example

```json
{
  "success": false,
  "data": null,
  "error": {
    "code": "CONNECTION_REQUIRED",
    "message": "string",
    "retryable": false,
    "data": {}
  },
  "metadata": {
    "requestId": "string"
  }
}
```

- `success` (`oficlinic.patients.create.response.409.success`; boolean, required)
  - one of `false`
- `data` (`oficlinic.patients.create.response.409.data`; unknown, required)
- `error` (`oficlinic.patients.create.response.409.error`; OficlinicCreatePatientConflictFailure, required)
  - one of: `OficlinicConnectionRequiredFailure`, `OficlinicConnectionNotActiveFailure`, `OficlinicConnectionBusyFailure`, `OficlinicReauthenticationRequiredFailure`, `OficlinicPatientAlreadyRegisteredFailure`, `OficlinicIdempotencyKeyReusedFailure`, `OficlinicWriteTargetUnresolvedFailure`
  - discriminator: `code`
- `metadata` (`oficlinic.patients.create.response.409.metadata`; object, required) — What every answer carries besides its data or error.
  - `requestId` (`oficlinic.patients.create.response.409.metadata.requestId`; string, required) — Request correlation identifier, also sent as X-Request-Id.

### 413

`REQUEST_TOO_LARGE`: The request exceeds the allowed size.

#### Example

```json
{
  "success": false,
  "data": null,
  "error": {
    "code": "REQUEST_TOO_LARGE",
    "message": "string",
    "retryable": false,
    "data": {}
  },
  "metadata": {
    "requestId": "string"
  }
}
```

- `success` (`oficlinic.patients.create.response.413.success`; boolean, required)
  - one of `false`
- `data` (`oficlinic.patients.create.response.413.data`; unknown, required)
- `error` (`oficlinic.patients.create.response.413.error`; object, required) — The request exceeds the allowed size.
  - `code` (`oficlinic.patients.create.response.413.error.code`; string, required) — The failure code, stable across releases.
    - one of `"REQUEST_TOO_LARGE"`
  - `message` (`oficlinic.patients.create.response.413.error.message`; string, required) — What went wrong, for people; it never contains input values.
  - `retryable` (`oficlinic.patients.create.response.413.error.retryable`; boolean, required) — Whether repeating the same request may succeed.
    - one of `false`
  - `data` (`oficlinic.patients.create.response.413.error.data`; object, required) — No fields.
- `metadata` (`oficlinic.patients.create.response.413.metadata`; object, required) — What every answer carries besides its data or error.
  - `requestId` (`oficlinic.patients.create.response.413.metadata.requestId`; string, required) — Request correlation identifier, also sent as X-Request-Id.

### 415

`UNSUPPORTED_MEDIA_TYPE`: The request content type is not supported.

#### Example

```json
{
  "success": false,
  "data": null,
  "error": {
    "code": "UNSUPPORTED_MEDIA_TYPE",
    "message": "string",
    "retryable": false,
    "data": {}
  },
  "metadata": {
    "requestId": "string"
  }
}
```

- `success` (`oficlinic.patients.create.response.415.success`; boolean, required)
  - one of `false`
- `data` (`oficlinic.patients.create.response.415.data`; unknown, required)
- `error` (`oficlinic.patients.create.response.415.error`; object, required) — The request content type is not supported.
  - `code` (`oficlinic.patients.create.response.415.error.code`; string, required) — The failure code, stable across releases.
    - one of `"UNSUPPORTED_MEDIA_TYPE"`
  - `message` (`oficlinic.patients.create.response.415.error.message`; string, required) — What went wrong, for people; it never contains input values.
  - `retryable` (`oficlinic.patients.create.response.415.error.retryable`; boolean, required) — Whether repeating the same request may succeed.
    - one of `false`
  - `data` (`oficlinic.patients.create.response.415.error.data`; object, required) — No fields.
- `metadata` (`oficlinic.patients.create.response.415.metadata`; object, required) — What every answer carries besides its data or error.
  - `requestId` (`oficlinic.patients.create.response.415.metadata.requestId`; string, required) — Request correlation identifier, also sent as X-Request-Id.

### 422

- `CREDENTIALS_REJECTED`: The organization's connection to this integration couldn't complete the request. Don't retry it automatically; if it keeps happening, contact your Arbol team.
- `CONTEXT_NOT_AVAILABLE`: The selected company, site or IPS is not available to the provider account.
- `PROVIDER_IDENTITY_MISMATCH`: The provider session does not belong to the connection's user and selected context.
- `REGISTRATION_OPTION_NOT_FOUND`: The provider's patient form did not offer one of the selected options.

#### Example

```json
{
  "success": false,
  "data": null,
  "error": {
    "code": "CREDENTIALS_REJECTED",
    "message": "string",
    "retryable": false
  },
  "metadata": {
    "requestId": "string"
  }
}
```

- `success` (`oficlinic.patients.create.response.422.success`; boolean, required)
  - one of `false`
- `data` (`oficlinic.patients.create.response.422.data`; unknown, required)
- `error` (`oficlinic.patients.create.response.422.error`; OficlinicCreatePatientUnprocessableContentFailure, required)
  - one of: `CredentialsRejectedFailure`, `OficlinicContextNotAvailableFailure`, `OficlinicProviderIdentityMismatchFailure`, `OficlinicRegistrationOptionNotFoundFailure`
  - discriminator: `code`
- `metadata` (`oficlinic.patients.create.response.422.metadata`; object, required) — What every answer carries besides its data or error.
  - `requestId` (`oficlinic.patients.create.response.422.metadata.requestId`; string, required) — Request correlation identifier, also sent as X-Request-Id.

### 429

- `RATE_LIMITED`: The request rate limit was exceeded. Try again later.
- `LOGIN_COOLING_DOWN`: The organization's connection to this integration couldn't complete the request. Don't retry it automatically; if it keeps happening, contact your Arbol team.

#### Example

```json
{
  "success": false,
  "data": null,
  "error": {
    "code": "RATE_LIMITED",
    "message": "string",
    "retryable": true,
    "data": {}
  },
  "metadata": {
    "requestId": "string"
  }
}
```

- `success` (`oficlinic.patients.create.response.429.success`; boolean, required)
  - one of `false`
- `data` (`oficlinic.patients.create.response.429.data`; unknown, required)
- `error` (`oficlinic.patients.create.response.429.error`; OficlinicCreatePatientTooManyRequestsFailure, required)
  - one of: `RateLimitedFailure`, `OficlinicLoginCoolingDownFailure`
  - discriminator: `code`
- `metadata` (`oficlinic.patients.create.response.429.metadata`; object, required) — What every answer carries besides its data or error.
  - `requestId` (`oficlinic.patients.create.response.429.metadata.requestId`; string, required) — Request correlation identifier, also sent as X-Request-Id.

### 500

`INTERNAL_ERROR`: The service could not complete the operation.

#### Example

```json
{
  "success": false,
  "data": null,
  "error": {
    "code": "INTERNAL_ERROR",
    "message": "string",
    "retryable": false,
    "data": {}
  },
  "metadata": {
    "requestId": "string"
  }
}
```

- `success` (`oficlinic.patients.create.response.500.success`; boolean, required)
  - one of `false`
- `data` (`oficlinic.patients.create.response.500.data`; unknown, required)
- `error` (`oficlinic.patients.create.response.500.error`; object, required) — The service could not complete the operation.
  - `code` (`oficlinic.patients.create.response.500.error.code`; string, required) — The failure code, stable across releases.
    - one of `"INTERNAL_ERROR"`
  - `message` (`oficlinic.patients.create.response.500.error.message`; string, required) — What went wrong, for people; it never contains input values.
  - `retryable` (`oficlinic.patients.create.response.500.error.retryable`; boolean, required) — Whether repeating the same request may succeed.
    - one of `false`
  - `data` (`oficlinic.patients.create.response.500.error.data`; object, required) — No fields.
- `metadata` (`oficlinic.patients.create.response.500.metadata`; object, required) — What every answer carries besides its data or error.
  - `requestId` (`oficlinic.patients.create.response.500.metadata.requestId`; string, required) — Request correlation identifier, also sent as X-Request-Id.

### 502

- `OUTCOME_UNKNOWN`: The operation may have been applied; check its result before repeating it.
- `SIGN_IN_OUTCOME_UNKNOWN`: The provider did not confirm a sign-in. It is not repeated automatically.
- `PROVIDER_PROTOCOL_CHANGED`: The provider returned an unrecognized response.
- `PATIENT_RECORD_MISMATCH`: The provider answered a record that does not match the request.

#### Example

```json
{
  "success": false,
  "data": null,
  "error": {
    "code": "OUTCOME_UNKNOWN",
    "message": "string",
    "retryable": false,
    "data": {}
  },
  "metadata": {
    "requestId": "string"
  }
}
```

- `success` (`oficlinic.patients.create.response.502.success`; boolean, required)
  - one of `false`
- `data` (`oficlinic.patients.create.response.502.data`; unknown, required)
- `error` (`oficlinic.patients.create.response.502.error`; OficlinicCreatePatientBadGatewayFailure, required)
  - one of: `OutcomeUnknownFailure`, `OficlinicSignInOutcomeUnknownFailure`, `ProviderProtocolChangedFailure`, `OficlinicPatientRecordMismatchFailure`
  - discriminator: `code`
- `metadata` (`oficlinic.patients.create.response.502.metadata`; object, required) — What every answer carries besides its data or error.
  - `requestId` (`oficlinic.patients.create.response.502.metadata.requestId`; string, required) — Request correlation identifier, also sent as X-Request-Id.

### 503

- `UPSTREAM_UNAVAILABLE`: The upstream service could not complete the request.
- `PROVIDER_UNAVAILABLE`: The provider could not complete the request.
- `WRITE_LEDGER_FULL`: The connection's write ledger is at capacity, so no new write was sent. Recorded writes stay answerable; staff must look.

#### Example

```json
{
  "success": false,
  "data": null,
  "error": {
    "code": "UPSTREAM_UNAVAILABLE",
    "message": "string",
    "retryable": true,
    "data": {}
  },
  "metadata": {
    "requestId": "string"
  }
}
```

- `success` (`oficlinic.patients.create.response.503.success`; boolean, required)
  - one of `false`
- `data` (`oficlinic.patients.create.response.503.data`; unknown, required)
- `error` (`oficlinic.patients.create.response.503.error`; OficlinicCreatePatientServiceUnavailableFailure, required)
  - one of: `UpstreamUnavailableFailure`, `ProviderUnavailableFailure`, `OficlinicWriteLedgerFullFailure`
  - discriminator: `code`
- `metadata` (`oficlinic.patients.create.response.503.metadata`; object, required) — What every answer carries besides its data or error.
  - `requestId` (`oficlinic.patients.create.response.503.metadata.requestId`; string, required) — Request correlation identifier, also sent as X-Request-Id.

### 504

`UPSTREAM_TIMEOUT`: The upstream service did not respond before its deadline.

#### Example

```json
{
  "success": false,
  "data": null,
  "error": {
    "code": "UPSTREAM_TIMEOUT",
    "message": "string",
    "retryable": true,
    "data": {}
  },
  "metadata": {
    "requestId": "string"
  }
}
```

- `success` (`oficlinic.patients.create.response.504.success`; boolean, required)
  - one of `false`
- `data` (`oficlinic.patients.create.response.504.data`; unknown, required)
- `error` (`oficlinic.patients.create.response.504.error`; object, required) — The upstream service did not respond before its deadline.
  - `code` (`oficlinic.patients.create.response.504.error.code`; string, required) — The failure code, stable across releases.
    - one of `"UPSTREAM_TIMEOUT"`
  - `message` (`oficlinic.patients.create.response.504.error.message`; string, required) — What went wrong, for people; it never contains input values.
  - `retryable` (`oficlinic.patients.create.response.504.error.retryable`; boolean, required) — Whether repeating the same request may succeed.
    - one of `true`
  - `data` (`oficlinic.patients.create.response.504.error.data`; object, required) — No fields.
- `metadata` (`oficlinic.patients.create.response.504.metadata`; object, required) — What every answer carries besides its data or error.
  - `requestId` (`oficlinic.patients.create.response.504.metadata.requestId`; string, required) — Request correlation identifier, also sent as X-Request-Id.


Source: https://docs.getarbol.com/api/oficlinic/patients/create/index.md
