---
title: "Look up a patient by document"
---

> 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.

# Look up a patient by document

Path: Oficlinic API › Patients

`POST /v1/oficlinic/patients/lookup`

Look up one patient in e-Oficlinic by citizenship card (CC) number, sent in the body and never in a URL. found answers a deliberately projected record (provider id, names, birth date, sex, address, phones, email, municipality) only when the provider returned a record with the requested document; not_found answers only the provider explicit negative. Any failure is not evidence that the patient is absent. This does not verify payer rights or the identity of the person presenting the document. agentMode true answers concise Spanish text instead.

- **Scope:** `oficlinic:patients:read`
- **Credentials:** an API key, a client-credentials token or a person's access token
- **Effect:** read-only; safe to retry
- **Limits:** request body up to 4 KB, response up to 8 KB
- **CLI:** `arbol oficlinic patients lookup` · **MCP tool:** `oficlinic_patients_lookup`

## Authentication

Requires one of the following:

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

## Request body

_Required._

- `documentType` (`oficlinic.patients.lookup.documentType`; string, required) — Colombian citizenship card. Other document types are not verified against the provider yet.
- `documentNumber` (`oficlinic.patients.lookup.documentNumber`; string, required) — The document number, digits only.
  - pattern `^[0-9]{3,15}$`
- `connectionId` (`oficlinic.patients.lookup.connectionId`; string, optional) — An Account connection id of the caller's organization.
  - pattern `^con_[0-9A-Za-z]{26}$`
- `agentMode` (`oficlinic.patients.lookup.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",
  "agentMode": false
}
```

## Code samples

### cURL

```bash
curl https://api.getarbol.com/v1/oficlinic/patients/lookup \
  --request POST \
  --header "Authorization: Bearer $ARBOL_API_KEY" \
  --header "Content-Type: application/json" \
  --data '{
  "documentType": "CC",
  "documentNumber": "<documentNumber>"
}'
```

### 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.lookup({
  documentType: "CC",
  documentNumber: "<documentNumber>",
});
```

### Rust

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

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

let input: types::OficlinicPatientsLookupInput = serde_json::from_value(serde_json::json!({
    "documentType": "CC",
    "documentNumber": "<documentNumber>"
}))?;
let data = arbol.oficlinic().patients().lookup(&input).await?;
```

### CLI

```bash
arbol oficlinic patients lookup --document-type CC --document-number '<documentNumber>'
```

### MCP

```json
{
  "name": "oficlinic_patients_lookup",
  "arguments": {
    "documentType": "CC",
    "documentNumber": "<documentNumber>"
  }
}
```

## Responses

### 200

Successful operation.

#### Example

```json
{
  "success": true,
  "data": {
    "status": "found",
    "observedAt": "2019-08-24T14:15:22Z",
    "patient": {
      "id": "string",
      "documentType": "string",
      "documentNumber": "string",
      "givenName": "string",
      "familyName": "string",
      "fullName": "string",
      "birthDate": "string",
      "sex": "string",
      "address": "string",
      "zone": "string",
      "phone": "string",
      "mobilePhone": "string",
      "email": "string",
      "municipalityCode": "string"
    }
  },
  "error": null,
  "metadata": {
    "requestId": "string"
  }
}
```

- `success` (`oficlinic.patients.lookup.response.200.success`; boolean, required)
  - one of `true`
- `data` (`oficlinic.patients.lookup.response.200.data`; OficlinicLookupPatientResult, required)
  - any of: `OficlinicPatientFound`, `OficlinicPatientNotFound`, `OficlinicAgentText`
- `error` (`oficlinic.patients.lookup.response.200.error`; unknown, required)
- `metadata` (`oficlinic.patients.lookup.response.200.metadata`; object, required) — What every answer carries besides its data or error.
  - `requestId` (`oficlinic.patients.lookup.response.200.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.lookup.response.400.success`; boolean, required)
  - one of `false`
- `data` (`oficlinic.patients.lookup.response.400.data`; unknown, required)
- `error` (`oficlinic.patients.lookup.response.400.error`; object, required) — The request does not match the published schema.
  - `code` (`oficlinic.patients.lookup.response.400.error.code`; string, required) — The failure code, stable across releases.
    - one of `"INVALID_INPUT"`
  - `message` (`oficlinic.patients.lookup.response.400.error.message`; string, required) — What went wrong, for people; it never contains input values.
  - `retryable` (`oficlinic.patients.lookup.response.400.error.retryable`; boolean, required) — Whether repeating the same request may succeed.
    - one of `false`
  - `data` (`oficlinic.patients.lookup.response.400.error.data`; object, required)
    - `issues` (`oficlinic.patients.lookup.response.400.error.data.issues`; array<object>, optional)
      - `path` (`oficlinic.patients.lookup.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.lookup.response.400.error.data.issues.message`; string, required)
        - maxLength 256
