> Documentation index for AI agents: https://docs.pagerduty.com/llms.txt

# Upload CSV records

`POST https://api.pagerduty.com/enrichment/schemas/{schema_id}/records`

Uploads a CSV file of enrichment records into an existing schema, as `multipart/form-data` or `text/csv`. The file is accepted for asynchronous processing (returns `202`) and is limited to 10 MB. The CSV columns must align with the schema's fields: missing columns result in empty values and extra columns are ignored. Records are keyed by their query-field values, so uploading a row whose query values match an existing record updates that record.

<!-- theme: warning -->

> ### Early Access
> This API is in Early Access and may change at any time. Contact your PagerDuty account team to request access.

Scoped OAuth requires: `contextual_data.write`

## Authorization

- **api_key** (apiKey) — `Authorization` header. The API Key with format `Token token=<API_KEY>`

## Path parameters

| Name | Type | Required | Description |
|---|---|---|---|
| `schema_id` | string (uuid) | yes | The ID of the enrichment schema. |

## Query parameters

| Name | Type | Required | Description |
|---|---|---|---|
| `filename` | string |  | The filename for the CSV content. Required when creating a schema from a `text/csv` body; optional for `text/csv` record uploads. Ignored for `multipart/form-data` and JSON requests. |

## Header parameters

| Name | Type | Required | Description |
|---|---|---|---|
| `Accept` | string | yes | The `Accept` header is used as a versioning header. Default: `application/vnd.pagerduty+json;version=2`. |

## Request body (`multipart/form-data`) — required

The CSV file to upload into the schema, as `multipart/form-data` or `text/csv`. The file is streamed for asynchronous processing and is limited to 10 MB. The CSV columns must align with the schema's fields: missing columns result in empty values and extra columns are ignored. Records are keyed by their query-field values, so uploading a row whose query values match an existing record updates that record.

| Field | Type | Required | Description |
|---|---|---|---|
| `file` | string | yes | The CSV file to upload (max 10 MB). |

## Request body (`text/csv`) — required

The CSV file to upload into the schema, as `multipart/form-data` or `text/csv`. The file is streamed for asynchronous processing and is limited to 10 MB. The CSV columns must align with the schema's fields: missing columns result in empty values and extra columns are ignored. Records are keyed by their query-field values, so uploading a row whose query values match an existing record updates that record.

Type: string

## Response 202

The CSV file was accepted for asynchronous processing.

### `application/json`

| Field | Type | Required | Description |
|---|---|---|---|
| `upload_id` | string (uuid) |  | Unique identifier for the CSV upload operation. |
| `schema_id` | string (uuid) |  | The schema the CSV data is being uploaded to. |
| `filename` | string \| null |  | Original filename of the uploaded CSV file. |
| `size_bytes` | integer (int64) |  | Size of the uploaded file in bytes. |
| `status` | string |  | Status of the upload operation. |
| `accepted_at` | string (date-time) |  | Timestamp when the upload was accepted. |

Example: Example Response

```json
{
  "upload_id": "605d87a2-c67c-441e-a4cb-dbbbd94a340c",
  "schema_id": "b620bbb5-2571-4b7a-b0c6-47c55bd491d0",
  "filename": "users.csv",
  "size_bytes": 1024,
  "status": "accepted",
  "accepted_at": "2026-06-30T10:30:00Z"
}
```

## Response 400

Caller provided invalid arguments. Please review the response for error details. Retrying with the same arguments will *not* work.

### `application/json`

| Field | Type | Required | Description |
|---|---|---|---|
| `error` | object |  |  |
| `error.code` | integer |  | Read-only. |
| `error.message` | string |  | Error message string. Read-only. |
| `error.errors` | array of string |  | Read-only. |

## Response 401

Caller did not supply credentials or did not provide the correct credentials.
If you are using an API key, it may be invalid or your Authorization header may be malformed.

### `application/json`

| Field | Type | Required | Description |
|---|---|---|---|
| `error` | object |  |  |
| `error.code` | integer |  | Read-only. |
| `error.message` | string |  | Error message string. Read-only. |
| `error.errors` | array of string |  | Read-only. |

## Response 403

Caller is not authorized to view the requested resource.
While your authentication is valid, the authenticated user or token does not have permission to perform this action.

### `application/json`

| Field | Type | Required | Description |
|---|---|---|---|
| `error` | object |  |  |
| `error.code` | integer |  | Read-only. |
| `error.message` | string |  | Error message string. Read-only. |
| `error.errors` | array of string |  | Read-only. |

## Response 404

The requested resource was not found.

### `application/json`

| Field | Type | Required | Description |
|---|---|---|---|
| `error` | object |  |  |
| `error.code` | integer |  | Read-only. |
| `error.message` | string |  | Error message string. Read-only. |
| `error.errors` | array of string |  | Read-only. |

## Response 429

Too many requests have been made, the rate limit has been reached.

### `application/json`

| Field | Type | Required | Description |
|---|---|---|---|
| `error` | object |  |  |
| `error.code` | integer |  | Read-only. |
| `error.message` | string |  | Error message string. Read-only. |
| `error.errors` | array of string |  | Read-only. |

## Response 500

Internal Server Error the PagerDuty server experienced an error.

### `application/json`

| Field | Type | Required | Description |
|---|---|---|---|
| `error` | object |  |  |
| `error.code` | integer |  | Read-only. |
| `error.message` | string |  | Error message string. Read-only. |
| `error.errors` | array of string |  | Read-only. |

## Developer Agreement

Your access to and use of the PagerDuty Developer Services is governed by the [PagerDuty Developer Agreement](https://docs.pagerduty.com/developer/pagerduty-developer-agreement).
