# Tag customers from a CSV

```http
POST https://trydimmi.com/api/v1/contact-lists
```

## Authorization

Send an API token as `Authorization: Bearer <token>`.
The token needs: `contacts:write`.

## Body

- `filename` (string): filename of the file being uploaded
- `name` (string): general purpose name for multipart form value

## Response 200 (OK)

- `data` (object, required)
  - `matched` (integer, required): How many values of the list named a customer, or how many customers the audience matched.
  - `object` (string, required): The kind of record this is, the same for every record of its kind, such as article.
  - `rows` (integer): How many values the uploaded list held. Left out when an audience was tagged instead of a list.
  - `tag_id` (string, required): Id of the tag that was applied, such as tag_.... Send it wherever a tag is asked for.
  - `tag_name` (string, required): Name of the tag that was applied.
  - `tagged` (integer, required): How many customers were newly tagged; those who already had the tag are not counted.
  - `unmatched` (integer, required): How many values of the list named nobody; 0 when an audience was tagged.
  - `unmatched_sample` (string[] | null, required): Some of the values that named nobody, to help fix the list; empty when all matched.

## Response default (Error)

- `code` (string, required): Stable code for programs to tell errors apart, such as validation_failed or internal_error.
- `errors` (object): Each rejected field mapped to its messages. Only present when the input was invalid.
- `message` (string, required): What went wrong, in words safe to show a person.

## Example request

```bash
curl --request POST \
  --url 'https://trydimmi.com/api/v1/contact-lists' \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "filename": "<string>",
  "name": "<string>"
}'
```

## Example response

```json
{
  "data": {
    "matched": 123,
    "object": "<string>",
    "rows": 123,
    "tag_id": "<string>",
    "tag_name": "<string>",
    "tagged": 123,
    "unmatched": 123,
    "unmatched_sample": [
      "<string>"
    ]
  }
}
```

---

Index of all dimmi docs: https://trydimmi.com/llms.txt (full text: https://trydimmi.com/llms-full.txt)
