Search + K

Command Palette

Search for a command to run...

Sign In

Update an enum option

PUT /enum_options/{enum_option_gid}
Copy endpoint
https://app.asana.com/api/1.0

Required scope: custom_fields:write

Updates an existing enum option. Enum custom fields require at least one enabled enum option. Locked custom fields can only be updated by the user who locked the field. Returns the full record of the updated enum option.

Parameters

path Path Parameters

Name Type
enum_option_gid required

Globally unique identifier for the enum option.

string

query Query Parameters

Name Type
opt_fields

This endpoint returns a resource which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include.

("color" | "enabled" | "name")[]
opt_pretty

Provides “pretty” output. Provides the response in a “pretty” format. In the case of JSON this means doing proper line breaking and indentation to make it readable. This will take extra time and increase the response size so it is advisable only to use this during debugging.

boolean

Request Body

application/json

The enum option object to update

{ data?: EnumOptionBase

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.

interface EnumOptionBase {
gid?: string;
resource_type?: string;
name?: string;
enabled?: boolean;
color?: string;
}
; }

Responses

200 application/json

Successfully updated the specified custom field enum.

{ data?: EnumOption

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.

interface EnumOption {
gid?: string;
resource_type?: string;
name?: string;
enabled?: boolean;
color?: string;
}
; }

Client Errors

400 application/json

This usually occurs because of a missing or malformed parameter. Check the documentation and the syntax of your request and try again.

interface ErrorResponse {
errors?: Error
interface Error {
message?: string;
help?: string;
phrase?: string;
}
[]
;
}
401 application/json

A valid authentication token was not provided with the request, so the API could not associate a user with the request.

interface ErrorResponse {
errors?: Error
interface Error {
message?: string;
help?: string;
phrase?: string;
}
[]
;
}
403 application/json

The authentication and request syntax was valid but the server is refusing to complete the request. This can happen if you try to read or write to objects or properties that the user does not have access to.

interface ErrorResponse {
errors?: Error
interface Error {
message?: string;
help?: string;
phrase?: string;
}
[]
;
}
404 application/json

Either the request method and path supplied do not specify a known action in the API, or the object specified by the request does not exist.

interface ErrorResponse {
errors?: Error
interface Error {
message?: string;
help?: string;
phrase?: string;
}
[]
;
}

Server Errors

500 application/json

There was a problem on Asana’s end. In the event of a server error the response body should contain an error phrase. These phrases can be used by Asana support to quickly look up the incident that caused the server error. Some errors are due to server load, and will not supply an error phrase.

interface ErrorResponse {
errors?: Error
interface Error {
message?: string;
help?: string;
phrase?: string;
}
[]
;
}