Sample - Asana API
POST/workspaces/{workspace_gid}/tags

Create a tag in a workspace

Creates a new tag in the workspace identified by workspace_gid. Supply the tag attributes in the data object and use opt_fields to request optional response properties. The tag remains associated with its workspace or organization after creation.

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

1 parameter · 1 body field
opt_fieldsarray<string>optional
Comma-separated properties to include in the response, including nested properties such as `followers.name` and `workspace.name`. Supported values include color, created_at, followers, followers.name, name, notes, permalink_url, workspace, and workspace.name.

The tag to create, supplied in the data object.

dataobjectoptional
Tag attributes for the new tag, including its name and any other supported properties.

6 status codes
201Returns the newly created tag record, including the properties requested through `opt_fields.
dataobjectoptional
400Returned when a required or supported request value is missing or malformed, including an invalid `opt_fields` value.
errorsarray<object>optional
401Returned when a valid authentication token is not provided with the request.
errorsarray<object>optional
403Returned when the authenticated user is not permitted to create the tag or lacks the required access scope.
errorsarray<object>optional
404Returned when the requested action or workspace does not exist.
errorsarray<object>optional
500Returned when a server-side problem prevents the tag from being created.
errorsarray<object>optional

Error handling

A 400 is returned when the request is malformed or opt_fields contains an invalid property. A 401 is returned when no valid authentication token is provided, and a 403 is returned when the authenticated user lacks the tags:write scope or access to the workspace. A 404 is returned when the workspace or action does not exist, while a 500 indicates a server-side failure.