> ## Documentation Index
> Fetch the complete documentation index at: https://docs.gu1.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Obtener datos actuales de enrichment

> Lee los payloads mapped y raw actuales de una entidad, agrupados por código de integración — sin volver a ejecutar enrichments.

## Descripción general

Devuelve el snapshot **actual** de enrichment de una entidad: los últimos datos **mapped** fusionados y las respuestas **raw** guardadas después de correr enrichments.

Este endpoint es una **lectura**. **No** llama a integraciones externas y **no** consume créditos de enrichment. Para ejecutar integraciones, usá [Ejecutar enrichment](/es/api-reference/enrichment/execute-by-id).

Usalo cuando necesitás payloads **por integración** (`mapped` / `raw` con claves como `br_cpf_enrichment`). Para el **dossier canónico de Gu1** que usan las reglas (`enrichmentData.normalized.*`), usá [Obtener enrichment normalizado](/es/api-reference/enrichment/get-normalized).

Requiere el permiso granular **`entities:read`** en la API key (fallback legacy `entities:read`).

## Endpoint

```
GET https://api.gu1.ai/entities/{id}/enrichment-data
```

## Autenticación

```bash theme={null}
Authorization: Bearer YOUR_API_KEY
```

## Parámetros de ruta

<ParamField path="id" type="string" required>
  UUID de la entidad en Gu1 (en la API el path param se llama `entityId`).
</ParamField>

## Respuesta

Envelope: `{ "success": true, "data": { ... } }`.

### Cuando hay datos (`hasEnrichmentData: true`)

<ResponseField name="entityId" type="string">
  UUID de la entidad.
</ResponseField>

<ResponseField name="hasEnrichmentData" type="boolean">
  `true` cuando existe una fila de snapshot actual.
</ResponseField>

<ResponseField name="status" type="string">
  Estado del snapshot (típicamente `completed`).
</ResponseField>

<ResponseField name="lastExecutedAt" type="string">
  Timestamp ISO 8601 del último enrichment que actualizó este snapshot.
</ResponseField>

<ResponseField name="lastExecutedBy" type="string">
  UUID del usuario que disparó la última corrida, o `"system"`.
</ResponseField>

<ResponseField name="lastExecutionDurationMs" type="number">
  Duración de la última corrida en milisegundos, cuando está registrada.
</ResponseField>

<ResponseField name="mapped" type="object">
  Campos mapped consolidados (mapeo Gu1). Las claves suelen ser códigos de integración; los valores son los objetos mapped de ese código.
</ResponseField>

<ResponseField name="raw" type="object">
  Payloads crudos de origen, con clave = código de integración. La forma varía por integración; no lo trates como schema estable de Gu1.
</ResponseField>

<ResponseField name="providersUsed" type="array">
  Códigos de integración presentes en este snapshot. El nombre del campo JSON es `providersUsed`.
</ResponseField>

<ResponseField name="summary" type="string">
  Resumen opcional de la última corrida.
</ResponseField>

<ResponseField name="normalizedEnrichmentId" type="string">
  UUID de la fila de [enrichment normalizado](/es/api-reference/enrichment/get-normalized) asociada, cuando existe.
</ResponseField>

<ResponseField name="createdAt" type="string">
  Timestamp ISO 8601 de creación del snapshot.
</ResponseField>

<ResponseField name="updatedAt" type="string">
  Timestamp ISO 8601 de la última actualización del snapshot.
</ResponseField>

### Cuando la entidad existe pero no hay snapshot

HTTP **200** con `hasEnrichmentData: false` (no es un 404):

```json theme={null}
{
  "success": true,
  "data": {
    "entityId": "550e8400-e29b-41d4-a716-446655440000",
    "hasEnrichmentData": false,
    "message": "No enrichment data available for this entity"
  }
}
```

Esto es distinto de [enrichment normalizado](/es/api-reference/enrichment/get-normalized), que responde **404** si no hay fila normalizada.

## Errores

| HTTP  | `error.code`       | Cuándo                                             |
| ----- | ------------------ | -------------------------------------------------- |
| `404` | `ENTITY_NOT_FOUND` | El UUID de la entidad no está en esta organización |
| `403` | —                  | La entidad está oculta para el llamador            |
| `500` | `INTERNAL_ERROR`   | Fallo inesperado                                   |

## Ejemplo

<CodeGroup>
  ```bash cURL theme={null}
  curl -X GET "https://api.gu1.ai/entities/550e8400-e29b-41d4-a716-446655440000/enrichment-data" \
    -H "Authorization: Bearer YOUR_API_KEY"
  ```

  ```javascript JavaScript theme={null}
  const response = await fetch(
    'https://api.gu1.ai/entities/550e8400-e29b-41d4-a716-446655440000/enrichment-data',
    { headers: { Authorization: 'Bearer YOUR_API_KEY' } }
  );
  const body = await response.json();
  ```

  ```python Python theme={null}
  import requests

  response = requests.get(
      'https://api.gu1.ai/entities/550e8400-e29b-41d4-a716-446655440000/enrichment-data',
      headers={'Authorization': 'Bearer YOUR_API_KEY'}
  )
  print(response.json())
  ```
</CodeGroup>

```json theme={null}
{
  "success": true,
  "data": {
    "entityId": "550e8400-e29b-41d4-a716-446655440000",
    "hasEnrichmentData": true,
    "status": "completed",
    "lastExecutedAt": "2026-09-03T15:30:00.000Z",
    "lastExecutedBy": "system",
    "lastExecutionDurationMs": 1840,
    "mapped": {
      "br_cpf_enrichment": {
        "taxId": "12345678901",
        "name": "Example Person"
      }
    },
    "raw": {
      "br_cpf_enrichment": {
        "status": "REGULAR"
      }
    },
    "providersUsed": ["br_cpf_enrichment"],
    "summary": null,
    "normalizedEnrichmentId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
    "createdAt": "2026-09-01T12:00:00.000Z",
    "updatedAt": "2026-09-03T15:30:00.000Z"
  }
}
```

`mapped` y `raw` en producción son más grandes y cambian según la integración. Tomá el ejemplo como pista de forma.

## Relacionado

* [Obtener enrichment normalizado](/es/api-reference/enrichment/get-normalized) — dossier canónico de Gu1
* [Ejecutar enrichment](/es/api-reference/enrichment/execute-by-id) — correr integraciones
* [Obtener entidad](/es/api-reference/entities/get) — identidad, estado y score de riesgo
* [Códigos de integración](/es/api-reference/integrations/provider-codes) — códigos usados como claves en `mapped` / `raw`
