Search + K

Command Palette

Search for a command to run...

Sign In

Get a workspace's custom fields

GET /workspaces/{workspace_gid}/custom_fields
Copy endpoint
https://app.asana.com/api/1.0

Required scope: custom_fields:read

Returns a list of the compact representation of all of the custom fields in a workspace.

Parameters

path Path Parameters

Name Type
workspace_gid required

Globally unique identifier for the workspace or organization.

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.

("asana_created_field" | "created_by" | "created_by.name" | "currency_code" | "custom_label" | "custom_label_position" | "date_value" | "date_value.date" | "date_value.date_time" | "default_access_level" | "description" | "display_value" | "enabled" | "enum_options" | "enum_options.color" | "enum_options.enabled" | "enum_options.name" | "enum_value" | "enum_value.color" | "enum_value.enabled" | "enum_value.name" | "format" | "has_notifications_enabled" | "id_prefix" | "input_restrictions" | "is_formula_field" | "is_global_to_workspace" | "is_value_read_only" | "multi_enum_values" | "multi_enum_values.color" | "multi_enum_values.enabled" | "multi_enum_values.name" | "name" | "number_value" | "offset" | "path" | "people_value" | "people_value.name" | "precision" | "privacy_setting" | "reference_value" | "reference_value.name" | "representation_type" | "resource_subtype" | "text_value" | "type" | "uri")[]
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
limit

Results per page. The number of objects to return per page. The value must be between 1 and 100.

number
offset

Offset token. An offset to the next page returned by the API. A pagination request will return an offset token, which can be used as an input parameter to the next request. If an offset is not passed in, the API will return the first page of results. Note: You can only pass in an offset that was returned to you via a previously paginated request.

string

Responses

200 application/json

Successfully retrieved all custom fields for the given workspace.

{ data?: CustomFieldResponse
type CustomFieldResponse = CustomFieldBase & {
representation_type?: "text" | "enum" | "multi_enum" | "number" | "date" | "people" | "formula" | "custom_id" | "reference";
id_prefix?: string | null;
input_restrictions?: string[];
is_formula_field?: boolean;
is_value_read_only?: boolean;
created_by?: UserCompact & null;
people_value?: UserCompact[];
reference_value?: AsanaNamedResource[];
privacy_setting?: "public_with_guests" | "public" | "private";
default_access_level?: "admin" | "editor" | "user";
resource_subtype?: "text" | "enum" | "multi_enum" | "number" | "date" | "people" | "reference";
}
[]
;next_page?: NextPage

Conditional. This property is only present when a limit query parameter is provided in the request. When making a paginated request, the API will return a number of results as specified by the limit parameter. If more results exist, then the response will contain a next_page attribute, which will include an offset, a relative path attribute, and a full uri attribute. If there are no more pages available, next_page will be null and no offset will be provided. Note that an offset token will expire after some time, as data may have changed.

type NextPage = { offset?: string;path?: string;uri?: string; } | null
; }

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;
}
[]
;
}