---
title: "Look up patients by identity document"
description: "Use the organization gMedic account. Finds the patient with this exact document type and number. Read-only request; an empty page means no such patient, and provider failures are never empty results.\n\n- **Scope:** `gmedic:patients:read`\n- **Credentials:** an API key, a client-credentials token or a person's access token\n- **Effect:** read-only; safe to retry\n- **Limits:** request body up to 32 KB, response up to 256 KB\n- **CLI:** `arbol gmedic patients lookup` · **MCP tool:** `gmedic_patients_lookup`"
---

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

Path: gMedic API › Patients

`POST /v1/gmedic/patients/lookup`

Use the organization gMedic account. Finds the patient with this exact document type and number. Read-only request; an empty page means no such patient, and provider failures are never empty results.

- **Scope:** `gmedic: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 32 KB, response up to 256 KB
- **CLI:** `arbol gmedic patients lookup` · **MCP tool:** `gmedic_patients_lookup`

## Authentication

Requires one of the following:

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

## Request body

_Required._

- `documentType` (`gmedic.patients.lookup.documentType`; any of, required)
  - any of: `string`, `string`, `string`
- `documentNumber` (`gmedic.patients.lookup.documentNumber`; string, required)
  - minLength 1; maxLength 30
- `cursor` (`gmedic.patients.lookup.cursor`; string, optional) — Opaque cursor returned by pageInfo; omit it to request the first page.
- `direction` (`gmedic.patients.lookup.direction`; string, optional) — Direction to traverse the stable keyset ordering from the supplied cursor.
  - one of `"forward"`, `"backward"`; default `"forward"`
- `limit` (`gmedic.patients.lookup.limit`; integer, optional) — Maximum items returned in one page. Defaults to 25; larger reads require another cursor.
  - min 1; max 100; default `25`
- `connectionId` (`gmedic.patients.lookup.connectionId`; string, optional)
  - pattern `^con_[0-9A-Za-z]{26}$`

## Example request

```json
{
  "cursor": "string",
  "direction": "forward",
  "limit": 25,
  "documentType": "CC",
  "documentNumber": "string",
  "connectionId": "string"
}
```

## Code samples

### cURL

```bash
curl https://api.getarbol.com/v1/gmedic/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.gmedic.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::GmedicPatientsLookupInput = serde_json::from_value(serde_json::json!({
    "documentType": "CC",
    "documentNumber": "<documentNumber>"
}))?;
let data = arbol.gmedic().patients().lookup(&input).await?;
```

### CLI

```bash
arbol gmedic patients lookup --input - <<'JSON'
{
  "documentType": "CC",
  "documentNumber": "<documentNumber>"
}
JSON
```

### MCP

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

## Responses

### 200

Successful operation.

#### Example

```json
{
  "success": true,
  "data": {
    "data": [
      {
        "id": "string",
        "key": "string",
        "createdAt": "string",
        "updatedAt": "string",
        "documentNumber": "string",
        "documentType": {
          "id": "string",
          "name": "string",
          "label": "string",
          "value": "string"
        },
        "givenName": "string",
        "familyName": "string",
        "healthCompanyName": "string",
        "birthDate": "string",
        "ageInYears": 0,
        "ageMonths": 0,
        "birthdayDays": 0,
        "email": "string",
        "phone": "string",
        "mobilePhone": "string",
        "address": "string",
        "location": "string",
        "gender": {
          "id": "string",
          "name": "string",
          "label": "string",
          "value": "string"
        },
        "genderIdentity": {
          "id": "string",
          "name": "string",
          "label": "string",
          "value": "string"
        },
        "contactPerson": "string",
        "contactPersonPhone": "string",
        "responsible": "string",
        "responsiblePhone": "string",
        "responsibleRelationship": "string",
        "healthRegime": {
          "id": "string",
          "name": "string",
          "label": "string",
          "value": "string"
        },
        "jobCompany": "string",
        "referredBy": {
          "id": "string",
          "name": "string",
          "label": "string",
          "value": "string"
        },
        "referredByName": "string",
        "status": {
          "id": "string",
          "name": "string",
          "label": "string",
          "value": "string"
        },
        "category": {
          "id": "string",
          "name": "string",
          "label": "string",
          "value": "string"
        },
        "patientType": {
          "id": "string",
          "name": "string",
          "label": "string",
          "value": "string"
        },
        "educationLevel": {
          "id": "string",
          "name": "string",
          "label": "string",
          "value": "string"
        },
        "profession": "string",
        "occupation": "string",
        "maritalStatus": {
          "id": "string",
          "name": "string",
          "label": "string",
          "value": "string"
        },
        "ethnicity": {
          "id": "string",
          "name": "string",
          "label": "string",
          "value": "string"
        },
        "disabilityCategory": {
          "id": "string",
          "name": "string",
          "label": "string",
          "value": "string"
        },
        "householdCompositionType": {
          "id": "string",
          "name": "string",
          "label": "string",
          "value": "string"
        },
        "householdSize": 0,
        "childrenCount": 0,
        "dependentsCount": 0,
        "socioeconomicStratum": 0,
        "eps": "string",
        "arl": "string",
        "afp": {
          "id": "string",
          "name": "string",
          "label": "string",
          "value": "string"
        },
        "properties": {}
      }
    ],
    "object": "list",
    "pageInfo": {
      "hasNextPage": true,
      "hasPreviousPage": true,
      "nextCursor": "string",
      "previousCursor": "string"
    }
  },
  "error": null,
  "metadata": {
    "requestId": "string"
  }
}
```

- `success` (`gmedic.patients.lookup.response.200.success`; boolean, required)
  - one of `true`
- `data` (`gmedic.patients.lookup.response.200.data`; object, required)
  - `data` (`gmedic.patients.lookup.response.200.data.data`; array<object>, required) — Items admitted by this resource contract within the verified organization.
    - `id` (`gmedic.patients.lookup.response.200.data.data.id`; string, required)
      - pattern `^[1-9][0-9]{0,14}$`
    - `key` (`gmedic.patients.lookup.response.200.data.data.key`; string | null, optional)
      - maxLength 20000
    - `createdAt` (`gmedic.patients.lookup.response.200.data.data.createdAt`; string | null, optional)
      - maxLength 20000
    - `updatedAt` (`gmedic.patients.lookup.response.200.data.data.updatedAt`; string | null, optional)
      - maxLength 20000
    - `documentNumber` (`gmedic.patients.lookup.response.200.data.data.documentNumber`; string | null, optional)
      - maxLength 20000
    - `documentType` (`gmedic.patients.lookup.response.200.data.data.documentType`; object | null, optional)
      - `id` (`gmedic.patients.lookup.response.200.data.data.documentType.id`; string, required)
        - pattern `^[1-9][0-9]{0,14}$`
      - `name` (`gmedic.patients.lookup.response.200.data.data.documentType.name`; string | null, optional)
        - maxLength 20000
      - `label` (`gmedic.patients.lookup.response.200.data.data.documentType.label`; string | null, optional)
        - maxLength 20000
      - `value` (`gmedic.patients.lookup.response.200.data.data.documentType.value`; string | null, optional)
        - maxLength 20000
    - `givenName` (`gmedic.patients.lookup.response.200.data.data.givenName`; string | null, optional)
      - maxLength 20000
    - `familyName` (`gmedic.patients.lookup.response.200.data.data.familyName`; string | null, optional)
      - maxLength 20000
    - `healthCompanyName` (`gmedic.patients.lookup.response.200.data.data.healthCompanyName`; string | null, optional)
      - maxLength 20000
    - `birthDate` (`gmedic.patients.lookup.response.200.data.data.birthDate`; string | null, optional)
      - maxLength 20000
    - `ageInYears` (`gmedic.patients.lookup.response.200.data.data.ageInYears`; integer | null, optional)
      - min 0; max 9007199254740991
    - `ageMonths` (`gmedic.patients.lookup.response.200.data.data.ageMonths`; integer | null, optional)
      - min 0; max 9007199254740991
    - `birthdayDays` (`gmedic.patients.lookup.response.200.data.data.birthdayDays`; integer | null, optional)
      - min 0; max 9007199254740991
    - `email` (`gmedic.patients.lookup.response.200.data.data.email`; string | null, optional)
      - maxLength 20000
    - `phone` (`gmedic.patients.lookup.response.200.data.data.phone`; string | null, optional)
      - maxLength 20000
    - `mobilePhone` (`gmedic.patients.lookup.response.200.data.data.mobilePhone`; string | null, optional)
      - maxLength 20000
    - `address` (`gmedic.patients.lookup.response.200.data.data.address`; string | null, optional)
      - maxLength 20000
    - `location` (`gmedic.patients.lookup.response.200.data.data.location`; string | null, optional)
      - maxLength 20000
    - `gender` (`gmedic.patients.lookup.response.200.data.data.gender`; object | null, optional)
      - `id` (`gmedic.patients.lookup.response.200.data.data.gender.id`; string, required)
        - pattern `^[1-9][0-9]{0,14}$`
      - `name` (`gmedic.patients.lookup.response.200.data.data.gender.name`; string | null, optional)
        - maxLength 20000
      - `label` (`gmedic.patients.lookup.response.200.data.data.gender.label`; string | null, optional)
        - maxLength 20000
      - `value` (`gmedic.patients.lookup.response.200.data.data.gender.value`; string | null, optional)
        - maxLength 20000
    - `genderIdentity` (`gmedic.patients.lookup.response.200.data.data.genderIdentity`; object | null, optional)
      - `id` (`gmedic.patients.lookup.response.200.data.data.genderIdentity.id`; string, required)
        - pattern `^[1-9][0-9]{0,14}$`
      - `name` (`gmedic.patients.lookup.response.200.data.data.genderIdentity.name`; string | null, optional)
        - maxLength 20000
      - `label` (`gmedic.patients.lookup.response.200.data.data.genderIdentity.label`; string | null, optional)
        - maxLength 20000
      - `value` (`gmedic.patients.lookup.response.200.data.data.genderIdentity.value`; string | null, optional)
        - maxLength 20000
    - `contactPerson` (`gmedic.patients.lookup.response.200.data.data.contactPerson`; string | null, optional)
      - maxLength 20000
    - `contactPersonPhone` (`gmedic.patients.lookup.response.200.data.data.contactPersonPhone`; string | null, optional)
      - maxLength 20000
    - `responsible` (`gmedic.patients.lookup.response.200.data.data.responsible`; string | null, optional)
      - maxLength 20000
    - `responsiblePhone` (`gmedic.patients.lookup.response.200.data.data.responsiblePhone`; string | null, optional)
      - maxLength 20000
    - `responsibleRelationship` (`gmedic.patients.lookup.response.200.data.data.responsibleRelationship`; string | null, optional)
      - maxLength 20000
    - `healthRegime` (`gmedic.patients.lookup.response.200.data.data.healthRegime`; object | null, optional)
      - `id` (`gmedic.patients.lookup.response.200.data.data.healthRegime.id`; string, required)
        - pattern `^[1-9][0-9]{0,14}$`
      - `name` (`gmedic.patients.lookup.response.200.data.data.healthRegime.name`; string | null, optional)
        - maxLength 20000
      - `label` (`gmedic.patients.lookup.response.200.data.data.healthRegime.label`; string | null, optional)
        - maxLength 20000
      - `value` (`gmedic.patients.lookup.response.200.data.data.healthRegime.value`; string | null, optional)
        - maxLength 20000
    - `jobCompany` (`gmedic.patients.lookup.response.200.data.data.jobCompany`; string | null, optional)
      - maxLength 20000
    - `referredBy` (`gmedic.patients.lookup.response.200.data.data.referredBy`; object | null, optional)
      - `id` (`gmedic.patients.lookup.response.200.data.data.referredBy.id`; string, required)
        - pattern `^[1-9][0-9]{0,14}$`
      - `name` (`gmedic.patients.lookup.response.200.data.data.referredBy.name`; string | null, optional)
        - maxLength 20000
      - `label` (`gmedic.patients.lookup.response.200.data.data.referredBy.label`; string | null, optional)
        - maxLength 20000
      - `value` (`gmedic.patients.lookup.response.200.data.data.referredBy.value`; string | null, optional)
        - maxLength 20000
    - `referredByName` (`gmedic.patients.lookup.response.200.data.data.referredByName`; string | null, optional)
      - maxLength 20000
    - `status` (`gmedic.patients.lookup.response.200.data.data.status`; object | null, optional)
      - `id` (`gmedic.patients.lookup.response.200.data.data.status.id`; string, required)
        - pattern `^[1-9][0-9]{0,14}$`
      - `name` (`gmedic.patients.lookup.response.200.data.data.status.name`; string | null, optional)
        - maxLength 20000
      - `label` (`gmedic.patients.lookup.response.200.data.data.status.label`; string | null, optional)
        - maxLength 20000
      - `value` (`gmedic.patients.lookup.response.200.data.data.status.value`; string | null, optional)
        - maxLength 20000
    - `category` (`gmedic.patients.lookup.response.200.data.data.category`; object | null, optional)
      - `id` (`gmedic.patients.lookup.response.200.data.data.category.id`; string, required)
        - pattern `^[1-9][0-9]{0,14}$`
      - `name` (`gmedic.patients.lookup.response.200.data.data.category.name`; string | null, optional)
        - maxLength 20000
      - `label` (`gmedic.patients.lookup.response.200.data.data.category.label`; string | null, optional)
        - maxLength 20000
      - `value` (`gmedic.patients.lookup.response.200.data.data.category.value`; string | null, optional)
        - maxLength 20000
    - `patientType` (`gmedic.patients.lookup.response.200.data.data.patientType`; object | null, optional)
      - `id` (`gmedic.patients.lookup.response.200.data.data.patientType.id`; string, required)
        - pattern `^[1-9][0-9]{0,14}$`
      - `name` (`gmedic.patients.lookup.response.200.data.data.patientType.name`; string | null, optional)
        - maxLength 20000
      - `label` (`gmedic.patients.lookup.response.200.data.data.patientType.label`; string | null, optional)
        - maxLength 20000
      - `value` (`gmedic.patients.lookup.response.200.data.data.patientType.value`; string | null, optional)
        - maxLength 20000
    - `educationLevel` (`gmedic.patients.lookup.response.200.data.data.educationLevel`; object | null, optional)
      - `id` (`gmedic.patients.lookup.response.200.data.data.educationLevel.id`; string, required)
        - pattern `^[1-9][0-9]{0,14}$`
      - `name` (`gmedic.patients.lookup.response.200.data.data.educationLevel.name`; string | null, optional)
        - maxLength 20000
      - `label` (`gmedic.patients.lookup.response.200.data.data.educationLevel.label`; string | null, optional)
        - maxLength 20000
      - `value` (`gmedic.patients.lookup.response.200.data.data.educationLevel.value`; string | null, optional)
        - maxLength 20000
    - `profession` (`gmedic.patients.lookup.response.200.data.data.profession`; string | null, optional)
      - maxLength 20000
    - `occupation` (`gmedic.patients.lookup.response.200.data.data.occupation`; string | null, optional)
      - maxLength 20000
    - `maritalStatus` (`gmedic.patients.lookup.response.200.data.data.maritalStatus`; object | null, optional)
      - `id` (`gmedic.patients.lookup.response.200.data.data.maritalStatus.id`; string, required)
        - pattern `^[1-9][0-9]{0,14}$`
      - `name` (`gmedic.patients.lookup.response.200.data.data.maritalStatus.name`; string | null, optional)
        - maxLength 20000
      - `label` (`gmedic.patients.lookup.response.200.data.data.maritalStatus.label`; string | null, optional)
        - maxLength 20000
      - `value` (`gmedic.patients.lookup.response.200.data.data.maritalStatus.value`; string | null, optional)
        - maxLength 20000
    - `ethnicity` (`gmedic.patients.lookup.response.200.data.data.ethnicity`; object | null, optional)
      - `id` (`gmedic.patients.lookup.response.200.data.data.ethnicity.id`; string, required)
        - pattern `^[1-9][0-9]{0,14}$`
      - `name` (`gmedic.patients.lookup.response.200.data.data.ethnicity.name`; string | null, optional)
        - maxLength 20000
      - `label` (`gmedic.patients.lookup.response.200.data.data.ethnicity.label`; string | null, optional)
        - maxLength 20000
      - `value` (`gmedic.patients.lookup.response.200.data.data.ethnicity.value`; string | null, optional)
        - maxLength 20000
    - `disabilityCategory` (`gmedic.patients.lookup.response.200.data.data.disabilityCategory`; object | null, optional)
      - `id` (`gmedic.patients.lookup.response.200.data.data.disabilityCategory.id`; string, required)
        - pattern `^[1-9][0-9]{0,14}$`
      - `name` (`gmedic.patients.lookup.response.200.data.data.disabilityCategory.name`; string | null, optional)
        - maxLength 20000
      - `label` (`gmedic.patients.lookup.response.200.data.data.disabilityCategory.label`; string | null, optional)
        - maxLength 20000
      - `value` (`gmedic.patients.lookup.response.200.data.data.disabilityCategory.value`; string | null, optional)
        - maxLength 20000
    - `householdCompositionType` (`gmedic.patients.lookup.response.200.data.data.householdCompositionType`; object | null, optional)
      - `id` (`gmedic.patients.lookup.response.200.data.data.householdCompositionType.id`; string, required)
        - pattern `^[1-9][0-9]{0,14}$`
      - `name` (`gmedic.patients.lookup.response.200.data.data.householdCompositionType.name`; string | null, optional)
        - maxLength 20000
      - `label` (`gmedic.patients.lookup.response.200.data.data.householdCompositionType.label`; string | null, optional)
        - maxLength 20000
      - `value` (`gmedic.patients.lookup.response.200.data.data.householdCompositionType.value`; string | null, optional)
        - maxLength 20000
    - `householdSize` (`gmedic.patients.lookup.response.200.data.data.householdSize`; integer | null, optional)
      - min 0; max 9007199254740991
    - `childrenCount` (`gmedic.patients.lookup.response.200.data.data.childrenCount`; integer | null, optional)
      - min 0; max 9007199254740991
    - `dependentsCount` (`gmedic.patients.lookup.response.200.data.data.dependentsCount`; integer | null, optional)
      - min 0; max 9007199254740991
    - `socioeconomicStratum` (`gmedic.patients.lookup.response.200.data.data.socioeconomicStratum`; integer | null, optional)
      - min 0; max 9007199254740991
    - `eps` (`gmedic.patients.lookup.response.200.data.data.eps`; string | null, optional)
      - maxLength 20000
    - `arl` (`gmedic.patients.lookup.response.200.data.data.arl`; string | null, optional)
      - maxLength 20000
    - `afp` (`gmedic.patients.lookup.response.200.data.data.afp`; object | null, optional)
      - `id` (`gmedic.patients.lookup.response.200.data.data.afp.id`; string, required)
        - pattern `^[1-9][0-9]{0,14}$`
      - `name` (`gmedic.patients.lookup.response.200.data.data.afp.name`; string | null, optional)
        - maxLength 20000
      - `label` (`gmedic.patients.lookup.response.200.data.data.afp.label`; string | null, optional)
        - maxLength 20000
      - `value` (`gmedic.patients.lookup.response.200.data.data.afp.value`; string | null, optional)
        - maxLength 20000
    - `properties` (`gmedic.patients.lookup.response.200.data.data.properties`; object | null, optional)
  - `object` (`gmedic.patients.lookup.response.200.data.object`; string, required) — Discriminator for a resource list response.
  - `pageInfo` (`gmedic.patients.lookup.response.200.data.pageInfo`; object, required) — Opaque navigation cursors for this page’s stable keyset order.
    - `hasNextPage` (`gmedic.patients.lookup.response.200.data.pageInfo.hasNextPage`; boolean, required) — Whether a later page exists in the current ordering.
    - `hasPreviousPage` (`gmedic.patients.lookup.response.200.data.pageInfo.hasPreviousPage`; boolean, required) — Whether an earlier page exists in the current ordering.
    - `nextCursor` (`gmedic.patients.lookup.response.200.data.pageInfo.nextCursor`; string | null, required) — Opaque cursor for the next page, or null when there is none.
    - `previousCursor` (`gmedic.patients.lookup.response.200.data.pageInfo.previousCursor`; string | null, required) — Opaque cursor for the previous page, or null when there is none.
- `error` (`gmedic.patients.lookup.response.200.error`; unknown, required)
- `metadata` (`gmedic.patients.lookup.response.200.metadata`; object, required) — What every answer carries besides its data or error.
  - `requestId` (`gmedic.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` (`gmedic.patients.lookup.response.400.success`; boolean, required)
  - one of `false`
- `data` (`gmedic.patients.lookup.response.400.data`; unknown, required)
- `error` (`gmedic.patients.lookup.response.400.error`; object, required) — The request does not match the published schema.
  - `code` (`gmedic.patients.lookup.response.400.error.code`; string, required) — The failure code, stable across releases.
    - one of `"INVALID_INPUT"`
  - `message` (`gmedic.patients.lookup.response.400.error.message`; string, required) — What went wrong, for people; it never contains input values.
  - `retryable` (`gmedic.patients.lookup.response.400.error.retryable`; boolean, required) — Whether repeating the same request may succeed.
    - one of `false`
  - `data` (`gmedic.patients.lookup.response.400.error.data`; object, required)
    - `issues` (`gmedic.patients.lookup.response.400.error.data.issues`; array<object>, optional)
      - `path` (`gmedic.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` (`gmedic.patients.lookup.response.400.error.data.issues.message`; string, required)
        - maxLength 256
- `metadata` (`gmedic.patients.lookup.response.400.metadata`; object, required) — What every answer carries besides its data or error.
  - `requestId` (`gmedic.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` (`gmedic.patients.lookup.response.401.success`; boolean, required)
  - one of `false`
- `data` (`gmedic.patients.lookup.response.401.data`; unknown, required)
- `error` (`gmedic.patients.lookup.response.401.error`; object, required) — A valid access token is required.
  - `code` (`gmedic.patients.lookup.response.401.error.code`; string, required) — The failure code, stable across releases.
    - one of `"UNAUTHORIZED"`
  - `message` (`gmedic.patients.lookup.response.401.error.message`; string, required) — What went wrong, for people; it never contains input values.
  - `retryable` (`gmedic.patients.lookup.response.401.error.retryable`; boolean, required) — Whether repeating the same request may succeed.
    - one of `false`
  - `data` (`gmedic.patients.lookup.response.401.error.data`; object, required) — No fields.
- `metadata` (`gmedic.patients.lookup.response.401.metadata`; object, required) — What every answer carries besides its data or error.
  - `requestId` (`gmedic.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` (`gmedic.patients.lookup.response.403.success`; boolean, required)
  - one of `false`
- `data` (`gmedic.patients.lookup.response.403.data`; unknown, required)
- `error` (`gmedic.patients.lookup.response.403.error`; object, required) — The token does not authorize this operation.
  - `code` (`gmedic.patients.lookup.response.403.error.code`; string, required) — The failure code, stable across releases.
    - one of `"FORBIDDEN"`
  - `message` (`gmedic.patients.lookup.response.403.error.message`; string, required) — What went wrong, for people; it never contains input values.
  - `retryable` (`gmedic.patients.lookup.response.403.error.retryable`; boolean, required) — Whether repeating the same request may succeed.
    - one of `false`
  - `data` (`gmedic.patients.lookup.response.403.error.data`; object, required) — No fields.
- `metadata` (`gmedic.patients.lookup.response.403.metadata`; object, required) — What every answer carries besides its data or error.
  - `requestId` (`gmedic.patients.lookup.response.403.metadata.requestId`; string, required) — Request correlation identifier, also sent as X-Request-Id.

### 404

- `CONNECTION_NOT_FOUND`: This organization has no gMedic connection with this id.
- `RECORD_NOT_FOUND`: gMedic has no record with one of the ids sent.

#### Example

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

- `success` (`gmedic.patients.lookup.response.404.success`; boolean, required)
  - one of `false`
- `data` (`gmedic.patients.lookup.response.404.data`; unknown, required)
- `error` (`gmedic.patients.lookup.response.404.error`; one of, required)
  - one of: `GmedicConnectionNotFoundFailure`, `GmedicRecordNotFoundFailure`
  - discriminator: `code`
- `metadata` (`gmedic.patients.lookup.response.404.metadata`; object, required) — What every answer carries besides its data or error.
  - `requestId` (`gmedic.patients.lookup.response.404.metadata.requestId`; string, required) — Request correlation identifier, also sent as X-Request-Id.

### 409

`NOT_CONFIGURED`: This organization has no verified gMedic connection.

#### Example

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

- `success` (`gmedic.patients.lookup.response.409.success`; boolean, required)
  - one of `false`
- `data` (`gmedic.patients.lookup.response.409.data`; unknown, required)
- `error` (`gmedic.patients.lookup.response.409.error`; object, required) — This organization has no verified gMedic connection.
  - `code` (`gmedic.patients.lookup.response.409.error.code`; string, required) — The failure code, stable across releases.
    - one of `"NOT_CONFIGURED"`
  - `message` (`gmedic.patients.lookup.response.409.error.message`; string, required) — What went wrong, for people; it never contains input values.
  - `retryable` (`gmedic.patients.lookup.response.409.error.retryable`; boolean, required) — Whether repeating the same request may succeed.
    - one of `false`
  - `data` (`gmedic.patients.lookup.response.409.error.data`; object, required) — No fields.
- `metadata` (`gmedic.patients.lookup.response.409.metadata`; object, required) — What every answer carries besides its data or error.
  - `requestId` (`gmedic.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` (`gmedic.patients.lookup.response.413.success`; boolean, required)
  - one of `false`
- `data` (`gmedic.patients.lookup.response.413.data`; unknown, required)
- `error` (`gmedic.patients.lookup.response.413.error`; object, required) — The request exceeds the allowed size.
  - `code` (`gmedic.patients.lookup.response.413.error.code`; string, required) — The failure code, stable across releases.
    - one of `"REQUEST_TOO_LARGE"`
  - `message` (`gmedic.patients.lookup.response.413.error.message`; string, required) — What went wrong, for people; it never contains input values.
  - `retryable` (`gmedic.patients.lookup.response.413.error.retryable`; boolean, required) — Whether repeating the same request may succeed.
    - one of `false`
  - `data` (`gmedic.patients.lookup.response.413.error.data`; object, required) — No fields.
- `metadata` (`gmedic.patients.lookup.response.413.metadata`; object, required) — What every answer carries besides its data or error.
  - `requestId` (`gmedic.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` (`gmedic.patients.lookup.response.415.success`; boolean, required)
  - one of `false`
- `data` (`gmedic.patients.lookup.response.415.data`; unknown, required)
- `error` (`gmedic.patients.lookup.response.415.error`; object, required) — The request content type is not supported.
  - `code` (`gmedic.patients.lookup.response.415.error.code`; string, required) — The failure code, stable across releases.
    - one of `"UNSUPPORTED_MEDIA_TYPE"`
  - `message` (`gmedic.patients.lookup.response.415.error.message`; string, required) — What went wrong, for people; it never contains input values.
  - `retryable` (`gmedic.patients.lookup.response.415.error.retryable`; boolean, required) — Whether repeating the same request may succeed.
    - one of `false`
  - `data` (`gmedic.patients.lookup.response.415.error.data`; object, required) — No fields.
- `metadata` (`gmedic.patients.lookup.response.415.metadata`; object, required) — What every answer carries besides its data or error.
  - `requestId` (`gmedic.patients.lookup.response.415.metadata.requestId`; string, required) — Request correlation identifier, also sent as X-Request-Id.

### 422

`PROVIDER_INPUT_REJECTED`: gMedic rejected the supplied fields.

#### Example

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

- `success` (`gmedic.patients.lookup.response.422.success`; boolean, required)
  - one of `false`
- `data` (`gmedic.patients.lookup.response.422.data`; unknown, required)
- `error` (`gmedic.patients.lookup.response.422.error`; object, required) — gMedic rejected the supplied fields.
  - `code` (`gmedic.patients.lookup.response.422.error.code`; string, required) — The failure code, stable across releases.
    - one of `"PROVIDER_INPUT_REJECTED"`
  - `message` (`gmedic.patients.lookup.response.422.error.message`; string, required) — What went wrong, for people; it never contains input values.
  - `retryable` (`gmedic.patients.lookup.response.422.error.retryable`; boolean, required) — Whether repeating the same request may succeed.
    - one of `false`
  - `data` (`gmedic.patients.lookup.response.422.error.data`; object, required) — No fields.
- `metadata` (`gmedic.patients.lookup.response.422.metadata`; object, required) — What every answer carries besides its data or error.
  - `requestId` (`gmedic.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.

