---
title: "Look up affiliation"
---

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

Path: Pijaos Salud API › Affiliations

`POST /v1/pijaos-salud/affiliations/lookup`

Read the affiliation status for one document through the organization’s active Pijaos Salud connection. An unconfirmed identity leaves affiliation unknown.

- **Scope:** `pijaos-salud:affiliations: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 pijaossalud affiliations lookup` · not available on MCP

## Authentication

Requires one of the following:

- `arbolHuman`, oauth2, scopes: `pijaos-salud:affiliations:read`
- `arbolMachine`, oauth2, scopes: `pijaos-salud:affiliations:read`
- `arbolApiKey`, http, header `Authorization`

## Request body

_Required._

- `connectionId` (`pijaos-salud.affiliations.lookup.connectionId`; string, required)
  - pattern `^con_[0-9A-Za-z]{26}$`
- `documentType` (`pijaos-salud.affiliations.lookup.documentType`; string, required)
  - one of `"NI"`, `"CC"`, `"MS"`, `"RC"`, `"TI"`, `"CE"`, `"PA"`, `"AS"`, `"CD"`, `"CN"`, `"SC"`, `"PE"`, `"PT"`, `"DE"`, `"OT"`
- `documentNumber` (`pijaos-salud.affiliations.lookup.documentNumber`; string, required)
  - pattern `^[A-Za-z0-9-]{1,40}$`
- `maxAgeDays` (`pijaos-salud.affiliations.lookup.maxAgeDays`; integer, optional) — Maximum age in days of a result from this IPS connection. Zero contacts the provider and refreshes the saved result.
  - min 0; max 30; default `7`

## Example request

```json
{
  "connectionId": "string",
  "documentType": "NI",
  "maxAgeDays": 7,
  "documentNumber": "string"
}
```

## Code samples

### cURL

```bash
curl https://api.getarbol.com/v1/pijaos-salud/affiliations/lookup \
  --request POST \
  --header "Authorization: Bearer $ARBOL_API_KEY" \
  --header "Content-Type: application/json" \
  --data '{
  "connectionId": "<connectionId>",
  "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.pijaosSalud.affiliations.lookup({
  connectionId: "<connectionId>",
  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 data = arbol
    .pijaos_salud()
    .affiliations()
    .lookup(&types::PijaosSaludAffiliationsLookupInput {
        connection_id: "<connectionId>".into(),
        document_type: types::PijaosSaludAffiliationsLookupInputDocumentType::CC,
        document_number: "<documentNumber>".into(),
        max_age_days: None,
    })
    .await?;
```

### CLI

```bash
arbol pijaossalud affiliations lookup --connection-id '<connectionId>' --document-type CC --document-number '<documentNumber>'
```

## Responses

### 200

Successful operation.

#### Example

```json
{
  "success": true,
  "data": {
    "outcome": "identity_not_confirmed",
    "checkedAt": "2019-08-24T14:15:22Z",
    "source": "provider"
  },
  "error": null,
  "metadata": {
    "requestId": "string"
  }
}
```

- `success` (`pijaos-salud.affiliations.lookup.response.200.success`; boolean, required)
  - one of `true`
- `data` (`pijaos-salud.affiliations.lookup.response.200.data`; PijaosSaludLookupAffiliationResult, required)
  - any of:
    - `object`
      - `outcome` (`pijaos-salud.affiliations.lookup.response.200.data.1.outcome`; string, required)
      - `checkedAt` (`pijaos-salud.affiliations.lookup.response.200.data.1.checkedAt`; string, required) — Time of the original provider lookup.
        - format `date-time`
      - `source` (`pijaos-salud.affiliations.lookup.response.200.data.1.source`; string, required)
        - one of `"provider"`, `"cache"`
    - `object`
      - `outcome` (`pijaos-salud.affiliations.lookup.response.200.data.2.outcome`; string, required)
      - `status` (`pijaos-salud.affiliations.lookup.response.200.data.2.status`; string, required)
        - one of `"activo"`, `"inactivo"`, `"suspendido"`, `"retirado"`, `"fallecido"`, `"cancelado"`, `"trasladado"`
      - `checkedAt` (`pijaos-salud.affiliations.lookup.response.200.data.2.checkedAt`; string, required) — Time of the original provider lookup.
        - format `date-time`
      - `source` (`pijaos-salud.affiliations.lookup.response.200.data.2.source`; string, required)
        - one of `"provider"`, `"cache"`
