Sample - Asana API
POST/custom_fields/{custom_field_gid}/enum_options

Create an enum option

Creates a new enum option and adds it to a custom field's list of options. New options are inserted at the end by default, and the custom field can contain no more than 500 options, including disabled options. The authenticated user must have the custom_fields:write scope, and locked custom fields can only be modified by the user who locked them.

  • RetriesRetries up to 2×, 500ms backoff, 30s timeout.

1 parameter · 1 body field
opt_fieldsarray<string>optional
A comma-separated list of optional properties to include in the response. Supported values are `color`, `enabled`, and `name`.

The enum option to add to the custom field, with optional placement information.

dataobjectoptional

6 status codes
201Returns the complete record of the newly created enum option.
dataobjectoptional
Enum options are the possible values which an enum custom field can adopt. An enum custom field must contain at least 1 enum option but no more than 500. You can add enum options to a custom field by using the `POST /custom_fields/custom_field_gid/enum_options` endpoint. **It is not possible to remove or delete an enum option**. Instead, enum options can be disabled by updating the `enabled` field to false with the `PUT /enum_options/enum_option_gid` endpoint. Other attributes can be updated similarly. On creation of an enum option, `enabled` is always set to `true`, meaning the enum option is a selectable value for the custom field. Setting `enabled=false` is equivalent to “trashing” the enum option in the Asana web app within the “Edit Fields” dialog. The enum option will no longer be selectable but, if the enum option value was previously set within a task, the task will retain the value. Enum options are an ordered list and by default new enum options are inserted at the end. Ordering in relation to existing enum options can be specified on creation by using `insert_before` or `insert_after` to reference an existing enum option. Only one of `insert_before` and `insert_after` can be provided when creating a new enum option. An enum options list can be reordered with the `POST /custom_fields/custom_field_gid/enum_options/insert` endpoint.
400Returned when a parameter or request value is missing or malformed.
errorsarray<object>optional
401Returned when a valid authentication token was not provided with the request.
errorsarray<object>optional
403Returned when the authenticated user does not have access to the custom field or the requested operation.
errorsarray<object>optional
404Returned when the request does not identify a known action or the specified custom field does not exist.
errorsarray<object>optional
500Returned when a server-side problem prevents the enum option from being created.
errorsarray<object>optional

Error handling

A 400 is returned when a parameter or request value is missing or malformed. A 401 is returned without a valid authentication token, a 403 when the authenticated user lacks access or the required custom_fields:write scope, a 404 when the custom field does not exist, and a 500 for a server-side failure. The custom field must contain no more than 500 enum options, including disabled options.