- `metadata` (`oficlinic.patients.lookup.response.400.metadata`; object, required) — What every answer carries besides its data or error.
  - `requestId` (`oficlinic.patients.lookup.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.lookup.response.401.success`; boolean, required)
  - one of `false`
- `data` (`oficlinic.patients.lookup.response.401.data`; unknown, required)
- `error` (`oficlinic.patients.lookup.response.401.error`; object, required) — A valid access token is required.
  - `code` (`oficlinic.patients.lookup.response.401.error.code`; string, required) — The failure code, stable across releases.
    - one of `"UNAUTHORIZED"`
  - `message` (`oficlinic.patients.lookup.response.401.error.message`; string, required) — What went wrong, for people; it never contains input values.
  - `retryable` (`oficlinic.patients.lookup.response.401.error.retryable`; boolean, required) — Whether repeating the same request may succeed.
    - one of `false`
  - `data` (`oficlinic.patients.lookup.response.401.error.data`; object, required) — No fields.
- `metadata` (`oficlinic.patients.lookup.response.401.metadata`; object, required) — What every answer carries besides its data or error.
  - `requestId` (`oficlinic.patients.lookup.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.lookup.response.403.success`; boolean, required)
  - one of `false`
- `data` (`oficlinic.patients.lookup.response.403.data`; unknown, required)
- `error` (`oficlinic.patients.lookup.response.403.error`; object, required) — The token does not authorize this operation.
  - `code` (`oficlinic.patients.lookup.response.403.error.code`; string, required) — The failure code, stable across releases.
    - one of `"FORBIDDEN"`
  - `message` (`oficlinic.patients.lookup.response.403.error.message`; string, required) — What went wrong, for people; it never contains input values.
  - `retryable` (`oficlinic.patients.lookup.response.403.error.retryable`; boolean, required) — Whether repeating the same request may succeed.
    - one of `false`
  - `data` (`oficlinic.patients.lookup.response.403.error.data`; object, required) — No fields.
- `metadata` (`oficlinic.patients.lookup.response.403.metadata`; object, required) — What every answer carries besides its data or error.
  - `requestId` (`oficlinic.patients.lookup.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.lookup.response.404.success`; boolean, required)
  - one of `false`
- `data` (`oficlinic.patients.lookup.response.404.data`; unknown, required)
- `error` (`oficlinic.patients.lookup.response.404.error`; object, required) — The connection does not exist in this organization.
  - `code` (`oficlinic.patients.lookup.response.404.error.code`; string, required) — The failure code, stable across releases.
    - one of `"CONNECTION_NOT_FOUND"`
  - `message` (`oficlinic.patients.lookup.response.404.error.message`; string, required) — What went wrong, for people; it never contains input values.
  - `retryable` (`oficlinic.patients.lookup.response.404.error.retryable`; boolean, required) — Whether repeating the same request may succeed.
    - one of `false`
  - `data` (`oficlinic.patients.lookup.response.404.error.data`; object, required) — No fields.
