# directory_csv_invalid

<!-- Generated by scripts/generate.ts. Do not edit. -->

<!-- Source: core commit `f70874a3916ad5b24a8619246cbae6cc8bc24d27`. -->

<div data-pagefind-ignore>

Since API version `1.0`.

| Field     | Value             |
| --------- | ----------------- |
| Type      | `invalid_request` |
| Status    | 400               |
| Surfaces  | `api`             |
| Retryable | No                |

</div>

## What it means

The CSV file was refused and nothing in the directory changed. The `message` lists up to 20 problems in words, and `details` lists the same problems one per item, with the row (1 is the header row; 0 is the file as a whole), the column when there is one, and what is wrong.

## Likely causes

- The header row has an unknown or duplicate column, or misses `external_id`, or has neither `user_name` nor `email`.
- A row has no `external_id`, an invalid email address, or an `active` value other than true or false.
- The file is not UTF-8, is larger than the limit, or has a malformed row (for example an unclosed quote).

## How to fix it

### For developers

- Read `details` to show each problem next to its row and column in your own upload screen; don't parse `message`.
- Fix every listed row and upload the whole file again; a file is applied all at once or not at all.
- Use `dry_run=true` to check a file without changing the directory.

### For IT administrators

- Fix the rows the error lists, save the file as UTF-8 CSV and upload it again.

## Example

The API answers HTTP 400. `details` carries one item per problem:

```json
{
  "error": {
    "type": "invalid_request",
    "code": "directory_csv_invalid",
    "message": "row 1 departmnt: unknown column; row 4 email: not an email address",
    "param": "body",
    "doc_url": "https://docs.ohauthcat.com/errors/directory_csv_invalid",
    "request_id": "req_01J9Z3K5V7W8X9Y0Z1A2B3C4D5",
    "details": [
      { "row": 1, "column": "departmnt", "problem": "unknown column" },
      { "row": 4, "column": "email", "problem": "not an email address" }
    ]
  }
}
```

## Developer message

The CSV file is invalid; `message` names up to 20 problems by row and column

## IT administrator message

The CSV file has errors. Fix the rows listed and upload it again

## Translated IT administrator messages

The hosted portal shows these machine translations, which native speakers have not reviewed yet. Placeholders and identity provider console labels stay in English.

- `de`: <span lang="de" data-pagefind-ignore>Die CSV-Datei enthält Fehler. Korrigieren Sie die aufgeführten Zeilen und laden Sie sie erneut hoch</span>
- `es`: <span lang="es" data-pagefind-ignore>El archivo CSV tiene errores. Corrija las filas indicadas y vuelva a subirlo</span>
- `fr`: <span lang="fr" data-pagefind-ignore>Le fichier CSV contient des erreurs. Corrigez les lignes indiquées et importez-le à nouveau</span>
- `ja`: <span lang="ja" data-pagefind-ignore>CSV ファイルにエラーがあります。表示された行を修正して、もう一度アップロードしてください</span>
- `pt-BR`: <span lang="pt-BR" data-pagefind-ignore>O arquivo CSV tem erros. Corrija as linhas indicadas e envie-o novamente</span>
