---
title: "Create an appointment"
---

> 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 an appointment

Path: Oficlinic API › Appointments

`POST /v1/oficlinic/appointments`

Book one appointment in e-Oficlinic (ASIGNAR_CITAS) for a slot that search_booking_slots or list_booking_slots offered in an availability flow. Send what a person at the desk chooses: confirm true; the slot's flowId and slotId; the patient's documentType and documentNumber; the payer's planId and subplanId (list_payer_plans, list_payer_subplans); and in classification the patient's regime and affiliateType (list_regimes, list_affiliate_types) and, for copayments, salaryRange (list_salary_ranges). Leave the rest out: the service resolves it as the provider's own booking screen does. The payer, program and attention type are the flow's; the purpose is the form's default, 10; the contract is the payer's only active one, or none when it has none; billing takes its flags from the payer's row, its copayment rate, cap and moderator fee from the salary range's row, and its tariff from the payer's tariff matrix for the flow's service under the plan and subplan. A value the caller does send is used as given, and a billing object is sent unchanged with nothing resolved. BOOKING_VALUE_UNRESOLVED means a needed value could not be resolved from the provider's own data and nothing was written; send it and repeat: contractId when the payer has several active contracts; classification.relationship when the affiliate type is neither C nor N; classification.listStatus when the payer uses an attention list; a classification.salaryRange the regime lists; or billing when the payer's tariff grid has no positive tariff for the service. Before anything is written, the patient is resolved by citizenship card; the source must still count exactly one unit for the program and attention type; the regime, affiliate type, relationship and salary range, and the payer, plan, subplan and contract, must be listed by the provider; the service must be configured for the slot's professional; and a fresh read must still show the slot. The intent and a fence on the slot are recorded before the single provider request, which is never resent. Success means the provider answered a strictly positive appointment number, the source's own creation signal (verification provider_acknowledgement). OUTCOME_UNKNOWN means the appointment may exist: do not book again; check lookup_appointments with status assigned and ask staff. WRITE_TARGET_UNRESOLVED means another key's write to this slot has no final outcome, so nothing was sent. WRITE_LEDGER_FULL means the connection's ledger refused a new write and nothing was sent. Repeating the identical request answers the recorded outcome; no idempotency key is needed. One-slot, one-unit bookings only. agentMode true answers concise Spanish text instead.

- **Scope:** `oficlinic:appointments: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 appointments create` · **MCP tool:** `oficlinic_appointments_create`

## Authentication

Requires one of the following:

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

## Request body

_Required._

- `confirm` (`oficlinic.appointments.create.confirm`; boolean, required) — Must be true: the patient or staff confirmed this exact booking. Without it nothing is written.
- `flowId` (`oficlinic.appointments.create.flowId`; string, required) — The availability flow id every booking list item carries (flowId). It expires 30 minutes after the first list.
  - pattern `^bf_[a-z2-7]{16}$`
- `slotId` (`oficlinic.appointments.create.slotId`; string, required) — A slot id from search_booking_slots or list_booking_slots in the same flow.
  - pattern `^[0-9A-Za-z._-]{1,32}$`
- `documentType` (`oficlinic.appointments.create.documentType`; string, required) — Colombian citizenship card. Other document types are not verified against the provider yet.
- `documentNumber` (`oficlinic.appointments.create.documentNumber`; string, required) — The document number, digits only.
  - pattern `^[0-9]{3,15}$`
- `planId` (`oficlinic.appointments.create.planId`; string, required) — A plan of the payer, from list_payer_plans.
  - pattern `^[0-9A-Za-z._-]{1,32}$`
- `subplanId` (`oficlinic.appointments.create.subplanId`; string, required) — A subplan of the plan, from list_payer_subplans.
  - pattern `^[0-9A-Za-z._-]{1,32}$`
