---
title: "Upload attributes list"
method: PUT
path: "/api/attribute-lists/{list_name}/csv"
tags: ["Attribute Lists"]
---

# Upload attributes list

`PUT /api/attribute-lists/{list_name}/csv`

## Request

- Base URL: `https://go.urbanairship.com`
- URL: `https://go.urbanairship.com/api/attribute-lists/{list_name}/csv`
- Auth: one of:
  - HTTP basic
  - HTTP bearer
  - OAuth 2
    - Client credentials
    - Token URL: `http://oauth2.{domain}.com/token` scopes: `lst`
- TypeScript: <https://skmtc.dev/airship/apis/airship-api/docs/api/attribute-lists/:list_name/csv/put.ts> (a function with typed inputs; its response is checked against the schema)

Upload a CSV to set Text, Number, or Date attribute values on the specified channels or named users.

CSV guidelines:
- The first entry in the uploaded CSV must be a header row. The first field must be one of the following identifier types: `channel_id`, `msisdn`, `email_address`, or `named_user`.
- Only one identifier type is allowed per file unless the identifier type name matches a custom attribute schema for the associated app key.
- You must include both `msisdn` and `sms_sender` columns when targeting SMS or MMS channel types. See example to the right.
- Uploads must be newline-delimited identifiers (text/CSV) as described in RFC 4180, with commas as the delimiter, optionally double-quoted values, UTF-8 encoded, and with CRLF or LF line separators.

Required column headers per identifier type:

| Target type      | Required column headers                                                                  |
|------------------|------------------------------------------------------------------------------------------|
| iOS              | `channel_id`                                                                           |
| Android          | `channel_id`                                                                           |
| Named user       | `named_user`                                                                           |
| Web              | `channel_id`                                                                           |
| Email            | `email_address`                                                                        |
| Open channel     | `channel_id`                                                                           |
| SMS              | <ul><li>`msisdn` (numeric and no leading 0) </li><li>`sms_sender` (numeric, e.g., `1234`)</li></ul> |
| MMS              | <ul><li>`msisdn` (numeric and no leading 0) </li><li> `sms_sender` (numeric, e.g., `1234`)</li></ul> |

Optional Fields: Opt-in and opt-out dates, tracking status, suppression state, and time zone can optionally be set for new or existing channels when the identifier is an `email_address` or `msisdn`.

| Target type     | Optional column headers                                                                  |
|-----------------|------------------------------------------------------------------------------------------|
| SMS             | `ua_opted_in` (UTC Timestamp)                                                          |
| MMS             | `ua_opted_in` (UTC Timestamp)                                                          |
| Email           | <ul><li>`ua_commercial_opted_in` or `ua_commercial_opted_out` (UTC Timestamp)<sup>1</sup></li><li>`ua_transactional_opted_in` or `ua_transactional_opted_out` (UTC Timestamp)<sup>1</sup></li><li>`ua_open_tracking_opted_in` or `ua_open_tracking_opted_out` (UTC Timestamp)<sup>2</sup></li><li>`ua_click_tracking_opted_in` or `ua_click_tracking_opted_out` (UTC Timestamp)<sup>2</sup></li><li>`ua_email_suppression_state` (`BOUNCE`, `SPAM_COMPLAINT`, `COMMERCIAL_SPAM_COMPLAINT`, or `IMPORTED`)</li><li>`timezone` (IANA time zone database value, for example, `America/Los_Angeles`)</li></ul> |

<sup>1</sup> Opt-in and opt-out dates are mutually exclusive. Providing both in the same row is invalid.<br>
<sup>2</sup> By default, new channels are opted in to open and click tracking. Opt out by setting an opt-out date. Opt back in with an opt-in date that is newer than the opt-out date. Providing both dates in the same row is invalid.

## Request body `text/csv`

- string, binary

## Response `202`

The request has been accepted for processing.

- OkResponseObject: Returned with 2xx Responses. At a minimum, successful calls return `true` for the `ok` key. If your call includes a verbose response (as with `GET` requests, etc.), the `ok` key will appear in the top-most object, outside the verbose response.
  - `ok` boolean, required: Success.
  - `operation_id` string, uuid: A unique string identifying the operations that modify resources. Use the operation ID to locate and track grouped operations (i.e., a batch push operation may generate multiple `push_id` strings, but a single `operation_id`) or operations that change an existing resource.

## Other responses

- `400`: Bad Request. Parsing or validating the request failed. | Error code | Description | |---|---| | 40002 | CSV contains too many identifiers | | 40003 | CSV header contains too many columns | | 40013 | CSV header's first field must be an identifier | | 40014 | CSV header contains an unknown attribute name | | 40015 | CSV header contains duplicate attribute names | | 40017 | CSV header contains duplicate column names | | 40018 | CSV header does not contain required column for identifier type |
- `401`: Authentication information (the app key and secret or bearer token) was either incorrect or missing.
- `403`: Authentication was correct, but the user does not have permission to access the requested API, e.g., if the feature in question is not included in your pricing plan.
- `404`: The requested resource doesn't exist.

---

[API](https://skmtc.dev/airship/apis/airship-api.md) - [All operations](https://skmtc.dev/airship/apis/airship-api/llms.txt) - [OpenAPI document](https://skmtc.dev/airship/apis/airship-api/revisions/bd6ab947117a?raw)