#### Example

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

- `success` (`gmedic.patients.lookup.response.429.success`; boolean, required)
  - one of `false`
- `data` (`gmedic.patients.lookup.response.429.data`; unknown, required)
- `error` (`gmedic.patients.lookup.response.429.error`; object, required) — The request rate limit was exceeded. Try again later.
  - `code` (`gmedic.patients.lookup.response.429.error.code`; string, required) — The failure code, stable across releases.
    - one of `"RATE_LIMITED"`
  - `message` (`gmedic.patients.lookup.response.429.error.message`; string, required) — What went wrong, for people; it never contains input values.
  - `retryable` (`gmedic.patients.lookup.response.429.error.retryable`; boolean, required) — Whether repeating the same request may succeed.
    - one of `true`
  - `data` (`gmedic.patients.lookup.response.429.error.data`; object, required) — No fields.
- `metadata` (`gmedic.patients.lookup.response.429.metadata`; object, required) — What every answer carries besides its data or error.
  - `requestId` (`gmedic.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` (`gmedic.patients.lookup.response.500.success`; boolean, required)
  - one of `false`
- `data` (`gmedic.patients.lookup.response.500.data`; unknown, required)
- `error` (`gmedic.patients.lookup.response.500.error`; object, required) — The service could not complete the operation.
  - `code` (`gmedic.patients.lookup.response.500.error.code`; string, required) — The failure code, stable across releases.
    - one of `"INTERNAL_ERROR"`
  - `message` (`gmedic.patients.lookup.response.500.error.message`; string, required) — What went wrong, for people; it never contains input values.
  - `retryable` (`gmedic.patients.lookup.response.500.error.retryable`; boolean, required) — Whether repeating the same request may succeed.
    - one of `false`
  - `data` (`gmedic.patients.lookup.response.500.error.data`; object, required) — No fields.
- `metadata` (`gmedic.patients.lookup.response.500.metadata`; object, required) — What every answer carries besides its data or error.
  - `requestId` (`gmedic.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.
- `PROVIDER_ACCESS_REJECTED`: The configured gMedic account did not authorize this operation.
- `PROVIDER_RESPONSE_INVALID`: gMedic returned an unexpected response.

#### Example

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

- `success` (`gmedic.patients.lookup.response.502.success`; boolean, required)
  - one of `false`
- `data` (`gmedic.patients.lookup.response.502.data`; unknown, required)
- `error` (`gmedic.patients.lookup.response.502.error`; one of, required)
  - one of: `OutcomeUnknownFailure`, `GmedicProviderAccessRejectedFailure`, `GmedicProviderResponseInvalidFailure`
  - discriminator: `code`
- `metadata` (`gmedic.patients.lookup.response.502.metadata`; object, required) — What every answer carries besides its data or error.
  - `requestId` (`gmedic.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.
- `CATALOG_SEARCH_INCOMPLETE`: The service catalog search could not be completed within its limits. Service absence cannot be concluded.
- `PROVIDER_UNAVAILABLE`: gMedic is temporarily unavailable.

#### Example

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

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


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