- `classification` (`oficlinic.appointments.create.classification`; object, required) — Coverage and clinical classification codes, as the clinic's own provider catalogs define them. regime and affiliateType are never guessed: the caller supplies them. The rest has the defaults each field states.
  - `affiliateType` (`oficlinic.appointments.create.classification.affiliateType`; string, required) — Sent as pTipoAfiliacion (the screen's affiliate type, strTafiliado). Required: one list_affiliate_types answers for the regime.
    - pattern `^[0-9A-Za-z._-]{1,32}$`
  - `regime` (`oficlinic.appointments.create.classification.regime`; string, required) — Sent as pTipoAfiliado (the screen's regime, strRegimen). Required: one list_regimes answers.
    - pattern `^[0-9A-Za-z._-]{1,32}$`
  - `relationship` (`oficlinic.appointments.create.classification.relationship`; string | null, optional) — Sent as pParentesco (strParentesco); empty when null. One list_relationships answers. The screen disables it for the affiliate types C and N; for any other affiliate type it requires one, so leaving it out then answers BOOKING_VALUE_UNRESOLVED.
    - pattern `^[0-9A-Za-z._-]{1,32}$`; default `null`
  - `salaryRange` (`oficlinic.appointments.create.classification.salaryRange`; string | null, optional) — Sent as pRangoSalarial (strRango); empty when null. One list_salary_ranges answers for the regime, or BOOKING_VALUE_UNRESOLVED. Required when billing is left out: its row supplies the copayment values.
    - pattern `^[0-9A-Za-z._-]{1,32}$`; default `null`
  - `listStatus` (`oficlinic.appointments.create.classification.listStatus`; string | null, optional) — Sent as pEstadoListado (strEstado); empty when null. No catalog of it is mapped, so it is not checked. The screen requires one only when the payer uses an attention list (usesAttentionList in list_payers): leaving it out then answers BOOKING_VALUE_UNRESOLVED.
    - pattern `^[0-9A-Za-z._-]{1,32}$`; default `null`
  - `programId` (`oficlinic.appointments.create.classification.programId`; string, optional) — Sent as pPrograma (sysPrograma). Left out: the program the availability flow was opened for. When given it must be that program.
    - pattern `^[0-9A-Za-z._-]{1,32}$`
  - `attentionTypeId` (`oficlinic.appointments.create.classification.attentionTypeId`; string, optional) — The one-unit attention type the availability flow was opened for. Left out: that one. When given it must be that one. The source's request has no field for it: it decides the slot list's unit count.
    - pattern `^[0-9A-Za-z._-]{1,32}$`
  - `purposeId` (`oficlinic.appointments.create.classification.purposeId`; string, optional) — Sent as pFinalidad (sysFinalidad). Left out: 10, the default of the screen's hidden control. No catalog proves it here, and a program's sourcePurpose is never applied in its place.
    - pattern `^[0-9A-Za-z._-]{1,32}$`; default `"10"`
- `connectionId` (`oficlinic.appointments.create.connectionId`; string, optional) — An Account connection id of the caller's organization.
  - pattern `^con_[0-9A-Za-z]{26}$`
- `idempotencyKey` (`oficlinic.appointments.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_-]+$`
- `payerId` (`oficlinic.appointments.create.payerId`; string, optional) — The payer the availability flow was opened for. Left out: that payer. When given it must be that payer.
  - pattern `^[0-9A-Za-z._-]{1,32}$`
- `contractId` (`oficlinic.appointments.create.contractId`; string | null, optional) — A contract of the payer from list_payer_contracts, which must not be inactive. An explicit null sends none. Leaving the key out is not the same as null: the service then sends the payer's only contract when list_payer_contracts has exactly one that is not inactive and marks it active, sends none when the payer has no contract or only inactive ones, and answers BOOKING_VALUE_UNRESOLVED otherwise (several contracts, or an unrecognized active flag).
  - pattern `^[0-9A-Za-z._-]{1,32}$`
- `billing` (`oficlinic.appointments.create.billing`; object, optional) — Billing values of the booking screen. Leave the whole object out and the service resolves them as the screen does: tariff from the payer's tariff matrix for the flow's service under the plan and subplan; billPrivately, billCopayments and enteredCopayment from the payer's row; copaymentPercentage, maxCopayment and indicatedModeratorFee from the row of classification.salaryRange; exempt 0, courtOrder 0 and markExempt false. When given, every value is sent exactly as given and nothing is resolved.
  - `tariff` (`oficlinic.appointments.create.billing.tariff`; string, required) — Sent as pTarifaProced: the unit value of the clinic's tariff for the service. Required when billing is given.
    - pattern `^(0|[1-9][0-9]{0,9})(\.[0-9]{1,2})?$`
  - `billPrivately` (`oficlinic.appointments.create.billing.billPrivately`; string | null, required) — Sent as pFacturarParticular.
    - pattern `^[0-9A-Za-z._-]{1,32}$`
  - `billCopayments` (`oficlinic.appointments.create.billing.billCopayments`; string | null, required) — Sent as pFacturarCopagos.
    - pattern `^[0-9A-Za-z._-]{1,32}$`
  - `enteredCopayment` (`oficlinic.appointments.create.billing.enteredCopayment`; string | null, required) — Sent as pCopagoDigitado.
    - pattern `^(0|[1-9][0-9]{0,9})(\.[0-9]{1,2})?$`
  - `copaymentPercentage` (`oficlinic.appointments.create.billing.copaymentPercentage`; string | null, required) — Sent unchanged as pPorCopagos, preserving the source rate's precision.
    - pattern `^(0|[1-9][0-9]{0,9})(\.[0-9]{1,6})?$`
  - `maxCopayment` (`oficlinic.appointments.create.billing.maxCopayment`; string | null, required) — Sent as pMaxCopago.
    - pattern `^(0|[1-9][0-9]{0,9})(\.[0-9]{1,2})?$`
  - `indicatedModeratorFee` (`oficlinic.appointments.create.billing.indicatedModeratorFee`; string | null, required) — Sent as pvlrCuotaModeradoraIndicada.
    - pattern `^(0|[1-9][0-9]{0,9})(\.[0-9]{1,2})?$`
  - `exempt` (`oficlinic.appointments.create.billing.exempt`; string | null, required) — Sent as pExento.
    - pattern `^[0-9A-Za-z._-]{1,32}$`
  - `courtOrder` (`oficlinic.appointments.create.billing.courtOrder`; string | null, required) — Sent as pTutela.
    - pattern `^[0-9A-Za-z._-]{1,32}$`
  - `markExempt` (`oficlinic.appointments.create.billing.markExempt`; boolean, required) — Sent as pMarcaExento, true or false as the screen's checkbox.
- `referral` (`oficlinic.appointments.create.referral`; object, optional) — Referral values of the booking screen. Left out: no requesting professional, no authorization number and requestedByUser false.
  - `requestingProfessionalId` (`oficlinic.appointments.create.referral.requestingProfessionalId`; string | null, optional) — Sent as pProfeSol; empty when null.
    - pattern `^[0-9A-Za-z._-]{1,32}$`; default `null`
  - `authorizationNumber` (`oficlinic.appointments.create.referral.authorizationNumber`; string | null, optional) — Sent as pAutorizacion: the payer's authorization number; empty when null. A payer that requires authorization (requiresAuthorization in list_payers) is still booked without one, as the clinic's staff do; they complete it before the visit.
    - pattern `^[0-9A-Za-z-]{1,30}$`; default `null`
  - `requestedByUser` (`oficlinic.appointments.create.referral.requestedByUser`; boolean, optional) — Sent as pSolicitudUsuario, 1 or 0: the booking screen's user-request checkbox, unchecked by default.
    - default `false`
- `observations` (`oficlinic.appointments.create.observations`; string | null, optional) — Observations sent as pObservaciones, accents removed and uppercased; null (the default) sends none.
  - minLength 1; maxLength 250; pattern `^[0-9A-Za-zÁÉÍÓÚÜÑáéíóúüñ ,.;:()/#-]*$`; default `null`
- `agentMode` (`oficlinic.appointments.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",
  "idempotencyKey": "stringst",
  "confirm": true,
  "flowId": "string",
  "slotId": "string",
  "documentType": "CC",
  "documentNumber": "string",
  "payerId": "string",
  "planId": "string",
  "subplanId": "string",
  "contractId": "string",
  "classification": {
    "affiliateType": "string",
    "regime": "string",
    "relationship": null,
    "salaryRange": null,
    "listStatus": null,
    "programId": "string",
    "attentionTypeId": "string",
    "purposeId": "10"
  },
  "billing": {
    "tariff": "string",
    "billPrivately": "string",
    "billCopayments": "string",
    "enteredCopayment": "string",
    "copaymentPercentage": "string",
    "maxCopayment": "string",
    "indicatedModeratorFee": "string",
    "exempt": "string",
    "courtOrder": "string",
    "markExempt": true
  },
  "referral": {
    "requestingProfessionalId": null,
    "authorizationNumber": null,
    "requestedByUser": false
  },
  "observations": null,
  "agentMode": false
}
```

## Code samples

### cURL

```bash
curl https://api.getarbol.com/v1/oficlinic/appointments \
  --request POST \
  --header "Authorization: Bearer $ARBOL_API_KEY" \
  --header "Content-Type: application/json" \
  --data '{
  "confirm": true,
  "flowId": "<flowId>",
  "slotId": "<slotId>",
  "documentType": "CC",
  "documentNumber": "<documentNumber>",
  "planId": "<planId>",
  "subplanId": "<subplanId>",
  "classification": {
    "affiliateType": "<affiliateType>",
    "regime": "<regime>"
  }
}'
```

### 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.appointments.create({
  confirm: true,
  flowId: "<flowId>",
  slotId: "<slotId>",
  documentType: "CC",
  documentNumber: "<documentNumber>",
  planId: "<planId>",
  subplanId: "<subplanId>",
  classification: {
    affiliateType: "<affiliateType>",
    regime: "<regime>",
  },
});
```

### Rust

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

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

let input: types::OficlinicAppointmentsCreateInput = serde_json::from_value(serde_json::json!({
    "confirm": true,
    "flowId": "<flowId>",
    "slotId": "<slotId>",
    "documentType": "CC",
    "documentNumber": "<documentNumber>",
    "planId": "<planId>",
    "subplanId": "<subplanId>",
    "classification": {
        "affiliateType": "<affiliateType>",
        "regime": "<regime>"
    }
}))?;
let data = arbol.oficlinic().appointments().create(&input).await?;
```

### CLI

```bash
arbol oficlinic appointments create --input - <<'JSON'
{
  "confirm": true,
  "flowId": "<flowId>",
  "slotId": "<slotId>",
  "documentType": "CC",
  "documentNumber": "<documentNumber>",
  "planId": "<planId>",
  "subplanId": "<subplanId>",
  "classification": {
    "affiliateType": "<affiliateType>",
    "regime": "<regime>"
  }
}
JSON
```

### MCP

```json
{
  "name": "oficlinic_appointments_create",
  "arguments": {
    "confirm": true,
    "flowId": "<flowId>",
    "slotId": "<slotId>",
    "documentType": "CC",
    "documentNumber": "<documentNumber>",
    "planId": "<planId>",
    "subplanId": "<subplanId>",
    "classification": {
      "affiliateType": "<affiliateType>",
      "regime": "<regime>"
    }
  }
}
```

## Responses

### 201

Successful operation.

#### Example

```json
{
  "success": true,
  "data": {
    "idempotencyKey": "string",
    "status": "acknowledged",
    "verification": "provider_acknowledgement",
    "providerReference": "string",
    "date": "string",
    "slotId": "string",
    "slotLabel": "string",
    "professional": {
      "id": "string",
      "name": "string"
    },
    "room": {
      "id": "string",
      "name": "string"
    },
    "service": {
      "id": "string",
      "code": "string",
      "name": "string"
    },
    "payer": {
      "id": "string",
      "name": "string"
    },
    "planId": "string",
    "subplanId": "string",
    "contractId": "string",
    "programId": "string",
    "attentionTypeId": "string",
    "acknowledgedAt": "2019-08-24T14:15:22Z"
  },
  "error": null,
  "metadata": {
    "requestId": "string"
  }
}
```

- `success` (`oficlinic.appointments.create.response.201.success`; boolean, required)
  - one of `true`
- `data` (`oficlinic.appointments.create.response.201.data`; OficlinicCreateAppointmentResult, required)
  - any of: `OficlinicAppointmentBooking`, `OficlinicAgentText`
- `error` (`oficlinic.appointments.create.response.201.error`; unknown, required)
- `metadata` (`oficlinic.appointments.create.response.201.metadata`; object, required) — What every answer carries besides its data or error.
  - `requestId` (`oficlinic.appointments.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.appointments.create.response.400.success`; boolean, required)
  - one of `false`
- `data` (`oficlinic.appointments.create.response.400.data`; unknown, required)
- `error` (`oficlinic.appointments.create.response.400.error`; object, required) — The request does not match the published schema.
  - `code` (`oficlinic.appointments.create.response.400.error.code`; string, required) — The failure code, stable across releases.
    - one of `"INVALID_INPUT"`
  - `message` (`oficlinic.appointments.create.response.400.error.message`; string, required) — What went wrong, for people; it never contains input values.
  - `retryable` (`oficlinic.appointments.create.response.400.error.retryable`; boolean, required) — Whether repeating the same request may succeed.
    - one of `false`
  - `data` (`oficlinic.appointments.create.response.400.error.data`; object, required)
    - `issues` (`oficlinic.appointments.create.response.400.error.data.issues`; array<object>, optional)
      - `path` (`oficlinic.appointments.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.appointments.create.response.400.error.data.issues.message`; string, required)
        - maxLength 256
- `metadata` (`oficlinic.appointments.create.response.400.metadata`; object, required) — What every answer carries besides its data or error.
  - `requestId` (`oficlinic.appointments.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.appointments.create.response.401.success`; boolean, required)
  - one of `false`
- `data` (`oficlinic.appointments.create.response.401.data`; unknown, required)
- `error` (`oficlinic.appointments.create.response.401.error`; object, required) — A valid access token is required.
  - `code` (`oficlinic.appointments.create.response.401.error.code`; string, required) — The failure code, stable across releases.
    - one of `"UNAUTHORIZED"`
  - `message` (`oficlinic.appointments.create.response.401.error.message`; string, required) — What went wrong, for people; it never contains input values.
  - `retryable` (`oficlinic.appointments.create.response.401.error.retryable`; boolean, required) — Whether repeating the same request may succeed.
    - one of `false`
  - `data` (`oficlinic.appointments.create.response.401.error.data`; object, required) — No fields.
- `metadata` (`oficlinic.appointments.create.response.401.metadata`; object, required) — What every answer carries besides its data or error.
  - `requestId` (`oficlinic.appointments.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.appointments.create.response.403.success`; boolean, required)
  - one of `false`
- `data` (`oficlinic.appointments.create.response.403.data`; unknown, required)
- `error` (`oficlinic.appointments.create.response.403.error`; object, required) — The token does not authorize this operation.
  - `code` (`oficlinic.appointments.create.response.403.error.code`; string, required) — The failure code, stable across releases.
    - one of `"FORBIDDEN"`
  - `message` (`oficlinic.appointments.create.response.403.error.message`; string, required) — What went wrong, for people; it never contains input values.
  - `retryable` (`oficlinic.appointments.create.response.403.error.retryable`; boolean, required) — Whether repeating the same request may succeed.
    - one of `false`
  - `data` (`oficlinic.appointments.create.response.403.error.data`; object, required) — No fields.
- `metadata` (`oficlinic.appointments.create.response.403.metadata`; object, required) — What every answer carries besides its data or error.
  - `requestId` (`oficlinic.appointments.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.
- `PATIENT_NOT_FOUND`: The provider explicitly reported no patient with the document.
- `PAYER_NOT_FOUND`: The payer is not configured for the connection's company and IPS.
- `PAYER_OPTION_NOT_FOUND`: The plan, subplan or contract is not one the provider lists for the payer, or the contract is inactive.
- `BOOKING_OPTION_NOT_FOUND`: The program, attention type, regime, affiliate type, relationship or cancellation reason is not one the provider lists.

#### Example

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

- `success` (`oficlinic.appointments.create.response.404.success`; boolean, required)
  - one of `false`
- `data` (`oficlinic.appointments.create.response.404.data`; unknown, required)
- `error` (`oficlinic.appointments.create.response.404.error`; OficlinicCreateAppointmentNotFoundFailure, required)
  - one of: `OficlinicConnectionNotFoundFailure`, `OficlinicPatientNotFoundFailure`, `OficlinicPayerNotFoundFailure`, `OficlinicPayerOptionNotFoundFailure`, `OficlinicBookingOptionNotFoundFailure`
  - discriminator: `code`
- `metadata` (`oficlinic.appointments.create.response.404.metadata`; object, required) — What every answer carries besides its data or error.
  - `requestId` (`oficlinic.appointments.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.
- `SERVICE_NOT_AVAILABLE`: The service is not configured for the selected professional.
- `SELECTION_NOT_AVAILABLE`: The professional, room, day or slot is not offered in this availability flow, or is no longer offered.
- `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.appointments.create.response.409.success`; boolean, required)
  - one of `false`
- `data` (`oficlinic.appointments.create.response.409.data`; unknown, required)
- `error` (`oficlinic.appointments.create.response.409.error`; OficlinicCreateAppointmentConflictFailure, required)
  - one of: `OficlinicConnectionRequiredFailure`, `OficlinicConnectionNotActiveFailure`, `OficlinicConnectionBusyFailure`, `OficlinicReauthenticationRequiredFailure`, `OficlinicServiceNotAvailableFailure`, `OficlinicSelectionNotAvailableFailure`, `OficlinicIdempotencyKeyReusedFailure`, `OficlinicWriteTargetUnresolvedFailure`
  - discriminator: `code`
- `metadata` (`oficlinic.appointments.create.response.409.metadata`; object, required) — What every answer carries besides its data or error.
  - `requestId` (`oficlinic.appointments.create.response.409.metadata.requestId`; string, required) — Request correlation identifier, also sent as X-Request-Id.

### 410

`SELECTION_EXPIRED`: The availability flow expired or does not exist. List booking professionals again.

#### Example

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

- `success` (`oficlinic.appointments.create.response.410.success`; boolean, required)
  - one of `false`
- `data` (`oficlinic.appointments.create.response.410.data`; unknown, required)
- `error` (`oficlinic.appointments.create.response.410.error`; object, required) — The availability flow expired or does not exist. List booking professionals again.
  - `code` (`oficlinic.appointments.create.response.410.error.code`; string, required) — The failure code, stable across releases.
    - one of `"SELECTION_EXPIRED"`
  - `message` (`oficlinic.appointments.create.response.410.error.message`; string, required) — What went wrong, for people; it never contains input values.
  - `retryable` (`oficlinic.appointments.create.response.410.error.retryable`; boolean, required) — Whether repeating the same request may succeed.
    - one of `false`
  - `data` (`oficlinic.appointments.create.response.410.error.data`; object, required) — No fields.
- `metadata` (`oficlinic.appointments.create.response.410.metadata`; object, required) — What every answer carries besides its data or error.
  - `requestId` (`oficlinic.appointments.create.response.410.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.appointments.create.response.413.success`; boolean, required)
  - one of `false`
- `data` (`oficlinic.appointments.create.response.413.data`; unknown, required)
- `error` (`oficlinic.appointments.create.response.413.error`; object, required) — The request exceeds the allowed size.
  - `code` (`oficlinic.appointments.create.response.413.error.code`; string, required) — The failure code, stable across releases.
    - one of `"REQUEST_TOO_LARGE"`
  - `message` (`oficlinic.appointments.create.response.413.error.message`; string, required) — What went wrong, for people; it never contains input values.
  - `retryable` (`oficlinic.appointments.create.response.413.error.retryable`; boolean, required) — Whether repeating the same request may succeed.
    - one of `false`
  - `data` (`oficlinic.appointments.create.response.413.error.data`; object, required) — No fields.
- `metadata` (`oficlinic.appointments.create.response.413.metadata`; object, required) — What every answer carries besides its data or error.
  - `requestId` (`oficlinic.appointments.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.appointments.create.response.415.success`; boolean, required)
  - one of `false`
- `data` (`oficlinic.appointments.create.response.415.data`; unknown, required)
- `error` (`oficlinic.appointments.create.response.415.error`; object, required) — The request content type is not supported.
  - `code` (`oficlinic.appointments.create.response.415.error.code`; string, required) — The failure code, stable across releases.
    - one of `"UNSUPPORTED_MEDIA_TYPE"`
  - `message` (`oficlinic.appointments.create.response.415.error.message`; string, required) — What went wrong, for people; it never contains input values.
  - `retryable` (`oficlinic.appointments.create.response.415.error.retryable`; boolean, required) — Whether repeating the same request may succeed.
    - one of `false`
  - `data` (`oficlinic.appointments.create.response.415.error.data`; object, required) — No fields.
- `metadata` (`oficlinic.appointments.create.response.415.metadata`; object, required) — What every answer carries besides its data or error.
  - `requestId` (`oficlinic.appointments.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.
- `BOOKING_VALUE_UNRESOLVED`: A value the booking needs could not be resolved from the provider's own data, so the caller must supply it: a contract, a relationship, a list status, an authorization number, a salary range the regime lists, or the billing values. Nothing was written.
- `PROGRAM_UNITS_NOT_SUPPORTED`: The attention type's source unit count is not exactly one, and this service books one-unit programs only.

#### Example

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

- `success` (`oficlinic.appointments.create.response.422.success`; boolean, required)
  - one of `false`
- `data` (`oficlinic.appointments.create.response.422.data`; unknown, required)
- `error` (`oficlinic.appointments.create.response.422.error`; OficlinicCreateAppointmentUnprocessableContentFailure, required)
  - one of: `CredentialsRejectedFailure`, `OficlinicContextNotAvailableFailure`, `OficlinicProviderIdentityMismatchFailure`, `OficlinicBookingValueUnresolvedFailure`, `OficlinicProgramUnitsNotSupportedFailure`
  - discriminator: `code`
- `metadata` (`oficlinic.appointments.create.response.422.metadata`; object, required) — What every answer carries besides its data or error.
  - `requestId` (`oficlinic.appointments.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.appointments.create.response.429.success`; boolean, required)
  - one of `false`
- `data` (`oficlinic.appointments.create.response.429.data`; unknown, required)
- `error` (`oficlinic.appointments.create.response.429.error`; OficlinicCreateAppointmentTooManyRequestsFailure, required)
  - one of: `RateLimitedFailure`, `OficlinicLoginCoolingDownFailure`
  - discriminator: `code`
- `metadata` (`oficlinic.appointments.create.response.429.metadata`; object, required) — What every answer carries besides its data or error.
  - `requestId` (`oficlinic.appointments.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.appointments.create.response.500.success`; boolean, required)
  - one of `false`
- `data` (`oficlinic.appointments.create.response.500.data`; unknown, required)
- `error` (`oficlinic.appointments.create.response.500.error`; object, required) — The service could not complete the operation.
  - `code` (`oficlinic.appointments.create.response.500.error.code`; string, required) — The failure code, stable across releases.
    - one of `"INTERNAL_ERROR"`
  - `message` (`oficlinic.appointments.create.response.500.error.message`; string, required) — What went wrong, for people; it never contains input values.
  - `retryable` (`oficlinic.appointments.create.response.500.error.retryable`; boolean, required) — Whether repeating the same request may succeed.
    - one of `false`
  - `data` (`oficlinic.appointments.create.response.500.error.data`; object, required) — No fields.
- `metadata` (`oficlinic.appointments.create.response.500.metadata`; object, required) — What every answer carries besides its data or error.
  - `requestId` (`oficlinic.appointments.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.appointments.create.response.502.success`; boolean, required)
  - one of `false`
- `data` (`oficlinic.appointments.create.response.502.data`; unknown, required)
- `error` (`oficlinic.appointments.create.response.502.error`; OficlinicCreateAppointmentBadGatewayFailure, required)
  - one of: `OutcomeUnknownFailure`, `OficlinicSignInOutcomeUnknownFailure`, `ProviderProtocolChangedFailure`, `OficlinicPatientRecordMismatchFailure`
  - discriminator: `code`
- `metadata` (`oficlinic.appointments.create.response.502.metadata`; object, required) — What every answer carries besides its data or error.
  - `requestId` (`oficlinic.appointments.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.appointments.create.response.503.success`; boolean, required)
  - one of `false`
- `data` (`oficlinic.appointments.create.response.503.data`; unknown, required)
- `error` (`oficlinic.appointments.create.response.503.error`; OficlinicCreateAppointmentServiceUnavailableFailure, required)
  - one of: `UpstreamUnavailableFailure`, `ProviderUnavailableFailure`, `OficlinicWriteLedgerFullFailure`
  - discriminator: `code`
- `metadata` (`oficlinic.appointments.create.response.503.metadata`; object, required) — What every answer carries besides its data or error.
  - `requestId` (`oficlinic.appointments.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.appointments.create.response.504.success`; boolean, required)
  - one of `false`
- `data` (`oficlinic.appointments.create.response.504.data`; unknown, required)
- `error` (`oficlinic.appointments.create.response.504.error`; object, required) — The upstream service did not respond before its deadline.
  - `code` (`oficlinic.appointments.create.response.504.error.code`; string, required) — The failure code, stable across releases.
    - one of `"UPSTREAM_TIMEOUT"`
  - `message` (`oficlinic.appointments.create.response.504.error.message`; string, required) — What went wrong, for people; it never contains input values.
  - `retryable` (`oficlinic.appointments.create.response.504.error.retryable`; boolean, required) — Whether repeating the same request may succeed.
    - one of `true`
  - `data` (`oficlinic.appointments.create.response.504.error.data`; object, required) — No fields.
- `metadata` (`oficlinic.appointments.create.response.504.metadata`; object, required) — What every answer carries besides its data or error.
  - `requestId` (`oficlinic.appointments.create.response.504.metadata.requestId`; string, required) — Request correlation identifier, also sent as X-Request-Id.


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