---
title: "Create a List Attribute"
method: POST
path: "/list_attributes"
tags: ["List Attributes"]
---

# Create a List Attribute

`POST /list_attributes`

Create a List Attribue with provided `name`, `list_type` and `key_field`. Fields `description` and `list_content` are optional.

## Request body

- ListAttribute
  - `account_id` integer — The unique identifier for the Optimizely account
  - `archived` boolean — Whether or not the List Attribute has been archived
  - `aws_access_key` string — AWS access key to upload List Attribute source file to S3
  - `aws_secret_key` string — AWS secret key to upload List Attribute source file to S3
  - `created` string, date-time — Time when the List Attribute was created
  - `description` string — A short description of the List Attribute
  - `id` integer — The unique identifier for the List Attribute
  - `key_field` string, required — The name of the object which holds targeting ids on your website
  - `last_modified` string, date-time — The last time the List Attribute was modified
  - `list_content` string — A comma separated string of IDs or ZIP Codes. Items will be matched against the key_field to determine if an active visitor should be targeted by the list. Note that if the list currently contains data, providing this value will overwrite the previous data.
  - `list_type` 'cookies' | 'query_parameters' | 'zip_codes' | 'js_variables' — The type of data object which holds targeting ids on your website (cookies, query parameters, zip codes, Global JS variables)
  - `name` string, required — A unique, human-readable name for the List Attribute
  - `project_id` integer, required — The ID of the project the List Attribute belongs to
  - `s3_path` string — S3 path containing files used to populate the List Attribute with data. Can be used with an S3 client or CLI to upload data.

## Response `201`

Successfully created the List Attribute

- ListAttribute
  - `account_id` integer — The unique identifier for the Optimizely account
  - `archived` boolean — Whether or not the List Attribute has been archived
  - `aws_access_key` string — AWS access key to upload List Attribute source file to S3
  - `aws_secret_key` string — AWS secret key to upload List Attribute source file to S3
  - `created` string, date-time — Time when the List Attribute was created
  - `description` string — A short description of the List Attribute
  - `id` integer — The unique identifier for the List Attribute
  - `key_field` string, required — The name of the object which holds targeting ids on your website
  - `last_modified` string, date-time — The last time the List Attribute was modified
  - `list_content` string — A comma separated string of IDs or ZIP Codes. Items will be matched against the key_field to determine if an active visitor should be targeted by the list. Note that if the list currently contains data, providing this value will overwrite the previous data.
  - `list_type` 'cookies' | 'query_parameters' | 'zip_codes' | 'js_variables' — The type of data object which holds targeting ids on your website (cookies, query parameters, zip codes, Global JS variables)
  - `name` string, required — A unique, human-readable name for the List Attribute
  - `project_id` integer, required — The ID of the project the List Attribute belongs to
  - `s3_path` string — S3 path containing files used to populate the List Attribute with data. Can be used with an S3 client or CLI to upload data.

## Other responses

- `400` — Invalid request body content
- `401` — Invalid credentials
- `default` — Unexpected error

---

[API](https://skmtc.dev/optimizely/apis/optimizely-api.md) · [All operations](https://skmtc.dev/optimizely/apis/optimizely-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/optimizely/optimizely-api/revisions/5151fe6a2297/schema)
