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

# User-event batch failures

> Download CSV or JSON reports listing failed user-event rows for a batch import job, including row numbers, error codes, and validation messages.

## Endpoints

```
GET https://api.gu1.ai/batch-import/user-event-jobs/{jobId}/failures.csv
GET https://api.gu1.ai/batch-import/user-event-jobs/{jobId}/failures
```

* **`…/failures.csv`** → CSV download
* **`…/failures`** → JSON

## Authentication

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

Requires at least one of: **`transactions:create`**, **`entities:bulk_import`**, **`events:create`**.

## HTTP responses

| Status | When               |
| ------ | ------------------ |
| `200`  | Job found          |
| `401`  | Not authenticated  |
| `403`  | Missing permission |
| `404`  | Job not found      |

## CSV columns

| Column    | Description                                                                                |
| --------- | ------------------------------------------------------------------------------------------ |
| `row_key` | Source row id (e.g. `row_5` = CSV line 5)                                                  |
| `code`    | Stable failure code — [catalog](/en/api-reference/bulk-imports/batch-import-failure-codes) |
| `error`   | Human-readable message                                                                     |

## JSON response

Same envelope as [Transaction failures](/en/api-reference/bulk-imports/get-transaction-batch-failures) with `kind: user_event_batch`. The `failures[]` sample (max 500) is hydrated from `failures.csv` in S3 when available; download the CSV for the full list.

```json theme={null}
{
  "success": true,
  "jobId": "…",
  "kind": "user_event_batch",
  "status": "completed",
  "totalItems": 50,
  "succeeded": 49,
  "failed": 1,
  "skipped": 0,
  "failures": [
    {
      "rowKey": "row_5",
      "code": "VALIDATION_ERROR",
      "message": "Required field empty"
    }
  ],
  "truncated": false,
  "failuresTotal": 1
}
```

Typical codes: `VALIDATION_ERROR`, `ENTITY_NOT_FOUND`, `PROCESSING_ERROR`.

See also: [Import user events](/en/api-reference/bulk-imports/import-user-events), [Failure codes](/en/api-reference/bulk-imports/batch-import-failure-codes).