- `error` (`pijaos-salud.affiliations.lookup.response.200.error`; unknown, required)
- `metadata` (`pijaos-salud.affiliations.lookup.response.200.metadata`; object, required) — What every answer carries besides its data or error.
  - `requestId` (`pijaos-salud.affiliations.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` (`pijaos-salud.affiliations.lookup.response.400.success`; boolean, required)
  - one of `false`
- `data` (`pijaos-salud.affiliations.lookup.response.400.data`; unknown, required)
- `error` (`pijaos-salud.affiliations.lookup.response.400.error`; object, required) — The request does not match the published schema.
  - `code` (`pijaos-salud.affiliations.lookup.response.400.error.code`; string, required) — The failure code, stable across releases.
    - one of `"INVALID_INPUT"`
  - `message` (`pijaos-salud.affiliations.lookup.response.400.error.message`; string, required) — What went wrong, for people; it never contains input values.
  - `retryable` (`pijaos-salud.affiliations.lookup.response.400.error.retryable`; boolean, required) — Whether repeating the same request may succeed.
    - one of `false`
  - `data` (`pijaos-salud.affiliations.lookup.response.400.error.data`; object, required)
    - `issues` (`pijaos-salud.affiliations.lookup.response.400.error.data.issues`; array<object>, optional)
      - `path` (`pijaos-salud.affiliations.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` (`pijaos-salud.affiliations.lookup.response.400.error.data.issues.message`; string, required)
        - maxLength 256
- `metadata` (`pijaos-salud.affiliations.lookup.response.400.metadata`; object, required) — What every answer carries besides its data or error.
  - `requestId` (`pijaos-salud.affiliations.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` (`pijaos-salud.affiliations.lookup.response.401.success`; boolean, required)
  - one of `false`
- `data` (`pijaos-salud.affiliations.lookup.response.401.data`; unknown, required)
- `error` (`pijaos-salud.affiliations.lookup.response.401.error`; object, required) — A valid access token is required.
  - `code` (`pijaos-salud.affiliations.lookup.response.401.error.code`; string, required) — The failure code, stable across releases.
    - one of `"UNAUTHORIZED"`
  - `message` (`pijaos-salud.affiliations.lookup.response.401.error.message`; string, required) — What went wrong, for people; it never contains input values.
  - `retryable` (`pijaos-salud.affiliations.lookup.response.401.error.retryable`; boolean, required) — Whether repeating the same request may succeed.
    - one of `false`
  - `data` (`pijaos-salud.affiliations.lookup.response.401.error.data`; object, required) — No fields.
- `metadata` (`pijaos-salud.affiliations.lookup.response.401.metadata`; object, required) — What every answer carries besides its data or error.
  - `requestId` (`pijaos-salud.affiliations.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` (`pijaos-salud.affiliations.lookup.response.403.success`; boolean, required)
  - one of `false`
- `data` (`pijaos-salud.affiliations.lookup.response.403.data`; unknown, required)
- `error` (`pijaos-salud.affiliations.lookup.response.403.error`; object, required) — The token does not authorize this operation.
  - `code` (`pijaos-salud.affiliations.lookup.response.403.error.code`; string, required) — The failure code, stable across releases.
    - one of `"FORBIDDEN"`
  - `message` (`pijaos-salud.affiliations.lookup.response.403.error.message`; string, required) — What went wrong, for people; it never contains input values.
  - `retryable` (`pijaos-salud.affiliations.lookup.response.403.error.retryable`; boolean, required) — Whether repeating the same request may succeed.
    - one of `false`
  - `data` (`pijaos-salud.affiliations.lookup.response.403.error.data`; object, required) — No fields.
- `metadata` (`pijaos-salud.affiliations.lookup.response.403.metadata`; object, required) — What every answer carries besides its data or error.
  - `requestId` (`pijaos-salud.affiliations.lookup.response.403.metadata.requestId`; string, required) — Request correlation identifier, also sent as X-Request-Id.

### 409

- `CONNECTION_UNAVAILABLE`: Select an active Pijaos Salud connection for this organization.
- `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.

#### Example

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

- `success` (`pijaos-salud.affiliations.lookup.response.409.success`; boolean, required)
  - one of `false`
- `data` (`pijaos-salud.affiliations.lookup.response.409.data`; unknown, required)
- `error` (`pijaos-salud.affiliations.lookup.response.409.error`; PijaosSaludLookupAffiliationConflictFailure, required)
  - one of: `PijaosSaludConnectionUnavailableFailure`, `PijaosSaludCredentialsRejectedFailure`
  - discriminator: `code`
- `metadata` (`pijaos-salud.affiliations.lookup.response.409.metadata`; object, required) — What every answer carries besides its data or error.
  - `requestId` (`pijaos-salud.affiliations.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` (`pijaos-salud.affiliations.lookup.response.413.success`; boolean, required)
  - one of `false`
- `data` (`pijaos-salud.affiliations.lookup.response.413.data`; unknown, required)
- `error` (`pijaos-salud.affiliations.lookup.response.413.error`; object, required) — The request exceeds the allowed size.
  - `code` (`pijaos-salud.affiliations.lookup.response.413.error.code`; string, required) — The failure code, stable across releases.
    - one of `"REQUEST_TOO_LARGE"`
  - `message` (`pijaos-salud.affiliations.lookup.response.413.error.message`; string, required) — What went wrong, for people; it never contains input values.
  - `retryable` (`pijaos-salud.affiliations.lookup.response.413.error.retryable`; boolean, required) — Whether repeating the same request may succeed.
    - one of `false`
  - `data` (`pijaos-salud.affiliations.lookup.response.413.error.data`; object, required) — No fields.
- `metadata` (`pijaos-salud.affiliations.lookup.response.413.metadata`; object, required) — What every answer carries besides its data or error.
  - `requestId` (`pijaos-salud.affiliations.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` (`pijaos-salud.affiliations.lookup.response.415.success`; boolean, required)
  - one of `false`
- `data` (`pijaos-salud.affiliations.lookup.response.415.data`; unknown, required)
- `error` (`pijaos-salud.affiliations.lookup.response.415.error`; object, required) — The request content type is not supported.
  - `code` (`pijaos-salud.affiliations.lookup.response.415.error.code`; string, required) — The failure code, stable across releases.
    - one of `"UNSUPPORTED_MEDIA_TYPE"`
  - `message` (`pijaos-salud.affiliations.lookup.response.415.error.message`; string, required) — What went wrong, for people; it never contains input values.
  - `retryable` (`pijaos-salud.affiliations.lookup.response.415.error.retryable`; boolean, required) — Whether repeating the same request may succeed.
    - one of `false`
  - `data` (`pijaos-salud.affiliations.lookup.response.415.error.data`; object, required) — No fields.
- `metadata` (`pijaos-salud.affiliations.lookup.response.415.metadata`; object, required) — What every answer carries besides its data or error.
  - `requestId` (`pijaos-salud.affiliations.lookup.response.415.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` (`pijaos-salud.affiliations.lookup.response.429.success`; boolean, required)
  - one of `false`
- `data` (`pijaos-salud.affiliations.lookup.response.429.data`; unknown, required)
- `error` (`pijaos-salud.affiliations.lookup.response.429.error`; object, required) — The request rate limit was exceeded. Try again later.
  - `code` (`pijaos-salud.affiliations.lookup.response.429.error.code`; string, required) — The failure code, stable across releases.
    - one of `"RATE_LIMITED"`
  - `message` (`pijaos-salud.affiliations.lookup.response.429.error.message`; string, required) — What went wrong, for people; it never contains input values.
  - `retryable` (`pijaos-salud.affiliations.lookup.response.429.error.retryable`; boolean, required) — Whether repeating the same request may succeed.
    - one of `true`
  - `data` (`pijaos-salud.affiliations.lookup.response.429.error.data`; object, required) — No fields.
- `metadata` (`pijaos-salud.affiliations.lookup.response.429.metadata`; object, required) — What every answer carries besides its data or error.
  - `requestId` (`pijaos-salud.affiliations.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` (`pijaos-salud.affiliations.lookup.response.500.success`; boolean, required)
  - one of `false`
- `data` (`pijaos-salud.affiliations.lookup.response.500.data`; unknown, required)
- `error` (`pijaos-salud.affiliations.lookup.response.500.error`; object, required) — The service could not complete the operation.
  - `code` (`pijaos-salud.affiliations.lookup.response.500.error.code`; string, required) — The failure code, stable across releases.
    - one of `"INTERNAL_ERROR"`
  - `message` (`pijaos-salud.affiliations.lookup.response.500.error.message`; string, required) — What went wrong, for people; it never contains input values.
  - `retryable` (`pijaos-salud.affiliations.lookup.response.500.error.retryable`; boolean, required) — Whether repeating the same request may succeed.
    - one of `false`
  - `data` (`pijaos-salud.affiliations.lookup.response.500.error.data`; object, required) — No fields.
- `metadata` (`pijaos-salud.affiliations.lookup.response.500.metadata`; object, required) — What every answer carries besides its data or error.
  - `requestId` (`pijaos-salud.affiliations.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.
- `AFFILIATION_UNRESOLVED`: The provider response could not be verified for the requested document.

#### Example

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

- `success` (`pijaos-salud.affiliations.lookup.response.502.success`; boolean, required)
  - one of `false`
- `data` (`pijaos-salud.affiliations.lookup.response.502.data`; unknown, required)
- `error` (`pijaos-salud.affiliations.lookup.response.502.error`; PijaosSaludLookupAffiliationBadGatewayFailure, required)
  - one of: `OutcomeUnknownFailure`, `PijaosSaludAffiliationUnresolvedFailure`
  - discriminator: `code`
- `metadata` (`pijaos-salud.affiliations.lookup.response.502.metadata`; object, required) — What every answer carries besides its data or error.
  - `requestId` (`pijaos-salud.affiliations.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.
- `ACCOUNT_UNAVAILABLE`: The connection could not be read.
- `PROVIDER_UNAVAILABLE`: Pijaos Salud could not complete the operation.

#### Example

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

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


Source: https://docs.getarbol.com/api/pijaos-salud/affiliations/lookup/index.md
