# Resolve a Bre-B key

`GET /v1/bre-b/keys/{key}` · [Sandbox · coming soon]

> Base URL: Sandbox `https://sandbox.zulu.com.co/v1`
>
> Not in production yet: it arrives with this same signature. Try it in the sandbox.

Looks a key up in the Bre-B directory (mobile, e-mail, document, merchant code or handle) and returns its holder and linked account: everything `POST /v1/transfer` needs in `destination`, `breBKey` included. Send the key URL-encoded (`@luisgomez` → `%40luisgomez`). Only an `ACTIVE` or `ACTIVE_BY_CLIENT` key receives payments. In the sandbox, `@notfound` answers 404, `@bloqueada` comes back blocked and any other key resolves to a deterministic synthetic holder.

## Authentication

`Authorization: Bearer <access_token>` (401 when missing or expired) and `X-API-Key` (403 when missing or not matching).

## Request

### Path parameters

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `key` | string | required | The key, URL-encoded (`@acme` → `%40acme`; use `encodeURIComponent`). |

## Responses

### 200

The key exists.

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `key` | string | required | The key looked up. |
| `keyType` | string | required | Key type. Values: `DOCUMENT` (Document number (GOU code `1`).), `PHONE` (Mobile number (GOU code `2`).), `EMAIL` (E-mail address (GOU code `3`).), `ALPHA` (Alphanumeric handle starting with `@` (GOU code `4`).), `MERCHANT` (Merchant code (GOU code `5`).). |
| `status` | string | required | Key status: only an active key receives payments. Values: `ACTIVE` (Active: receives payments.), `ACTIVE_BY_CLIENT` (Active, reactivated by its holder after a suspension: receives payments.), `BLOCKED_BY_ZULU` (Blocked by zulu: does not receive payments.), `BLOCKED_BY_CLIENT` (Suspended by its holder: does not receive payments.). |
| `fullName` | string | required | Holder: full name or company name. |
| `entityType` | string | required | Holder type. Values: `person` (Natural person (an individual).), `company` (Company (legal entity).). |
| `documentType` | string | required | Holder's document type. |
| `documentNumber` | string | required | Holder's document number. |
| `bankCode` | string | required | ACH code of the account's bank. |
| `bankName` | string | required | Account's bank. |
| `accountType` | string | required | Type of the linked account. Values: `ahorros` (Savings account.), `corriente` (Checking account.). |
| `accountNumber` | string | required | Number of the linked account. |
| `bankOrgId` | string | required | Tax id (NIT) of the key's bank. |
| `bankCamera` | string | required | Clearing house. |

### 401

The access token is missing, invalid or expired.

### 403

The `X-API-Key` is missing, invalid or does not match the token.

### 404

The resource does not exist.

### 429

Too many requests: wait the seconds in `Retry-After`.

### 500

Internal error.

## Errors

| HTTP | error | cause | Description |
| --- | --- | --- | --- |
| 401 | — | `Unauthorized` | The `Authorization: Bearer <access_token>` header is missing, or the token is invalid or expired. |
| 403 | — | `Forbidden` | The `X-API-Key` is missing, unknown, revoked or does not belong to the credentials of the token. |
| 404 | `NotFoundApiError` | `bre-b key "%s" not found` | The key does not exist (in your workspace, or in the Bre-B directory when resolving it). Test data: `@notfound`. |
| 429 | — | `Too Many Requests` | You exceeded the request limit of your credentials. Wait the seconds in `Retry-After`. |
| 500 | `InternalServerApiError` | `[code:1] unexpected error` | Internal error. On operations that move money, check the state before retrying so the operation is not duplicated. |

## Examples

### Active alphanumeric key

```bash
curl https://sandbox.zulu.com.co/v1/bre-b/keys/%40luisgomez \
  -H "Authorization: Bearer $ZULU_ACCESS_TOKEN" \
  -H "X-API-Key: $ZULU_API_KEY"
```

**Response 200**

```json
{
  "key": "@luisgomez",
  "keyType": "ALPHA",
  "status": "ACTIVE",
  "fullName": "Santiago Vargas",
  "entityType": "person",
  "documentType": "CC",
  "documentNumber": "1383497382",
  "bankCode": "0032",
  "bankName": "Banco Caja Social Bcsc",
  "accountType": "ahorros",
  "accountNumber": "0009641366",
  "bankOrgId": "860007335",
  "bankCamera": "TFY"
}
```

### Blocked key (`@bloqueada`)

```bash
curl https://sandbox.zulu.com.co/v1/bre-b/keys/%40bloqueada \
  -H "Authorization: Bearer $ZULU_ACCESS_TOKEN" \
  -H "X-API-Key: $ZULU_API_KEY"
```

**Response 200**

```json
{
  "key": "@bloqueada",
  "keyType": "ALPHA",
  "status": "BLOCKED_BY_ZULU",
  "fullName": "Juan Martínez",
  "entityType": "person",
  "documentType": "CC",
  "documentNumber": "1372501175",
  "bankCode": "0013",
  "bankName": "BBVA",
  "accountType": "ahorros",
  "accountNumber": "0044515786",
  "bankOrgId": "860003020",
  "bankCamera": "TFY"
}
```

### Unknown key (`@notfound`)

```bash
curl https://sandbox.zulu.com.co/v1/bre-b/keys/%40notfound \
  -H "Authorization: Bearer $ZULU_ACCESS_TOKEN" \
  -H "X-API-Key: $ZULU_API_KEY"
```

**Response 404**

```json
{
  "error": "NotFoundApiError",
  "cause": "bre-b key \"@notfound\" not found"
}
```