- `metadata` (`oficlinic.patients.lookup.response.404.metadata`; object, required) — What every answer carries besides its data or error.
  - `requestId` (`oficlinic.patients.lookup.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.

#### Example

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

- `success` (`oficlinic.patients.lookup.response.409.success`; boolean, required)
  - one of `false`
- `data` (`oficlinic.patients.lookup.response.409.data`; unknown, required)
- `error` (`oficlinic.patients.lookup.response.409.error`; OficlinicLookupPatientConflictFailure, required)
  - one of: `OficlinicConnectionRequiredFailure`, `OficlinicConnectionNotActiveFailure`, `OficlinicConnectionBusyFailure`, `OficlinicReauthenticationRequiredFailure`
  - discriminator: `code`
- `metadata` (`oficlinic.patients.lookup.response.409.metadata`; object, required) — What every answer carries besides its data or error.
  - `requestId` (`oficlinic.patients.lookup.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.lookup.response.413.success`; boolean, required)
  - one of `false`
- `data` (`oficlinic.patients.lookup.response.413.data`; unknown, required)
- `error` (`oficlinic.patients.lookup.response.413.error`; object, required) — The request exceeds the allowed size.
  - `code` (`oficlinic.patients.lookup.response.413.error.code`; string, required) — The failure code, stable across releases.
    - one of `"REQUEST_TOO_LARGE"`
  - `message` (`oficlinic.patients.lookup.response.413.error.message`; string, required) — What went wrong, for people; it never contains input values.
  - `retryable` (`oficlinic.patients.lookup.response.413.error.retryable`; boolean, required) — Whether repeating the same request may succeed.
    - one of `false`
  - `data` (`oficlinic.patients.lookup.response.413.error.data`; object, required) — No fields.
- `metadata` (`oficlinic.patients.lookup.response.413.metadata`; object, required) — What every answer carries besides its data or error.
  - `requestId` (`oficlinic.patients.lookup.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.lookup.response.415.success`; boolean, required)
  - one of `false`
- `data` (`oficlinic.patients.lookup.response.415.data`; unknown, required)
- `error` (`oficlinic.patients.lookup.response.415.error`; object, required) — The request content type is not supported.
  - `code` (`oficlinic.patients.lookup.response.415.error.code`; string, required) — The failure code, stable across releases.
    - one of `"UNSUPPORTED_MEDIA_TYPE"`
  - `message` (`oficlinic.patients.lookup.response.415.error.message`; string, required) — What went wrong, for people; it never contains input values.
  - `retryable` (`oficlinic.patients.lookup.response.415.error.retryable`; boolean, required) — Whether repeating the same request may succeed.
    - one of `false`
  - `data` (`oficlinic.patients.lookup.response.415.error.data`; object, required) — No fields.
- `metadata` (`oficlinic.patients.lookup.response.415.metadata`; object, required) — What every answer carries besides its data or error.
  - `requestId` (`oficlinic.patients.lookup.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.

#### Example

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

- `success` (`oficlinic.patients.lookup.response.422.success`; boolean, required)
  - one of `false`
- `data` (`oficlinic.patients.lookup.response.422.data`; unknown, required)
- `error` (`oficlinic.patients.lookup.response.422.error`; OficlinicLookupPatientUnprocessableContentFailure, required)
  - one of: `CredentialsRejectedFailure`, `OficlinicContextNotAvailableFailure`, `OficlinicProviderIdentityMismatchFailure`
  - discriminator: `code`
- `metadata` (`oficlinic.patients.lookup.response.422.metadata`; object, required) — What every answer carries besides its data or error.
  - `requestId` (`oficlinic.patients.lookup.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.lookup.response.429.success`; boolean, required)
  - one of `false`
- `data` (`oficlinic.patients.lookup.response.429.data`; unknown, required)
- `error` (`oficlinic.patients.lookup.response.429.error`; OficlinicLookupPatientTooManyRequestsFailure, required)
  - one of: `RateLimitedFailure`, `OficlinicLoginCoolingDownFailure`
  - discriminator: `code`
- `metadata` (`oficlinic.patients.lookup.response.429.metadata`; object, required) — What every answer carries besides its data or error.
  - `requestId` (`oficlinic.patients.lookup.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.lookup.response.500.success`; boolean, required)
  - one of `false`
- `data` (`oficlinic.patients.lookup.response.500.data`; unknown, required)
- `error` (`oficlinic.patients.lookup.response.500.error`; object, required) — The service could not complete the operation.
  - `code` (`oficlinic.patients.lookup.response.500.error.code`; string, required) — The failure code, stable across releases.
    - one of `"INTERNAL_ERROR"`
  - `message` (`oficlinic.patients.lookup.response.500.error.message`; string, required) — What went wrong, for people; it never contains input values.
  - `retryable` (`oficlinic.patients.lookup.response.500.error.retryable`; boolean, required) — Whether repeating the same request may succeed.
    - one of `false`
  - `data` (`oficlinic.patients.lookup.response.500.error.data`; object, required) — No fields.
- `metadata` (`oficlinic.patients.lookup.response.500.metadata`; object, required) — What every answer carries besides its data or error.
  - `requestId` (`oficlinic.patients.lookup.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.lookup.response.502.success`; boolean, required)
  - one of `false`
- `data` (`oficlinic.patients.lookup.response.502.data`; unknown, required)
- `error` (`oficlinic.patients.lookup.response.502.error`; OficlinicLookupPatientBadGatewayFailure, required)
  - one of: `OutcomeUnknownFailure`, `OficlinicSignInOutcomeUnknownFailure`, `ProviderProtocolChangedFailure`, `OficlinicPatientRecordMismatchFailure`
  - discriminator: `code`
- `metadata` (`oficlinic.patients.lookup.response.502.metadata`; object, required) — What every answer carries besides its data or error.
  - `requestId` (`oficlinic.patients.lookup.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.

#### Example

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

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


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