This is the interface for interacting with the [Asana Platform](https://developers.asana.com). Our API reference is generated from our [OpenAPI spec] (https://raw.githubusercontent.com/Asana/openapi/master/defs/asana_oas.yaml).
Operations
GET /api/1.0/access_requests
Get access requests
Returns the pending access requests for a target object or a target object filtered by user.
This operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.
Authentication
[
{
"personalAccessToken": []
},
{
"oauth2": []
}
]
Request, responses and operation details
{
"summary": "Get access requests",
"description": "Returns the pending access requests for a target object or a target object filtered by user.\n\nThis operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.",
"tags": [
"Access requests"
],
"operationId": "getAccessRequests",
"parameters": [
{
"$ref": "#/components/parameters/target_query_param"
},
{
"$ref": "#/components/parameters/user_query_param"
},
{
"$ref": "#/components/parameters/pretty"
},
{
"name": "opt_fields",
"in": "query",
"description": "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. Properties can include nested fields. To learn more, see the [input/output options guide](/docs/inputoutput-options#selecting-nested-fields).",
"required": false,
"example": [
"approval_status",
"message",
"requester",
"requester.name",
"target"
],
"schema": {
"type": "array",
"items": {
"type": "string",
"enum": [
"approval_status",
"message",
"requester",
"requester.name",
"target"
]
}
},
"style": "form",
"explode": false
}
],
"responses": {
"200": {
"description": "Successfully retrieved access requests.",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"type": "array",
"items": {
"$ref": "#/components/schemas/AccessRequestResponse"
}
}
}
}
}
}
},
"400": {
"$ref": "#/components/responses/BadRequest"
},
"401": {
"$ref": "#/components/responses/Unauthorized"
},
"402": {
"$ref": "#/components/responses/PaymentRequired"
},
"403": {
"$ref": "#/components/responses/Forbidden"
},
"404": {
"$ref": "#/components/responses/NotFound"
},
"500": {
"$ref": "#/components/responses/InternalServerError"
}
},
"security": [
{
"personalAccessToken": []
},
{
"oauth2": []
}
],
"x-readme": {
"code-samples": [
{
"language": "node",
"install": "npm install asana",
"code": "const Asana = require('asana');\n\nlet client = new Asana.ApiClient();\nclient.authentications.token.accessToken = '<YOUR_ACCESS_TOKEN>';\n\nlet accessRequestsApiInstance = new Asana.AccessRequestsApi(client);\nlet target = \"1331\"; // String | Globally unique identifier for the target object.\nlet opts = { \n 'user': \"me\", \n 'opt_fields': \"approval_status,message,requester,requester.name,target\"\n};\naccessRequestsApiInstance.getAccessRequests(target, opts).then((result) => {\n console.log('API called successfully. Returned data: ' + JSON.stringify(result.data, null, 2));\n}, (error) => {\n console.error(error.response.body);\n});",
"name": "node-sdk-v3"
},
{
"language": "python",
"install": "pip install asana",
"code": "import asana\nfrom asana.rest import ApiException\nfrom pprint import pprint\n\nconfiguration = asana.Configuration()\nconfiguration.access_token = '<YOUR_ACCESS_TOKEN>'\napi_client = asana.ApiClient(configuration)\n\n# create an instance of the API class\naccess_requests_api_instance = asana.AccessRequestsApi(api_client)\ntarget = \"1331\" # str | Globally unique identifier for the target object.\nopts = {\n 'user': \"me\", # str | A string identifying a user. This can either be the string \\\"me\\\", an email, or the gid of a user.\n 'opt_fields': \"approval_status,message,requester,requester.name,target\", # list[str] | 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.\n}\n\ntry:\n # Get access requests\n api_response = access_requests_api_instance.get_access_requests(target, opts)\n for data in api_response:\n pprint(data)\nexcept ApiException as e:\n print(\"Exception when calling AccessRequestsApi->get_access_requests: %s\\n\" % e)",
"name": "python-sdk-v5"
}
]
},
"x-purple-suite-runtime": "unavailable"
}
POST /api/1.0/access_requests
Create an access request
Submits a new access request for a private object. Currently supports projects and portfolios.
This operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.
Authentication
[
{
"personalAccessToken": []
},
{
"oauth2": []
}
]
Request, responses and operation details
{
"summary": "Create an access request",
"description": "Submits a new access request for a private object. Currently supports projects and portfolios.\n\nThis operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.",
"operationId": "createAccessRequest",
"tags": [
"Access requests"
],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"$ref": "#/components/schemas/AccessRequestCreateRequest"
}
}
}
}
}
},
"responses": {
"201": {
"description": "Successfully created a new access request.",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"$ref": "#/components/schemas/AccessRequestResponse"
}
}
}
}
}
},
"400": {
"$ref": "#/components/responses/BadRequest"
},
"401": {
"$ref": "#/components/responses/Unauthorized"
},
"402": {
"$ref": "#/components/responses/PaymentRequired"
},
"403": {
"$ref": "#/components/responses/Forbidden"
},
"404": {
"$ref": "#/components/responses/NotFound"
},
"500": {
"$ref": "#/components/responses/InternalServerError"
}
},
"security": [
{
"personalAccessToken": []
},
{
"oauth2": []
}
],
"x-readme": {
"code-samples": [
{
"language": "node",
"install": "npm install asana",
"code": "const Asana = require('asana');\n\nlet client = new Asana.ApiClient();\nclient.authentications.token.accessToken = '<YOUR_ACCESS_TOKEN>';\n\nlet accessRequestsApiInstance = new Asana.AccessRequestsApi(client);\nlet body = {\"data\": {\"<PARAM_1>\": \"<VALUE_1>\", \"<PARAM_2>\": \"<VALUE_2>\",}}; // Object | \n\naccessRequestsApiInstance.createAccessRequest(body).then((result) => {\n console.log('API called successfully. Returned data: ' + JSON.stringify(result.data, null, 2));\n}, (error) => {\n console.error(error.response.body);\n});",
"name": "node-sdk-v3"
},
{
"language": "python",
"install": "pip install asana",
"code": "import asana\nfrom asana.rest import ApiException\nfrom pprint import pprint\n\nconfiguration = asana.Configuration()\nconfiguration.access_token = '<YOUR_ACCESS_TOKEN>'\napi_client = asana.ApiClient(configuration)\n\n# create an instance of the API class\naccess_requests_api_instance = asana.AccessRequestsApi(api_client)\nbody = {\"data\": {\"<PARAM_1>\": \"<VALUE_1>\", \"<PARAM_2>\": \"<VALUE_2>\",}} # dict | \n\n\ntry:\n # Create an access request\n api_response = access_requests_api_instance.create_access_request(body)\n pprint(api_response)\nexcept ApiException as e:\n print(\"Exception when calling AccessRequestsApi->create_access_request: %s\\n\" % e)",
"name": "python-sdk-v5"
}
]
},
"x-purple-suite-runtime": "unavailable"
}
POST /api/1.0/access_requests/{access_request_gid}/approve
Approve an access request
Approves an access request for a target object.
This operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.
Authentication
[
{
"personalAccessToken": []
},
{
"oauth2": []
}
]
Request, responses and operation details
{
"summary": "Approve an access request",
"description": "Approves an access request for a target object.\n\nThis operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.",
"tags": [
"Access requests"
],
"operationId": "approveAccessRequest",
"parameters": [
{
"$ref": "#/components/parameters/access_request_gid"
}
],
"responses": {
"200": {
"description": "Successfully approved an access request.",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"$ref": "#/components/schemas/EmptyResponse"
}
}
}
}
}
},
"400": {
"$ref": "#/components/responses/BadRequest"
},
"401": {
"$ref": "#/components/responses/Unauthorized"
},
"403": {
"$ref": "#/components/responses/Forbidden"
},
"404": {
"$ref": "#/components/responses/NotFound"
},
"500": {
"$ref": "#/components/responses/InternalServerError"
}
},
"security": [
{
"personalAccessToken": []
},
{
"oauth2": []
}
],
"x-readme": {
"code-samples": [
{
"language": "node",
"install": "npm install asana",
"code": "const Asana = require('asana');\n\nlet client = new Asana.ApiClient();\nclient.authentications.token.accessToken = '<YOUR_ACCESS_TOKEN>';\n\nlet accessRequestsApiInstance = new Asana.AccessRequestsApi(client);\nlet access_request_gid = \"12345\"; // String | Globally unique identifier for the access request.\n\naccessRequestsApiInstance.approveAccessRequest(access_request_gid).then((result) => {\n console.log('API called successfully. Returned data: ' + JSON.stringify(result.data, null, 2));\n}, (error) => {\n console.error(error.response.body);\n});",
"name": "node-sdk-v3"
},
{
"language": "python",
"install": "pip install asana",
"code": "import asana\nfrom asana.rest import ApiException\nfrom pprint import pprint\n\nconfiguration = asana.Configuration()\nconfiguration.access_token = '<YOUR_ACCESS_TOKEN>'\napi_client = asana.ApiClient(configuration)\n\n# create an instance of the API class\naccess_requests_api_instance = asana.AccessRequestsApi(api_client)\naccess_request_gid = \"12345\" # str | Globally unique identifier for the access request.\n\n\ntry:\n # Approve an access request\n api_response = access_requests_api_instance.approve_access_request(access_request_gid)\n pprint(api_response)\nexcept ApiException as e:\n print(\"Exception when calling AccessRequestsApi->approve_access_request: %s\\n\" % e)",
"name": "python-sdk-v5"
}
]
},
"x-purple-suite-runtime": "unavailable"
}
POST /api/1.0/access_requests/{access_request_gid}/reject
Reject an access request
Rejects an access request for a target object.
This operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.
Authentication
[
{
"personalAccessToken": []
},
{
"oauth2": []
}
]
Request, responses and operation details
{
"summary": "Reject an access request",
"description": "Rejects an access request for a target object.\n\nThis operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.",
"tags": [
"Access requests"
],
"operationId": "rejectAccessRequest",
"parameters": [
{
"$ref": "#/components/parameters/access_request_gid"
}
],
"responses": {
"200": {
"description": "Successfully rejected an access request.",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"$ref": "#/components/schemas/EmptyResponse"
}
}
}
}
}
},
"400": {
"$ref": "#/components/responses/BadRequest"
},
"401": {
"$ref": "#/components/responses/Unauthorized"
},
"403": {
"$ref": "#/components/responses/Forbidden"
},
"404": {
"$ref": "#/components/responses/NotFound"
},
"500": {
"$ref": "#/components/responses/InternalServerError"
}
},
"security": [
{
"personalAccessToken": []
},
{
"oauth2": []
}
],
"x-readme": {
"code-samples": [
{
"language": "node",
"install": "npm install asana",
"code": "const Asana = require('asana');\n\nlet client = new Asana.ApiClient();\nclient.authentications.token.accessToken = '<YOUR_ACCESS_TOKEN>';\n\nlet accessRequestsApiInstance = new Asana.AccessRequestsApi(client);\nlet access_request_gid = \"12345\"; // String | Globally unique identifier for the access request.\n\naccessRequestsApiInstance.rejectAccessRequest(access_request_gid).then((result) => {\n console.log('API called successfully. Returned data: ' + JSON.stringify(result.data, null, 2));\n}, (error) => {\n console.error(error.response.body);\n});",
"name": "node-sdk-v3"
},
{
"language": "python",
"install": "pip install asana",
"code": "import asana\nfrom asana.rest import ApiException\nfrom pprint import pprint\n\nconfiguration = asana.Configuration()\nconfiguration.access_token = '<YOUR_ACCESS_TOKEN>'\napi_client = asana.ApiClient(configuration)\n\n# create an instance of the API class\naccess_requests_api_instance = asana.AccessRequestsApi(api_client)\naccess_request_gid = \"12345\" # str | Globally unique identifier for the access request.\n\n\ntry:\n # Reject an access request\n api_response = access_requests_api_instance.reject_access_request(access_request_gid)\n pprint(api_response)\nexcept ApiException as e:\n print(\"Exception when calling AccessRequestsApi->reject_access_request: %s\\n\" % e)",
"name": "python-sdk-v5"
}
]
},
"x-purple-suite-runtime": "unavailable"
}
GET /api/1.0/workspaces/{workspace_gid}/agents
Get a list of agents in a workspace
Returns the compact records of agents (AI Teammates) configured. Use `opt_fields` to request additional fields in the workspace.
This operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.
Authentication
[
{
"personalAccessToken": []
},
{
"oauth2": []
}
]
Path-level parameters and metadata
{
"parameters": [
{
"$ref": "#/components/parameters/workspace_path_gid"
},
{
"$ref": "#/components/parameters/pretty"
}
]
}
Request, responses and operation details
{
"summary": "Get a list of agents in a workspace",
"description": "Returns the compact records of agents (AI Teammates) configured. Use `opt_fields` to request additional fields in the workspace.\n\nThis operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.",
"tags": [
"Agents"
],
"operationId": "getAgentsForWorkspace",
"parameters": [
{
"$ref": "#/components/parameters/limit"
},
{
"$ref": "#/components/parameters/offset"
},
{
"name": "opt_fields",
"in": "query",
"description": "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. Properties can include nested fields. To learn more, see the [input/output options guide](/docs/inputoutput-options#selecting-nested-fields).",
"required": false,
"example": [
"behavior_guidance",
"description",
"name",
"offset",
"path",
"photo",
"photo.image_1024x1024",
"photo.image_128x128",
"photo.image_21x21",
"photo.image_27x27",
"photo.image_36x36",
"photo.image_60x60",
"resource_subtype",
"uri",
"workspace"
],
"schema": {
"type": "array",
"items": {
"type": "string",
"enum": [
"behavior_guidance",
"description",
"name",
"offset",
"path",
"photo",
"photo.image_1024x1024",
"photo.image_128x128",
"photo.image_21x21",
"photo.image_27x27",
"photo.image_36x36",
"photo.image_60x60",
"resource_subtype",
"uri",
"workspace"
]
}
},
"style": "form",
"explode": false
}
],
"responses": {
"200": {
"description": "Successfully retrieved the requested workspace's agents.",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"type": "array",
"items": {
"$ref": "#/components/schemas/AgentCompact"
}
},
"next_page": {
"$ref": "#/components/schemas/NextPage"
}
}
}
}
}
},
"400": {
"$ref": "#/components/responses/BadRequest"
},
"401": {
"$ref": "#/components/responses/Unauthorized"
},
"403": {
"$ref": "#/components/responses/Forbidden"
},
"404": {
"$ref": "#/components/responses/NotFound"
},
"500": {
"$ref": "#/components/responses/InternalServerError"
}
},
"security": [
{
"personalAccessToken": []
},
{
"oauth2": []
}
],
"x-readme": {
"code-samples": [
{
"language": "node",
"install": "npm install asana",
"code": "const Asana = require('asana');\n\nlet client = new Asana.ApiClient();\nclient.authentications.token.accessToken = '<YOUR_ACCESS_TOKEN>';\n\nlet agentsApiInstance = new Asana.AgentsApi(client);\nlet workspace_gid = \"12345\"; // String | Globally unique identifier for the workspace or organization.\nlet opts = { \n 'limit': 50, \n 'offset': \"eyJ0eXAiOJiKV1iQLCJhbGciOiJIUzI1NiJ9\", \n 'opt_fields': \"behavior_guidance,description,name,offset,path,photo,photo.image_1024x1024,photo.image_128x128,photo.image_21x21,photo.image_27x27,photo.image_36x36,photo.image_60x60,resource_subtype,uri,workspace\"\n};\nagentsApiInstance.getAgentsForWorkspace(workspace_gid, opts).then((result) => {\n console.log('API called successfully. Returned data: ' + JSON.stringify(result.data, null, 2));\n}, (error) => {\n console.error(error.response.body);\n});",
"name": "node-sdk-v3"
},
{
"language": "python",
"install": "pip install asana",
"code": "import asana\nfrom asana.rest import ApiException\nfrom pprint import pprint\n\nconfiguration = asana.Configuration()\nconfiguration.access_token = '<YOUR_ACCESS_TOKEN>'\napi_client = asana.ApiClient(configuration)\n\n# create an instance of the API class\nagents_api_instance = asana.AgentsApi(api_client)\nworkspace_gid = \"12345\" # str | Globally unique identifier for the workspace or organization.\nopts = {\n 'limit': 50, # int | Results per page. The number of objects to return per page. The value must be between 1 and 100.\n 'offset': \"eyJ0eXAiOJiKV1iQLCJhbGciOiJIUzI1NiJ9\", # str | 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.*\n 'opt_fields': \"behavior_guidance,description,name,offset,path,photo,photo.image_1024x1024,photo.image_128x128,photo.image_21x21,photo.image_27x27,photo.image_36x36,photo.image_60x60,resource_subtype,uri,workspace\", # list[str] | 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.\n}\n\ntry:\n # Get a list of agents in a workspace\n api_response = agents_api_instance.get_agents_for_workspace(workspace_gid, opts)\n for data in api_response:\n pprint(data)\nexcept ApiException as e:\n print(\"Exception when calling AgentsApi->get_agents_for_workspace: %s\\n\" % e)",
"name": "python-sdk-v5"
}
]
},
"x-purple-suite-runtime": "unavailable"
}
GET /api/1.0/agents/{agent_gid}
Get an agent
Returns the complete record for a single agent (AI Teammate).
This operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.
Authentication
[
{
"personalAccessToken": []
},
{
"oauth2": []
}
]
Path-level parameters and metadata
{
"parameters": [
{
"$ref": "#/components/parameters/agent_path_gid"
},
{
"$ref": "#/components/parameters/pretty"
}
]
}
Request, responses and operation details
{
"summary": "Get an agent",
"description": "Returns the complete record for a single agent (AI Teammate).\n\nThis operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.",
"tags": [
"Agents"
],
"operationId": "getAgent",
"parameters": [
{
"name": "opt_fields",
"in": "query",
"description": "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. Properties can include nested fields. To learn more, see the [input/output options guide](/docs/inputoutput-options#selecting-nested-fields).",
"required": false,
"example": [
"behavior_guidance",
"description",
"name",
"photo",
"photo.image_1024x1024",
"photo.image_128x128",
"photo.image_21x21",
"photo.image_27x27",
"photo.image_36x36",
"photo.image_60x60",
"resource_subtype",
"workspace"
],
"schema": {
"type": "array",
"items": {
"type": "string",
"enum": [
"behavior_guidance",
"description",
"name",
"photo",
"photo.image_1024x1024",
"photo.image_128x128",
"photo.image_21x21",
"photo.image_27x27",
"photo.image_36x36",
"photo.image_60x60",
"resource_subtype",
"workspace"
]
}
},
"style": "form",
"explode": false
}
],
"responses": {
"200": {
"description": "Successfully retrieved the requested agent.",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"$ref": "#/components/schemas/AgentResponse"
}
}
}
}
}
},
"400": {
"$ref": "#/components/responses/BadRequest"
},
"401": {
"$ref": "#/components/responses/Unauthorized"
},
"403": {
"$ref": "#/components/responses/Forbidden"
},
"404": {
"$ref": "#/components/responses/NotFound"
},
"500": {
"$ref": "#/components/responses/InternalServerError"
}
},
"security": [
{
"personalAccessToken": []
},
{
"oauth2": []
}
],
"x-readme": {
"code-samples": [
{
"language": "node",
"install": "npm install asana",
"code": "const Asana = require('asana');\n\nlet client = new Asana.ApiClient();\nclient.authentications.token.accessToken = '<YOUR_ACCESS_TOKEN>';\n\nlet agentsApiInstance = new Asana.AgentsApi(client);\nlet agent_gid = \"12345\"; // String | Globally unique identifier for the agent.\nlet opts = { \n 'opt_fields': \"behavior_guidance,description,name,photo,photo.image_1024x1024,photo.image_128x128,photo.image_21x21,photo.image_27x27,photo.image_36x36,photo.image_60x60,resource_subtype,workspace\"\n};\nagentsApiInstance.getAgent(agent_gid, opts).then((result) => {\n console.log('API called successfully. Returned data: ' + JSON.stringify(result.data, null, 2));\n}, (error) => {\n console.error(error.response.body);\n});",
"name": "node-sdk-v3"
},
{
"language": "python",
"install": "pip install asana",
"code": "import asana\nfrom asana.rest import ApiException\nfrom pprint import pprint\n\nconfiguration = asana.Configuration()\nconfiguration.access_token = '<YOUR_ACCESS_TOKEN>'\napi_client = asana.ApiClient(configuration)\n\n# create an instance of the API class\nagents_api_instance = asana.AgentsApi(api_client)\nagent_gid = \"12345\" # str | Globally unique identifier for the agent.\nopts = {\n 'opt_fields': \"behavior_guidance,description,name,photo,photo.image_1024x1024,photo.image_128x128,photo.image_21x21,photo.image_27x27,photo.image_36x36,photo.image_60x60,resource_subtype,workspace\", # list[str] | 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.\n}\n\ntry:\n # Get an agent\n api_response = agents_api_instance.get_agent(agent_gid, opts)\n pprint(api_response)\nexcept ApiException as e:\n print(\"Exception when calling AgentsApi->get_agent: %s\\n\" % e)",
"name": "python-sdk-v5"
}
]
},
"x-purple-suite-runtime": "unavailable"
}
GET /api/1.0/workspaces/{workspace_gid}/ai_studio/runs
Get AI Studio credit utilization
Returns one row per AI Studio run (rule execution) for the workspace, in ascending order (oldest first) so that incremental consumers can poll forward. Each row describes what ran, who it is attributed to, the model used, and the credits consumed.
Credit data is available from January 8th, 2025 onward, and is queryable for the full history since then (there is no limit on how far back you can query). A `start_at` earlier than January 8th, 2025 is silently clamped; it is not an error.
The list is always [paginated](/docs/pagination). When more results exist, the response includes a `next_page` with an `offset` that can be used to retrieve the next set of rows. The row `gid` is stable and can be used to de-duplicate rows across incremental loads.
This endpoint is restricted to [service accounts](https://help.asana.com/s/article/service-accounts) in organizations licensed for AI Studio.
This operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.
Authentication
[
{
"personalAccessToken": []
},
{
"oauth2": []
}
]
Path-level parameters and metadata
{
"parameters": [
{
"$ref": "#/components/parameters/workspace_path_gid"
},
{
"$ref": "#/components/parameters/ai_studio_start_at"
},
{
"$ref": "#/components/parameters/ai_studio_end_at"
},
{
"$ref": "#/components/parameters/ai_studio_division_gid"
},
{
"$ref": "#/components/parameters/limit"
},
{
"$ref": "#/components/parameters/offset"
}
]
}
Request, responses and operation details
{
"summary": "Get AI Studio credit utilization",
"description": "Returns one row per AI Studio run (rule execution) for the workspace, in ascending order (oldest first) so that incremental consumers can poll forward. Each row describes what ran, who it is attributed to, the model used, and the credits consumed.\n\nCredit data is available from January 8th, 2025 onward, and is queryable for the full history since then (there is no limit on how far back you can query). A `start_at` earlier than January 8th, 2025 is silently clamped; it is not an error.\n\nThe list is always [paginated](/docs/pagination). When more results exist, the response includes a `next_page` with an `offset` that can be used to retrieve the next set of rows. The row `gid` is stable and can be used to de-duplicate rows across incremental loads.\n\nThis endpoint is restricted to [service accounts](https://help.asana.com/s/article/service-accounts) in organizations licensed for AI Studio.\n\nThis operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.",
"tags": [
"AI Studio usage API"
],
"operationId": "getAiStudioRuns",
"responses": {
"200": {
"description": "Successfully retrieved AI Studio credit utilization rows.",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"type": "array",
"items": {
"$ref": "#/components/schemas/AiStudioRunResponse"
}
},
"next_page": {
"$ref": "#/components/schemas/NextPage"
}
}
}
}
}
},
"400": {
"$ref": "#/components/responses/BadRequest"
},
"401": {
"$ref": "#/components/responses/Unauthorized"
},
"403": {
"$ref": "#/components/responses/Forbidden"
},
"404": {
"$ref": "#/components/responses/NotFound"
},
"500": {
"$ref": "#/components/responses/InternalServerError"
}
},
"security": [
{
"personalAccessToken": []
},
{
"oauth2": []
}
],
"x-readme": {
"code-samples": [
{
"language": "node",
"install": "npm install asana",
"code": "const Asana = require('asana');\n\nlet client = new Asana.ApiClient();\nclient.authentications.token.accessToken = '<YOUR_ACCESS_TOKEN>';\n\nlet aiStudioUsageApiApiInstance = new Asana.AIStudioUsageAPIApi(client);\nlet workspace_gid = \"12345\"; // String | Globally unique identifier for the workspace or organization.\nlet opts = { \n 'start_at': \"2013-10-20T19:20:30+01:00\", \n 'end_at': \"2013-10-20T19:20:30+01:00\", \n 'division_gid': \"division_gid_example\", \n 'limit': 50, \n 'offset': \"eyJ0eXAiOJiKV1iQLCJhbGciOiJIUzI1NiJ9\"\n};\naiStudioUsageApiApiInstance.getAiStudioRuns(workspace_gid, opts).then((result) => {\n console.log('API called successfully. Returned data: ' + JSON.stringify(result.data, null, 2));\n}, (error) => {\n console.error(error.response.body);\n});",
"name": "node-sdk-v3"
},
{
"language": "python",
"install": "pip install asana",
"code": "import asana\nfrom asana.rest import ApiException\nfrom pprint import pprint\n\nconfiguration = asana.Configuration()\nconfiguration.access_token = '<YOUR_ACCESS_TOKEN>'\napi_client = asana.ApiClient(configuration)\n\n# create an instance of the API class\nai_studio_usage_api_api_instance = asana.AIStudioUsageAPIApi(api_client)\nworkspace_gid = \"12345\" # str | Globally unique identifier for the workspace or organization.\nopts = {\n 'start_at': '2013-10-20T19:20:30+01:00', # datetime | Inclusive lower bound. Runs are ordered and filtered by when their usage was recorded (the monotonic timestamp used for incremental polling), not by `run_started_at`. Omitted ⇒ the 2025-01-08 floor — no credit data exists before then, and there is no limit on how far back you can query. A value earlier than 2025-01-08 is treated as 2025-01-08 (not rejected), matching the audit log.\n 'end_at': '2013-10-20T19:20:30+01:00', # datetime | Filter to runs whose usage was recorded before this time (exclusive) — by when the run's credit usage was recorded, not by `run_started_at`. Defaults to the time of the request.\n 'division_gid': \"division_gid_example\", # str | Scope results to a single division (its gid). Omitted ⇒ the org's first licensed division. Use this to retrieve only one division's slice (e.g. for a division-level admin or billing owner) rather than the whole organization.\n 'limit': 50, # int | Results per page. The number of objects to return per page. The value must be between 1 and 100.\n 'offset': \"eyJ0eXAiOJiKV1iQLCJhbGciOiJIUzI1NiJ9\", # str | 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.*\n}\n\ntry:\n # Get AI Studio credit utilization\n api_response = ai_studio_usage_api_api_instance.get_ai_studio_runs(workspace_gid, opts)\n for data in api_response:\n pprint(data)\nexcept ApiException as e:\n print(\"Exception when calling AIStudioUsageAPIApi->get_ai_studio_runs: %s\\n\" % e)",
"name": "python-sdk-v5"
}
]
},
"x-purple-suite-runtime": "unavailable"
}
GET /api/1.0/workspaces/{workspace_gid}/ai_studio/seats
Get AI Studio seats
Returns a current snapshot of AI Studio seat allocations for the workspace — who has access, at what license tier, and the state of each seat. This is a point-in-time snapshot; customers build their own history tables on top of periodic pulls.
The list is always [paginated](/docs/pagination). When more results exist, the response includes a `next_page` with an `offset` that can be used to retrieve the next set of rows.
This endpoint is restricted to [service accounts](https://help.asana.com/s/article/service-accounts) in organizations licensed for AI Studio.
This operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.
Authentication
[
{
"personalAccessToken": []
},
{
"oauth2": []
}
]
Path-level parameters and metadata
{
"parameters": [
{
"$ref": "#/components/parameters/workspace_path_gid"
},
{
"$ref": "#/components/parameters/ai_studio_seat_state"
},
{
"$ref": "#/components/parameters/ai_studio_division_gid"
},
{
"$ref": "#/components/parameters/limit"
},
{
"$ref": "#/components/parameters/offset"
}
]
}
Request, responses and operation details
{
"summary": "Get AI Studio seats",
"description": "Returns a current snapshot of AI Studio seat allocations for the workspace — who has access, at what license tier, and the state of each seat. This is a point-in-time snapshot; customers build their own history tables on top of periodic pulls.\n\nThe list is always [paginated](/docs/pagination). When more results exist, the response includes a `next_page` with an `offset` that can be used to retrieve the next set of rows.\n\nThis endpoint is restricted to [service accounts](https://help.asana.com/s/article/service-accounts) in organizations licensed for AI Studio.\n\nThis operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.",
"tags": [
"AI Studio usage API"
],
"operationId": "getAiStudioSeats",
"responses": {
"200": {
"description": "Successfully retrieved AI Studio seats.",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"type": "array",
"items": {
"$ref": "#/components/schemas/AiStudioSeatResponse"
}
},
"next_page": {
"$ref": "#/components/schemas/NextPage"
}
}
}
}
}
},
"400": {
"$ref": "#/components/responses/BadRequest"
},
"401": {
"$ref": "#/components/responses/Unauthorized"
},
"403": {
"$ref": "#/components/responses/Forbidden"
},
"404": {
"$ref": "#/components/responses/NotFound"
},
"500": {
"$ref": "#/components/responses/InternalServerError"
}
},
"security": [
{
"personalAccessToken": []
},
{
"oauth2": []
}
],
"x-readme": {
"code-samples": [
{
"language": "node",
"install": "npm install asana",
"code": "const Asana = require('asana');\n\nlet client = new Asana.ApiClient();\nclient.authentications.token.accessToken = '<YOUR_ACCESS_TOKEN>';\n\nlet aiStudioUsageApiApiInstance = new Asana.AIStudioUsageAPIApi(client);\nlet workspace_gid = \"12345\"; // String | Globally unique identifier for the workspace or organization.\nlet opts = { \n 'state': \"state_example\", \n 'division_gid': \"division_gid_example\", \n 'limit': 50, \n 'offset': \"eyJ0eXAiOJiKV1iQLCJhbGciOiJIUzI1NiJ9\"\n};\naiStudioUsageApiApiInstance.getAiStudioSeats(workspace_gid, opts).then((result) => {\n console.log('API called successfully. Returned data: ' + JSON.stringify(result.data, null, 2));\n}, (error) => {\n console.error(error.response.body);\n});",
"name": "node-sdk-v3"
},
{
"language": "python",
"install": "pip install asana",
"code": "import asana\nfrom asana.rest import ApiException\nfrom pprint import pprint\n\nconfiguration = asana.Configuration()\nconfiguration.access_token = '<YOUR_ACCESS_TOKEN>'\napi_client = asana.ApiClient(configuration)\n\n# create an instance of the API class\nai_studio_usage_api_api_instance = asana.AIStudioUsageAPIApi(api_client)\nworkspace_gid = \"12345\" # str | Globally unique identifier for the workspace or organization.\nopts = {\n 'state': \"state_example\", # str | Filter seats to this state.\n 'division_gid': \"division_gid_example\", # str | Scope results to a single division (its gid). Omitted ⇒ the org's first licensed division. Use this to retrieve only one division's slice (e.g. for a division-level admin or billing owner) rather than the whole organization.\n 'limit': 50, # int | Results per page. The number of objects to return per page. The value must be between 1 and 100.\n 'offset': \"eyJ0eXAiOJiKV1iQLCJhbGciOiJIUzI1NiJ9\", # str | 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.*\n}\n\ntry:\n # Get AI Studio seats\n api_response = ai_studio_usage_api_api_instance.get_ai_studio_seats(workspace_gid, opts)\n for data in api_response:\n pprint(data)\nexcept ApiException as e:\n print(\"Exception when calling AIStudioUsageAPIApi->get_ai_studio_seats: %s\\n\" % e)",
"name": "python-sdk-v5"
}
]
},
"x-purple-suite-runtime": "unavailable"
}
GET /api/1.0/allocations/{allocation_gid}
Get an allocation
Returns the complete allocation record for a single allocation.
This operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.
Authentication
[
{
"personalAccessToken": []
},
{
"oauth2": []
}
]
Path-level parameters and metadata
{
"parameters": [
{
"$ref": "#/components/parameters/allocation_path_gid"
},
{
"$ref": "#/components/parameters/pretty"
}
]
}
Request, responses and operation details
{
"summary": "Get an allocation",
"description": "Returns the complete allocation record for a single allocation.\n\nThis operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.",
"tags": [
"Allocations"
],
"operationId": "getAllocation",
"parameters": [
{
"name": "opt_fields",
"in": "query",
"description": "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. Properties can include nested fields. To learn more, see the [input/output options guide](/docs/inputoutput-options#selecting-nested-fields).",
"required": false,
"example": [
"assignee",
"assignee.name",
"created_by",
"created_by.name",
"effort",
"effort.type",
"effort.value",
"end_date",
"parent",
"parent.name",
"parent.resource_subtype",
"resource_subtype",
"start_date"
],
"schema": {
"type": "array",
"items": {
"type": "string",
"enum": [
"assignee",
"assignee.name",
"created_by",
"created_by.name",
"effort",
"effort.type",
"effort.value",
"end_date",
"parent",
"parent.name",
"parent.resource_subtype",
"resource_subtype",
"start_date"
]
}
},
"style": "form",
"explode": false
}
],
"responses": {
"200": {
"description": "Successfully retrieved the record for a single allocation.",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"$ref": "#/components/schemas/AllocationResponse"
}
}
}
}
}
},
"400": {
"$ref": "#/components/responses/BadRequest"
},
"401": {
"$ref": "#/components/responses/Unauthorized"
},
"402": {
"$ref": "#/components/responses/PaymentRequired"
},
"403": {
"$ref": "#/components/responses/Forbidden"
},
"404": {
"$ref": "#/components/responses/NotFound"
},
"500": {
"$ref": "#/components/responses/InternalServerError"
}
},
"security": [
{
"personalAccessToken": []
},
{
"oauth2": []
}
],
"x-readme": {
"code-samples": [
{
"language": "node",
"install": "npm install asana",
"code": "const Asana = require('asana');\n\nlet client = new Asana.ApiClient();\nclient.authentications.token.accessToken = '<YOUR_ACCESS_TOKEN>';\n\nlet allocationsApiInstance = new Asana.AllocationsApi(client);\nlet allocation_gid = \"77688\"; // String | Globally unique identifier for the allocation.\nlet opts = { \n 'opt_fields': \"assignee,assignee.name,created_by,created_by.name,effort,effort.type,effort.value,end_date,parent,parent.name,parent.resource_subtype,resource_subtype,start_date\"\n};\nallocationsApiInstance.getAllocation(allocation_gid, opts).then((result) => {\n console.log('API called successfully. Returned data: ' + JSON.stringify(result.data, null, 2));\n}, (error) => {\n console.error(error.response.body);\n});",
"name": "node-sdk-v3"
},
{
"language": "node",
"install": "npm install asana@1.0.5",
"code": "const asana = require('asana');\n\nconst client = asana.Client.create().useAccessToken('PERSONAL_ACCESS_TOKEN');\n\nclient.allocations.getAllocation(allocationGid, {param: \"value\", param: \"value\", opt_pretty: true})\n .then((result) => {\n console.log(result);\n });",
"name": "node-sdk-v1"
},
{
"language": "python",
"install": "pip install asana",
"code": "import asana\nfrom asana.rest import ApiException\nfrom pprint import pprint\n\nconfiguration = asana.Configuration()\nconfiguration.access_token = '<YOUR_ACCESS_TOKEN>'\napi_client = asana.ApiClient(configuration)\n\n# create an instance of the API class\nallocations_api_instance = asana.AllocationsApi(api_client)\nallocation_gid = \"77688\" # str | Globally unique identifier for the allocation.\nopts = {\n 'opt_fields': \"assignee,assignee.name,created_by,created_by.name,effort,effort.type,effort.value,end_date,parent,parent.name,parent.resource_subtype,resource_subtype,start_date\", # list[str] | 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.\n}\n\ntry:\n # Get an allocation\n api_response = allocations_api_instance.get_allocation(allocation_gid, opts)\n pprint(api_response)\nexcept ApiException as e:\n print(\"Exception when calling AllocationsApi->get_allocation: %s\\n\" % e)",
"name": "python-sdk-v5"
},
{
"language": "python",
"install": "pip install asana==3.2.3",
"code": "import asana\n\nclient = asana.Client.access_token('PERSONAL_ACCESS_TOKEN')\n\nresult = client.allocations.get_allocation(allocation_gid, {'param': 'value', 'param': 'value'}, opt_pretty=True)",
"name": "python-sdk-v3"
}
]
},
"x-purple-suite-runtime": "unavailable"
}
PUT /api/1.0/allocations/{allocation_gid}
Update an allocation
An existing allocation can be updated by making a PUT request on the URL for
that allocation. Only the fields provided in the `data` block will be updated;
any unspecified fields will remain unchanged.
Returns the complete updated allocation record.
This operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.
Authentication
[
{
"personalAccessToken": []
},
{
"oauth2": []
}
]
Path-level parameters and metadata
{
"parameters": [
{
"$ref": "#/components/parameters/allocation_path_gid"
},
{
"$ref": "#/components/parameters/pretty"
}
]
}
Request, responses and operation details
{
"summary": "Update an allocation",
"description": "An existing allocation can be updated by making a PUT request on the URL for\nthat allocation. Only the fields provided in the `data` block will be updated;\nany unspecified fields will remain unchanged.\n\nReturns the complete updated allocation record.\n\nThis operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.",
"tags": [
"Allocations"
],
"operationId": "updateAllocation",
"parameters": [
{
"name": "opt_fields",
"in": "query",
"description": "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. Properties can include nested fields. To learn more, see the [input/output options guide](/docs/inputoutput-options#selecting-nested-fields).",
"required": false,
"example": [
"assignee",
"assignee.name",
"created_by",
"created_by.name",
"effort",
"effort.type",
"effort.value",
"end_date",
"parent",
"parent.name",
"parent.resource_subtype",
"resource_subtype",
"start_date"
],
"schema": {
"type": "array",
"items": {
"type": "string",
"enum": [
"assignee",
"assignee.name",
"created_by",
"created_by.name",
"effort",
"effort.type",
"effort.value",
"end_date",
"parent",
"parent.name",
"parent.resource_subtype",
"resource_subtype",
"start_date"
]
}
},
"style": "form",
"explode": false
}
],
"requestBody": {
"description": "The updated fields for the allocation.",
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"$ref": "#/components/schemas/AllocationRequest"
}
}
}
}
}
},
"responses": {
"200": {
"description": "Successfully updated the allocation.",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"$ref": "#/components/schemas/AllocationResponse"
}
}
}
}
}
},
"400": {
"$ref": "#/components/responses/BadRequest"
},
"401": {
"$ref": "#/components/responses/Unauthorized"
},
"403": {
"$ref": "#/components/responses/Forbidden"
},
"404": {
"$ref": "#/components/responses/NotFound"
},
"500": {
"$ref": "#/components/responses/InternalServerError"
}
},
"security": [
{
"personalAccessToken": []
},
{
"oauth2": []
}
],
"x-readme": {
"code-samples": [
{
"language": "node",
"install": "npm install asana",
"code": "const Asana = require('asana');\n\nlet client = new Asana.ApiClient();\nclient.authentications.token.accessToken = '<YOUR_ACCESS_TOKEN>';\n\nlet allocationsApiInstance = new Asana.AllocationsApi(client);\nlet body = {\"data\": {\"<PARAM_1>\": \"<VALUE_1>\", \"<PARAM_2>\": \"<VALUE_2>\",}}; // Object | The updated fields for the allocation.\nlet allocation_gid = \"77688\"; // String | Globally unique identifier for the allocation.\nlet opts = { \n 'opt_fields': \"assignee,assignee.name,created_by,created_by.name,effort,effort.type,effort.value,end_date,parent,parent.name,parent.resource_subtype,resource_subtype,start_date\"\n};\nallocationsApiInstance.updateAllocation(body, allocation_gid, opts).then((result) => {\n console.log('API called successfully. Returned data: ' + JSON.stringify(result.data, null, 2));\n}, (error) => {\n console.error(error.response.body);\n});",
"name": "node-sdk-v3"
},
{
"language": "node",
"install": "npm install asana@1.0.5",
"code": "const asana = require('asana');\n\nconst client = asana.Client.create().useAccessToken('PERSONAL_ACCESS_TOKEN');\n\nclient.allocations.updateAllocation(allocationGid, {field: \"value\", field: \"value\", pretty: true})\n .then((result) => {\n console.log(result);\n });",
"name": "node-sdk-v1"
},
{
"language": "python",
"install": "pip install asana",
"code": "import asana\nfrom asana.rest import ApiException\nfrom pprint import pprint\n\nconfiguration = asana.Configuration()\nconfiguration.access_token = '<YOUR_ACCESS_TOKEN>'\napi_client = asana.ApiClient(configuration)\n\n# create an instance of the API class\nallocations_api_instance = asana.AllocationsApi(api_client)\nbody = {\"data\": {\"<PARAM_1>\": \"<VALUE_1>\", \"<PARAM_2>\": \"<VALUE_2>\",}} # dict | The updated fields for the allocation.\nallocation_gid = \"77688\" # str | Globally unique identifier for the allocation.\nopts = {\n 'opt_fields': \"assignee,assignee.name,created_by,created_by.name,effort,effort.type,effort.value,end_date,parent,parent.name,parent.resource_subtype,resource_subtype,start_date\", # list[str] | 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.\n}\n\ntry:\n # Update an allocation\n api_response = allocations_api_instance.update_allocation(body, allocation_gid, opts)\n pprint(api_response)\nexcept ApiException as e:\n print(\"Exception when calling AllocationsApi->update_allocation: %s\\n\" % e)",
"name": "python-sdk-v5"
},
{
"language": "python",
"install": "pip install asana==3.2.3",
"code": "import asana\n\nclient = asana.Client.access_token('PERSONAL_ACCESS_TOKEN')\n\nresult = client.allocations.update_allocation(allocation_gid, {'field': 'value', 'field': 'value'}, opt_pretty=True)",
"name": "python-sdk-v3"
}
]
},
"x-purple-suite-runtime": "unavailable"
}
DELETE /api/1.0/allocations/{allocation_gid}
Delete an allocation
A specific, existing allocation can be deleted by making a DELETE request on the URL for that allocation.
Returns an empty data record.
This operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.
Authentication
[
{
"personalAccessToken": []
},
{
"oauth2": []
}
]
Path-level parameters and metadata
{
"parameters": [
{
"$ref": "#/components/parameters/allocation_path_gid"
},
{
"$ref": "#/components/parameters/pretty"
}
]
}
Request, responses and operation details
{
"summary": "Delete an allocation",
"description": "A specific, existing allocation can be deleted by making a DELETE request on the URL for that allocation.\n\nReturns an empty data record.\n\nThis operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.",
"tags": [
"Allocations"
],
"operationId": "deleteAllocation",
"responses": {
"200": {
"description": "Successfully deleted the specified allocation.",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"$ref": "#/components/schemas/EmptyResponse"
}
}
}
}
}
},
"400": {
"$ref": "#/components/responses/BadRequest"
},
"401": {
"$ref": "#/components/responses/Unauthorized"
},
"402": {
"$ref": "#/components/responses/PaymentRequired"
},
"403": {
"$ref": "#/components/responses/Forbidden"
},
"404": {
"$ref": "#/components/responses/NotFound"
},
"500": {
"$ref": "#/components/responses/InternalServerError"
}
},
"security": [
{
"personalAccessToken": []
},
{
"oauth2": []
}
],
"x-readme": {
"code-samples": [
{
"language": "node",
"install": "npm install asana",
"code": "const Asana = require('asana');\n\nlet client = new Asana.ApiClient();\nclient.authentications.token.accessToken = '<YOUR_ACCESS_TOKEN>';\n\nlet allocationsApiInstance = new Asana.AllocationsApi(client);\nlet allocation_gid = \"77688\"; // String | Globally unique identifier for the allocation.\n\nallocationsApiInstance.deleteAllocation(allocation_gid).then((result) => {\n console.log('API called successfully. Returned data: ' + JSON.stringify(result.data, null, 2));\n}, (error) => {\n console.error(error.response.body);\n});",
"name": "node-sdk-v3"
},
{
"language": "node",
"install": "npm install asana@1.0.5",
"code": "const asana = require('asana');\n\nconst client = asana.Client.create().useAccessToken('PERSONAL_ACCESS_TOKEN');\n\nclient.allocations.deleteAllocation(allocationGid)\n .then((result) => {\n console.log(result);\n });",
"name": "node-sdk-v1"
},
{
"language": "python",
"install": "pip install asana",
"code": "import asana\nfrom asana.rest import ApiException\nfrom pprint import pprint\n\nconfiguration = asana.Configuration()\nconfiguration.access_token = '<YOUR_ACCESS_TOKEN>'\napi_client = asana.ApiClient(configuration)\n\n# create an instance of the API class\nallocations_api_instance = asana.AllocationsApi(api_client)\nallocation_gid = \"77688\" # str | Globally unique identifier for the allocation.\n\n\ntry:\n # Delete an allocation\n api_response = allocations_api_instance.delete_allocation(allocation_gid)\n pprint(api_response)\nexcept ApiException as e:\n print(\"Exception when calling AllocationsApi->delete_allocation: %s\\n\" % e)",
"name": "python-sdk-v5"
},
{
"language": "python",
"install": "pip install asana==3.2.3",
"code": "import asana\n\nclient = asana.Client.access_token('PERSONAL_ACCESS_TOKEN')\n\nresult = client.allocations.delete_allocation(allocation_gid, opt_pretty=True)",
"name": "python-sdk-v3"
}
]
},
"x-purple-suite-runtime": "unavailable"
}
GET /api/1.0/allocations
Get multiple allocations
Returns a list of allocations filtered to a specific project, user or placeholder.
This operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.
Authentication
[
{
"personalAccessToken": []
},
{
"oauth2": []
}
]
Path-level parameters and metadata
{
"parameters": [
{
"$ref": "#/components/parameters/pretty"
}
]
}
Request, responses and operation details
{
"summary": "Get multiple allocations",
"description": "Returns a list of allocations filtered to a specific project, user or placeholder.\n\nThis operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.",
"tags": [
"Allocations"
],
"operationId": "getAllocations",
"parameters": [
{
"name": "parent",
"in": "query",
"description": "Globally unique identifier for the project to filter allocations by.",
"schema": {
"type": "string"
},
"example": "77688"
},
{
"name": "assignee",
"in": "query",
"description": "Globally unique identifier for the user or placeholder the allocation is assigned to.",
"schema": {
"type": "string"
},
"example": "12345"
},
{
"name": "workspace",
"in": "query",
"description": "Globally unique identifier for the workspace.",
"schema": {
"type": "string"
},
"example": "98765"
},
{
"$ref": "#/components/parameters/limit"
},
{
"$ref": "#/components/parameters/offset"
},
{
"name": "opt_fields",
"in": "query",
"description": "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. Properties can include nested fields. To learn more, see the [input/output options guide](/docs/inputoutput-options#selecting-nested-fields).",
"required": false,
"example": [
"assignee",
"assignee.name",
"created_by",
"created_by.name",
"effort",
"effort.type",
"effort.value",
"end_date",
"offset",
"parent",
"parent.name",
"parent.resource_subtype",
"path",
"resource_subtype",
"start_date",
"uri"
],
"schema": {
"type": "array",
"items": {
"type": "string",
"enum": [
"assignee",
"assignee.name",
"created_by",
"created_by.name",
"effort",
"effort.type",
"effort.value",
"end_date",
"offset",
"parent",
"parent.name",
"parent.resource_subtype",
"path",
"resource_subtype",
"start_date",
"uri"
]
}
},
"style": "form",
"explode": false
}
],
"responses": {
"200": {
"description": "Successfully retrieved the requested allocations.",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"type": "array",
"items": {
"$ref": "#/components/schemas/AllocationResponse"
}
},
"next_page": {
"$ref": "#/components/schemas/NextPage"
}
}
}
}
}
},
"400": {
"$ref": "#/components/responses/BadRequest"
},
"401": {
"$ref": "#/components/responses/Unauthorized"
},
"402": {
"$ref": "#/components/responses/PaymentRequired"
},
"403": {
"$ref": "#/components/responses/Forbidden"
},
"404": {
"$ref": "#/components/responses/NotFound"
},
"500": {
"$ref": "#/components/responses/InternalServerError"
}
},
"security": [
{
"personalAccessToken": []
},
{
"oauth2": []
}
],
"x-readme": {
"code-samples": [
{
"language": "node",
"install": "npm install asana",
"code": "const Asana = require('asana');\n\nlet client = new Asana.ApiClient();\nclient.authentications.token.accessToken = '<YOUR_ACCESS_TOKEN>';\n\nlet allocationsApiInstance = new Asana.AllocationsApi(client);\nlet opts = { \n 'parent': \"77688\", \n 'assignee': \"12345\", \n 'workspace': \"98765\", \n 'limit': 50, \n 'offset': \"eyJ0eXAiOJiKV1iQLCJhbGciOiJIUzI1NiJ9\", \n 'opt_fields': \"assignee,assignee.name,created_by,created_by.name,effort,effort.type,effort.value,end_date,offset,parent,parent.name,parent.resource_subtype,path,resource_subtype,start_date,uri\"\n};\nallocationsApiInstance.getAllocations(opts).then((result) => {\n console.log('API called successfully. Returned data: ' + JSON.stringify(result.data, null, 2));\n}, (error) => {\n console.error(error.response.body);\n});",
"name": "node-sdk-v3"
},
{
"language": "node",
"install": "npm install asana@1.0.5",
"code": "const asana = require('asana');\n\nconst client = asana.Client.create().useAccessToken('PERSONAL_ACCESS_TOKEN');\n\nclient.allocations.getAllocations({param: \"value\", param: \"value\", opt_pretty: true})\n .then((result) => {\n console.log(result);\n });",
"name": "node-sdk-v1"
},
{
"language": "python",
"install": "pip install asana",
"code": "import asana\nfrom asana.rest import ApiException\nfrom pprint import pprint\n\nconfiguration = asana.Configuration()\nconfiguration.access_token = '<YOUR_ACCESS_TOKEN>'\napi_client = asana.ApiClient(configuration)\n\n# create an instance of the API class\nallocations_api_instance = asana.AllocationsApi(api_client)\nopts = {\n 'parent': \"77688\", # str | Globally unique identifier for the project to filter allocations by.\n 'assignee': \"12345\", # str | Globally unique identifier for the user or placeholder the allocation is assigned to.\n 'workspace': \"98765\", # str | Globally unique identifier for the workspace.\n 'limit': 50, # int | Results per page. The number of objects to return per page. The value must be between 1 and 100.\n 'offset': \"eyJ0eXAiOJiKV1iQLCJhbGciOiJIUzI1NiJ9\", # str | 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.*\n 'opt_fields': \"assignee,assignee.name,created_by,created_by.name,effort,effort.type,effort.value,end_date,offset,parent,parent.name,parent.resource_subtype,path,resource_subtype,start_date,uri\", # list[str] | 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.\n}\n\ntry:\n # Get multiple allocations\n api_response = allocations_api_instance.get_allocations(opts)\n for data in api_response:\n pprint(data)\nexcept ApiException as e:\n print(\"Exception when calling AllocationsApi->get_allocations: %s\\n\" % e)",
"name": "python-sdk-v5"
},
{
"language": "python",
"install": "pip install asana==3.2.3",
"code": "import asana\n\nclient = asana.Client.access_token('PERSONAL_ACCESS_TOKEN')\n\nresult = client.allocations.get_allocations({'param': 'value', 'param': 'value'}, opt_pretty=True)",
"name": "python-sdk-v3"
}
]
},
"x-purple-suite-runtime": "unavailable"
}
POST /api/1.0/allocations
Create an allocation
Creates a new allocation.
Returns the full record of the newly created allocation.
This operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.
Authentication
[
{
"personalAccessToken": []
},
{
"oauth2": []
}
]
Path-level parameters and metadata
{
"parameters": [
{
"$ref": "#/components/parameters/pretty"
}
]
}
Request, responses and operation details
{
"summary": "Create an allocation",
"description": "Creates a new allocation.\n\nReturns the full record of the newly created allocation.\n\nThis operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.",
"tags": [
"Allocations"
],
"operationId": "createAllocation",
"parameters": [
{
"name": "opt_fields",
"in": "query",
"description": "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. Properties can include nested fields. To learn more, see the [input/output options guide](/docs/inputoutput-options#selecting-nested-fields).",
"required": false,
"example": [
"assignee",
"assignee.name",
"created_by",
"created_by.name",
"effort",
"effort.type",
"effort.value",
"end_date",
"parent",
"parent.name",
"parent.resource_subtype",
"resource_subtype",
"start_date"
],
"schema": {
"type": "array",
"items": {
"type": "string",
"enum": [
"assignee",
"assignee.name",
"created_by",
"created_by.name",
"effort",
"effort.type",
"effort.value",
"end_date",
"parent",
"parent.name",
"parent.resource_subtype",
"resource_subtype",
"start_date"
]
}
},
"style": "form",
"explode": false
}
],
"requestBody": {
"description": "The allocation to create.",
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"allOf": [
{
"$ref": "#/components/schemas/AllocationRequest"
},
{
"type": "object",
"required": [
"assignee",
"end_date",
"parent",
"start_date"
]
}
]
}
}
}
}
}
},
"responses": {
"201": {
"description": "Successfully created a new allocation.",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"$ref": "#/components/schemas/AllocationResponse"
}
}
}
}
}
},
"400": {
"$ref": "#/components/responses/BadRequest"
},
"401": {
"$ref": "#/components/responses/Unauthorized"
},
"402": {
"$ref": "#/components/responses/PaymentRequired"
},
"403": {
"$ref": "#/components/responses/Forbidden"
},
"404": {
"$ref": "#/components/responses/NotFound"
},
"500": {
"$ref": "#/components/responses/InternalServerError"
}
},
"security": [
{
"personalAccessToken": []
},
{
"oauth2": []
}
],
"x-readme": {
"code-samples": [
{
"language": "node",
"install": "npm install asana",
"code": "const Asana = require('asana');\n\nlet client = new Asana.ApiClient();\nclient.authentications.token.accessToken = '<YOUR_ACCESS_TOKEN>';\n\nlet allocationsApiInstance = new Asana.AllocationsApi(client);\nlet body = {\"data\": {\"<PARAM_1>\": \"<VALUE_1>\", \"<PARAM_2>\": \"<VALUE_2>\",}}; // Object | The allocation to create.\nlet opts = { \n 'opt_fields': \"assignee,assignee.name,created_by,created_by.name,effort,effort.type,effort.value,end_date,parent,parent.name,parent.resource_subtype,resource_subtype,start_date\"\n};\nallocationsApiInstance.createAllocation(body, opts).then((result) => {\n console.log('API called successfully. Returned data: ' + JSON.stringify(result.data, null, 2));\n}, (error) => {\n console.error(error.response.body);\n});",
"name": "node-sdk-v3"
},
{
"language": "node",
"install": "npm install asana@1.0.5",
"code": "const asana = require('asana');\n\nconst client = asana.Client.create().useAccessToken('PERSONAL_ACCESS_TOKEN');\n\nclient.allocations.createAllocation({field: \"value\", field: \"value\", pretty: true})\n .then((result) => {\n console.log(result);\n });",
"name": "node-sdk-v1"
},
{
"language": "python",
"install": "pip install asana",
"code": "import asana\nfrom asana.rest import ApiException\nfrom pprint import pprint\n\nconfiguration = asana.Configuration()\nconfiguration.access_token = '<YOUR_ACCESS_TOKEN>'\napi_client = asana.ApiClient(configuration)\n\n# create an instance of the API class\nallocations_api_instance = asana.AllocationsApi(api_client)\nbody = {\"data\": {\"<PARAM_1>\": \"<VALUE_1>\", \"<PARAM_2>\": \"<VALUE_2>\",}} # dict | The allocation to create.\nopts = {\n 'opt_fields': \"assignee,assignee.name,created_by,created_by.name,effort,effort.type,effort.value,end_date,parent,parent.name,parent.resource_subtype,resource_subtype,start_date\", # list[str] | 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.\n}\n\ntry:\n # Create an allocation\n api_response = allocations_api_instance.create_allocation(body, opts)\n pprint(api_response)\nexcept ApiException as e:\n print(\"Exception when calling AllocationsApi->create_allocation: %s\\n\" % e)",
"name": "python-sdk-v5"
},
{
"language": "python",
"install": "pip install asana==3.2.3",
"code": "import asana\n\nclient = asana.Client.access_token('PERSONAL_ACCESS_TOKEN')\n\nresult = client.allocations.create_allocation({'field': 'value', 'field': 'value'}, opt_pretty=True)",
"name": "python-sdk-v3"
}
]
},
"x-purple-suite-runtime": "unavailable"
}
GET /api/1.0/attachments/{attachment_gid}
Get an attachment
<b>Required scope: </b><code>attachments:read</code>
Get the full record for a single attachment.
This operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.
Authentication
[
{
"personalAccessToken": []
},
{
"oauth2": [
"attachments:read"
]
}
]
Path-level parameters and metadata
{
"parameters": [
{
"$ref": "#/components/parameters/attachment_path_gid"
},
{
"$ref": "#/components/parameters/pretty"
}
]
}
Request, responses and operation details
{
"summary": "Get an attachment",
"description": "<b>Required scope: </b><code>attachments:read</code>\n\nGet the full record for a single attachment.\n\nThis operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.",
"tags": [
"Attachments"
],
"operationId": "getAttachment",
"parameters": [
{
"name": "opt_fields",
"in": "query",
"description": "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. Properties can include nested fields. To learn more, see the [input/output options guide](/docs/inputoutput-options#selecting-nested-fields).",
"required": false,
"example": [
"connected_to_app",
"created_at",
"download_url",
"host",
"name",
"parent",
"parent.created_by",
"parent.name",
"parent.resource_subtype",
"permanent_url",
"resource_subtype",
"size",
"view_url"
],
"schema": {
"type": "array",
"items": {
"type": "string",
"enum": [
"connected_to_app",
"created_at",
"download_url",
"host",
"name",
"parent",
"parent.created_by",
"parent.name",
"parent.resource_subtype",
"permanent_url",
"resource_subtype",
"size",
"view_url"
]
}
},
"style": "form",
"explode": false
}
],
"responses": {
"200": {
"description": "Successfully retrieved the record for a single attachment.",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"$ref": "#/components/schemas/AttachmentResponse"
}
}
}
}
}
},
"400": {
"$ref": "#/components/responses/BadRequest"
},
"401": {
"$ref": "#/components/responses/Unauthorized"
},
"402": {
"$ref": "#/components/responses/PaymentRequired"
},
"403": {
"$ref": "#/components/responses/Forbidden"
},
"404": {
"$ref": "#/components/responses/NotFound"
},
"424": {
"$ref": "#/components/responses/TooManyRequests"
},
"500": {
"$ref": "#/components/responses/InternalServerError"
},
"501": {
"$ref": "#/components/responses/BadGateway"
},
"503": {
"$ref": "#/components/responses/ServiceUnavailable"
},
"504": {
"$ref": "#/components/responses/GatewayTimeout"
}
},
"security": [
{
"personalAccessToken": []
},
{
"oauth2": [
"attachments:read"
]
}
],
"x-readme": {
"code-samples": [
{
"language": "java",
"install": "<dependency><groupId>com.asana</groupId><artifactId>asana</artifactId><version>1.0.0</version></dependency>",
"code": "import com.asana.Client;\n\nClient client = Client.accessToken(\"PERSONAL_ACCESS_TOKEN\");\n\nAttachment result = client.attachments.getAttachment(attachmentGid)\n .option(\"pretty\", true)\n .execute();"
},
{
"language": "node",
"install": "npm install asana",
"code": "const Asana = require('asana');\n\nlet client = new Asana.ApiClient();\nclient.authentications.token.accessToken = '<YOUR_ACCESS_TOKEN>';\n\nlet attachmentsApiInstance = new Asana.AttachmentsApi(client);\nlet attachment_gid = \"12345\"; // String | Globally unique identifier for the attachment.\nlet opts = { \n 'opt_fields': \"connected_to_app,created_at,download_url,host,name,parent,parent.created_by,parent.name,parent.resource_subtype,permanent_url,resource_subtype,size,view_url\"\n};\nattachmentsApiInstance.getAttachment(attachment_gid, opts).then((result) => {\n console.log('API called successfully. Returned data: ' + JSON.stringify(result.data, null, 2));\n}, (error) => {\n console.error(error.response.body);\n});",
"name": "node-sdk-v3"
},
{
"language": "node",
"install": "npm install asana@1.0.5",
"code": "const asana = require('asana');\n\nconst client = asana.Client.create().useAccessToken('PERSONAL_ACCESS_TOKEN');\n\nclient.attachments.getAttachment(attachmentGid, {param: \"value\", param: \"value\", opt_pretty: true})\n .then((result) => {\n console.log(result);\n });",
"name": "node-sdk-v1"
},
{
"language": "python",
"install": "pip install asana",
"code": "import asana\nfrom asana.rest import ApiException\nfrom pprint import pprint\n\nconfiguration = asana.Configuration()\nconfiguration.access_token = '<YOUR_ACCESS_TOKEN>'\napi_client = asana.ApiClient(configuration)\n\n# create an instance of the API class\nattachments_api_instance = asana.AttachmentsApi(api_client)\nattachment_gid = \"12345\" # str | Globally unique identifier for the attachment.\nopts = {\n 'opt_fields': \"connected_to_app,created_at,download_url,host,name,parent,parent.created_by,parent.name,parent.resource_subtype,permanent_url,resource_subtype,size,view_url\", # list[str] | 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.\n}\n\ntry:\n # Get an attachment\n api_response = attachments_api_instance.get_attachment(attachment_gid, opts)\n pprint(api_response)\nexcept ApiException as e:\n print(\"Exception when calling AttachmentsApi->get_attachment: %s\\n\" % e)",
"name": "python-sdk-v5"
},
{
"language": "python",
"install": "pip install asana==3.2.3",
"code": "import asana\n\nclient = asana.Client.access_token('PERSONAL_ACCESS_TOKEN')\n\nresult = client.attachments.get_attachment(attachment_gid, {'param': 'value', 'param': 'value'}, opt_pretty=True)",
"name": "python-sdk-v3"
},
{
"language": "php",
"install": "composer require asana/asana",
"code": "<?php\nrequire 'vendor/autoload.php';\n\n$client = Asana\\Client::accessToken('PERSONAL_ACCESS_TOKEN');\n\n$result = $client->attachments->getAttachment($attachment_gid, array('param' => 'value', 'param' => 'value'), array('opt_pretty' => 'true'))"
},
{
"language": "ruby",
"install": "gem install asana",
"code": "require 'asana'\n\nclient = Asana::Client.new do |c|\n c.authentication :access_token, 'PERSONAL_ACCESS_TOKEN'\nend\n\nresult = client.attachments.get_attachment(attachment_gid: 'attachment_gid', param: \"value\", param: \"value\", options: {pretty: true})"
}
]
},
"x-purple-suite-runtime": "unavailable"
}
DELETE /api/1.0/attachments/{attachment_gid}
Delete an attachment
<b>Required scope: </b><code>attachments:delete</code>
Deletes a specific, existing attachment.
Returns an empty data record.
This operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.
Authentication
[
{
"personalAccessToken": []
},
{
"oauth2": [
"attachments:delete"
]
}
]
Path-level parameters and metadata
{
"parameters": [
{
"$ref": "#/components/parameters/attachment_path_gid"
},
{
"$ref": "#/components/parameters/pretty"
}
]
}
Request, responses and operation details
{
"summary": "Delete an attachment",
"description": "<b>Required scope: </b><code>attachments:delete</code>\n\nDeletes a specific, existing attachment.\n\nReturns an empty data record.\n\nThis operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.",
"tags": [
"Attachments"
],
"operationId": "deleteAttachment",
"responses": {
"200": {
"description": "Successfully deleted the specified attachment.",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"$ref": "#/components/schemas/EmptyResponse"
}
}
}
}
}
},
"400": {
"$ref": "#/components/responses/BadRequest"
},
"401": {
"$ref": "#/components/responses/Unauthorized"
},
"403": {
"$ref": "#/components/responses/Forbidden"
},
"404": {
"$ref": "#/components/responses/NotFound"
},
"500": {
"$ref": "#/components/responses/InternalServerError"
}
},
"security": [
{
"personalAccessToken": []
},
{
"oauth2": [
"attachments:delete"
]
}
],
"x-readme": {
"code-samples": [
{
"language": "java",
"install": "<dependency><groupId>com.asana</groupId><artifactId>asana</artifactId><version>1.0.0</version></dependency>",
"code": "import com.asana.Client;\n\nClient client = Client.accessToken(\"PERSONAL_ACCESS_TOKEN\");\n\nJsonElement result = client.attachments.deleteAttachment(attachmentGid)\n .option(\"pretty\", true)\n .execute();"
},
{
"language": "node",
"install": "npm install asana",
"code": "const Asana = require('asana');\n\nlet client = new Asana.ApiClient();\nclient.authentications.token.accessToken = '<YOUR_ACCESS_TOKEN>';\n\nlet attachmentsApiInstance = new Asana.AttachmentsApi(client);\nlet attachment_gid = \"12345\"; // String | Globally unique identifier for the attachment.\n\nattachmentsApiInstance.deleteAttachment(attachment_gid).then((result) => {\n console.log('API called successfully. Returned data: ' + JSON.stringify(result.data, null, 2));\n}, (error) => {\n console.error(error.response.body);\n});",
"name": "node-sdk-v3"
},
{
"language": "node",
"install": "npm install asana@1.0.5",
"code": "const asana = require('asana');\n\nconst client = asana.Client.create().useAccessToken('PERSONAL_ACCESS_TOKEN');\n\nclient.attachments.deleteAttachment(attachmentGid)\n .then((result) => {\n console.log(result);\n });",
"name": "node-sdk-v1"
},
{
"language": "python",
"install": "pip install asana",
"code": "import asana\nfrom asana.rest import ApiException\nfrom pprint import pprint\n\nconfiguration = asana.Configuration()\nconfiguration.access_token = '<YOUR_ACCESS_TOKEN>'\napi_client = asana.ApiClient(configuration)\n\n# create an instance of the API class\nattachments_api_instance = asana.AttachmentsApi(api_client)\nattachment_gid = \"12345\" # str | Globally unique identifier for the attachment.\n\n\ntry:\n # Delete an attachment\n api_response = attachments_api_instance.delete_attachment(attachment_gid)\n pprint(api_response)\nexcept ApiException as e:\n print(\"Exception when calling AttachmentsApi->delete_attachment: %s\\n\" % e)",
"name": "python-sdk-v5"
},
{
"language": "python",
"install": "pip install asana==3.2.3",
"code": "import asana\n\nclient = asana.Client.access_token('PERSONAL_ACCESS_TOKEN')\n\nresult = client.attachments.delete_attachment(attachment_gid, opt_pretty=True)",
"name": "python-sdk-v3"
},
{
"language": "php",
"install": "composer require asana/asana",
"code": "<?php\nrequire 'vendor/autoload.php';\n\n$client = Asana\\Client::accessToken('PERSONAL_ACCESS_TOKEN');\n\n$result = $client->attachments->deleteAttachment($attachment_gid, array('opt_pretty' => 'true'))"
},
{
"language": "ruby",
"install": "gem install asana",
"code": "require 'asana'\n\nclient = Asana::Client.new do |c|\n c.authentication :access_token, 'PERSONAL_ACCESS_TOKEN'\nend\n\nresult = client.attachments.delete_attachment(attachment_gid: 'attachment_gid', options: {pretty: true})"
}
]
},
"x-purple-suite-runtime": "unavailable"
}
GET /api/1.0/attachments
Get attachments from an object
<b>Required scope: </b><code>attachments:read</code>
Returns the compact records for all attachments on the object.
There are three possible `parent` values for this request: `project`, `project_brief`, and `task`. For a project, an attachment refers to a file uploaded to the "Key resources" section in the project Overview. For a project brief, an attachment refers to inline files in the project brief itself. For a task, an attachment refers to a file directly associated to that task.
Note that within the Asana app, inline images in the task description do not appear in the index of image thumbnails nor as stories in the task. However, requests made to `GET /attachments` for a task will return all of the images in the task, including inline images.
This operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.
Authentication
[
{
"personalAccessToken": []
},
{
"oauth2": [
"attachments:read"
]
}
]
Path-level parameters and metadata
{
"parameters": [
{
"$ref": "#/components/parameters/pretty"
}
]
}
Request, responses and operation details
{
"summary": "Get attachments from an object",
"description": "<b>Required scope: </b><code>attachments:read</code>\n\nReturns the compact records for all attachments on the object.\nThere are three possible `parent` values for this request: `project`, `project_brief`, and `task`. For a project, an attachment refers to a file uploaded to the \"Key resources\" section in the project Overview. For a project brief, an attachment refers to inline files in the project brief itself. For a task, an attachment refers to a file directly associated to that task.\n\nNote that within the Asana app, inline images in the task description do not appear in the index of image thumbnails nor as stories in the task. However, requests made to `GET /attachments` for a task will return all of the images in the task, including inline images.\n\nThis operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.",
"tags": [
"Attachments"
],
"operationId": "getAttachmentsForObject",
"parameters": [
{
"$ref": "#/components/parameters/limit"
},
{
"$ref": "#/components/parameters/offset"
},
{
"name": "parent",
"required": true,
"in": "query",
"description": "Globally unique identifier for the object to fetch attachments from. Must be a GID for a `project`, `project_brief`, or `task`.",
"schema": {
"type": "string"
},
"example": "159874"
},
{
"name": "opt_fields",
"in": "query",
"description": "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. Properties can include nested fields. To learn more, see the [input/output options guide](/docs/inputoutput-options#selecting-nested-fields).",
"required": false,
"example": [
"connected_to_app",
"created_at",
"download_url",
"host",
"name",
"offset",
"parent",
"parent.created_by",
"parent.name",
"parent.resource_subtype",
"path",
"permanent_url",
"resource_subtype",
"size",
"uri",
"view_url"
],
"schema": {
"type": "array",
"items": {
"type": "string",
"enum": [
"connected_to_app",
"created_at",
"download_url",
"host",
"name",
"offset",
"parent",
"parent.created_by",
"parent.name",
"parent.resource_subtype",
"path",
"permanent_url",
"resource_subtype",
"size",
"uri",
"view_url"
]
}
},
"style": "form",
"explode": false
}
],
"responses": {
"200": {
"description": "Successfully retrieved the specified object's attachments.",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"type": "array",
"items": {
"$ref": "#/components/schemas/AttachmentCompact"
}
},
"next_page": {
"$ref": "#/components/schemas/NextPage"
}
}
}
}
}
},
"400": {
"$ref": "#/components/responses/BadRequest"
},
"401": {
"$ref": "#/components/responses/Unauthorized"
},
"403": {
"$ref": "#/components/responses/Forbidden"
},
"404": {
"$ref": "#/components/responses/NotFound"
},
"500": {
"$ref": "#/components/responses/InternalServerError"
}
},
"security": [
{
"personalAccessToken": []
},
{
"oauth2": [
"attachments:read"
]
}
],
"x-readme": {
"code-samples": [
{
"language": "java",
"install": "<dependency><groupId>com.asana</groupId><artifactId>asana</artifactId><version>1.0.0</version></dependency>",
"code": "import com.asana.Client;\n\nClient client = Client.accessToken(\"PERSONAL_ACCESS_TOKEN\");\n\nList<Attachment> result = client.attachments.getAttachmentsForObject(parent)\n .option(\"pretty\", true)\n .execute();"
},
{
"language": "node",
"install": "npm install asana",
"code": "const Asana = require('asana');\n\nlet client = new Asana.ApiClient();\nclient.authentications.token.accessToken = '<YOUR_ACCESS_TOKEN>';\n\nlet attachmentsApiInstance = new Asana.AttachmentsApi(client);\nlet parent = \"159874\"; // String | Globally unique identifier for object to fetch statuses from. Must be a GID for a `project`, `project_brief`, or `task`.\nlet opts = { \n 'limit': 50, \n 'offset': \"eyJ0eXAiOJiKV1iQLCJhbGciOiJIUzI1NiJ9\", \n 'opt_fields': \"connected_to_app,created_at,download_url,host,name,offset,parent,parent.created_by,parent.name,parent.resource_subtype,path,permanent_url,resource_subtype,size,uri,view_url\"\n};\nattachmentsApiInstance.getAttachmentsForObject(parent, opts).then((result) => {\n console.log('API called successfully. Returned data: ' + JSON.stringify(result.data, null, 2));\n}, (error) => {\n console.error(error.response.body);\n});",
"name": "node-sdk-v3"
},
{
"language": "node",
"install": "npm install asana@1.0.5",
"code": "const asana = require('asana');\n\nconst client = asana.Client.create().useAccessToken('PERSONAL_ACCESS_TOKEN');\n\nclient.attachments.getAttachmentsForObject({param: \"value\", param: \"value\", opt_pretty: true})\n .then((result) => {\n console.log(result);\n });",
"name": "node-sdk-v1"
},
{
"language": "python",
"install": "pip install asana",
"code": "import asana\nfrom asana.rest import ApiException\nfrom pprint import pprint\n\nconfiguration = asana.Configuration()\nconfiguration.access_token = '<YOUR_ACCESS_TOKEN>'\napi_client = asana.ApiClient(configuration)\n\n# create an instance of the API class\nattachments_api_instance = asana.AttachmentsApi(api_client)\nparent = \"159874\" # str | Globally unique identifier for object to fetch statuses from. Must be a GID for a `project`, `project_brief`, or `task`.\nopts = {\n 'limit': 50, # int | Results per page. The number of objects to return per page. The value must be between 1 and 100.\n 'offset': \"eyJ0eXAiOJiKV1iQLCJhbGciOiJIUzI1NiJ9\", # str | 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.*\n 'opt_fields': \"connected_to_app,created_at,download_url,host,name,offset,parent,parent.created_by,parent.name,parent.resource_subtype,path,permanent_url,resource_subtype,size,uri,view_url\", # list[str] | 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.\n}\n\ntry:\n # Get attachments from an object\n api_response = attachments_api_instance.get_attachments_for_object(parent, opts)\n for data in api_response:\n pprint(data)\nexcept ApiException as e:\n print(\"Exception when calling AttachmentsApi->get_attachments_for_object: %s\\n\" % e)",
"name": "python-sdk-v5"
},
{
"language": "python",
"install": "pip install asana==3.2.3",
"code": "import asana\n\nclient = asana.Client.access_token('PERSONAL_ACCESS_TOKEN')\n\nresult = client.attachments.get_attachments_for_object({'param': 'value', 'param': 'value'}, opt_pretty=True)",
"name": "python-sdk-v3"
},
{
"language": "php",
"install": "composer require asana/asana",
"code": "<?php\nrequire 'vendor/autoload.php';\n\n$client = Asana\\Client::accessToken('PERSONAL_ACCESS_TOKEN');\n\n$result = $client->attachments->getAttachmentsForObject(array('param' => 'value', 'param' => 'value'), array('opt_pretty' => 'true'))"
},
{
"language": "ruby",
"install": "gem install asana",
"code": "require 'asana'\n\nclient = Asana::Client.new do |c|\n c.authentication :access_token, 'PERSONAL_ACCESS_TOKEN'\nend\n\nresult = client.attachments.get_attachments_for_object(parent: ''parent_example'', param: \"value\", param: \"value\", options: {pretty: true})"
}
]
},
"x-purple-suite-runtime": "unavailable"
}
POST /api/1.0/attachments
Upload an attachment
<b>Required scope: </b><code>attachments:write</code>
Upload an attachment.
This method uploads an attachment on an object and returns the compact
record for the created attachment object. This is possible by either:
- Providing the URL of the external resource being attached, or
- Downloading the file content first and then uploading it as any other attachment. Note that it is not possible to attach
files from third party services such as Dropbox, Box, Vimeo & Google Drive via the API
The 100MB size limit on attachments in Asana is enforced on this endpoint.
This endpoint expects a multipart/form-data encoded request containing the full contents of the file to be uploaded.
Requests made should follow the HTTP/1.1 specification that line
terminators are of the form `CRLF` or `\r\n` outlined
[here](http://www.w3.org/Protocols/HTTP/1.1/draft-ietf-http-v11-spec-01#Basic-Rules) in order for the server to reliably and properly handle the request.
For file names that contain non-ASCII characters, the file name should be URL-encoded. For example, a file named `résumé.pdf` should be encoded as
`r%C3%A9sum%C3%A9.pdf` and the `filename` parameter in the `Content-Disposition` header should be set to the encoded file name.
Below is an example of a cURL request with the `Content-Disposition` header:
```
export ASANA_PAT="<YOUR_ASANA_PERSONAL_ACCESS_TOKEN>"
export PARENT_ID="<PARENT_GID>"
export ENCODED_NAME="r%C3%A9sum%C3%A9.pdf"
curl --location 'https://app.asana.com/api/1.0/attachments' \
--header 'Content-Type: multipart/form-data' \
--header 'Accept: application/json' \
--header "Authorization: Bearer $ASANA_PAT" \
--form "parent=$PARENT_ID" \
--form "file=@/Users/exampleUser/Downloads/résumé.pdf;headers=\"Content-Disposition: form-data; name="file"; filename="$ENCODED_NAME.pdf"; filename*=UTF-8''$ENCODED_NAME.pdf\""
```
This operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.
Authentication
[
{
"personalAccessToken": []
},
{
"oauth2": [
"attachments:write"
]
}
]
Path-level parameters and metadata
{
"parameters": [
{
"$ref": "#/components/parameters/pretty"
}
]
}
Request, responses and operation details
{
"summary": "Upload an attachment",
"description": "<b>Required scope: </b><code>attachments:write</code>\n\nUpload an attachment.\n\nThis method uploads an attachment on an object and returns the compact\nrecord for the created attachment object. This is possible by either:\n\n- Providing the URL of the external resource being attached, or\n- Downloading the file content first and then uploading it as any other attachment. Note that it is not possible to attach\nfiles from third party services such as Dropbox, Box, Vimeo & Google Drive via the API\n\nThe 100MB size limit on attachments in Asana is enforced on this endpoint.\n\nThis endpoint expects a multipart/form-data encoded request containing the full contents of the file to be uploaded.\n\nRequests made should follow the HTTP/1.1 specification that line\nterminators are of the form `CRLF` or `\\r\\n` outlined\n[here](http://www.w3.org/Protocols/HTTP/1.1/draft-ietf-http-v11-spec-01#Basic-Rules) in order for the server to reliably and properly handle the request.\n\nFor file names that contain non-ASCII characters, the file name should be URL-encoded. For example, a file named `résumé.pdf` should be encoded as\n`r%C3%A9sum%C3%A9.pdf` and the `filename` parameter in the `Content-Disposition` header should be set to the encoded file name.\n\nBelow is an example of a cURL request with the `Content-Disposition` header:\n\n```\nexport ASANA_PAT=\"<YOUR_ASANA_PERSONAL_ACCESS_TOKEN>\"\nexport PARENT_ID=\"<PARENT_GID>\"\nexport ENCODED_NAME=\"r%C3%A9sum%C3%A9.pdf\"\ncurl --location 'https://app.asana.com/api/1.0/attachments' \\\n --header 'Content-Type: multipart/form-data' \\\n --header 'Accept: application/json' \\\n --header \"Authorization: Bearer $ASANA_PAT\" \\\n --form \"parent=$PARENT_ID\" \\\n --form \"file=@/Users/exampleUser/Downloads/résumé.pdf;headers=\\\"Content-Disposition: form-data; name=\"file\"; filename=\"$ENCODED_NAME.pdf\"; filename*=UTF-8''$ENCODED_NAME.pdf\\\"\"\n```\n\nThis operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.",
"tags": [
"Attachments"
],
"operationId": "createAttachmentForObject",
"parameters": [
{
"name": "opt_fields",
"in": "query",
"description": "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. Properties can include nested fields. To learn more, see the [input/output options guide](/docs/inputoutput-options#selecting-nested-fields).",
"required": false,
"example": [
"connected_to_app",
"created_at",
"download_url",
"host",
"name",
"parent",
"parent.created_by",
"parent.name",
"parent.resource_subtype",
"permanent_url",
"resource_subtype",
"size",
"view_url"
],
"schema": {
"type": "array",
"items": {
"type": "string",
"enum": [
"connected_to_app",
"created_at",
"download_url",
"host",
"name",
"parent",
"parent.created_by",
"parent.name",
"parent.resource_subtype",
"permanent_url",
"resource_subtype",
"size",
"view_url"
]
}
},
"style": "form",
"explode": false
}
],
"requestBody": {
"description": "The file you want to upload.\n\n*Note when using curl:*\n\nBe sure to add an `‘@’` before the file path, and use the `--form`\noption instead of the `-d` option.\n\nWhen uploading PDFs with curl, force the content-type to be pdf by\nappending the content type to the file path: `--form\n\"file=@file.pdf;type=application/pdf\"`.",
"content": {
"multipart/form-data": {
"schema": {
"$ref": "#/components/schemas/AttachmentRequest"
}
}
}
},
"responses": {
"200": {
"description": "Successfully uploaded the attachment to the parent object.",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"$ref": "#/components/schemas/AttachmentResponse"
}
}
}
}
}
},
"400": {
"$ref": "#/components/responses/BadRequest"
},
"401": {
"$ref": "#/components/responses/Unauthorized"
},
"403": {
"$ref": "#/components/responses/Forbidden"
},
"404": {
"$ref": "#/components/responses/NotFound"
},
"500": {
"$ref": "#/components/responses/InternalServerError"
}
},
"security": [
{
"personalAccessToken": []
},
{
"oauth2": [
"attachments:write"
]
}
],
"x-readme": {
"code-samples": [
{
"language": "java",
"install": "<dependency><groupId>com.asana</groupId><artifactId>asana</artifactId><version>1.0.0</version></dependency>",
"code": "import com.asana.Client;\n\nClient client = Client.accessToken(\"PERSONAL_ACCESS_TOKEN\");\n\nAttachment result = client.attachments.createAttachmentForObject(file, parent, url, name)\n .data(\"field\", \"value\")\n .data(\"field\", \"value\")\n .option(\"pretty\", true)\n .execute();"
},
{
"language": "node",
"install": "npm install asana",
"code": "const Asana = require('asana');\nconst fs = require(\"fs\");\n\nlet client = new Asana.ApiClient();\nclient.authentications.token.accessToken = '<YOUR_ACCESS_TOKEN>';\n\nlet attachmentsApiInstance = new Asana.AttachmentsApi(client);\nlet opts = { \n 'resource_subtype': \"external\", \n 'file': fs.createReadStream(\"file_example\"), \n 'parent': \"parent_example\", \n 'url': \"url_example\", \n 'name': \"name_example\", \n 'connect_to_app': true, \n 'opt_fields': \"connected_to_app,created_at,download_url,host,name,parent,parent.created_by,parent.name,parent.resource_subtype,permanent_url,resource_subtype,size,view_url\"\n};\nattachmentsApiInstance.createAttachmentForObject(opts).then((result) => {\n console.log('API called successfully. Returned data: ' + JSON.stringify(result.data, null, 2));\n}, (error) => {\n console.error(error.response.body);\n});",
"name": "node-sdk-v3"
},
{
"language": "node",
"install": "npm install asana@1.0.5",
"code": "const asana = require('asana');\n\nconst client = asana.Client.create().useAccessToken('PERSONAL_ACCESS_TOKEN');\n\nclient.attachments.createAttachmentForObject({field: \"value\", field: \"value\", pretty: true})\n .then((result) => {\n console.log(result);\n });",
"name": "node-sdk-v1"
},
{
"language": "python",
"install": "pip install asana",
"code": "import asana\nfrom asana.rest import ApiException\nfrom pprint import pprint\n\nconfiguration = asana.Configuration()\nconfiguration.access_token = '<YOUR_ACCESS_TOKEN>'\napi_client = asana.ApiClient(configuration)\n\n# create an instance of the API class\nattachments_api_instance = asana.AttachmentsApi(api_client)\nopts = {\n 'resource_subtype': \"external\", # str | \n 'file': \"file_example\", # str | \n 'parent': \"parent_example\", # str | \n 'url': \"url_example\", # str | \n 'name': \"name_example\", # str | \n 'connect_to_app': True, # bool | \n 'opt_fields': \"connected_to_app,created_at,download_url,host,name,parent,parent.created_by,parent.name,parent.resource_subtype,permanent_url,resource_subtype,size,view_url\", # list[str] | 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.\n}\n\ntry:\n # Upload an attachment\n api_response = attachments_api_instance.create_attachment_for_object(opts)\n pprint(api_response)\nexcept ApiException as e:\n print(\"Exception when calling AttachmentsApi->create_attachment_for_object: %s\\n\" % e)",
"name": "python-sdk-v5"
},
{
"language": "python",
"install": "pip install asana==3.2.3",
"code": "import asana\n\nclient = asana.Client.access_token('PERSONAL_ACCESS_TOKEN')\n\nresult = client.attachments.create_attachment_for_object({'field': 'value', 'field': 'value'}, opt_pretty=True)",
"name": "python-sdk-v3"
},
{
"language": "php",
"install": "composer require asana/asana",
"code": "<?php\nrequire 'vendor/autoload.php';\n\n$client = Asana\\Client::accessToken('PERSONAL_ACCESS_TOKEN');\n\n$result = $client->attachments->createAttachmentForObject(array('field' => 'value', 'field' => 'value'), array('opt_pretty' => 'true'))"
},
{
"language": "ruby",
"install": "gem install asana",
"code": "require 'asana'\n\nclient = Asana::Client.new do |c|\n c.authentication :access_token, 'PERSONAL_ACCESS_TOKEN'\nend\n\nresult = client.attachments.create_attachment_for_object(field: \"value\", field: \"value\", options: {pretty: true})"
}
]
},
"x-purple-suite-runtime": "unavailable"
}
GET /api/1.0/workspaces/{workspace_gid}/audit_log_events
Get audit log events
Retrieve the audit log events that have been captured in your domain.
This endpoint will return a list of [AuditLogEvent](/reference/audit-log-api) objects, sorted by creation time in ascending order. Note that the Audit Log API captures events from October 8th, 2021 and later. Queries for events before this date will not return results.
There are a number of query parameters (below) that can be used to filter the set of [AuditLogEvent](/reference/audit-log-api) objects that are returned in the response. Any combination of query parameters is valid. When no filters are provided, all of the events that have been captured in your domain will match.
The list of events will always be [paginated](/docs/pagination). The default limit is 1000 events. The next set of events can be retrieved using the `offset` from the previous response. If there are no events that match the provided filters in your domain, the endpoint will return `null` for the `next_page` field. Querying again with the same filters may return new events if they were captured after the last request. Once a response includes a `next_page` with an `offset`, subsequent requests can be made with the latest `offset` to poll for new events that match the provided filters.
*Note: If the filters you provided match events in your domain and `next_page` is present in the response, we will continue to send `next_page` on subsequent requests even when there are no more events that match the filters. This was put in place so that you can implement an audit log stream that will return future events that match these filters. If you are not interested in future events that match the filters you have defined, you can rely on checking empty `data` response for the end of current events that match your filters.*
When no `offset` is provided, the response will begin with the oldest events that match the provided filters. It is important to note that [AuditLogEvent](/reference/audit-log-api) objects will be permanently deleted from our systems after 90 days. If you wish to keep a permanent record of these events, we recommend using a SIEM tool to ingest and store these logs.
This operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.
Authentication
[
{
"personalAccessToken": []
},
{
"oauth2": []
}
]
Path-level parameters and metadata
{
"parameters": [
{
"$ref": "#/components/parameters/workspace_path_gid"
},
{
"$ref": "#/components/parameters/audit_log_start_at"
},
{
"$ref": "#/components/parameters/audit_log_end_at"
},
{
"$ref": "#/components/parameters/audit_log_event_type"
},
{
"$ref": "#/components/parameters/audit_log_actor_type"
},
{
"$ref": "#/components/parameters/audit_log_actor_gid"
},
{
"$ref": "#/components/parameters/audit_log_resource_gid"
},
{
"$ref": "#/components/parameters/limit"
},
{
"$ref": "#/components/parameters/offset"
}
]
}
Request, responses and operation details
{
"summary": "Get audit log events",
"description": "Retrieve the audit log events that have been captured in your domain.\n\nThis endpoint will return a list of [AuditLogEvent](/reference/audit-log-api) objects, sorted by creation time in ascending order. Note that the Audit Log API captures events from October 8th, 2021 and later. Queries for events before this date will not return results.\n\nThere are a number of query parameters (below) that can be used to filter the set of [AuditLogEvent](/reference/audit-log-api) objects that are returned in the response. Any combination of query parameters is valid. When no filters are provided, all of the events that have been captured in your domain will match.\n\nThe list of events will always be [paginated](/docs/pagination). The default limit is 1000 events. The next set of events can be retrieved using the `offset` from the previous response. If there are no events that match the provided filters in your domain, the endpoint will return `null` for the `next_page` field. Querying again with the same filters may return new events if they were captured after the last request. Once a response includes a `next_page` with an `offset`, subsequent requests can be made with the latest `offset` to poll for new events that match the provided filters.\n\n*Note: If the filters you provided match events in your domain and `next_page` is present in the response, we will continue to send `next_page` on subsequent requests even when there are no more events that match the filters. This was put in place so that you can implement an audit log stream that will return future events that match these filters. If you are not interested in future events that match the filters you have defined, you can rely on checking empty `data` response for the end of current events that match your filters.*\n\nWhen no `offset` is provided, the response will begin with the oldest events that match the provided filters. It is important to note that [AuditLogEvent](/reference/audit-log-api) objects will be permanently deleted from our systems after 90 days. If you wish to keep a permanent record of these events, we recommend using a SIEM tool to ingest and store these logs.\n\nThis operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.",
"tags": [
"Audit log API"
],
"operationId": "getAuditLogEvents",
"responses": {
"200": {
"description": "AuditLogEvents were successfully retrieved.",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"type": "array",
"items": {
"$ref": "#/components/schemas/AuditLogEvent"
}
},
"next_page": {
"$ref": "#/components/schemas/NextPage"
}
}
}
}
}
},
"400": {
"$ref": "#/components/responses/BadRequest"
},
"401": {
"$ref": "#/components/responses/Unauthorized"
},
"403": {
"$ref": "#/components/responses/Forbidden"
},
"404": {
"$ref": "#/components/responses/NotFound"
},
"500": {
"$ref": "#/components/responses/InternalServerError"
}
},
"security": [
{
"personalAccessToken": []
},
{
"oauth2": []
}
],
"x-readme": {
"code-samples": [
{
"language": "java",
"install": "<dependency><groupId>com.asana</groupId><artifactId>asana</artifactId><version>1.0.0</version></dependency>",
"code": "import com.asana.Client;\n\nClient client = Client.accessToken(\"PERSONAL_ACCESS_TOKEN\");\n\nList<JsonElement> result = client.auditlogapi.getAuditLogEvents(workspaceGid, resourceGid, actorGid, actorType, eventType, endAt, startAt)\n .option(\"pretty\", true)\n .execute();"
},
{
"language": "node",
"install": "npm install asana",
"code": "const Asana = require('asana');\n\nlet client = new Asana.ApiClient();\nclient.authentications.token.accessToken = '<YOUR_ACCESS_TOKEN>';\n\nlet auditLogApiApiInstance = new Asana.AuditLogAPIApi(client);\nlet workspace_gid = \"12345\"; // String | Globally unique identifier for the workspace or organization.\nlet opts = { \n 'start_at': \"2013-10-20T19:20:30+01:00\", \n 'end_at': \"2013-10-20T19:20:30+01:00\", \n 'event_type': \"event_type_example\", \n 'actor_type': \"actor_type_example\", \n 'actor_gid': \"actor_gid_example\", \n 'resource_gid': \"resource_gid_example\", \n 'limit': 50, \n 'offset': \"eyJ0eXAiOJiKV1iQLCJhbGciOiJIUzI1NiJ9\"\n};\nauditLogApiApiInstance.getAuditLogEvents(workspace_gid, opts).then((result) => {\n console.log('API called successfully. Returned data: ' + JSON.stringify(result.data, null, 2));\n}, (error) => {\n console.error(error.response.body);\n});",
"name": "node-sdk-v3"
},
{
"language": "node",
"install": "npm install asana@1.0.5",
"code": "const asana = require('asana');\n\nconst client = asana.Client.create().useAccessToken('PERSONAL_ACCESS_TOKEN');\n\nclient.auditlogapi.getAuditLogEvents(workspaceGid, {param: \"value\", param: \"value\", opt_pretty: true})\n .then((result) => {\n console.log(result);\n });",
"name": "node-sdk-v1"
},
{
"language": "python",
"install": "pip install asana",
"code": "import asana\nfrom asana.rest import ApiException\nfrom pprint import pprint\n\nconfiguration = asana.Configuration()\nconfiguration.access_token = '<YOUR_ACCESS_TOKEN>'\napi_client = asana.ApiClient(configuration)\n\n# create an instance of the API class\naudit_log_api_api_instance = asana.AuditLogAPIApi(api_client)\nworkspace_gid = \"12345\" # str | Globally unique identifier for the workspace or organization.\nopts = {\n 'start_at': '2013-10-20T19:20:30+01:00', # datetime | Filter to events created after this time (inclusive).\n 'end_at': '2013-10-20T19:20:30+01:00', # datetime | Filter to events created before this time (exclusive).\n 'event_type': \"event_type_example\", # str | Filter to events of this type. Refer to the [supported audit log events](/docs/audit-log-events#supported-audit-log-events) for a full list of values.\n 'actor_type': \"actor_type_example\", # str | Filter to events with an actor of this type. This only needs to be included if querying for actor types without an ID. If `actor_gid` is included, this should be excluded.\n 'actor_gid': \"actor_gid_example\", # str | Filter to events triggered by the actor with this ID.\n 'resource_gid': \"resource_gid_example\", # str | Filter to events with this resource ID.\n 'limit': 50, # int | Results per page. The number of objects to return per page. The value must be between 1 and 100.\n 'offset': \"eyJ0eXAiOJiKV1iQLCJhbGciOiJIUzI1NiJ9\", # str | 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.*\n}\n\ntry:\n # Get audit log events\n api_response = audit_log_api_api_instance.get_audit_log_events(workspace_gid, opts)\n for data in api_response:\n pprint(data)\nexcept ApiException as e:\n print(\"Exception when calling AuditLogAPIApi->get_audit_log_events: %s\\n\" % e)",
"name": "python-sdk-v5"
},
{
"language": "python",
"install": "pip install asana==3.2.3",
"code": "import asana\n\nclient = asana.Client.access_token('PERSONAL_ACCESS_TOKEN')\n\nresult = client.audit_log_api.get_audit_log_events(workspace_gid, {'param': 'value', 'param': 'value'}, opt_pretty=True)",
"name": "python-sdk-v3"
},
{
"language": "php",
"install": "composer require asana/asana",
"code": "<?php\nrequire 'vendor/autoload.php';\n\n$client = Asana\\Client::accessToken('PERSONAL_ACCESS_TOKEN');\n\n$result = $client->auditlogapi->getAuditLogEvents($workspace_gid, array('param' => 'value', 'param' => 'value'), array('opt_pretty' => 'true'))"
},
{
"language": "ruby",
"install": "gem install asana",
"code": "require 'asana'\n\nclient = Asana::Client.new do |c|\n c.authentication :access_token, 'PERSONAL_ACCESS_TOKEN'\nend\n\nresult = client.audit_log_api.get_audit_log_events(workspace_gid: 'workspace_gid', param: \"value\", param: \"value\", options: {pretty: true})"
}
]
},
"x-purple-suite-runtime": "unavailable"
}
POST /api/1.0/batch
Submit parallel requests
Make multiple requests in parallel to Asana's API.
This operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.
Authentication
[
{
"personalAccessToken": []
},
{
"oauth2": []
}
]
Path-level parameters and metadata
{
"parameters": [
{
"$ref": "#/components/parameters/pretty"
}
]
}
Request, responses and operation details
{
"summary": "Submit parallel requests",
"description": "Make multiple requests in parallel to Asana's API.\n\nThis operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.",
"tags": [
"Batch API"
],
"operationId": "createBatchRequest",
"parameters": [
{
"name": "opt_fields",
"in": "query",
"description": "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. Properties can include nested fields. To learn more, see the [input/output options guide](/docs/inputoutput-options#selecting-nested-fields).",
"required": false,
"example": [
"body",
"headers",
"status_code"
],
"schema": {
"type": "array",
"items": {
"type": "string",
"enum": [
"body",
"headers",
"status_code"
]
}
},
"style": "form",
"explode": false
}
],
"requestBody": {
"description": "The requests to batch together via the Batch API.",
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"$ref": "#/components/schemas/BatchRequest"
}
}
}
}
}
},
"responses": {
"200": {
"description": "Successfully completed the requested batch API operations.",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"type": "array",
"items": {
"$ref": "#/components/schemas/BatchResponse"
}
}
}
}
}
}
},
"400": {
"$ref": "#/components/responses/BadRequest"
},
"401": {
"$ref": "#/components/responses/Unauthorized"
},
"403": {
"$ref": "#/components/responses/Forbidden"
},
"404": {
"$ref": "#/components/responses/NotFound"
},
"500": {
"$ref": "#/components/responses/InternalServerError"
}
},
"security": [
{
"personalAccessToken": []
},
{
"oauth2": []
}
],
"x-readme": {
"code-samples": [
{
"language": "java",
"install": "<dependency><groupId>com.asana</groupId><artifactId>asana</artifactId><version>1.0.0</version></dependency>",
"code": "import com.asana.Client;\n\nClient client = Client.accessToken(\"PERSONAL_ACCESS_TOKEN\");\n\nList<JsonElement> result = client.batchapi.createBatchRequest()\n .data(\"field\", \"value\")\n .data(\"field\", \"value\")\n .option(\"pretty\", true)\n .execute();"
},
{
"language": "node",
"install": "npm install asana",
"code": "const Asana = require('asana');\n\nlet client = new Asana.ApiClient();\nclient.authentications.token.accessToken = '<YOUR_ACCESS_TOKEN>';\n\nlet batchApiApiInstance = new Asana.BatchAPIApi(client);\nlet body = {\"data\": {\"<PARAM_1>\": \"<VALUE_1>\", \"<PARAM_2>\": \"<VALUE_2>\",}}; // Object | The requests to batch together via the Batch API.\nlet opts = { \n 'opt_fields': \"body,headers,status_code\"\n};\nbatchApiApiInstance.createBatchRequest(body, opts).then((result) => {\n console.log('API called successfully. Returned data: ' + JSON.stringify(result.data, null, 2));\n}, (error) => {\n console.error(error.response.body);\n});",
"name": "node-sdk-v3"
},
{
"language": "node",
"install": "npm install asana@1.0.5",
"code": "const asana = require('asana');\n\nconst client = asana.Client.create().useAccessToken('PERSONAL_ACCESS_TOKEN');\n\nclient.batchapi.createBatchRequest({field: \"value\", field: \"value\", pretty: true})\n .then((result) => {\n console.log(result);\n });",
"name": "node-sdk-v1"
},
{
"language": "python",
"install": "pip install asana",
"code": "import asana\nfrom asana.rest import ApiException\nfrom pprint import pprint\n\nconfiguration = asana.Configuration()\nconfiguration.access_token = '<YOUR_ACCESS_TOKEN>'\napi_client = asana.ApiClient(configuration)\n\n# create an instance of the API class\nbatch_api_api_instance = asana.BatchAPIApi(api_client)\nbody = {\"data\": {\"<PARAM_1>\": \"<VALUE_1>\", \"<PARAM_2>\": \"<VALUE_2>\",}} # dict | The requests to batch together via the Batch API.\nopts = {\n 'opt_fields': \"body,headers,status_code\", # list[str] | 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.\n}\n\ntry:\n # Submit parallel requests\n api_response = batch_api_api_instance.create_batch_request(body, opts)\n for data in api_response:\n pprint(data)\nexcept ApiException as e:\n print(\"Exception when calling BatchAPIApi->create_batch_request: %s\\n\" % e)",
"name": "python-sdk-v5"
},
{
"language": "python",
"install": "pip install asana==3.2.3",
"code": "import asana\n\nclient = asana.Client.access_token('PERSONAL_ACCESS_TOKEN')\n\nresult = client.batch_api.create_batch_request({'field': 'value', 'field': 'value'}, opt_pretty=True)",
"name": "python-sdk-v3"
},
{
"language": "php",
"install": "composer require asana/asana",
"code": "<?php\nrequire 'vendor/autoload.php';\n\n$client = Asana\\Client::accessToken('PERSONAL_ACCESS_TOKEN');\n\n$result = $client->batchapi->createBatchRequest(array('field' => 'value', 'field' => 'value'), array('opt_pretty' => 'true'))"
},
{
"language": "ruby",
"install": "gem install asana",
"code": "require 'asana'\n\nclient = Asana::Client.new do |c|\n c.authentication :access_token, 'PERSONAL_ACCESS_TOKEN'\nend\n\nresult = client.batch_api.create_batch_request(field: \"value\", field: \"value\", options: {pretty: true})"
}
]
},
"x-purple-suite-runtime": "unavailable"
}
GET /api/1.0/budgets
Get all budgets
Gets all budgets for a given *parent*. This will at most return a list of size 1 for a given *parent*.
This operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.
Authentication
[
{
"personalAccessToken": []
},
{
"oauth2": []
}
]
Path-level parameters and metadata
{
"parameters": [
{
"$ref": "#/components/parameters/pretty"
}
]
}
Request, responses and operation details
{
"summary": "Get all budgets",
"description": "Gets all budgets for a given *parent*. This will at most return a list of size 1 for a given *parent*.\n\nThis operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.",
"operationId": "getBudgets",
"tags": [
"Budgets"
],
"parameters": [
{
"name": "parent",
"in": "query",
"required": true,
"description": "Globally unique identifier for the budget's parent object. This currently can only be a `project`.",
"schema": {
"type": "string"
},
"example": "1331"
}
],
"responses": {
"200": {
"description": "Successfully retrieved the requested budgets.",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"type": "array",
"items": {
"$ref": "#/components/schemas/BudgetResponse"
}
}
}
}
}
}
},
"400": {
"$ref": "#/components/responses/BadRequest"
},
"401": {
"$ref": "#/components/responses/Unauthorized"
},
"402": {
"$ref": "#/components/responses/PaymentRequired"
},
"403": {
"$ref": "#/components/responses/Forbidden"
},
"404": {
"$ref": "#/components/responses/NotFound"
},
"500": {
"$ref": "#/components/responses/InternalServerError"
}
},
"security": [
{
"personalAccessToken": []
},
{
"oauth2": []
}
],
"x-readme": {
"code-samples": [
{
"language": "node",
"install": "npm install asana",
"code": "const Asana = require('asana');\n\nlet client = new Asana.ApiClient();\nclient.authentications.token.accessToken = '<YOUR_ACCESS_TOKEN>';\n\nlet budgetsApiInstance = new Asana.BudgetsApi(client);\nlet parent = \"1331\"; // String | Globally unique identifier for the budget's parent object. This currently can only be a `project`.\n\nbudgetsApiInstance.getBudgets(parent).then((result) => {\n console.log('API called successfully. Returned data: ' + JSON.stringify(result.data, null, 2));\n}, (error) => {\n console.error(error.response.body);\n});",
"name": "node-sdk-v3"
},
{
"language": "python",
"install": "pip install asana",
"code": "import asana\nfrom asana.rest import ApiException\nfrom pprint import pprint\n\nconfiguration = asana.Configuration()\nconfiguration.access_token = '<YOUR_ACCESS_TOKEN>'\napi_client = asana.ApiClient(configuration)\n\n# create an instance of the API class\nbudgets_api_instance = asana.BudgetsApi(api_client)\nparent = \"1331\" # str | Globally unique identifier for the budget's parent object. This currently can only be a `project`.\n\n\ntry:\n # Get all budgets\n api_response = budgets_api_instance.get_budgets(parent)\n for data in api_response:\n pprint(data)\nexcept ApiException as e:\n print(\"Exception when calling BudgetsApi->get_budgets: %s\\n\" % e)",
"name": "python-sdk-v5"
}
]
},
"x-purple-suite-runtime": "unavailable"
}
POST /api/1.0/budgets
Create a budget
Creates a new budget.
This operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.
Authentication
[
{
"personalAccessToken": []
},
{
"oauth2": []
}
]
Path-level parameters and metadata
{
"parameters": [
{
"$ref": "#/components/parameters/pretty"
}
]
}
Request, responses and operation details
{
"summary": "Create a budget",
"description": "Creates a new budget.\n\nThis operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.",
"tags": [
"Budgets"
],
"operationId": "createBudget",
"requestBody": {
"description": "The budget to create.",
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"$ref": "#/components/schemas/BudgetRequest"
}
}
}
}
}
},
"responses": {
"201": {
"description": "Successfully created a new budget.",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"$ref": "#/components/schemas/BudgetResponse"
}
}
}
}
}
},
"400": {
"$ref": "#/components/responses/BadRequest"
},
"401": {
"$ref": "#/components/responses/Unauthorized"
},
"402": {
"$ref": "#/components/responses/PaymentRequired"
},
"403": {
"$ref": "#/components/responses/Forbidden"
},
"404": {
"$ref": "#/components/responses/NotFound"
},
"500": {
"$ref": "#/components/responses/InternalServerError"
}
},
"security": [
{
"personalAccessToken": []
},
{
"oauth2": []
}
],
"x-readme": {
"code-samples": [
{
"language": "node",
"install": "npm install asana",
"code": "const Asana = require('asana');\n\nlet client = new Asana.ApiClient();\nclient.authentications.token.accessToken = '<YOUR_ACCESS_TOKEN>';\n\nlet budgetsApiInstance = new Asana.BudgetsApi(client);\nlet body = {\"data\": {\"<PARAM_1>\": \"<VALUE_1>\", \"<PARAM_2>\": \"<VALUE_2>\",}}; // Object | The budget to create.\n\nbudgetsApiInstance.createBudget(body).then((result) => {\n console.log('API called successfully. Returned data: ' + JSON.stringify(result.data, null, 2));\n}, (error) => {\n console.error(error.response.body);\n});",
"name": "node-sdk-v3"
},
{
"language": "python",
"install": "pip install asana",
"code": "import asana\nfrom asana.rest import ApiException\nfrom pprint import pprint\n\nconfiguration = asana.Configuration()\nconfiguration.access_token = '<YOUR_ACCESS_TOKEN>'\napi_client = asana.ApiClient(configuration)\n\n# create an instance of the API class\nbudgets_api_instance = asana.BudgetsApi(api_client)\nbody = {\"data\": {\"<PARAM_1>\": \"<VALUE_1>\", \"<PARAM_2>\": \"<VALUE_2>\",}} # dict | The budget to create.\n\n\ntry:\n # Create a budget\n api_response = budgets_api_instance.create_budget(body)\n pprint(api_response)\nexcept ApiException as e:\n print(\"Exception when calling BudgetsApi->create_budget: %s\\n\" % e)",
"name": "python-sdk-v5"
}
]
},
"x-purple-suite-runtime": "unavailable"
}
GET /api/1.0/budgets/{budget_gid}
Get a budget
Returns the complete budget record for a single budget.
This operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.
Authentication
[
{
"personalAccessToken": []
},
{
"oauth2": []
}
]
Path-level parameters and metadata
{
"parameters": [
{
"$ref": "#/components/parameters/budget_path_gid"
},
{
"$ref": "#/components/parameters/pretty"
}
]
}
Request, responses and operation details
{
"summary": "Get a budget",
"description": "Returns the complete budget record for a single budget.\n\nThis operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.",
"tags": [
"Budgets"
],
"operationId": "getBudget",
"parameters": [
{
"name": "opt_fields",
"in": "query",
"description": "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. Properties can include nested fields. To learn more, see the [input/output options guide](/docs/inputoutput-options#selecting-nested-fields).",
"required": false,
"example": [
"actual",
"actual.billable_status_filter",
"actual.units",
"actual.value",
"budget_type",
"estimate",
"estimate.billable_status_filter",
"estimate.enabled",
"estimate.source",
"estimate.units",
"estimate.value",
"parent",
"parent.name",
"parent.resource_subtype",
"total",
"total.enabled",
"total.units",
"total.value"
],
"schema": {
"type": "array",
"items": {
"type": "string",
"enum": [
"actual",
"actual.billable_status_filter",
"actual.units",
"actual.value",
"budget_type",
"estimate",
"estimate.billable_status_filter",
"estimate.enabled",
"estimate.source",
"estimate.units",
"estimate.value",
"parent",
"parent.name",
"parent.resource_subtype",
"total",
"total.enabled",
"total.units",
"total.value"
]
}
},
"style": "form",
"explode": false
}
],
"responses": {
"200": {
"description": "Successfully retrieved the requested budget.",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"$ref": "#/components/schemas/BudgetResponse"
}
}
}
}
}
},
"400": {
"$ref": "#/components/responses/BadRequest"
},
"401": {
"$ref": "#/components/responses/Unauthorized"
},
"402": {
"$ref": "#/components/responses/PaymentRequired"
},
"403": {
"$ref": "#/components/responses/Forbidden"
},
"404": {
"$ref": "#/components/responses/NotFound"
},
"500": {
"$ref": "#/components/responses/InternalServerError"
}
},
"security": [
{
"personalAccessToken": []
},
{
"oauth2": []
}
],
"x-readme": {
"code-samples": [
{
"language": "node",
"install": "npm install asana",
"code": "const Asana = require('asana');\n\nlet client = new Asana.ApiClient();\nclient.authentications.token.accessToken = '<YOUR_ACCESS_TOKEN>';\n\nlet budgetsApiInstance = new Asana.BudgetsApi(client);\nlet budget_gid = \"12345\"; // String | Globally unique identifier for the budget.\nlet opts = { \n 'opt_fields': \"actual,actual.billable_status_filter,actual.units,actual.value,budget_type,estimate,estimate.billable_status_filter,estimate.enabled,estimate.source,estimate.units,estimate.value,parent,parent.name,parent.resource_subtype,total,total.enabled,total.units,total.value\"\n};\nbudgetsApiInstance.getBudget(budget_gid, opts).then((result) => {\n console.log('API called successfully. Returned data: ' + JSON.stringify(result.data, null, 2));\n}, (error) => {\n console.error(error.response.body);\n});",
"name": "node-sdk-v3"
},
{
"language": "python",
"install": "pip install asana",
"code": "import asana\nfrom asana.rest import ApiException\nfrom pprint import pprint\n\nconfiguration = asana.Configuration()\nconfiguration.access_token = '<YOUR_ACCESS_TOKEN>'\napi_client = asana.ApiClient(configuration)\n\n# create an instance of the API class\nbudgets_api_instance = asana.BudgetsApi(api_client)\nbudget_gid = \"12345\" # str | Globally unique identifier for the budget.\nopts = {\n 'opt_fields': \"actual,actual.billable_status_filter,actual.units,actual.value,budget_type,estimate,estimate.billable_status_filter,estimate.enabled,estimate.source,estimate.units,estimate.value,parent,parent.name,parent.resource_subtype,total,total.enabled,total.units,total.value\", # list[str] | 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.\n}\n\ntry:\n # Get a budget\n api_response = budgets_api_instance.get_budget(budget_gid, opts)\n pprint(api_response)\nexcept ApiException as e:\n print(\"Exception when calling BudgetsApi->get_budget: %s\\n\" % e)",
"name": "python-sdk-v5"
}
]
},
"x-purple-suite-runtime": "unavailable"
}
PUT /api/1.0/budgets/{budget_gid}
Update a budget
An existing budget can be updated by making a PUT request on the URL for
that budget. Only the fields provided in the `data` block will be updated;
any unspecified fields will remain unchanged.
This operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.
Authentication
[
{
"personalAccessToken": []
},
{
"oauth2": []
}
]
Path-level parameters and metadata
{
"parameters": [
{
"$ref": "#/components/parameters/budget_path_gid"
},
{
"$ref": "#/components/parameters/pretty"
}
]
}
Request, responses and operation details
{
"summary": "Update a budget",
"description": "An existing budget can be updated by making a PUT request on the URL for\nthat budget. Only the fields provided in the `data` block will be updated;\nany unspecified fields will remain unchanged.\n\nThis operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.",
"tags": [
"Budgets"
],
"operationId": "updateBudget",
"parameters": [
{
"name": "opt_fields",
"in": "query",
"description": "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. Properties can include nested fields. To learn more, see the [input/output options guide](/docs/inputoutput-options#selecting-nested-fields).",
"required": false,
"example": [
"actual",
"actual.billable_status_filter",
"actual.units",
"actual.value",
"budget_type",
"estimate",
"estimate.billable_status_filter",
"estimate.enabled",
"estimate.source",
"estimate.units",
"estimate.value",
"parent",
"parent.name",
"parent.resource_subtype",
"total",
"total.enabled",
"total.units",
"total.value"
],
"schema": {
"type": "array",
"items": {
"type": "string",
"enum": [
"actual",
"actual.billable_status_filter",
"actual.units",
"actual.value",
"budget_type",
"estimate",
"estimate.billable_status_filter",
"estimate.enabled",
"estimate.source",
"estimate.units",
"estimate.value",
"parent",
"parent.name",
"parent.resource_subtype",
"total",
"total.enabled",
"total.units",
"total.value"
]
}
},
"style": "form",
"explode": false
}
],
"requestBody": {
"description": "The budget to update.",
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"$ref": "#/components/schemas/BudgetRequest"
}
}
}
}
}
},
"responses": {
"200": {
"description": "Successfully updated the budget.",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"$ref": "#/components/schemas/BudgetResponse"
}
}
}
}
}
},
"400": {
"$ref": "#/components/responses/BadRequest"
},
"401": {
"$ref": "#/components/responses/Unauthorized"
},
"402": {
"$ref": "#/components/responses/PaymentRequired"
},
"403": {
"$ref": "#/components/responses/Forbidden"
},
"404": {
"$ref": "#/components/responses/NotFound"
},
"500": {
"$ref": "#/components/responses/InternalServerError"
}
},
"security": [
{
"personalAccessToken": []
},
{
"oauth2": []
}
],
"x-readme": {
"code-samples": [
{
"language": "node",
"install": "npm install asana",
"code": "const Asana = require('asana');\n\nlet client = new Asana.ApiClient();\nclient.authentications.token.accessToken = '<YOUR_ACCESS_TOKEN>';\n\nlet budgetsApiInstance = new Asana.BudgetsApi(client);\nlet body = {\"data\": {\"<PARAM_1>\": \"<VALUE_1>\", \"<PARAM_2>\": \"<VALUE_2>\",}}; // Object | The budget to update.\nlet budget_gid = \"12345\"; // String | Globally unique identifier for the budget.\nlet opts = { \n 'opt_fields': \"actual,actual.billable_status_filter,actual.units,actual.value,budget_type,estimate,estimate.billable_status_filter,estimate.enabled,estimate.source,estimate.units,estimate.value,parent,parent.name,parent.resource_subtype,total,total.enabled,total.units,total.value\"\n};\nbudgetsApiInstance.updateBudget(body, budget_gid, opts).then((result) => {\n console.log('API called successfully. Returned data: ' + JSON.stringify(result.data, null, 2));\n}, (error) => {\n console.error(error.response.body);\n});",
"name": "node-sdk-v3"
},
{
"language": "python",
"install": "pip install asana",
"code": "import asana\nfrom asana.rest import ApiException\nfrom pprint import pprint\n\nconfiguration = asana.Configuration()\nconfiguration.access_token = '<YOUR_ACCESS_TOKEN>'\napi_client = asana.ApiClient(configuration)\n\n# create an instance of the API class\nbudgets_api_instance = asana.BudgetsApi(api_client)\nbody = {\"data\": {\"<PARAM_1>\": \"<VALUE_1>\", \"<PARAM_2>\": \"<VALUE_2>\",}} # dict | The budget to update.\nbudget_gid = \"12345\" # str | Globally unique identifier for the budget.\nopts = {\n 'opt_fields': \"actual,actual.billable_status_filter,actual.units,actual.value,budget_type,estimate,estimate.billable_status_filter,estimate.enabled,estimate.source,estimate.units,estimate.value,parent,parent.name,parent.resource_subtype,total,total.enabled,total.units,total.value\", # list[str] | 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.\n}\n\ntry:\n # Update a budget\n api_response = budgets_api_instance.update_budget(body, budget_gid, opts)\n pprint(api_response)\nexcept ApiException as e:\n print(\"Exception when calling BudgetsApi->update_budget: %s\\n\" % e)",
"name": "python-sdk-v5"
}
]
},
"x-purple-suite-runtime": "unavailable"
}
DELETE /api/1.0/budgets/{budget_gid}
Delete a budget
A specific, existing budget can be deleted by making a DELETE request on the URL for that budget.
Returns an empty data record.
This operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.
Authentication
[
{
"personalAccessToken": []
},
{
"oauth2": []
}
]
Path-level parameters and metadata
{
"parameters": [
{
"$ref": "#/components/parameters/budget_path_gid"
},
{
"$ref": "#/components/parameters/pretty"
}
]
}
Request, responses and operation details
{
"summary": "Delete a budget",
"description": "A specific, existing budget can be deleted by making a DELETE request on the URL for that budget.\n\nReturns an empty data record.\n\nThis operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.",
"tags": [
"Budgets"
],
"operationId": "deleteBudget",
"responses": {
"200": {
"description": "Successfully deleted the specified budget.",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"$ref": "#/components/schemas/EmptyResponse"
}
}
}
}
}
},
"400": {
"$ref": "#/components/responses/BadRequest"
},
"401": {
"$ref": "#/components/responses/Unauthorized"
},
"402": {
"$ref": "#/components/responses/PaymentRequired"
},
"403": {
"$ref": "#/components/responses/Forbidden"
},
"404": {
"$ref": "#/components/responses/NotFound"
},
"500": {
"$ref": "#/components/responses/InternalServerError"
}
},
"security": [
{
"personalAccessToken": []
},
{
"oauth2": []
}
],
"x-readme": {
"code-samples": [
{
"language": "node",
"install": "npm install asana",
"code": "const Asana = require('asana');\n\nlet client = new Asana.ApiClient();\nclient.authentications.token.accessToken = '<YOUR_ACCESS_TOKEN>';\n\nlet budgetsApiInstance = new Asana.BudgetsApi(client);\nlet budget_gid = \"12345\"; // String | Globally unique identifier for the budget.\n\nbudgetsApiInstance.deleteBudget(budget_gid).then((result) => {\n console.log('API called successfully. Returned data: ' + JSON.stringify(result.data, null, 2));\n}, (error) => {\n console.error(error.response.body);\n});",
"name": "node-sdk-v3"
},
{
"language": "python",
"install": "pip install asana",
"code": "import asana\nfrom asana.rest import ApiException\nfrom pprint import pprint\n\nconfiguration = asana.Configuration()\nconfiguration.access_token = '<YOUR_ACCESS_TOKEN>'\napi_client = asana.ApiClient(configuration)\n\n# create an instance of the API class\nbudgets_api_instance = asana.BudgetsApi(api_client)\nbudget_gid = \"12345\" # str | Globally unique identifier for the budget.\n\n\ntry:\n # Delete a budget\n api_response = budgets_api_instance.delete_budget(budget_gid)\n pprint(api_response)\nexcept ApiException as e:\n print(\"Exception when calling BudgetsApi->delete_budget: %s\\n\" % e)",
"name": "python-sdk-v5"
}
]
},
"x-purple-suite-runtime": "unavailable"
}
GET /api/1.0/projects/{project_gid}/custom_field_settings
Get a project's custom fields
<b>Required scope: </b><code>projects:read</code>
Returns a list of all of the custom fields settings on a project, in compact form. Note that, as in all queries to collections which return compact representation, `opt_fields` can be used to include more data than is returned in the compact representation. See the [documentation for input/output options](https://developers.asana.com/docs/inputoutput-options) for more information.
This operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.
Authentication
[
{
"personalAccessToken": []
},
{
"oauth2": [
"projects:read"
]
}
]
Path-level parameters and metadata
{
"parameters": [
{
"$ref": "#/components/parameters/project_path_gid"
},
{
"$ref": "#/components/parameters/pretty"
},
{
"$ref": "#/components/parameters/limit"
},
{
"$ref": "#/components/parameters/offset"
}
]
}
Request, responses and operation details
{
"summary": "Get a project's custom fields",
"description": "<b>Required scope: </b><code>projects:read</code>\n\nReturns a list of all of the custom fields settings on a project, in compact form. Note that, as in all queries to collections which return compact representation, `opt_fields` can be used to include more data than is returned in the compact representation. See the [documentation for input/output options](https://developers.asana.com/docs/inputoutput-options) for more information.\n\nThis operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.",
"tags": [
"Custom field settings"
],
"operationId": "getCustomFieldSettingsForProject",
"parameters": [
{
"name": "opt_fields",
"in": "query",
"description": "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. Properties can include nested fields. To learn more, see the [input/output options guide](/docs/inputoutput-options#selecting-nested-fields).",
"required": false,
"example": [
"custom_field",
"custom_field.asana_created_field",
"custom_field.created_by",
"custom_field.created_by.name",
"custom_field.currency_code",
"custom_field.custom_label",
"custom_field.custom_label_position",
"custom_field.date_value",
"custom_field.date_value.date",
"custom_field.date_value.date_time",
"custom_field.default_access_level",
"custom_field.description",
"custom_field.display_value",
"custom_field.enabled",
"custom_field.enum_options",
"custom_field.enum_options.color",
"custom_field.enum_options.enabled",
"custom_field.enum_options.name",
"custom_field.enum_value",
"custom_field.enum_value.color",
"custom_field.enum_value.enabled",
"custom_field.enum_value.name",
"custom_field.format",
"custom_field.has_notifications_enabled",
"custom_field.html_text_value",
"custom_field.id_prefix",
"custom_field.input_restrictions",
"custom_field.is_formula_field",
"custom_field.is_global_to_workspace",
"custom_field.is_value_read_only",
"custom_field.multi_enum_values",
"custom_field.multi_enum_values.color",
"custom_field.multi_enum_values.enabled",
"custom_field.multi_enum_values.name",
"custom_field.name",
"custom_field.number_value",
"custom_field.people_value",
"custom_field.people_value.name",
"custom_field.precision",
"custom_field.privacy_setting",
"custom_field.reference_value",
"custom_field.reference_value.name",
"custom_field.representation_type",
"custom_field.resource_subtype",
"custom_field.text_value",
"custom_field.type",
"is_important",
"offset",
"parent",
"parent.name",
"parent.resource_subtype",
"path",
"project",
"project.name",
"project.resource_subtype",
"uri"
],
"schema": {
"type": "array",
"items": {
"type": "string",
"enum": [
"custom_field",
"custom_field.asana_created_field",
"custom_field.created_by",
"custom_field.created_by.name",
"custom_field.currency_code",
"custom_field.custom_label",
"custom_field.custom_label_position",
"custom_field.date_value",
"custom_field.date_value.date",
"custom_field.date_value.date_time",
"custom_field.default_access_level",
"custom_field.description",
"custom_field.display_value",
"custom_field.enabled",
"custom_field.enum_options",
"custom_field.enum_options.color",
"custom_field.enum_options.enabled",
"custom_field.enum_options.name",
"custom_field.enum_value",
"custom_field.enum_value.color",
"custom_field.enum_value.enabled",
"custom_field.enum_value.name",
"custom_field.format",
"custom_field.has_notifications_enabled",
"custom_field.html_text_value",
"custom_field.id_prefix",
"custom_field.input_restrictions",
"custom_field.is_formula_field",
"custom_field.is_global_to_workspace",
"custom_field.is_value_read_only",
"custom_field.multi_enum_values",
"custom_field.multi_enum_values.color",
"custom_field.multi_enum_values.enabled",
"custom_field.multi_enum_values.name",
"custom_field.name",
"custom_field.number_value",
"custom_field.people_value",
"custom_field.people_value.name",
"custom_field.precision",
"custom_field.privacy_setting",
"custom_field.reference_value",
"custom_field.reference_value.name",
"custom_field.representation_type",
"custom_field.resource_subtype",
"custom_field.text_value",
"custom_field.type",
"is_important",
"offset",
"parent",
"parent.name",
"parent.resource_subtype",
"path",
"project",
"project.name",
"project.resource_subtype",
"uri"
]
}
},
"style": "form",
"explode": false
}
],
"responses": {
"200": {
"description": "Successfully retrieved custom field settings objects for a project.",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"type": "array",
"items": {
"$ref": "#/components/schemas/CustomFieldSettingResponse"
}
},
"next_page": {
"$ref": "#/components/schemas/NextPage"
}
}
}
}
}
},
"400": {
"$ref": "#/components/responses/BadRequest"
},
"401": {
"$ref": "#/components/responses/Unauthorized"
},
"403": {
"$ref": "#/components/responses/Forbidden"
},
"404": {
"$ref": "#/components/responses/NotFound"
},
"500": {
"$ref": "#/components/responses/InternalServerError"
}
},
"security": [
{
"personalAccessToken": []
},
{
"oauth2": [
"projects:read"
]
}
],
"x-readme": {
"code-samples": [
{
"language": "java",
"install": "<dependency><groupId>com.asana</groupId><artifactId>asana</artifactId><version>1.0.0</version></dependency>",
"code": "import com.asana.Client;\n\nClient client = Client.accessToken(\"PERSONAL_ACCESS_TOKEN\");\n\nList<CustomFieldSetting> result = client.customfieldsettings.getCustomFieldSettingsForProject(projectGid)\n .option(\"pretty\", true)\n .execute();"
},
{
"language": "node",
"install": "npm install asana",
"code": "const Asana = require('asana');\n\nlet client = new Asana.ApiClient();\nclient.authentications.token.accessToken = '<YOUR_ACCESS_TOKEN>';\n\nlet customFieldSettingsApiInstance = new Asana.CustomFieldSettingsApi(client);\nlet project_gid = \"1331\"; // String | Globally unique identifier for the project.\nlet opts = { \n 'limit': 50, \n 'offset': \"eyJ0eXAiOJiKV1iQLCJhbGciOiJIUzI1NiJ9\", \n 'opt_fields': \"custom_field,custom_field.asana_created_field,custom_field.created_by,custom_field.created_by.name,custom_field.currency_code,custom_field.custom_label,custom_field.custom_label_position,custom_field.date_value,custom_field.date_value.date,custom_field.date_value.date_time,custom_field.default_access_level,custom_field.description,custom_field.display_value,custom_field.enabled,custom_field.enum_options,custom_field.enum_options.color,custom_field.enum_options.enabled,custom_field.enum_options.name,custom_field.enum_value,custom_field.enum_value.color,custom_field.enum_value.enabled,custom_field.enum_value.name,custom_field.format,custom_field.has_notifications_enabled,custom_field.html_text_value,custom_field.id_prefix,custom_field.input_restrictions,custom_field.is_formula_field,custom_field.is_global_to_workspace,custom_field.is_value_read_only,custom_field.multi_enum_values,custom_field.multi_enum_values.color,custom_field.multi_enum_values.enabled,custom_field.multi_enum_values.name,custom_field.name,custom_field.number_value,custom_field.people_value,custom_field.people_value.name,custom_field.precision,custom_field.privacy_setting,custom_field.reference_value,custom_field.reference_value.name,custom_field.representation_type,custom_field.resource_subtype,custom_field.text_value,custom_field.type,is_important,offset,parent,parent.name,parent.resource_subtype,path,project,project.name,project.resource_subtype,uri\"\n};\ncustomFieldSettingsApiInstance.getCustomFieldSettingsForProject(project_gid, opts).then((result) => {\n console.log('API called successfully. Returned data: ' + JSON.stringify(result.data, null, 2));\n}, (error) => {\n console.error(error.response.body);\n});",
"name": "node-sdk-v3"
},
{
"language": "node",
"install": "npm install asana@1.0.5",
"code": "const asana = require('asana');\n\nconst client = asana.Client.create().useAccessToken('PERSONAL_ACCESS_TOKEN');\n\nclient.customfieldsettings.getCustomFieldSettingsForProject(projectGid, {param: \"value\", param: \"value\", opt_pretty: true})\n .then((result) => {\n console.log(result);\n });",
"name": "node-sdk-v1"
},
{
"language": "python",
"install": "pip install asana",
"code": "import asana\nfrom asana.rest import ApiException\nfrom pprint import pprint\n\nconfiguration = asana.Configuration()\nconfiguration.access_token = '<YOUR_ACCESS_TOKEN>'\napi_client = asana.ApiClient(configuration)\n\n# create an instance of the API class\ncustom_field_settings_api_instance = asana.CustomFieldSettingsApi(api_client)\nproject_gid = \"1331\" # str | Globally unique identifier for the project.\nopts = {\n 'limit': 50, # int | Results per page. The number of objects to return per page. The value must be between 1 and 100.\n 'offset': \"eyJ0eXAiOJiKV1iQLCJhbGciOiJIUzI1NiJ9\", # str | 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.*\n 'opt_fields': \"custom_field,custom_field.asana_created_field,custom_field.created_by,custom_field.created_by.name,custom_field.currency_code,custom_field.custom_label,custom_field.custom_label_position,custom_field.date_value,custom_field.date_value.date,custom_field.date_value.date_time,custom_field.default_access_level,custom_field.description,custom_field.display_value,custom_field.enabled,custom_field.enum_options,custom_field.enum_options.color,custom_field.enum_options.enabled,custom_field.enum_options.name,custom_field.enum_value,custom_field.enum_value.color,custom_field.enum_value.enabled,custom_field.enum_value.name,custom_field.format,custom_field.has_notifications_enabled,custom_field.html_text_value,custom_field.id_prefix,custom_field.input_restrictions,custom_field.is_formula_field,custom_field.is_global_to_workspace,custom_field.is_value_read_only,custom_field.multi_enum_values,custom_field.multi_enum_values.color,custom_field.multi_enum_values.enabled,custom_field.multi_enum_values.name,custom_field.name,custom_field.number_value,custom_field.people_value,custom_field.people_value.name,custom_field.precision,custom_field.privacy_setting,custom_field.reference_value,custom_field.reference_value.name,custom_field.representation_type,custom_field.resource_subtype,custom_field.text_value,custom_field.type,is_important,offset,parent,parent.name,parent.resource_subtype,path,project,project.name,project.resource_subtype,uri\", # list[str] | 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.\n}\n\ntry:\n # Get a project's custom fields\n api_response = custom_field_settings_api_instance.get_custom_field_settings_for_project(project_gid, opts)\n for data in api_response:\n pprint(data)\nexcept ApiException as e:\n print(\"Exception when calling CustomFieldSettingsApi->get_custom_field_settings_for_project: %s\\n\" % e)",
"name": "python-sdk-v5"
},
{
"language": "python",
"install": "pip install asana==3.2.3",
"code": "import asana\n\nclient = asana.Client.access_token('PERSONAL_ACCESS_TOKEN')\n\nresult = client.custom_field_settings.get_custom_field_settings_for_project(project_gid, {'param': 'value', 'param': 'value'}, opt_pretty=True)",
"name": "python-sdk-v3"
},
{
"language": "php",
"install": "composer require asana/asana",
"code": "<?php\nrequire 'vendor/autoload.php';\n\n$client = Asana\\Client::accessToken('PERSONAL_ACCESS_TOKEN');\n\n$result = $client->customfieldsettings->getCustomFieldSettingsForProject($project_gid, array('param' => 'value', 'param' => 'value'), array('opt_pretty' => 'true'))"
},
{
"language": "ruby",
"install": "gem install asana",
"code": "require 'asana'\n\nclient = Asana::Client.new do |c|\n c.authentication :access_token, 'PERSONAL_ACCESS_TOKEN'\nend\n\nresult = client.custom_field_settings.get_custom_field_settings_for_project(project_gid: 'project_gid', param: \"value\", param: \"value\", options: {pretty: true})"
}
]
},
"x-purple-suite-runtime": "unavailable"
}
GET /api/1.0/portfolios/{portfolio_gid}/custom_field_settings
Get a portfolio's custom fields
<b>Required scope: </b><code>portfolios:read</code>
Returns a list of all of the custom fields settings on a portfolio, in compact form.
This operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.
Authentication
[
{
"personalAccessToken": []
},
{
"oauth2": [
"portfolios:read"
]
}
]
Path-level parameters and metadata
{
"parameters": [
{
"$ref": "#/components/parameters/portfolio_path_gid"
},
{
"$ref": "#/components/parameters/pretty"
},
{
"$ref": "#/components/parameters/limit"
},
{
"$ref": "#/components/parameters/offset"
}
]
}
Request, responses and operation details
{
"summary": "Get a portfolio's custom fields",
"description": "<b>Required scope: </b><code>portfolios:read</code>\n\nReturns a list of all of the custom fields settings on a portfolio, in compact form.\n\nThis operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.",
"tags": [
"Custom field settings"
],
"operationId": "getCustomFieldSettingsForPortfolio",
"parameters": [
{
"name": "opt_fields",
"in": "query",
"description": "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. Properties can include nested fields. To learn more, see the [input/output options guide](/docs/inputoutput-options#selecting-nested-fields).",
"required": false,
"example": [
"custom_field",
"custom_field.asana_created_field",
"custom_field.created_by",
"custom_field.created_by.name",
"custom_field.currency_code",
"custom_field.custom_label",
"custom_field.custom_label_position",
"custom_field.date_value",
"custom_field.date_value.date",
"custom_field.date_value.date_time",
"custom_field.default_access_level",
"custom_field.description",
"custom_field.display_value",
"custom_field.enabled",
"custom_field.enum_options",
"custom_field.enum_options.color",
"custom_field.enum_options.enabled",
"custom_field.enum_options.name",
"custom_field.enum_value",
"custom_field.enum_value.color",
"custom_field.enum_value.enabled",
"custom_field.enum_value.name",
"custom_field.format",
"custom_field.has_notifications_enabled",
"custom_field.html_text_value",
"custom_field.id_prefix",
"custom_field.input_restrictions",
"custom_field.is_formula_field",
"custom_field.is_global_to_workspace",
"custom_field.is_value_read_only",
"custom_field.multi_enum_values",
"custom_field.multi_enum_values.color",
"custom_field.multi_enum_values.enabled",
"custom_field.multi_enum_values.name",
"custom_field.name",
"custom_field.number_value",
"custom_field.people_value",
"custom_field.people_value.name",
"custom_field.precision",
"custom_field.privacy_setting",
"custom_field.reference_value",
"custom_field.reference_value.name",
"custom_field.representation_type",
"custom_field.resource_subtype",
"custom_field.text_value",
"custom_field.type",
"is_important",
"offset",
"parent",
"parent.name",
"parent.resource_subtype",
"path",
"project",
"project.name",
"project.resource_subtype",
"uri"
],
"schema": {
"type": "array",
"items": {
"type": "string",
"enum": [
"custom_field",
"custom_field.asana_created_field",
"custom_field.created_by",
"custom_field.created_by.name",
"custom_field.currency_code",
"custom_field.custom_label",
"custom_field.custom_label_position",
"custom_field.date_value",
"custom_field.date_value.date",
"custom_field.date_value.date_time",
"custom_field.default_access_level",
"custom_field.description",
"custom_field.display_value",
"custom_field.enabled",
"custom_field.enum_options",
"custom_field.enum_options.color",
"custom_field.enum_options.enabled",
"custom_field.enum_options.name",
"custom_field.enum_value",
"custom_field.enum_value.color",
"custom_field.enum_value.enabled",
"custom_field.enum_value.name",
"custom_field.format",
"custom_field.has_notifications_enabled",
"custom_field.html_text_value",
"custom_field.id_prefix",
"custom_field.input_restrictions",
"custom_field.is_formula_field",
"custom_field.is_global_to_workspace",
"custom_field.is_value_read_only",
"custom_field.multi_enum_values",
"custom_field.multi_enum_values.color",
"custom_field.multi_enum_values.enabled",
"custom_field.multi_enum_values.name",
"custom_field.name",
"custom_field.number_value",
"custom_field.people_value",
"custom_field.people_value.name",
"custom_field.precision",
"custom_field.privacy_setting",
"custom_field.reference_value",
"custom_field.reference_value.name",
"custom_field.representation_type",
"custom_field.resource_subtype",
"custom_field.text_value",
"custom_field.type",
"is_important",
"offset",
"parent",
"parent.name",
"parent.resource_subtype",
"path",
"project",
"project.name",
"project.resource_subtype",
"uri"
]
}
},
"style": "form",
"explode": false
}
],
"responses": {
"200": {
"description": "Successfully retrieved custom field settings objects for a portfolio.",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"type": "array",
"items": {
"$ref": "#/components/schemas/CustomFieldSettingResponse"
}
},
"next_page": {
"$ref": "#/components/schemas/NextPage"
}
}
}
}
}
},
"400": {
"$ref": "#/components/responses/BadRequest"
},
"401": {
"$ref": "#/components/responses/Unauthorized"
},
"403": {
"$ref": "#/components/responses/Forbidden"
},
"404": {
"$ref": "#/components/responses/NotFound"
},
"500": {
"$ref": "#/components/responses/InternalServerError"
}
},
"security": [
{
"personalAccessToken": []
},
{
"oauth2": [
"portfolios:read"
]
}
],
"x-readme": {
"code-samples": [
{
"language": "java",
"install": "<dependency><groupId>com.asana</groupId><artifactId>asana</artifactId><version>1.0.0</version></dependency>",
"code": "import com.asana.Client;\n\nClient client = Client.accessToken(\"PERSONAL_ACCESS_TOKEN\");\n\nList<CustomFieldSetting> result = client.customfieldsettings.getCustomFieldSettingsForPortfolio(portfolioGid)\n .option(\"pretty\", true)\n .execute();"
},
{
"language": "node",
"install": "npm install asana",
"code": "const Asana = require('asana');\n\nlet client = new Asana.ApiClient();\nclient.authentications.token.accessToken = '<YOUR_ACCESS_TOKEN>';\n\nlet customFieldSettingsApiInstance = new Asana.CustomFieldSettingsApi(client);\nlet portfolio_gid = \"12345\"; // String | Globally unique identifier for the portfolio.\nlet opts = { \n 'limit': 50, \n 'offset': \"eyJ0eXAiOJiKV1iQLCJhbGciOiJIUzI1NiJ9\", \n 'opt_fields': \"custom_field,custom_field.asana_created_field,custom_field.created_by,custom_field.created_by.name,custom_field.currency_code,custom_field.custom_label,custom_field.custom_label_position,custom_field.date_value,custom_field.date_value.date,custom_field.date_value.date_time,custom_field.default_access_level,custom_field.description,custom_field.display_value,custom_field.enabled,custom_field.enum_options,custom_field.enum_options.color,custom_field.enum_options.enabled,custom_field.enum_options.name,custom_field.enum_value,custom_field.enum_value.color,custom_field.enum_value.enabled,custom_field.enum_value.name,custom_field.format,custom_field.has_notifications_enabled,custom_field.html_text_value,custom_field.id_prefix,custom_field.input_restrictions,custom_field.is_formula_field,custom_field.is_global_to_workspace,custom_field.is_value_read_only,custom_field.multi_enum_values,custom_field.multi_enum_values.color,custom_field.multi_enum_values.enabled,custom_field.multi_enum_values.name,custom_field.name,custom_field.number_value,custom_field.people_value,custom_field.people_value.name,custom_field.precision,custom_field.privacy_setting,custom_field.reference_value,custom_field.reference_value.name,custom_field.representation_type,custom_field.resource_subtype,custom_field.text_value,custom_field.type,is_important,offset,parent,parent.name,parent.resource_subtype,path,project,project.name,project.resource_subtype,uri\"\n};\ncustomFieldSettingsApiInstance.getCustomFieldSettingsForPortfolio(portfolio_gid, opts).then((result) => {\n console.log('API called successfully. Returned data: ' + JSON.stringify(result.data, null, 2));\n}, (error) => {\n console.error(error.response.body);\n});",
"name": "node-sdk-v3"
},
{
"language": "node",
"install": "npm install asana@1.0.5",
"code": "const asana = require('asana');\n\nconst client = asana.Client.create().useAccessToken('PERSONAL_ACCESS_TOKEN');\n\nclient.customfieldsettings.getCustomFieldSettingsForPortfolio(portfolioGid, {param: \"value\", param: \"value\", opt_pretty: true})\n .then((result) => {\n console.log(result);\n });",
"name": "node-sdk-v1"
},
{
"language": "python",
"install": "pip install asana",
"code": "import asana\nfrom asana.rest import ApiException\nfrom pprint import pprint\n\nconfiguration = asana.Configuration()\nconfiguration.access_token = '<YOUR_ACCESS_TOKEN>'\napi_client = asana.ApiClient(configuration)\n\n# create an instance of the API class\ncustom_field_settings_api_instance = asana.CustomFieldSettingsApi(api_client)\nportfolio_gid = \"12345\" # str | Globally unique identifier for the portfolio.\nopts = {\n 'limit': 50, # int | Results per page. The number of objects to return per page. The value must be between 1 and 100.\n 'offset': \"eyJ0eXAiOJiKV1iQLCJhbGciOiJIUzI1NiJ9\", # str | 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.*\n 'opt_fields': \"custom_field,custom_field.asana_created_field,custom_field.created_by,custom_field.created_by.name,custom_field.currency_code,custom_field.custom_label,custom_field.custom_label_position,custom_field.date_value,custom_field.date_value.date,custom_field.date_value.date_time,custom_field.default_access_level,custom_field.description,custom_field.display_value,custom_field.enabled,custom_field.enum_options,custom_field.enum_options.color,custom_field.enum_options.enabled,custom_field.enum_options.name,custom_field.enum_value,custom_field.enum_value.color,custom_field.enum_value.enabled,custom_field.enum_value.name,custom_field.format,custom_field.has_notifications_enabled,custom_field.html_text_value,custom_field.id_prefix,custom_field.input_restrictions,custom_field.is_formula_field,custom_field.is_global_to_workspace,custom_field.is_value_read_only,custom_field.multi_enum_values,custom_field.multi_enum_values.color,custom_field.multi_enum_values.enabled,custom_field.multi_enum_values.name,custom_field.name,custom_field.number_value,custom_field.people_value,custom_field.people_value.name,custom_field.precision,custom_field.privacy_setting,custom_field.reference_value,custom_field.reference_value.name,custom_field.representation_type,custom_field.resource_subtype,custom_field.text_value,custom_field.type,is_important,offset,parent,parent.name,parent.resource_subtype,path,project,project.name,project.resource_subtype,uri\", # list[str] | 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.\n}\n\ntry:\n # Get a portfolio's custom fields\n api_response = custom_field_settings_api_instance.get_custom_field_settings_for_portfolio(portfolio_gid, opts)\n for data in api_response:\n pprint(data)\nexcept ApiException as e:\n print(\"Exception when calling CustomFieldSettingsApi->get_custom_field_settings_for_portfolio: %s\\n\" % e)",
"name": "python-sdk-v5"
},
{
"language": "python",
"install": "pip install asana==3.2.3",
"code": "import asana\n\nclient = asana.Client.access_token('PERSONAL_ACCESS_TOKEN')\n\nresult = client.custom_field_settings.get_custom_field_settings_for_portfolio(portfolio_gid, {'param': 'value', 'param': 'value'}, opt_pretty=True)",
"name": "python-sdk-v3"
},
{
"language": "php",
"install": "composer require asana/asana",
"code": "<?php\nrequire 'vendor/autoload.php';\n\n$client = Asana\\Client::accessToken('PERSONAL_ACCESS_TOKEN');\n\n$result = $client->customfieldsettings->getCustomFieldSettingsForPortfolio($portfolio_gid, array('param' => 'value', 'param' => 'value'), array('opt_pretty' => 'true'))"
},
{
"language": "ruby",
"install": "gem install asana",
"code": "require 'asana'\n\nclient = Asana::Client.new do |c|\n c.authentication :access_token, 'PERSONAL_ACCESS_TOKEN'\nend\n\nresult = client.custom_field_settings.get_custom_field_settings_for_portfolio(portfolio_gid: 'portfolio_gid', param: \"value\", param: \"value\", options: {pretty: true})"
}
]
},
"x-purple-suite-runtime": "unavailable"
}
GET /api/1.0/goals/{goal_gid}/custom_field_settings
Get a goal's custom fields
<b>Required scope: </b><code>goals:read</code>
Returns a list of all of the custom fields settings on a goal, in compact form. Note that, as in all queries to collections which return compact representation, `opt_fields` can be used to include more data than is returned in the compact representation. See the [documentation for input/output options](https://developers.asana.com/docs/inputoutput-options) for more information.
This operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.
Authentication
[
{
"personalAccessToken": []
},
{
"oauth2": [
"goals:read"
]
}
]
Path-level parameters and metadata
{
"parameters": [
{
"$ref": "#/components/parameters/goal_path_gid"
},
{
"$ref": "#/components/parameters/pretty"
},
{
"$ref": "#/components/parameters/limit"
},
{
"$ref": "#/components/parameters/offset"
}
]
}
Request, responses and operation details
{
"summary": "Get a goal's custom fields",
"description": "<b>Required scope: </b><code>goals:read</code>\n\nReturns a list of all of the custom fields settings on a goal, in compact form. Note that, as in all queries to collections which return compact representation, `opt_fields` can be used to include more data than is returned in the compact representation. See the [documentation for input/output options](https://developers.asana.com/docs/inputoutput-options) for more information.\n\nThis operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.",
"tags": [
"Custom field settings"
],
"operationId": "getCustomFieldSettingsForGoal",
"parameters": [
{
"name": "opt_fields",
"in": "query",
"description": "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. Properties can include nested fields. To learn more, see the [input/output options guide](/docs/inputoutput-options#selecting-nested-fields).",
"required": false,
"example": [
"custom_field",
"custom_field.asana_created_field",
"custom_field.created_by",
"custom_field.created_by.name",
"custom_field.currency_code",
"custom_field.custom_label",
"custom_field.custom_label_position",
"custom_field.date_value",
"custom_field.date_value.date",
"custom_field.date_value.date_time",
"custom_field.default_access_level",
"custom_field.description",
"custom_field.display_value",
"custom_field.enabled",
"custom_field.enum_options",
"custom_field.enum_options.color",
"custom_field.enum_options.enabled",
"custom_field.enum_options.name",
"custom_field.enum_value",
"custom_field.enum_value.color",
"custom_field.enum_value.enabled",
"custom_field.enum_value.name",
"custom_field.format",
"custom_field.has_notifications_enabled",
"custom_field.html_text_value",
"custom_field.id_prefix",
"custom_field.input_restrictions",
"custom_field.is_formula_field",
"custom_field.is_global_to_workspace",
"custom_field.is_value_read_only",
"custom_field.multi_enum_values",
"custom_field.multi_enum_values.color",
"custom_field.multi_enum_values.enabled",
"custom_field.multi_enum_values.name",
"custom_field.name",
"custom_field.number_value",
"custom_field.people_value",
"custom_field.people_value.name",
"custom_field.precision",
"custom_field.privacy_setting",
"custom_field.reference_value",
"custom_field.reference_value.name",
"custom_field.representation_type",
"custom_field.resource_subtype",
"custom_field.text_value",
"custom_field.type",
"is_important",
"offset",
"parent",
"parent.name",
"parent.resource_subtype",
"path",
"project",
"project.name",
"project.resource_subtype",
"uri"
],
"schema": {
"type": "array",
"items": {
"type": "string",
"enum": [
"custom_field",
"custom_field.asana_created_field",
"custom_field.created_by",
"custom_field.created_by.name",
"custom_field.currency_code",
"custom_field.custom_label",
"custom_field.custom_label_position",
"custom_field.date_value",
"custom_field.date_value.date",
"custom_field.date_value.date_time",
"custom_field.default_access_level",
"custom_field.description",
"custom_field.display_value",
"custom_field.enabled",
"custom_field.enum_options",
"custom_field.enum_options.color",
"custom_field.enum_options.enabled",
"custom_field.enum_options.name",
"custom_field.enum_value",
"custom_field.enum_value.color",
"custom_field.enum_value.enabled",
"custom_field.enum_value.name",
"custom_field.format",
"custom_field.has_notifications_enabled",
"custom_field.html_text_value",
"custom_field.id_prefix",
"custom_field.input_restrictions",
"custom_field.is_formula_field",
"custom_field.is_global_to_workspace",
"custom_field.is_value_read_only",
"custom_field.multi_enum_values",
"custom_field.multi_enum_values.color",
"custom_field.multi_enum_values.enabled",
"custom_field.multi_enum_values.name",
"custom_field.name",
"custom_field.number_value",
"custom_field.people_value",
"custom_field.people_value.name",
"custom_field.precision",
"custom_field.privacy_setting",
"custom_field.reference_value",
"custom_field.reference_value.name",
"custom_field.representation_type",
"custom_field.resource_subtype",
"custom_field.text_value",
"custom_field.type",
"is_important",
"offset",
"parent",
"parent.name",
"parent.resource_subtype",
"path",
"project",
"project.name",
"project.resource_subtype",
"uri"
]
}
},
"style": "form",
"explode": false
}
],
"responses": {
"200": {
"description": "Successfully retrieved custom field settings objects for a goal.",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"type": "array",
"items": {
"$ref": "#/components/schemas/CustomFieldSettingResponse"
}
},
"next_page": {
"$ref": "#/components/schemas/NextPage"
}
}
}
}
}
},
"400": {
"$ref": "#/components/responses/BadRequest"
},
"401": {
"$ref": "#/components/responses/Unauthorized"
},
"403": {
"$ref": "#/components/responses/Forbidden"
},
"404": {
"$ref": "#/components/responses/NotFound"
},
"500": {
"$ref": "#/components/responses/InternalServerError"
}
},
"security": [
{
"personalAccessToken": []
},
{
"oauth2": [
"goals:read"
]
}
],
"x-readme": {
"code-samples": [
{
"language": "node",
"install": "npm install asana",
"code": "const Asana = require('asana');\n\nlet client = new Asana.ApiClient();\nclient.authentications.token.accessToken = '<YOUR_ACCESS_TOKEN>';\n\nlet customFieldSettingsApiInstance = new Asana.CustomFieldSettingsApi(client);\nlet goal_gid = \"12345\"; // String | Globally unique identifier for the goal.\nlet opts = { \n 'limit': 50, \n 'offset': \"eyJ0eXAiOJiKV1iQLCJhbGciOiJIUzI1NiJ9\", \n 'opt_fields': \"custom_field,custom_field.asana_created_field,custom_field.created_by,custom_field.created_by.name,custom_field.currency_code,custom_field.custom_label,custom_field.custom_label_position,custom_field.date_value,custom_field.date_value.date,custom_field.date_value.date_time,custom_field.default_access_level,custom_field.description,custom_field.display_value,custom_field.enabled,custom_field.enum_options,custom_field.enum_options.color,custom_field.enum_options.enabled,custom_field.enum_options.name,custom_field.enum_value,custom_field.enum_value.color,custom_field.enum_value.enabled,custom_field.enum_value.name,custom_field.format,custom_field.has_notifications_enabled,custom_field.html_text_value,custom_field.id_prefix,custom_field.input_restrictions,custom_field.is_formula_field,custom_field.is_global_to_workspace,custom_field.is_value_read_only,custom_field.multi_enum_values,custom_field.multi_enum_values.color,custom_field.multi_enum_values.enabled,custom_field.multi_enum_values.name,custom_field.name,custom_field.number_value,custom_field.people_value,custom_field.people_value.name,custom_field.precision,custom_field.privacy_setting,custom_field.reference_value,custom_field.reference_value.name,custom_field.representation_type,custom_field.resource_subtype,custom_field.text_value,custom_field.type,is_important,offset,parent,parent.name,parent.resource_subtype,path,project,project.name,project.resource_subtype,uri\"\n};\ncustomFieldSettingsApiInstance.getCustomFieldSettingsForGoal(goal_gid, opts).then((result) => {\n console.log('API called successfully. Returned data: ' + JSON.stringify(result.data, null, 2));\n}, (error) => {\n console.error(error.response.body);\n});",
"name": "node-sdk-v3"
},
{
"language": "python",
"install": "pip install asana",
"code": "import asana\nfrom asana.rest import ApiException\nfrom pprint import pprint\n\nconfiguration = asana.Configuration()\nconfiguration.access_token = '<YOUR_ACCESS_TOKEN>'\napi_client = asana.ApiClient(configuration)\n\n# create an instance of the API class\ncustom_field_settings_api_instance = asana.CustomFieldSettingsApi(api_client)\ngoal_gid = \"12345\" # str | Globally unique identifier for the goal.\nopts = {\n 'limit': 50, # int | Results per page. The number of objects to return per page. The value must be between 1 and 100.\n 'offset': \"eyJ0eXAiOJiKV1iQLCJhbGciOiJIUzI1NiJ9\", # str | 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.*\n 'opt_fields': \"custom_field,custom_field.asana_created_field,custom_field.created_by,custom_field.created_by.name,custom_field.currency_code,custom_field.custom_label,custom_field.custom_label_position,custom_field.date_value,custom_field.date_value.date,custom_field.date_value.date_time,custom_field.default_access_level,custom_field.description,custom_field.display_value,custom_field.enabled,custom_field.enum_options,custom_field.enum_options.color,custom_field.enum_options.enabled,custom_field.enum_options.name,custom_field.enum_value,custom_field.enum_value.color,custom_field.enum_value.enabled,custom_field.enum_value.name,custom_field.format,custom_field.has_notifications_enabled,custom_field.html_text_value,custom_field.id_prefix,custom_field.input_restrictions,custom_field.is_formula_field,custom_field.is_global_to_workspace,custom_field.is_value_read_only,custom_field.multi_enum_values,custom_field.multi_enum_values.color,custom_field.multi_enum_values.enabled,custom_field.multi_enum_values.name,custom_field.name,custom_field.number_value,custom_field.people_value,custom_field.people_value.name,custom_field.precision,custom_field.privacy_setting,custom_field.reference_value,custom_field.reference_value.name,custom_field.representation_type,custom_field.resource_subtype,custom_field.text_value,custom_field.type,is_important,offset,parent,parent.name,parent.resource_subtype,path,project,project.name,project.resource_subtype,uri\", # list[str] | 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.\n}\n\ntry:\n # Get a goal's custom fields\n api_response = custom_field_settings_api_instance.get_custom_field_settings_for_goal(goal_gid, opts)\n for data in api_response:\n pprint(data)\nexcept ApiException as e:\n print(\"Exception when calling CustomFieldSettingsApi->get_custom_field_settings_for_goal: %s\\n\" % e)",
"name": "python-sdk-v5"
}
]
},
"x-purple-suite-runtime": "unavailable"
}
GET /api/1.0/teams/{team_gid}/custom_field_settings
Get a team's custom fields
<b>Required scope: </b><code>teams:read</code>
Returns a list of all of the custom fields settings on a team, in compact form. Note that, as in all queries to collections which return compact representation, `opt_fields` can be used to include more data than is returned in the compact representation. See the [documentation for input/output options](https://developers.asana.com/docs/inputoutput-options) for more information.
This operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.
Authentication
[
{
"personalAccessToken": []
},
{
"oauth2": [
"teams:read"
]
}
]
Path-level parameters and metadata
{
"parameters": [
{
"$ref": "#/components/parameters/team_path_gid"
},
{
"$ref": "#/components/parameters/pretty"
}
]
}
Request, responses and operation details
{
"summary": "Get a team's custom fields",
"description": "<b>Required scope: </b><code>teams:read</code>\n\nReturns a list of all of the custom fields settings on a team, in compact form. Note that, as in all queries to collections which return compact representation, `opt_fields` can be used to include more data than is returned in the compact representation. See the [documentation for input/output options](https://developers.asana.com/docs/inputoutput-options) for more information.\n\nThis operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.",
"tags": [
"Custom field settings"
],
"operationId": "getCustomFieldSettingsForTeam",
"parameters": [
{
"name": "opt_fields",
"in": "query",
"description": "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. Properties can include nested fields. To learn more, see the [input/output options guide](/docs/inputoutput-options#selecting-nested-fields).",
"required": false,
"example": [
"custom_field",
"custom_field.asana_created_field",
"custom_field.created_by",
"custom_field.created_by.name",
"custom_field.currency_code",
"custom_field.custom_label",
"custom_field.custom_label_position",
"custom_field.date_value",
"custom_field.date_value.date",
"custom_field.date_value.date_time",
"custom_field.default_access_level",
"custom_field.description",
"custom_field.display_value",
"custom_field.enabled",
"custom_field.enum_options",
"custom_field.enum_options.color",
"custom_field.enum_options.enabled",
"custom_field.enum_options.name",
"custom_field.enum_value",
"custom_field.enum_value.color",
"custom_field.enum_value.enabled",
"custom_field.enum_value.name",
"custom_field.format",
"custom_field.has_notifications_enabled",
"custom_field.html_text_value",
"custom_field.id_prefix",
"custom_field.input_restrictions",
"custom_field.is_formula_field",
"custom_field.is_global_to_workspace",
"custom_field.is_value_read_only",
"custom_field.multi_enum_values",
"custom_field.multi_enum_values.color",
"custom_field.multi_enum_values.enabled",
"custom_field.multi_enum_values.name",
"custom_field.name",
"custom_field.number_value",
"custom_field.people_value",
"custom_field.people_value.name",
"custom_field.precision",
"custom_field.privacy_setting",
"custom_field.reference_value",
"custom_field.reference_value.name",
"custom_field.representation_type",
"custom_field.resource_subtype",
"custom_field.text_value",
"custom_field.type",
"is_important",
"parent",
"parent.name",
"parent.resource_subtype",
"project",
"project.name",
"project.resource_subtype"
],
"schema": {
"type": "array",
"items": {
"type": "string",
"enum": [
"custom_field",
"custom_field.asana_created_field",
"custom_field.created_by",
"custom_field.created_by.name",
"custom_field.currency_code",
"custom_field.custom_label",
"custom_field.custom_label_position",
"custom_field.date_value",
"custom_field.date_value.date",
"custom_field.date_value.date_time",
"custom_field.default_access_level",
"custom_field.description",
"custom_field.display_value",
"custom_field.enabled",
"custom_field.enum_options",
"custom_field.enum_options.color",
"custom_field.enum_options.enabled",
"custom_field.enum_options.name",
"custom_field.enum_value",
"custom_field.enum_value.color",
"custom_field.enum_value.enabled",
"custom_field.enum_value.name",
"custom_field.format",
"custom_field.has_notifications_enabled",
"custom_field.html_text_value",
"custom_field.id_prefix",
"custom_field.input_restrictions",
"custom_field.is_formula_field",
"custom_field.is_global_to_workspace",
"custom_field.is_value_read_only",
"custom_field.multi_enum_values",
"custom_field.multi_enum_values.color",
"custom_field.multi_enum_values.enabled",
"custom_field.multi_enum_values.name",
"custom_field.name",
"custom_field.number_value",
"custom_field.people_value",
"custom_field.people_value.name",
"custom_field.precision",
"custom_field.privacy_setting",
"custom_field.reference_value",
"custom_field.reference_value.name",
"custom_field.representation_type",
"custom_field.resource_subtype",
"custom_field.text_value",
"custom_field.type",
"is_important",
"parent",
"parent.name",
"parent.resource_subtype",
"project",
"project.name",
"project.resource_subtype"
]
}
},
"style": "form",
"explode": false
}
],
"responses": {
"200": {
"description": "Successfully retrieved custom field settings objects for a team.",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"type": "array",
"items": {
"$ref": "#/components/schemas/CustomFieldSettingResponse"
}
}
}
}
}
}
},
"400": {
"$ref": "#/components/responses/BadRequest"
},
"401": {
"$ref": "#/components/responses/Unauthorized"
},
"403": {
"$ref": "#/components/responses/Forbidden"
},
"404": {
"$ref": "#/components/responses/NotFound"
},
"500": {
"$ref": "#/components/responses/InternalServerError"
}
},
"security": [
{
"personalAccessToken": []
},
{
"oauth2": [
"teams:read"
]
}
],
"x-readme": {
"code-samples": [
{
"language": "node",
"install": "npm install asana",
"code": "const Asana = require('asana');\n\nlet client = new Asana.ApiClient();\nclient.authentications.token.accessToken = '<YOUR_ACCESS_TOKEN>';\n\nlet customFieldSettingsApiInstance = new Asana.CustomFieldSettingsApi(client);\nlet team_gid = \"159874\"; // String | Globally unique identifier for the team.\nlet opts = { \n 'opt_fields': \"custom_field,custom_field.asana_created_field,custom_field.created_by,custom_field.created_by.name,custom_field.currency_code,custom_field.custom_label,custom_field.custom_label_position,custom_field.date_value,custom_field.date_value.date,custom_field.date_value.date_time,custom_field.default_access_level,custom_field.description,custom_field.display_value,custom_field.enabled,custom_field.enum_options,custom_field.enum_options.color,custom_field.enum_options.enabled,custom_field.enum_options.name,custom_field.enum_value,custom_field.enum_value.color,custom_field.enum_value.enabled,custom_field.enum_value.name,custom_field.format,custom_field.has_notifications_enabled,custom_field.html_text_value,custom_field.id_prefix,custom_field.input_restrictions,custom_field.is_formula_field,custom_field.is_global_to_workspace,custom_field.is_value_read_only,custom_field.multi_enum_values,custom_field.multi_enum_values.color,custom_field.multi_enum_values.enabled,custom_field.multi_enum_values.name,custom_field.name,custom_field.number_value,custom_field.people_value,custom_field.people_value.name,custom_field.precision,custom_field.privacy_setting,custom_field.reference_value,custom_field.reference_value.name,custom_field.representation_type,custom_field.resource_subtype,custom_field.text_value,custom_field.type,is_important,parent,parent.name,parent.resource_subtype,project,project.name,project.resource_subtype\"\n};\ncustomFieldSettingsApiInstance.getCustomFieldSettingsForTeam(team_gid, opts).then((result) => {\n console.log('API called successfully. Returned data: ' + JSON.stringify(result.data, null, 2));\n}, (error) => {\n console.error(error.response.body);\n});",
"name": "node-sdk-v3"
},
{
"language": "python",
"install": "pip install asana",
"code": "import asana\nfrom asana.rest import ApiException\nfrom pprint import pprint\n\nconfiguration = asana.Configuration()\nconfiguration.access_token = '<YOUR_ACCESS_TOKEN>'\napi_client = asana.ApiClient(configuration)\n\n# create an instance of the API class\ncustom_field_settings_api_instance = asana.CustomFieldSettingsApi(api_client)\nteam_gid = \"159874\" # str | Globally unique identifier for the team.\nopts = {\n 'opt_fields': \"custom_field,custom_field.asana_created_field,custom_field.created_by,custom_field.created_by.name,custom_field.currency_code,custom_field.custom_label,custom_field.custom_label_position,custom_field.date_value,custom_field.date_value.date,custom_field.date_value.date_time,custom_field.default_access_level,custom_field.description,custom_field.display_value,custom_field.enabled,custom_field.enum_options,custom_field.enum_options.color,custom_field.enum_options.enabled,custom_field.enum_options.name,custom_field.enum_value,custom_field.enum_value.color,custom_field.enum_value.enabled,custom_field.enum_value.name,custom_field.format,custom_field.has_notifications_enabled,custom_field.html_text_value,custom_field.id_prefix,custom_field.input_restrictions,custom_field.is_formula_field,custom_field.is_global_to_workspace,custom_field.is_value_read_only,custom_field.multi_enum_values,custom_field.multi_enum_values.color,custom_field.multi_enum_values.enabled,custom_field.multi_enum_values.name,custom_field.name,custom_field.number_value,custom_field.people_value,custom_field.people_value.name,custom_field.precision,custom_field.privacy_setting,custom_field.reference_value,custom_field.reference_value.name,custom_field.representation_type,custom_field.resource_subtype,custom_field.text_value,custom_field.type,is_important,parent,parent.name,parent.resource_subtype,project,project.name,project.resource_subtype\", # list[str] | 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.\n}\n\ntry:\n # Get a team's custom fields\n api_response = custom_field_settings_api_instance.get_custom_field_settings_for_team(team_gid, opts)\n for data in api_response:\n pprint(data)\nexcept ApiException as e:\n print(\"Exception when calling CustomFieldSettingsApi->get_custom_field_settings_for_team: %s\\n\" % e)",
"name": "python-sdk-v5"
}
]
},
"x-purple-suite-runtime": "unavailable"
}
POST /api/1.0/custom_fields
Create a custom field
<b>Required scope: </b><code>custom_fields:write</code>
Creates a new custom field in a workspace. Every custom field is required
to be created in a specific workspace, and this workspace cannot be
changed once set.
A custom field’s name must be unique within a workspace and not conflict
with names of existing task properties such as `Due Date` or `Assignee`.
A custom field’s type must be one of `text`, `enum`, `multi_enum`, `number`,
`date`, or `people`.
Returns the full record of the newly created custom field.
This operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.
Authentication
[
{
"personalAccessToken": []
},
{
"oauth2": [
"custom_fields:write"
]
}
]
Path-level parameters and metadata
{
"parameters": [
{
"$ref": "#/components/parameters/pretty"
}
]
}
Request, responses and operation details
{
"summary": "Create a custom field",
"description": "<b>Required scope: </b><code>custom_fields:write</code>\n\nCreates a new custom field in a workspace. Every custom field is required\nto be created in a specific workspace, and this workspace cannot be\nchanged once set.\n\nA custom field’s name must be unique within a workspace and not conflict\nwith names of existing task properties such as `Due Date` or `Assignee`.\nA custom field’s type must be one of `text`, `enum`, `multi_enum`, `number`,\n`date`, or `people`.\n\nReturns the full record of the newly created custom field.\n\nThis operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.",
"tags": [
"Custom fields"
],
"operationId": "createCustomField",
"parameters": [
{
"name": "opt_fields",
"in": "query",
"description": "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. Properties can include nested fields. To learn more, see the [input/output options guide](/docs/inputoutput-options#selecting-nested-fields).",
"required": false,
"example": [
"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",
"html_text_value",
"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",
"people_value",
"people_value.name",
"precision",
"privacy_setting",
"reference_value",
"reference_value.name",
"representation_type",
"resource_subtype",
"text_value",
"type"
],
"schema": {
"type": "array",
"items": {
"type": "string",
"enum": [
"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",
"html_text_value",
"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",
"people_value",
"people_value.name",
"precision",
"privacy_setting",
"reference_value",
"reference_value.name",
"representation_type",
"resource_subtype",
"text_value",
"type"
]
}
},
"style": "form",
"explode": false
}
],
"requestBody": {
"description": "The custom field object to create.",
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"$ref": "#/components/schemas/CustomFieldCreateRequest"
}
}
}
}
}
},
"responses": {
"201": {
"description": "Custom field successfully created.",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"$ref": "#/components/schemas/CustomFieldResponse"
}
}
}
}
}
},
"400": {
"$ref": "#/components/responses/BadRequest"
},
"401": {
"$ref": "#/components/responses/Unauthorized"
},
"403": {
"$ref": "#/components/responses/Forbidden"
},
"404": {
"$ref": "#/components/responses/NotFound"
},
"500": {
"$ref": "#/components/responses/InternalServerError"
}
},
"security": [
{
"personalAccessToken": []
},
{
"oauth2": [
"custom_fields:write"
]
}
],
"x-readme": {
"code-samples": [
{
"language": "java",
"install": "<dependency><groupId>com.asana</groupId><artifactId>asana</artifactId><version>1.0.0</version></dependency>",
"code": "import com.asana.Client;\n\nClient client = Client.accessToken(\"PERSONAL_ACCESS_TOKEN\");\n\nCustomField result = client.customfields.createCustomField()\n .data(\"field\", \"value\")\n .data(\"field\", \"value\")\n .option(\"pretty\", true)\n .execute();"
},
{
"language": "node",
"install": "npm install asana",
"code": "const Asana = require('asana');\n\nlet client = new Asana.ApiClient();\nclient.authentications.token.accessToken = '<YOUR_ACCESS_TOKEN>';\n\nlet customFieldsApiInstance = new Asana.CustomFieldsApi(client);\nlet body = {\"data\": {\"<PARAM_1>\": \"<VALUE_1>\", \"<PARAM_2>\": \"<VALUE_2>\",}}; // Object | The custom field object to create.\nlet opts = { \n 'opt_fields': \"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,html_text_value,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,people_value,people_value.name,precision,privacy_setting,reference_value,reference_value.name,representation_type,resource_subtype,text_value,type\"\n};\ncustomFieldsApiInstance.createCustomField(body, opts).then((result) => {\n console.log('API called successfully. Returned data: ' + JSON.stringify(result.data, null, 2));\n}, (error) => {\n console.error(error.response.body);\n});",
"name": "node-sdk-v3"
},
{
"language": "node",
"install": "npm install asana@1.0.5",
"code": "const asana = require('asana');\n\nconst client = asana.Client.create().useAccessToken('PERSONAL_ACCESS_TOKEN');\n\nclient.customfields.createCustomField({field: \"value\", field: \"value\", pretty: true})\n .then((result) => {\n console.log(result);\n });",
"name": "node-sdk-v1"
},
{
"language": "python",
"install": "pip install asana",
"code": "import asana\nfrom asana.rest import ApiException\nfrom pprint import pprint\n\nconfiguration = asana.Configuration()\nconfiguration.access_token = '<YOUR_ACCESS_TOKEN>'\napi_client = asana.ApiClient(configuration)\n\n# create an instance of the API class\ncustom_fields_api_instance = asana.CustomFieldsApi(api_client)\nbody = {\"data\": {\"<PARAM_1>\": \"<VALUE_1>\", \"<PARAM_2>\": \"<VALUE_2>\",}} # dict | The custom field object to create.\nopts = {\n 'opt_fields': \"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,html_text_value,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,people_value,people_value.name,precision,privacy_setting,reference_value,reference_value.name,representation_type,resource_subtype,text_value,type\", # list[str] | 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.\n}\n\ntry:\n # Create a custom field\n api_response = custom_fields_api_instance.create_custom_field(body, opts)\n pprint(api_response)\nexcept ApiException as e:\n print(\"Exception when calling CustomFieldsApi->create_custom_field: %s\\n\" % e)",
"name": "python-sdk-v5"
},
{
"language": "python",
"install": "pip install asana==3.2.3",
"code": "import asana\n\nclient = asana.Client.access_token('PERSONAL_ACCESS_TOKEN')\n\nresult = client.custom_fields.create_custom_field({'field': 'value', 'field': 'value'}, opt_pretty=True)",
"name": "python-sdk-v3"
},
{
"language": "php",
"install": "composer require asana/asana",
"code": "<?php\nrequire 'vendor/autoload.php';\n\n$client = Asana\\Client::accessToken('PERSONAL_ACCESS_TOKEN');\n\n$result = $client->customfields->createCustomField(array('field' => 'value', 'field' => 'value'), array('opt_pretty' => 'true'))"
},
{
"language": "ruby",
"install": "gem install asana",
"code": "require 'asana'\n\nclient = Asana::Client.new do |c|\n c.authentication :access_token, 'PERSONAL_ACCESS_TOKEN'\nend\n\nresult = client.custom_fields.create_custom_field(field: \"value\", field: \"value\", options: {pretty: true})"
}
]
},
"x-purple-suite-runtime": "unavailable"
}
GET /api/1.0/custom_fields/{custom_field_gid}
Get a custom field
<b>Required scope: </b><code>custom_fields:read</code>
Get the complete definition of a custom field’s metadata.
Since custom fields can be defined for one of a number of types, and
these types have different data and behaviors, there are fields that are
relevant to a particular type. For instance, as noted above, enum_options
is only relevant for the enum type and defines the set of choices that
the enum could represent. The examples below show some of these
type-specific custom field definitions.
This operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.
Authentication
[
{
"personalAccessToken": []
},
{
"oauth2": [
"custom_fields:read"
]
}
]
Path-level parameters and metadata
{
"parameters": [
{
"$ref": "#/components/parameters/custom_field_path_gid"
},
{
"$ref": "#/components/parameters/pretty"
}
]
}
Request, responses and operation details
{
"summary": "Get a custom field",
"description": "<b>Required scope: </b><code>custom_fields:read</code>\n\nGet the complete definition of a custom field’s metadata.\n\nSince custom fields can be defined for one of a number of types, and\nthese types have different data and behaviors, there are fields that are\nrelevant to a particular type. For instance, as noted above, enum_options\nis only relevant for the enum type and defines the set of choices that\nthe enum could represent. The examples below show some of these\ntype-specific custom field definitions.\n\nThis operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.",
"tags": [
"Custom fields"
],
"operationId": "getCustomField",
"parameters": [
{
"name": "opt_fields",
"in": "query",
"description": "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. Properties can include nested fields. To learn more, see the [input/output options guide](/docs/inputoutput-options#selecting-nested-fields).",
"required": false,
"example": [
"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",
"html_text_value",
"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",
"people_value",
"people_value.name",
"precision",
"privacy_setting",
"reference_value",
"reference_value.name",
"representation_type",
"resource_subtype",
"text_value",
"type"
],
"schema": {
"type": "array",
"items": {
"type": "string",
"enum": [
"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",
"html_text_value",
"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",
"people_value",
"people_value.name",
"precision",
"privacy_setting",
"reference_value",
"reference_value.name",
"representation_type",
"resource_subtype",
"text_value",
"type"
]
}
},
"style": "form",
"explode": false
}
],
"responses": {
"200": {
"description": "Successfully retrieved the complete definition of a custom field’s metadata.",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"$ref": "#/components/schemas/CustomFieldResponse"
}
}
}
}
}
},
"400": {
"$ref": "#/components/responses/BadRequest"
},
"401": {
"$ref": "#/components/responses/Unauthorized"
},
"403": {
"$ref": "#/components/responses/Forbidden"
},
"404": {
"$ref": "#/components/responses/NotFound"
},
"500": {
"$ref": "#/components/responses/InternalServerError"
}
},
"security": [
{
"personalAccessToken": []
},
{
"oauth2": [
"custom_fields:read"
]
}
],
"x-readme": {
"code-samples": [
{
"language": "java",
"install": "<dependency><groupId>com.asana</groupId><artifactId>asana</artifactId><version>1.0.0</version></dependency>",
"code": "import com.asana.Client;\n\nClient client = Client.accessToken(\"PERSONAL_ACCESS_TOKEN\");\n\nCustomField result = client.customfields.getCustomField(customFieldGid)\n .option(\"pretty\", true)\n .execute();"
},
{
"language": "node",
"install": "npm install asana",
"code": "const Asana = require('asana');\n\nlet client = new Asana.ApiClient();\nclient.authentications.token.accessToken = '<YOUR_ACCESS_TOKEN>';\n\nlet customFieldsApiInstance = new Asana.CustomFieldsApi(client);\nlet custom_field_gid = \"12345\"; // String | Globally unique identifier for the custom field.\nlet opts = { \n 'opt_fields': \"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,html_text_value,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,people_value,people_value.name,precision,privacy_setting,reference_value,reference_value.name,representation_type,resource_subtype,text_value,type\"\n};\ncustomFieldsApiInstance.getCustomField(custom_field_gid, opts).then((result) => {\n console.log('API called successfully. Returned data: ' + JSON.stringify(result.data, null, 2));\n}, (error) => {\n console.error(error.response.body);\n});",
"name": "node-sdk-v3"
},
{
"language": "node",
"install": "npm install asana@1.0.5",
"code": "const asana = require('asana');\n\nconst client = asana.Client.create().useAccessToken('PERSONAL_ACCESS_TOKEN');\n\nclient.customfields.getCustomField(customFieldGid, {param: \"value\", param: \"value\", opt_pretty: true})\n .then((result) => {\n console.log(result);\n });",
"name": "node-sdk-v1"
},
{
"language": "python",
"install": "pip install asana",
"code": "import asana\nfrom asana.rest import ApiException\nfrom pprint import pprint\n\nconfiguration = asana.Configuration()\nconfiguration.access_token = '<YOUR_ACCESS_TOKEN>'\napi_client = asana.ApiClient(configuration)\n\n# create an instance of the API class\ncustom_fields_api_instance = asana.CustomFieldsApi(api_client)\ncustom_field_gid = \"12345\" # str | Globally unique identifier for the custom field.\nopts = {\n 'opt_fields': \"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,html_text_value,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,people_value,people_value.name,precision,privacy_setting,reference_value,reference_value.name,representation_type,resource_subtype,text_value,type\", # list[str] | 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.\n}\n\ntry:\n # Get a custom field\n api_response = custom_fields_api_instance.get_custom_field(custom_field_gid, opts)\n pprint(api_response)\nexcept ApiException as e:\n print(\"Exception when calling CustomFieldsApi->get_custom_field: %s\\n\" % e)",
"name": "python-sdk-v5"
},
{
"language": "python",
"install": "pip install asana==3.2.3",
"code": "import asana\n\nclient = asana.Client.access_token('PERSONAL_ACCESS_TOKEN')\n\nresult = client.custom_fields.get_custom_field(custom_field_gid, {'param': 'value', 'param': 'value'}, opt_pretty=True)",
"name": "python-sdk-v3"
},
{
"language": "php",
"install": "composer require asana/asana",
"code": "<?php\nrequire 'vendor/autoload.php';\n\n$client = Asana\\Client::accessToken('PERSONAL_ACCESS_TOKEN');\n\n$result = $client->customfields->getCustomField($custom_field_gid, array('param' => 'value', 'param' => 'value'), array('opt_pretty' => 'true'))"
},
{
"language": "ruby",
"install": "gem install asana",
"code": "require 'asana'\n\nclient = Asana::Client.new do |c|\n c.authentication :access_token, 'PERSONAL_ACCESS_TOKEN'\nend\n\nresult = client.custom_fields.get_custom_field(custom_field_gid: 'custom_field_gid', param: \"value\", param: \"value\", options: {pretty: true})"
}
]
},
"x-purple-suite-runtime": "unavailable"
}
PUT /api/1.0/custom_fields/{custom_field_gid}
Update a custom field
<b>Required scope: </b><code>custom_fields:write</code>
A specific, existing custom field can be updated by making a PUT request on the URL for that custom field. Only the fields provided in the `data` block will be updated; any unspecified fields will remain unchanged
When using this method, it is best to specify only those fields you wish to change, or else you may overwrite changes made by another user since you last retrieved the custom field.
A custom field’s `type` cannot be updated.
An enum custom field’s `enum_options` cannot be updated with this endpoint. Instead see “Work With Enum Options” for information on how to update `enum_options`.
Locked custom fields can only be updated by the user who locked the field.
Returns the complete updated custom field record.
This operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.
Authentication
[
{
"personalAccessToken": []
},
{
"oauth2": [
"custom_fields:write"
]
}
]
Path-level parameters and metadata
{
"parameters": [
{
"$ref": "#/components/parameters/custom_field_path_gid"
},
{
"$ref": "#/components/parameters/pretty"
}
]
}
Request, responses and operation details
{
"summary": "Update a custom field",
"description": "<b>Required scope: </b><code>custom_fields:write</code>\n\nA specific, existing custom field can be updated by making a PUT request on the URL for that custom field. Only the fields provided in the `data` block will be updated; any unspecified fields will remain unchanged\nWhen using this method, it is best to specify only those fields you wish to change, or else you may overwrite changes made by another user since you last retrieved the custom field.\nA custom field’s `type` cannot be updated.\nAn enum custom field’s `enum_options` cannot be updated with this endpoint. Instead see “Work With Enum Options” for information on how to update `enum_options`.\nLocked custom fields can only be updated by the user who locked the field.\nReturns the complete updated custom field record.\n\nThis operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.",
"tags": [
"Custom fields"
],
"operationId": "updateCustomField",
"parameters": [
{
"name": "opt_fields",
"in": "query",
"description": "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. Properties can include nested fields. To learn more, see the [input/output options guide](/docs/inputoutput-options#selecting-nested-fields).",
"required": false,
"example": [
"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",
"html_text_value",
"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",
"people_value",
"people_value.name",
"precision",
"privacy_setting",
"reference_value",
"reference_value.name",
"representation_type",
"resource_subtype",
"text_value",
"type"
],
"schema": {
"type": "array",
"items": {
"type": "string",
"enum": [
"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",
"html_text_value",
"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",
"people_value",
"people_value.name",
"precision",
"privacy_setting",
"reference_value",
"reference_value.name",
"representation_type",
"resource_subtype",
"text_value",
"type"
]
}
},
"style": "form",
"explode": false
}
],
"requestBody": {
"description": "The custom field object with all updated properties.",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"$ref": "#/components/schemas/CustomFieldRequest"
}
}
}
}
}
},
"responses": {
"200": {
"description": "The custom field was successfully updated.",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"$ref": "#/components/schemas/CustomFieldResponse"
}
}
}
}
}
},
"400": {
"$ref": "#/components/responses/BadRequest"
},
"401": {
"$ref": "#/components/responses/Unauthorized"
},
"403": {
"$ref": "#/components/responses/Forbidden"
},
"404": {
"$ref": "#/components/responses/NotFound"
},
"500": {
"$ref": "#/components/responses/InternalServerError"
}
},
"security": [
{
"personalAccessToken": []
},
{
"oauth2": [
"custom_fields:write"
]
}
],
"x-readme": {
"code-samples": [
{
"language": "java",
"install": "<dependency><groupId>com.asana</groupId><artifactId>asana</artifactId><version>1.0.0</version></dependency>",
"code": "import com.asana.Client;\n\nClient client = Client.accessToken(\"PERSONAL_ACCESS_TOKEN\");\n\nCustomField result = client.customfields.updateCustomField(customFieldGid)\n .data(\"field\", \"value\")\n .data(\"field\", \"value\")\n .option(\"pretty\", true)\n .execute();"
},
{
"language": "node",
"install": "npm install asana",
"code": "const Asana = require('asana');\n\nlet client = new Asana.ApiClient();\nclient.authentications.token.accessToken = '<YOUR_ACCESS_TOKEN>';\n\nlet customFieldsApiInstance = new Asana.CustomFieldsApi(client);\nlet custom_field_gid = \"12345\"; // String | Globally unique identifier for the custom field.\nlet opts = { \n 'body': {\"data\": {\"<PARAM_1>\": \"<VALUE_1>\", \"<PARAM_2>\": \"<VALUE_2>\",}}, \n 'opt_fields': \"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,html_text_value,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,people_value,people_value.name,precision,privacy_setting,reference_value,reference_value.name,representation_type,resource_subtype,text_value,type\"\n};\ncustomFieldsApiInstance.updateCustomField(custom_field_gid, opts).then((result) => {\n console.log('API called successfully. Returned data: ' + JSON.stringify(result.data, null, 2));\n}, (error) => {\n console.error(error.response.body);\n});",
"name": "node-sdk-v3"
},
{
"language": "node",
"install": "npm install asana@1.0.5",
"code": "const asana = require('asana');\n\nconst client = asana.Client.create().useAccessToken('PERSONAL_ACCESS_TOKEN');\n\nclient.customfields.updateCustomField(customFieldGid, {field: \"value\", field: \"value\", pretty: true})\n .then((result) => {\n console.log(result);\n });",
"name": "node-sdk-v1"
},
{
"language": "python",
"install": "pip install asana",
"code": "import asana\nfrom asana.rest import ApiException\nfrom pprint import pprint\n\nconfiguration = asana.Configuration()\nconfiguration.access_token = '<YOUR_ACCESS_TOKEN>'\napi_client = asana.ApiClient(configuration)\n\n# create an instance of the API class\ncustom_fields_api_instance = asana.CustomFieldsApi(api_client)\ncustom_field_gid = \"12345\" # str | Globally unique identifier for the custom field.\nopts = {\n 'body': {\"data\": {\"<PARAM_1>\": \"<VALUE_1>\", \"<PARAM_2>\": \"<VALUE_2>\",}}, # dict | The custom field object with all updated properties.\n 'opt_fields': \"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,html_text_value,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,people_value,people_value.name,precision,privacy_setting,reference_value,reference_value.name,representation_type,resource_subtype,text_value,type\", # list[str] | 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.\n}\n\ntry:\n # Update a custom field\n api_response = custom_fields_api_instance.update_custom_field(custom_field_gid, opts)\n pprint(api_response)\nexcept ApiException as e:\n print(\"Exception when calling CustomFieldsApi->update_custom_field: %s\\n\" % e)",
"name": "python-sdk-v5"
},
{
"language": "python",
"install": "pip install asana==3.2.3",
"code": "import asana\n\nclient = asana.Client.access_token('PERSONAL_ACCESS_TOKEN')\n\nresult = client.custom_fields.update_custom_field(custom_field_gid, {'field': 'value', 'field': 'value'}, opt_pretty=True)",
"name": "python-sdk-v3"
},
{
"language": "php",
"install": "composer require asana/asana",
"code": "<?php\nrequire 'vendor/autoload.php';\n\n$client = Asana\\Client::accessToken('PERSONAL_ACCESS_TOKEN');\n\n$result = $client->customfields->updateCustomField($custom_field_gid, array('field' => 'value', 'field' => 'value'), array('opt_pretty' => 'true'))"
},
{
"language": "ruby",
"install": "gem install asana",
"code": "require 'asana'\n\nclient = Asana::Client.new do |c|\n c.authentication :access_token, 'PERSONAL_ACCESS_TOKEN'\nend\n\nresult = client.custom_fields.update_custom_field(custom_field_gid: 'custom_field_gid', field: \"value\", field: \"value\", options: {pretty: true})"
}
]
},
"x-purple-suite-runtime": "unavailable"
}
DELETE /api/1.0/custom_fields/{custom_field_gid}
Delete a custom field
A specific, existing custom field can be deleted by making a DELETE request on the URL for that custom field.
Locked custom fields can only be deleted by the user who locked the field.
Returns an empty data record.
This operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.
Authentication
[
{
"personalAccessToken": []
},
{
"oauth2": []
}
]
Path-level parameters and metadata
{
"parameters": [
{
"$ref": "#/components/parameters/custom_field_path_gid"
},
{
"$ref": "#/components/parameters/pretty"
}
]
}
Request, responses and operation details
{
"summary": "Delete a custom field",
"description": "A specific, existing custom field can be deleted by making a DELETE request on the URL for that custom field.\nLocked custom fields can only be deleted by the user who locked the field.\nReturns an empty data record.\n\nThis operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.",
"tags": [
"Custom fields"
],
"operationId": "deleteCustomField",
"responses": {
"200": {
"description": "The custom field was successfully deleted.",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"$ref": "#/components/schemas/EmptyResponse"
}
}
}
}
}
},
"400": {
"$ref": "#/components/responses/BadRequest"
},
"401": {
"$ref": "#/components/responses/Unauthorized"
},
"403": {
"$ref": "#/components/responses/Forbidden"
},
"404": {
"$ref": "#/components/responses/NotFound"
},
"500": {
"$ref": "#/components/responses/InternalServerError"
}
},
"security": [
{
"personalAccessToken": []
},
{
"oauth2": []
}
],
"x-readme": {
"code-samples": [
{
"language": "java",
"install": "<dependency><groupId>com.asana</groupId><artifactId>asana</artifactId><version>1.0.0</version></dependency>",
"code": "import com.asana.Client;\n\nClient client = Client.accessToken(\"PERSONAL_ACCESS_TOKEN\");\n\nJsonElement result = client.customfields.deleteCustomField(customFieldGid)\n .option(\"pretty\", true)\n .execute();"
},
{
"language": "node",
"install": "npm install asana",
"code": "const Asana = require('asana');\n\nlet client = new Asana.ApiClient();\nclient.authentications.token.accessToken = '<YOUR_ACCESS_TOKEN>';\n\nlet customFieldsApiInstance = new Asana.CustomFieldsApi(client);\nlet custom_field_gid = \"12345\"; // String | Globally unique identifier for the custom field.\n\ncustomFieldsApiInstance.deleteCustomField(custom_field_gid).then((result) => {\n console.log('API called successfully. Returned data: ' + JSON.stringify(result.data, null, 2));\n}, (error) => {\n console.error(error.response.body);\n});",
"name": "node-sdk-v3"
},
{
"language": "node",
"install": "npm install asana@1.0.5",
"code": "const asana = require('asana');\n\nconst client = asana.Client.create().useAccessToken('PERSONAL_ACCESS_TOKEN');\n\nclient.customfields.deleteCustomField(customFieldGid)\n .then((result) => {\n console.log(result);\n });",
"name": "node-sdk-v1"
},
{
"language": "python",
"install": "pip install asana",
"code": "import asana\nfrom asana.rest import ApiException\nfrom pprint import pprint\n\nconfiguration = asana.Configuration()\nconfiguration.access_token = '<YOUR_ACCESS_TOKEN>'\napi_client = asana.ApiClient(configuration)\n\n# create an instance of the API class\ncustom_fields_api_instance = asana.CustomFieldsApi(api_client)\ncustom_field_gid = \"12345\" # str | Globally unique identifier for the custom field.\n\n\ntry:\n # Delete a custom field\n api_response = custom_fields_api_instance.delete_custom_field(custom_field_gid)\n pprint(api_response)\nexcept ApiException as e:\n print(\"Exception when calling CustomFieldsApi->delete_custom_field: %s\\n\" % e)",
"name": "python-sdk-v5"
},
{
"language": "python",
"install": "pip install asana==3.2.3",
"code": "import asana\n\nclient = asana.Client.access_token('PERSONAL_ACCESS_TOKEN')\n\nresult = client.custom_fields.delete_custom_field(custom_field_gid, opt_pretty=True)",
"name": "python-sdk-v3"
},
{
"language": "php",
"install": "composer require asana/asana",
"code": "<?php\nrequire 'vendor/autoload.php';\n\n$client = Asana\\Client::accessToken('PERSONAL_ACCESS_TOKEN');\n\n$result = $client->customfields->deleteCustomField($custom_field_gid, array('opt_pretty' => 'true'))"
},
{
"language": "ruby",
"install": "gem install asana",
"code": "require 'asana'\n\nclient = Asana::Client.new do |c|\n c.authentication :access_token, 'PERSONAL_ACCESS_TOKEN'\nend\n\nresult = client.custom_fields.delete_custom_field(custom_field_gid: 'custom_field_gid', options: {pretty: true})"
}
]
},
"x-purple-suite-runtime": "unavailable"
}
GET /api/1.0/workspaces/{workspace_gid}/custom_fields
Get a workspace's custom fields
<b>Required scope: </b><code>custom_fields:read</code>
Returns a list of the compact representation of all of the custom fields in a workspace.
This operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.
Authentication
[
{
"personalAccessToken": []
},
{
"oauth2": [
"custom_fields:read"
]
}
]
Path-level parameters and metadata
{
"parameters": [
{
"$ref": "#/components/parameters/workspace_path_gid"
},
{
"$ref": "#/components/parameters/pretty"
},
{
"$ref": "#/components/parameters/limit"
},
{
"$ref": "#/components/parameters/offset"
}
]
}
Request, responses and operation details
{
"summary": "Get a workspace's custom fields",
"description": "<b>Required scope: </b><code>custom_fields:read</code>\n\nReturns a list of the compact representation of all of the custom fields in a workspace.\n\nThis operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.",
"tags": [
"Custom fields"
],
"operationId": "getCustomFieldsForWorkspace",
"parameters": [
{
"name": "opt_fields",
"in": "query",
"description": "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. Properties can include nested fields. To learn more, see the [input/output options guide](/docs/inputoutput-options#selecting-nested-fields).",
"required": false,
"example": [
"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",
"html_text_value",
"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"
],
"schema": {
"type": "array",
"items": {
"type": "string",
"enum": [
"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",
"html_text_value",
"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"
]
}
},
"style": "form",
"explode": false
}
],
"responses": {
"200": {
"description": "Successfully retrieved all custom fields for the given workspace.",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"type": "array",
"items": {
"$ref": "#/components/schemas/CustomFieldResponse"
}
},
"next_page": {
"$ref": "#/components/schemas/NextPage"
}
}
}
}
}
},
"400": {
"$ref": "#/components/responses/BadRequest"
},
"401": {
"$ref": "#/components/responses/Unauthorized"
},
"403": {
"$ref": "#/components/responses/Forbidden"
},
"404": {
"$ref": "#/components/responses/NotFound"
},
"500": {
"$ref": "#/components/responses/InternalServerError"
}
},
"security": [
{
"personalAccessToken": []
},
{
"oauth2": [
"custom_fields:read"
]
}
],
"x-readme": {
"code-samples": [
{
"language": "java",
"install": "<dependency><groupId>com.asana</groupId><artifactId>asana</artifactId><version>1.0.0</version></dependency>",
"code": "import com.asana.Client;\n\nClient client = Client.accessToken(\"PERSONAL_ACCESS_TOKEN\");\n\nList<CustomField> result = client.customfields.getCustomFieldsForWorkspace(workspaceGid)\n .option(\"pretty\", true)\n .execute();"
},
{
"language": "node",
"install": "npm install asana",
"code": "const Asana = require('asana');\n\nlet client = new Asana.ApiClient();\nclient.authentications.token.accessToken = '<YOUR_ACCESS_TOKEN>';\n\nlet customFieldsApiInstance = new Asana.CustomFieldsApi(client);\nlet workspace_gid = \"12345\"; // String | Globally unique identifier for the workspace or organization.\nlet opts = { \n 'limit': 50, \n 'offset': \"eyJ0eXAiOJiKV1iQLCJhbGciOiJIUzI1NiJ9\", \n 'opt_fields': \"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,html_text_value,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\"\n};\ncustomFieldsApiInstance.getCustomFieldsForWorkspace(workspace_gid, opts).then((result) => {\n console.log('API called successfully. Returned data: ' + JSON.stringify(result.data, null, 2));\n}, (error) => {\n console.error(error.response.body);\n});",
"name": "node-sdk-v3"
},
{
"language": "node",
"install": "npm install asana@1.0.5",
"code": "const asana = require('asana');\n\nconst client = asana.Client.create().useAccessToken('PERSONAL_ACCESS_TOKEN');\n\nclient.customfields.getCustomFieldsForWorkspace(workspaceGid, {param: \"value\", param: \"value\", opt_pretty: true})\n .then((result) => {\n console.log(result);\n });",
"name": "node-sdk-v1"
},
{
"language": "python",
"install": "pip install asana",
"code": "import asana\nfrom asana.rest import ApiException\nfrom pprint import pprint\n\nconfiguration = asana.Configuration()\nconfiguration.access_token = '<YOUR_ACCESS_TOKEN>'\napi_client = asana.ApiClient(configuration)\n\n# create an instance of the API class\ncustom_fields_api_instance = asana.CustomFieldsApi(api_client)\nworkspace_gid = \"12345\" # str | Globally unique identifier for the workspace or organization.\nopts = {\n 'limit': 50, # int | Results per page. The number of objects to return per page. The value must be between 1 and 100.\n 'offset': \"eyJ0eXAiOJiKV1iQLCJhbGciOiJIUzI1NiJ9\", # str | 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.*\n 'opt_fields': \"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,html_text_value,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\", # list[str] | 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.\n}\n\ntry:\n # Get a workspace's custom fields\n api_response = custom_fields_api_instance.get_custom_fields_for_workspace(workspace_gid, opts)\n for data in api_response:\n pprint(data)\nexcept ApiException as e:\n print(\"Exception when calling CustomFieldsApi->get_custom_fields_for_workspace: %s\\n\" % e)",
"name": "python-sdk-v5"
},
{
"language": "python",
"install": "pip install asana==3.2.3",
"code": "import asana\n\nclient = asana.Client.access_token('PERSONAL_ACCESS_TOKEN')\n\nresult = client.custom_fields.get_custom_fields_for_workspace(workspace_gid, {'param': 'value', 'param': 'value'}, opt_pretty=True)",
"name": "python-sdk-v3"
},
{
"language": "php",
"install": "composer require asana/asana",
"code": "<?php\nrequire 'vendor/autoload.php';\n\n$client = Asana\\Client::accessToken('PERSONAL_ACCESS_TOKEN');\n\n$result = $client->customfields->getCustomFieldsForWorkspace($workspace_gid, array('param' => 'value', 'param' => 'value'), array('opt_pretty' => 'true'))"
},
{
"language": "ruby",
"install": "gem install asana",
"code": "require 'asana'\n\nclient = Asana::Client.new do |c|\n c.authentication :access_token, 'PERSONAL_ACCESS_TOKEN'\nend\n\nresult = client.custom_fields.get_custom_fields_for_workspace(workspace_gid: 'workspace_gid', param: \"value\", param: \"value\", options: {pretty: true})"
}
]
},
"x-purple-suite-runtime": "unavailable"
}
POST /api/1.0/custom_fields/{custom_field_gid}/enum_options
Create an enum option
<b>Required scope: </b><code>custom_fields:write</code>
Creates an enum option and adds it to this custom field’s list of enum options. A custom field can have at most 500 enum options (including disabled options). By default new enum options are inserted at the end of a custom field’s list.
Locked custom fields can only have enum options added by the user who locked the field.
Returns the full record of the newly created enum option.
This operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.
Authentication
[
{
"personalAccessToken": []
},
{
"oauth2": [
"custom_fields:write"
]
}
]
Path-level parameters and metadata
{
"parameters": [
{
"$ref": "#/components/parameters/custom_field_path_gid"
},
{
"$ref": "#/components/parameters/pretty"
}
]
}
Request, responses and operation details
{
"summary": "Create an enum option",
"description": "<b>Required scope: </b><code>custom_fields:write</code>\n\nCreates an enum option and adds it to this custom field’s list of enum options. A custom field can have at most 500 enum options (including disabled options). By default new enum options are inserted at the end of a custom field’s list.\nLocked custom fields can only have enum options added by the user who locked the field.\nReturns the full record of the newly created enum option.\n\nThis operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.",
"tags": [
"Custom fields"
],
"operationId": "createEnumOptionForCustomField",
"parameters": [
{
"name": "opt_fields",
"in": "query",
"description": "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. Properties can include nested fields. To learn more, see the [input/output options guide](/docs/inputoutput-options#selecting-nested-fields).",
"required": false,
"example": [
"color",
"enabled",
"name"
],
"schema": {
"type": "array",
"items": {
"type": "string",
"enum": [
"color",
"enabled",
"name"
]
}
},
"style": "form",
"explode": false
}
],
"requestBody": {
"description": "The enum option object to create.",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"$ref": "#/components/schemas/EnumOptionRequest"
}
}
}
}
}
},
"responses": {
"201": {
"description": "Custom field enum option successfully created.",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"$ref": "#/components/schemas/EnumOption"
}
}
}
}
}
},
"400": {
"$ref": "#/components/responses/BadRequest"
},
"401": {
"$ref": "#/components/responses/Unauthorized"
},
"403": {
"$ref": "#/components/responses/Forbidden"
},
"404": {
"$ref": "#/components/responses/NotFound"
},
"500": {
"$ref": "#/components/responses/InternalServerError"
}
},
"security": [
{
"personalAccessToken": []
},
{
"oauth2": [
"custom_fields:write"
]
}
],
"x-readme": {
"code-samples": [
{
"language": "java",
"install": "<dependency><groupId>com.asana</groupId><artifactId>asana</artifactId><version>1.0.0</version></dependency>",
"code": "import com.asana.Client;\n\nClient client = Client.accessToken(\"PERSONAL_ACCESS_TOKEN\");\n\nJsonElement result = client.customfields.createEnumOptionForCustomField(customFieldGid)\n .data(\"field\", \"value\")\n .data(\"field\", \"value\")\n .option(\"pretty\", true)\n .execute();"
},
{
"language": "node",
"install": "npm install asana",
"code": "const Asana = require('asana');\n\nlet client = new Asana.ApiClient();\nclient.authentications.token.accessToken = '<YOUR_ACCESS_TOKEN>';\n\nlet customFieldsApiInstance = new Asana.CustomFieldsApi(client);\nlet custom_field_gid = \"12345\"; // String | Globally unique identifier for the custom field.\nlet opts = { \n 'body': {\"data\": {\"<PARAM_1>\": \"<VALUE_1>\", \"<PARAM_2>\": \"<VALUE_2>\",}}, \n 'opt_fields': \"color,enabled,name\"\n};\ncustomFieldsApiInstance.createEnumOptionForCustomField(custom_field_gid, opts).then((result) => {\n console.log('API called successfully. Returned data: ' + JSON.stringify(result.data, null, 2));\n}, (error) => {\n console.error(error.response.body);\n});",
"name": "node-sdk-v3"
},
{
"language": "node",
"install": "npm install asana@1.0.5",
"code": "const asana = require('asana');\n\nconst client = asana.Client.create().useAccessToken('PERSONAL_ACCESS_TOKEN');\n\nclient.customfields.createEnumOptionForCustomField(customFieldGid, {field: \"value\", field: \"value\", pretty: true})\n .then((result) => {\n console.log(result);\n });",
"name": "node-sdk-v1"
},
{
"language": "python",
"install": "pip install asana",
"code": "import asana\nfrom asana.rest import ApiException\nfrom pprint import pprint\n\nconfiguration = asana.Configuration()\nconfiguration.access_token = '<YOUR_ACCESS_TOKEN>'\napi_client = asana.ApiClient(configuration)\n\n# create an instance of the API class\ncustom_fields_api_instance = asana.CustomFieldsApi(api_client)\ncustom_field_gid = \"12345\" # str | Globally unique identifier for the custom field.\nopts = {\n 'body': {\"data\": {\"<PARAM_1>\": \"<VALUE_1>\", \"<PARAM_2>\": \"<VALUE_2>\",}}, # dict | The enum option object to create.\n 'opt_fields': \"color,enabled,name\", # list[str] | 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.\n}\n\ntry:\n # Create an enum option\n api_response = custom_fields_api_instance.create_enum_option_for_custom_field(custom_field_gid, opts)\n pprint(api_response)\nexcept ApiException as e:\n print(\"Exception when calling CustomFieldsApi->create_enum_option_for_custom_field: %s\\n\" % e)",
"name": "python-sdk-v5"
},
{
"language": "python",
"install": "pip install asana==3.2.3",
"code": "import asana\n\nclient = asana.Client.access_token('PERSONAL_ACCESS_TOKEN')\n\nresult = client.custom_fields.create_enum_option_for_custom_field(custom_field_gid, {'field': 'value', 'field': 'value'}, opt_pretty=True)",
"name": "python-sdk-v3"
},
{
"language": "php",
"install": "composer require asana/asana",
"code": "<?php\nrequire 'vendor/autoload.php';\n\n$client = Asana\\Client::accessToken('PERSONAL_ACCESS_TOKEN');\n\n$result = $client->customfields->createEnumOptionForCustomField($custom_field_gid, array('field' => 'value', 'field' => 'value'), array('opt_pretty' => 'true'))"
},
{
"language": "ruby",
"install": "gem install asana",
"code": "require 'asana'\n\nclient = Asana::Client.new do |c|\n c.authentication :access_token, 'PERSONAL_ACCESS_TOKEN'\nend\n\nresult = client.custom_fields.create_enum_option_for_custom_field(custom_field_gid: 'custom_field_gid', field: \"value\", field: \"value\", options: {pretty: true})"
}
]
},
"x-purple-suite-runtime": "unavailable"
}
POST /api/1.0/custom_fields/{custom_field_gid}/enum_options/insert
Reorder a custom field's enum
<b>Required scope: </b><code>custom_fields:write</code>
Moves a particular enum option to be either before or after another specified enum option in the custom field.
Locked custom fields can only be reordered by the user who locked the field.
This operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.
Authentication
[
{
"personalAccessToken": []
},
{
"oauth2": [
"custom_fields:write"
]
}
]
Path-level parameters and metadata
{
"parameters": [
{
"$ref": "#/components/parameters/custom_field_path_gid"
},
{
"$ref": "#/components/parameters/pretty"
}
]
}
Request, responses and operation details
{
"summary": "Reorder a custom field's enum",
"description": "<b>Required scope: </b><code>custom_fields:write</code>\n\nMoves a particular enum option to be either before or after another specified enum option in the custom field.\nLocked custom fields can only be reordered by the user who locked the field.\n\nThis operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.",
"tags": [
"Custom fields"
],
"operationId": "insertEnumOptionForCustomField",
"parameters": [
{
"name": "opt_fields",
"in": "query",
"description": "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. Properties can include nested fields. To learn more, see the [input/output options guide](/docs/inputoutput-options#selecting-nested-fields).",
"required": false,
"example": [
"color",
"enabled",
"name"
],
"schema": {
"type": "array",
"items": {
"type": "string",
"enum": [
"color",
"enabled",
"name"
]
}
},
"style": "form",
"explode": false
}
],
"requestBody": {
"description": "The enum option object to create.",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"$ref": "#/components/schemas/EnumOptionInsertRequest"
}
}
}
}
}
},
"responses": {
"200": {
"description": "Custom field enum option successfully reordered.",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"$ref": "#/components/schemas/EnumOption"
}
}
}
}
}
},
"400": {
"$ref": "#/components/responses/BadRequest"
},
"401": {
"$ref": "#/components/responses/Unauthorized"
},
"403": {
"$ref": "#/components/responses/Forbidden"
},
"404": {
"$ref": "#/components/responses/NotFound"
},
"500": {
"$ref": "#/components/responses/InternalServerError"
}
},
"security": [
{
"personalAccessToken": []
},
{
"oauth2": [
"custom_fields:write"
]
}
],
"x-readme": {
"code-samples": [
{
"language": "java",
"install": "<dependency><groupId>com.asana</groupId><artifactId>asana</artifactId><version>1.0.0</version></dependency>",
"code": "import com.asana.Client;\n\nClient client = Client.accessToken(\"PERSONAL_ACCESS_TOKEN\");\n\nJsonElement result = client.customfields.insertEnumOptionForCustomField(customFieldGid)\n .data(\"field\", \"value\")\n .data(\"field\", \"value\")\n .option(\"pretty\", true)\n .execute();"
},
{
"language": "node",
"install": "npm install asana",
"code": "const Asana = require('asana');\n\nlet client = new Asana.ApiClient();\nclient.authentications.token.accessToken = '<YOUR_ACCESS_TOKEN>';\n\nlet customFieldsApiInstance = new Asana.CustomFieldsApi(client);\nlet custom_field_gid = \"12345\"; // String | Globally unique identifier for the custom field.\nlet opts = { \n 'body': {\"data\": {\"<PARAM_1>\": \"<VALUE_1>\", \"<PARAM_2>\": \"<VALUE_2>\",}}, \n 'opt_fields': \"color,enabled,name\"\n};\ncustomFieldsApiInstance.insertEnumOptionForCustomField(custom_field_gid, opts).then((result) => {\n console.log('API called successfully. Returned data: ' + JSON.stringify(result.data, null, 2));\n}, (error) => {\n console.error(error.response.body);\n});",
"name": "node-sdk-v3"
},
{
"language": "node",
"install": "npm install asana@1.0.5",
"code": "const asana = require('asana');\n\nconst client = asana.Client.create().useAccessToken('PERSONAL_ACCESS_TOKEN');\n\nclient.customfields.insertEnumOptionForCustomField(customFieldGid, {field: \"value\", field: \"value\", pretty: true})\n .then((result) => {\n console.log(result);\n });",
"name": "node-sdk-v1"
},
{
"language": "python",
"install": "pip install asana",
"code": "import asana\nfrom asana.rest import ApiException\nfrom pprint import pprint\n\nconfiguration = asana.Configuration()\nconfiguration.access_token = '<YOUR_ACCESS_TOKEN>'\napi_client = asana.ApiClient(configuration)\n\n# create an instance of the API class\ncustom_fields_api_instance = asana.CustomFieldsApi(api_client)\ncustom_field_gid = \"12345\" # str | Globally unique identifier for the custom field.\nopts = {\n 'body': {\"data\": {\"<PARAM_1>\": \"<VALUE_1>\", \"<PARAM_2>\": \"<VALUE_2>\",}}, # dict | The enum option object to create.\n 'opt_fields': \"color,enabled,name\", # list[str] | 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.\n}\n\ntry:\n # Reorder a custom field's enum\n api_response = custom_fields_api_instance.insert_enum_option_for_custom_field(custom_field_gid, opts)\n pprint(api_response)\nexcept ApiException as e:\n print(\"Exception when calling CustomFieldsApi->insert_enum_option_for_custom_field: %s\\n\" % e)",
"name": "python-sdk-v5"
},
{
"language": "python",
"install": "pip install asana==3.2.3",
"code": "import asana\n\nclient = asana.Client.access_token('PERSONAL_ACCESS_TOKEN')\n\nresult = client.custom_fields.insert_enum_option_for_custom_field(custom_field_gid, {'field': 'value', 'field': 'value'}, opt_pretty=True)",
"name": "python-sdk-v3"
},
{
"language": "php",
"install": "composer require asana/asana",
"code": "<?php\nrequire 'vendor/autoload.php';\n\n$client = Asana\\Client::accessToken('PERSONAL_ACCESS_TOKEN');\n\n$result = $client->customfields->insertEnumOptionForCustomField($custom_field_gid, array('field' => 'value', 'field' => 'value'), array('opt_pretty' => 'true'))"
},
{
"language": "ruby",
"install": "gem install asana",
"code": "require 'asana'\n\nclient = Asana::Client.new do |c|\n c.authentication :access_token, 'PERSONAL_ACCESS_TOKEN'\nend\n\nresult = client.custom_fields.insert_enum_option_for_custom_field(custom_field_gid: 'custom_field_gid', field: \"value\", field: \"value\", options: {pretty: true})"
}
]
},
"x-purple-suite-runtime": "unavailable"
}
PUT /api/1.0/enum_options/{enum_option_gid}
Update an enum option
<b>Required scope: </b><code>custom_fields:write</code>
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.
This operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.
Authentication
[
{
"personalAccessToken": []
},
{
"oauth2": [
"custom_fields:write"
]
}
]
Path-level parameters and metadata
{
"parameters": [
{
"name": "enum_option_gid",
"in": "path",
"required": true,
"description": "Globally unique identifier for the enum option.",
"schema": {
"type": "string"
},
"example": "124578"
},
{
"$ref": "#/components/parameters/pretty"
}
]
}
Request, responses and operation details
{
"summary": "Update an enum option",
"description": "<b>Required scope: </b><code>custom_fields:write</code>\n\nUpdates an existing enum option. Enum custom fields require at least one enabled enum option.\nLocked custom fields can only be updated by the user who locked the field.\nReturns the full record of the updated enum option.\n\nThis operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.",
"tags": [
"Custom fields"
],
"operationId": "updateEnumOption",
"parameters": [
{
"name": "opt_fields",
"in": "query",
"description": "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. Properties can include nested fields. To learn more, see the [input/output options guide](/docs/inputoutput-options#selecting-nested-fields).",
"required": false,
"example": [
"color",
"enabled",
"name"
],
"schema": {
"type": "array",
"items": {
"type": "string",
"enum": [
"color",
"enabled",
"name"
]
}
},
"style": "form",
"explode": false
}
],
"requestBody": {
"description": "The enum option object to update",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"$ref": "#/components/schemas/EnumOptionBase"
}
}
}
}
}
},
"responses": {
"200": {
"description": "Successfully updated the specified custom field enum.",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"$ref": "#/components/schemas/EnumOption"
}
}
}
}
}
},
"400": {
"$ref": "#/components/responses/BadRequest"
},
"401": {
"$ref": "#/components/responses/Unauthorized"
},
"403": {
"$ref": "#/components/responses/Forbidden"
},
"404": {
"$ref": "#/components/responses/NotFound"
},
"500": {
"$ref": "#/components/responses/InternalServerError"
}
},
"security": [
{
"personalAccessToken": []
},
{
"oauth2": [
"custom_fields:write"
]
}
],
"x-readme": {
"code-samples": [
{
"language": "java",
"install": "<dependency><groupId>com.asana</groupId><artifactId>asana</artifactId><version>1.0.0</version></dependency>",
"code": "import com.asana.Client;\n\nClient client = Client.accessToken(\"PERSONAL_ACCESS_TOKEN\");\n\nJsonElement result = client.customfields.updateEnumOption(enumOptionGid)\n .data(\"field\", \"value\")\n .data(\"field\", \"value\")\n .option(\"pretty\", true)\n .execute();"
},
{
"language": "node",
"install": "npm install asana",
"code": "const Asana = require('asana');\n\nlet client = new Asana.ApiClient();\nclient.authentications.token.accessToken = '<YOUR_ACCESS_TOKEN>';\n\nlet customFieldsApiInstance = new Asana.CustomFieldsApi(client);\nlet enum_option_gid = \"124578\"; // String | Globally unique identifier for the enum option.\nlet opts = { \n 'body': {\"data\": {\"<PARAM_1>\": \"<VALUE_1>\", \"<PARAM_2>\": \"<VALUE_2>\",}}, \n 'opt_fields': \"color,enabled,name\"\n};\ncustomFieldsApiInstance.updateEnumOption(enum_option_gid, opts).then((result) => {\n console.log('API called successfully. Returned data: ' + JSON.stringify(result.data, null, 2));\n}, (error) => {\n console.error(error.response.body);\n});",
"name": "node-sdk-v3"
},
{
"language": "node",
"install": "npm install asana@1.0.5",
"code": "const asana = require('asana');\n\nconst client = asana.Client.create().useAccessToken('PERSONAL_ACCESS_TOKEN');\n\nclient.customfields.updateEnumOption(enumOptionGid, {field: \"value\", field: \"value\", pretty: true})\n .then((result) => {\n console.log(result);\n });",
"name": "node-sdk-v1"
},
{
"language": "python",
"install": "pip install asana",
"code": "import asana\nfrom asana.rest import ApiException\nfrom pprint import pprint\n\nconfiguration = asana.Configuration()\nconfiguration.access_token = '<YOUR_ACCESS_TOKEN>'\napi_client = asana.ApiClient(configuration)\n\n# create an instance of the API class\ncustom_fields_api_instance = asana.CustomFieldsApi(api_client)\nenum_option_gid = \"124578\" # str | Globally unique identifier for the enum option.\nopts = {\n 'body': {\"data\": {\"<PARAM_1>\": \"<VALUE_1>\", \"<PARAM_2>\": \"<VALUE_2>\",}}, # dict | The enum option object to update\n 'opt_fields': \"color,enabled,name\", # list[str] | 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.\n}\n\ntry:\n # Update an enum option\n api_response = custom_fields_api_instance.update_enum_option(enum_option_gid, opts)\n pprint(api_response)\nexcept ApiException as e:\n print(\"Exception when calling CustomFieldsApi->update_enum_option: %s\\n\" % e)",
"name": "python-sdk-v5"
},
{
"language": "python",
"install": "pip install asana==3.2.3",
"code": "import asana\n\nclient = asana.Client.access_token('PERSONAL_ACCESS_TOKEN')\n\nresult = client.custom_fields.update_enum_option(enum_option_gid, {'field': 'value', 'field': 'value'}, opt_pretty=True)",
"name": "python-sdk-v3"
},
{
"language": "php",
"install": "composer require asana/asana",
"code": "<?php\nrequire 'vendor/autoload.php';\n\n$client = Asana\\Client::accessToken('PERSONAL_ACCESS_TOKEN');\n\n$result = $client->customfields->updateEnumOption($enum_option_gid, array('field' => 'value', 'field' => 'value'), array('opt_pretty' => 'true'))"
},
{
"language": "ruby",
"install": "gem install asana",
"code": "require 'asana'\n\nclient = Asana::Client.new do |c|\n c.authentication :access_token, 'PERSONAL_ACCESS_TOKEN'\nend\n\nresult = client.custom_fields.update_enum_option(enum_option_gid: 'enum_option_gid', field: \"value\", field: \"value\", options: {pretty: true})"
}
]
},
"x-purple-suite-runtime": "unavailable"
}
GET /api/1.0/custom_types
Get all custom types associated with an object
<b>Required scope: </b><code>custom_types:read</code>
Returns a list of all of the custom types associated with an object. Exactly one of `project` or `workspace` must be provided as a query parameter. When `workspace` is provided, all custom types in the workspace are listed, including types created by Asana products. Note that, as in all queries to collections which return compact representation, `opt_fields` can be used to include more data than is returned in the compact representation. See the [documentation for input/output options](https://developers.asana.com/docs/inputoutput-options) for more information.
This operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.
Authentication
[
{
"personalAccessToken": []
},
{
"oauth2": [
"custom_types:read"
]
}
]
Path-level parameters and metadata
{
"parameters": [
{
"$ref": "#/components/parameters/project_query_param"
},
{
"$ref": "#/components/parameters/workspace_query_param"
},
{
"$ref": "#/components/parameters/pretty"
},
{
"$ref": "#/components/parameters/limit"
},
{
"$ref": "#/components/parameters/offset"
}
]
}
Request, responses and operation details
{
"summary": "Get all custom types associated with an object",
"description": "<b>Required scope: </b><code>custom_types:read</code>\n\nReturns a list of all of the custom types associated with an object. Exactly one of `project` or `workspace` must be provided as a query parameter. When `workspace` is provided, all custom types in the workspace are listed, including types created by Asana products. Note that, as in all queries to collections which return compact representation, `opt_fields` can be used to include more data than is returned in the compact representation. See the [documentation for input/output options](https://developers.asana.com/docs/inputoutput-options) for more information.\n\nThis operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.",
"tags": [
"Custom types"
],
"operationId": "getCustomTypes",
"parameters": [
{
"name": "opt_fields",
"in": "query",
"description": "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. Properties can include nested fields. To learn more, see the [input/output options guide](/docs/inputoutput-options#selecting-nested-fields).",
"required": false,
"example": [
"asana_created_type_identifier",
"name",
"offset",
"path",
"status_options",
"status_options.color",
"status_options.completion_state",
"status_options.enabled",
"status_options.name",
"uri"
],
"schema": {
"type": "array",
"items": {
"type": "string",
"enum": [
"asana_created_type_identifier",
"name",
"offset",
"path",
"status_options",
"status_options.color",
"status_options.completion_state",
"status_options.enabled",
"status_options.name",
"uri"
]
}
},
"style": "form",
"explode": false
}
],
"responses": {
"200": {
"description": "Successfully retrieved custom types",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"type": "array",
"items": {
"$ref": "#/components/schemas/CustomTypeResponse"
}
},
"next_page": {
"$ref": "#/components/schemas/NextPage"
}
}
}
}
}
},
"400": {
"$ref": "#/components/responses/BadRequest"
},
"401": {
"$ref": "#/components/responses/Unauthorized"
},
"403": {
"$ref": "#/components/responses/Forbidden"
},
"404": {
"$ref": "#/components/responses/NotFound"
},
"500": {
"$ref": "#/components/responses/InternalServerError"
}
},
"security": [
{
"personalAccessToken": []
},
{
"oauth2": [
"custom_types:read"
]
}
],
"x-readme": {
"code-samples": [
{
"language": "node",
"install": "npm install asana",
"code": "const Asana = require('asana');\n\nlet client = new Asana.ApiClient();\nclient.authentications.token.accessToken = '<YOUR_ACCESS_TOKEN>';\n\nlet customTypesApiInstance = new Asana.CustomTypesApi(client);\nlet opts = { \n 'project': \"1331\", \n 'workspace': \"12345\", \n 'limit': 50, \n 'offset': \"eyJ0eXAiOJiKV1iQLCJhbGciOiJIUzI1NiJ9\", \n 'opt_fields': \"asana_created_type_identifier,name,offset,path,status_options,status_options.color,status_options.completion_state,status_options.enabled,status_options.name,uri\"\n};\ncustomTypesApiInstance.getCustomTypes(opts).then((result) => {\n console.log('API called successfully. Returned data: ' + JSON.stringify(result.data, null, 2));\n}, (error) => {\n console.error(error.response.body);\n});",
"name": "node-sdk-v3"
},
{
"language": "python",
"install": "pip install asana",
"code": "import asana\nfrom asana.rest import ApiException\nfrom pprint import pprint\n\nconfiguration = asana.Configuration()\nconfiguration.access_token = '<YOUR_ACCESS_TOKEN>'\napi_client = asana.ApiClient(configuration)\n\n# create an instance of the API class\ncustom_types_api_instance = asana.CustomTypesApi(api_client)\nopts = {\n 'project': \"1331\", # str | Globally unique identifier for the project, used as a filter when retrieving custom types.\n 'workspace': \"12345\", # str | The workspace to filter results on.\n 'limit': 50, # int | Results per page. The number of objects to return per page. The value must be between 1 and 100.\n 'offset': \"eyJ0eXAiOJiKV1iQLCJhbGciOiJIUzI1NiJ9\", # str | 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.*\n 'opt_fields': \"asana_created_type_identifier,name,offset,path,status_options,status_options.color,status_options.completion_state,status_options.enabled,status_options.name,uri\", # list[str] | 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.\n}\n\ntry:\n # Get all custom types associated with an object\n api_response = custom_types_api_instance.get_custom_types(opts)\n for data in api_response:\n pprint(data)\nexcept ApiException as e:\n print(\"Exception when calling CustomTypesApi->get_custom_types: %s\\n\" % e)",
"name": "python-sdk-v5"
}
]
},
"x-purple-suite-runtime": "unavailable"
}
GET /api/1.0/custom_types/{custom_type_gid}
Get a custom type
<b>Required scope: </b><code>custom_types:read</code>
Returns the complete custom type record for a single custom type.
This operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.
Authentication
[
{
"personalAccessToken": []
},
{
"oauth2": [
"custom_types:read"
]
}
]
Path-level parameters and metadata
{
"parameters": [
{
"$ref": "#/components/parameters/custom_type_gid"
},
{
"$ref": "#/components/parameters/pretty"
}
]
}
Request, responses and operation details
{
"summary": "Get a custom type",
"description": "<b>Required scope: </b><code>custom_types:read</code>\n\nReturns the complete custom type record for a single custom type.\n\nThis operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.",
"tags": [
"Custom types"
],
"operationId": "getCustomType",
"parameters": [
{
"name": "opt_fields",
"in": "query",
"description": "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. Properties can include nested fields. To learn more, see the [input/output options guide](/docs/inputoutput-options#selecting-nested-fields).",
"required": false,
"example": [
"asana_created_type_identifier",
"name",
"status_options",
"status_options.color",
"status_options.completion_state",
"status_options.enabled",
"status_options.name"
],
"schema": {
"type": "array",
"items": {
"type": "string",
"enum": [
"asana_created_type_identifier",
"name",
"status_options",
"status_options.color",
"status_options.completion_state",
"status_options.enabled",
"status_options.name"
]
}
},
"style": "form",
"explode": false
}
],
"responses": {
"200": {
"description": "Successfully retrieved the requested custom type.",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"$ref": "#/components/schemas/CustomTypeResponse"
}
}
}
}
}
},
"400": {
"$ref": "#/components/responses/BadRequest"
},
"401": {
"$ref": "#/components/responses/Unauthorized"
},
"403": {
"$ref": "#/components/responses/Forbidden"
},
"404": {
"$ref": "#/components/responses/NotFound"
},
"500": {
"$ref": "#/components/responses/InternalServerError"
}
},
"security": [
{
"personalAccessToken": []
},
{
"oauth2": [
"custom_types:read"
]
}
],
"x-readme": {
"code-samples": [
{
"language": "node",
"install": "npm install asana",
"code": "const Asana = require('asana');\n\nlet client = new Asana.ApiClient();\nclient.authentications.token.accessToken = '<YOUR_ACCESS_TOKEN>';\n\nlet customTypesApiInstance = new Asana.CustomTypesApi(client);\nlet custom_type_gid = \"12345\"; // String | Globally unique identifier for the custom type.\nlet opts = { \n 'opt_fields': \"asana_created_type_identifier,name,status_options,status_options.color,status_options.completion_state,status_options.enabled,status_options.name\"\n};\ncustomTypesApiInstance.getCustomType(custom_type_gid, opts).then((result) => {\n console.log('API called successfully. Returned data: ' + JSON.stringify(result.data, null, 2));\n}, (error) => {\n console.error(error.response.body);\n});",
"name": "node-sdk-v3"
},
{
"language": "python",
"install": "pip install asana",
"code": "import asana\nfrom asana.rest import ApiException\nfrom pprint import pprint\n\nconfiguration = asana.Configuration()\nconfiguration.access_token = '<YOUR_ACCESS_TOKEN>'\napi_client = asana.ApiClient(configuration)\n\n# create an instance of the API class\ncustom_types_api_instance = asana.CustomTypesApi(api_client)\ncustom_type_gid = \"12345\" # str | Globally unique identifier for the custom type.\nopts = {\n 'opt_fields': \"asana_created_type_identifier,name,status_options,status_options.color,status_options.completion_state,status_options.enabled,status_options.name\", # list[str] | 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.\n}\n\ntry:\n # Get a custom type\n api_response = custom_types_api_instance.get_custom_type(custom_type_gid, opts)\n pprint(api_response)\nexcept ApiException as e:\n print(\"Exception when calling CustomTypesApi->get_custom_type: %s\\n\" % e)",
"name": "python-sdk-v5"
}
]
},
"x-purple-suite-runtime": "unavailable"
}
GET /api/1.0/events
Get events on a resource
Returns the full record for all events that have occurred since the sync
token was created.
A `GET` request to the endpoint `/[path_to_resource]/events` can be made in
lieu of including the resource ID in the data for the request.
Asana limits a single sync token to 100 events. If more than 100 events exist
for a given resource, `has_more: true` will be returned in the response, indicating
that there are more events to pull.
*Note: The resource returned will be the resource that triggered the
event. This may be different from the one that the events were requested
for. For example, a subscription to a project will contain events for
tasks contained within the project.*
This operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.
Authentication
[
{
"personalAccessToken": []
},
{
"oauth2": []
}
]
Path-level parameters and metadata
{
"parameters": [
{
"name": "resource",
"in": "query",
"required": true,
"description": "A resource ID to subscribe to. The resource can be a task, project, or goal.",
"schema": {
"type": "string"
},
"example": "12345"
},
{
"name": "sync",
"in": "query",
"required": false,
"description": "A sync token received from the last request, or none on first sync. Events will be returned from the point in time that the sync token was generated.\n*Note: On your first request, omit the sync token. The response will be the same as for an expired sync token, and will include a new valid sync token.If the sync token is too old (which may happen from time to time) the API will return a `412 Precondition Failed` error, and include a fresh sync token in the response.*",
"schema": {
"type": "string"
},
"example": "de4774f6915eae04714ca93bb2f5ee81"
},
{
"$ref": "#/components/parameters/pretty"
}
]
}
Request, responses and operation details
{
"summary": "Get events on a resource",
"description": "Returns the full record for all events that have occurred since the sync\ntoken was created.\n\nA `GET` request to the endpoint `/[path_to_resource]/events` can be made in\nlieu of including the resource ID in the data for the request.\n\nAsana limits a single sync token to 100 events. If more than 100 events exist\nfor a given resource, `has_more: true` will be returned in the response, indicating\nthat there are more events to pull.\n\n*Note: The resource returned will be the resource that triggered the\nevent. This may be different from the one that the events were requested\nfor. For example, a subscription to a project will contain events for\ntasks contained within the project.*\n\nThis operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.",
"tags": [
"Events"
],
"operationId": "getEvents",
"parameters": [
{
"name": "opt_fields",
"in": "query",
"description": "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. Properties can include nested fields. To learn more, see the [input/output options guide](/docs/inputoutput-options#selecting-nested-fields).",
"required": false,
"example": [
"action",
"change",
"change.action",
"change.added_value",
"change.field",
"change.new_value",
"change.removed_value",
"created_at",
"parent",
"parent.name",
"resource",
"resource.name",
"type",
"user",
"user.name"
],
"schema": {
"type": "array",
"items": {
"type": "string",
"enum": [
"action",
"change",
"change.action",
"change.added_value",
"change.field",
"change.new_value",
"change.removed_value",
"created_at",
"parent",
"parent.name",
"resource",
"resource.name",
"type",
"user",
"user.name"
]
}
},
"style": "form",
"explode": false
}
],
"responses": {
"200": {
"description": "Successfully retrieved events.",
"content": {
"application/json": {
"schema": {
"type": "object",
"description": "The full record for all events that have occurred since the sync token was created.",
"properties": {
"data": {
"type": "array",
"items": {
"$ref": "#/components/schemas/EventResponse"
}
},
"sync": {
"description": "A sync token to be used with the next call to the /events endpoint.",
"type": "string",
"example": "de4774f6915eae04714ca93bb2f5ee81"
},
"has_more": {
"description": "Indicates whether there are more events to pull.",
"type": "boolean",
"example": true
}
}
}
}
}
},
"400": {
"$ref": "#/components/responses/BadRequest"
},
"401": {
"$ref": "#/components/responses/Unauthorized"
},
"403": {
"$ref": "#/components/responses/Forbidden"
},
"404": {
"$ref": "#/components/responses/NotFound"
},
"412": {
"description": "The request is missing or has an expired sync token.",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"errors": {
"type": "array",
"items": {
"type": "object",
"properties": {
"message": {
"type": "string",
"readOnly": true,
"description": "Message providing more detail about the error that occurred, if available.",
"example": "Sync token invalid or too old. If you are attempting to keep resources in sync, you must fetch the full dataset for this query now and use the new sync token for the next sync."
}
}
}
},
"sync": {
"type": "string",
"readOnly": true,
"description": "A sync token to be used with the next call to the /events endpoint.",
"example": "de4774f6915eae04714ca93bb2f5ee81"
}
}
}
}
}
},
"500": {
"$ref": "#/components/responses/InternalServerError"
}
},
"security": [
{
"personalAccessToken": []
},
{
"oauth2": []
}
],
"x-readme": {
"code-samples": [
{
"language": "java",
"install": "<dependency><groupId>com.asana</groupId><artifactId>asana</artifactId><version>1.0.0</version></dependency>",
"code": "import com.asana.Client;\n\nClient client = Client.accessToken(\"PERSONAL_ACCESS_TOKEN\");\n\nList<JsonElement> result = client.events.getEvents(sync, resource)\n .option(\"pretty\", true)\n .execute();"
},
{
"language": "node",
"install": "npm install asana",
"code": "const Asana = require('asana');\n\nlet client = new Asana.ApiClient();\nclient.authentications.token.accessToken = '<YOUR_ACCESS_TOKEN>';\n\nlet eventsApiInstance = new Asana.EventsApi(client);\nlet resource = \"12345\"; // String | A resource ID to subscribe to. The resource can be a task, project, or goal.\nlet opts = { \n 'sync': \"de4774f6915eae04714ca93bb2f5ee81\", \n 'opt_fields': \"action,change,change.action,change.added_value,change.field,change.new_value,change.removed_value,created_at,parent,parent.name,resource,resource.name,type,user,user.name\"\n};\neventsApiInstance.getEvents(resource, opts).then((result) => {\n console.log('API called successfully. Returned data: ' + JSON.stringify(result.data, null, 2));\n}, (error) => {\n console.error(error.response.body);\n});",
"name": "node-sdk-v3"
},
{
"language": "node",
"install": "npm install asana@1.0.5",
"code": "const asana = require('asana');\n\nconst client = asana.Client.create().useAccessToken('PERSONAL_ACCESS_TOKEN');\n\nclient.events.getEvents({param: \"value\", param: \"value\", opt_pretty: true})\n .then((result) => {\n console.log(result);\n });",
"name": "node-sdk-v1"
},
{
"language": "python",
"install": "pip install asana",
"code": "import asana\nfrom asana.rest import ApiException\nfrom pprint import pprint\n\nconfiguration = asana.Configuration()\nconfiguration.access_token = '<YOUR_ACCESS_TOKEN>'\napi_client = asana.ApiClient(configuration)\n\n# create an instance of the API class\nevents_api_instance = asana.EventsApi(api_client)\nresource = \"12345\" # str | A resource ID to subscribe to. The resource can be a task, project, or goal.\nopts = {\n 'sync': \"de4774f6915eae04714ca93bb2f5ee81\", # str | A sync token received from the last request, or none on first sync. Events will be returned from the point in time that the sync token was generated. *Note: On your first request, omit the sync token. The response will be the same as for an expired sync token, and will include a new valid sync token.If the sync token is too old (which may happen from time to time) the API will return a `412 Precondition Failed` error, and include a fresh sync token in the response.*\n 'opt_fields': \"action,change,change.action,change.added_value,change.field,change.new_value,change.removed_value,created_at,parent,parent.name,resource,resource.name,type,user,user.name\", # list[str] | 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.\n}\n\ntry:\n # Get events on a resource\n api_response = events_api_instance.get_events(resource, opts)\n for data in api_response:\n pprint(data)\nexcept ApiException as e:\n print(\"Exception when calling EventsApi->get_events: %s\\n\" % e)",
"name": "python-sdk-v5"
},
{
"language": "python",
"install": "pip install asana==3.2.3",
"code": "import asana\n\nclient = asana.Client.access_token('PERSONAL_ACCESS_TOKEN')\n\nresult = client.events.get_events({'param': 'value', 'param': 'value'}, opt_pretty=True)",
"name": "python-sdk-v3"
},
{
"language": "php",
"install": "composer require asana/asana",
"code": "<?php\nrequire 'vendor/autoload.php';\n\n$client = Asana\\Client::accessToken('PERSONAL_ACCESS_TOKEN');\n\n$result = $client->events->getEvents(array('param' => 'value', 'param' => 'value'), array('opt_pretty' => 'true'))"
},
{
"language": "ruby",
"install": "gem install asana",
"code": "require 'asana'\n\nclient = Asana::Client.new do |c|\n c.authentication :access_token, 'PERSONAL_ACCESS_TOKEN'\nend\n\nresult = client.events.get_events(resource: ''resource_example'', param: \"value\", param: \"value\", options: {pretty: true})"
}
]
},
"x-purple-suite-runtime": "unavailable"
}
POST /api/1.0/exports/graph
Initiate a graph export
Initiates a graph export job for a given parent object
(goal, team, portfolio, or project). The export will be processed asynchronously.
Once initiated, use the [jobs](/reference/getjob) endpoint to monitor progress.
**Export Caching:** When exporting more than 1,000 tasks, the results are cached for 4 hours. Any new export requests made within this 4-hour window will return the same cached results rather than generating a fresh export.
This operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.
Authentication
[
{
"personalAccessToken": []
},
{
"oauth2": []
}
]
Request, responses and operation details
{
"summary": "Initiate a graph export",
"description": "Initiates a graph export job for a given parent object\n(goal, team, portfolio, or project). The export will be processed asynchronously.\nOnce initiated, use the [jobs](/reference/getjob) endpoint to monitor progress.\n\n**Export Caching:** When exporting more than 1,000 tasks, the results are cached for 4 hours. Any new export requests made within this 4-hour window will return the same cached results rather than generating a fresh export.\n\nThis operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.",
"tags": [
"Exports"
],
"operationId": "createGraphExport",
"requestBody": {
"description": "A JSON payload specifying the parent object to export.",
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"$ref": "#/components/schemas/GraphExportRequest"
}
}
}
}
}
},
"responses": {
"201": {
"description": "Successfully created Graph export request.",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"$ref": "#/components/schemas/GraphExportResponse"
}
}
}
}
}
},
"400": {
"$ref": "#/components/responses/BadRequest"
},
"401": {
"$ref": "#/components/responses/Unauthorized"
},
"403": {
"$ref": "#/components/responses/Forbidden"
},
"404": {
"$ref": "#/components/responses/NotFound"
},
"500": {
"$ref": "#/components/responses/InternalServerError"
}
},
"security": [
{
"personalAccessToken": []
},
{
"oauth2": []
}
],
"x-readme": {
"code-samples": [
{
"language": "node",
"install": "npm install asana",
"code": "const Asana = require('asana');\n\nlet client = new Asana.ApiClient();\nclient.authentications.token.accessToken = '<YOUR_ACCESS_TOKEN>';\n\nlet exportsApiInstance = new Asana.ExportsApi(client);\nlet body = {\"data\": {\"<PARAM_1>\": \"<VALUE_1>\", \"<PARAM_2>\": \"<VALUE_2>\",}}; // Object | A JSON payload specifying the parent object to export.\n\nexportsApiInstance.createGraphExport(body).then((result) => {\n console.log('API called successfully. Returned data: ' + JSON.stringify(result.data, null, 2));\n}, (error) => {\n console.error(error.response.body);\n});",
"name": "node-sdk-v3"
},
{
"language": "python",
"install": "pip install asana",
"code": "import asana\nfrom asana.rest import ApiException\nfrom pprint import pprint\n\nconfiguration = asana.Configuration()\nconfiguration.access_token = '<YOUR_ACCESS_TOKEN>'\napi_client = asana.ApiClient(configuration)\n\n# create an instance of the API class\nexports_api_instance = asana.ExportsApi(api_client)\nbody = {\"data\": {\"<PARAM_1>\": \"<VALUE_1>\", \"<PARAM_2>\": \"<VALUE_2>\",}} # dict | A JSON payload specifying the parent object to export.\n\n\ntry:\n # Initiate a graph export\n api_response = exports_api_instance.create_graph_export(body)\n pprint(api_response)\nexcept ApiException as e:\n print(\"Exception when calling ExportsApi->create_graph_export: %s\\n\" % e)",
"name": "python-sdk-v5"
}
]
},
"x-purple-suite-runtime": "unavailable"
}
POST /api/1.0/exports/resource
Initiate a resource export
Initiates a bulk export of resources for a workspace. The export will be processed asynchronously. Once the export has been requested, its progress can be monitored using the [jobs](/reference/getjob) endpoint.
## Supported resource types
This endpoint currently supports exporting tasks, teams and messages within a workspace. Resources can be requested to be part of the export by providing the `export_request_parameters` parameter. The following resource types are supported:
### Tasks:
Tasks are formatted for exports with some differences from their documented [schema](/reference/tasks):
- `attachments` are included by default and returns an array of associated attachments.
- Attachment objects do not include `download_url` or `view_url`. The `attachments` [endpoint](/reference/attachment) should be queried for up-to-date URLs.
- `stories` are included by default and returns an array of comments and other changes made to a task
### Teams:
Teams are formatted for exports with these differences from their documented [schema](/reference/teams):
- `members` are included by default and returns an array of Users that are members of the team
- Filtering is not supported for teams.
### Messages:
The returned schema encompasses both default messages and status updates and is similar to the status update schema.
The available fields for messages are:
- `gid` - The globally unique identifier for the message.
- `resource_type` - The type of resource, which is always "message".
- `resource_subtype` - Optional. The subtype of the message, which can be "default" or "status_update".
- `status_type` - The type associated with the status update. This can be one of: “on_track”, “at_risk”, “off_track”, “on_hold”, “complete”, “achieved”, “partial”, “missed”, “dropped”
- `created_by` - The user who created the message.
- `created_at` - The time at which this resource was created and sent available to other users.
- `modified_at` - The time at which this resource was last modified.
- `title` - The title of the message.
- `text` - The text content of the message.
- `html_notes` - The text content of the message with formatting as HTML. Not included by default. Can be included by using “fields” in the initial request.
- `num_likes` - The number of users who have liked this message.
- `likes` - An array of users who have liked this message.
- `stories` - Optional. Array of stories applied to the message.
- `attachments` - Optional. Array of attachments added to the message.
- `followers` - Optional. Array of users currently following the message. Users that were sent the message are treated as followers.
- `parents` - Array of objects the message was sent to. Can be a Project, Portfolio, Team or Goal. Limited to a single object for status updates.
## Export file
The final export file will be in JSON Lines format and compressed in a gzip container.
Objects are formatted according to their corresponding API schema, or limited to the fields
included in the `fields` parameter. Exports currently include undeleted objects.
An object in the export will be up to date anywhere between the exports `created_at` and `completed_at`. There is no guaranteed ordering of objects in the export.
Access to the export file expires 30 days after its completion.
## Exporting specific fields
By default, each object in an export includes a predefined set of fields based on its schema. If a more limited set of fields
or fields not included by default are required, the Export API allows for specifying which fields to include in the requested export.
Fields can be specified using the `fields` parameter. The fields parameter conforms to the fields
optional parameter available for all Asana endpoints which is documented [here](https://developers.asana.com/docs/inputoutput-options).
Utilizing the `fields` parameter is recommended if the full object is not required, especially when a large number of objects are being exported, to reduce the overall export time.
## Filtering resources
A disjunction of two or more filters can be achieved by providing multiple `export_request_parameters` for the same resource, each with different filters.
However, this approach may result in duplicate resources being returned.
## Rate Limits
A workspace is currently limited to *one* in progress export request at a given time. The request will return with a 403 Forbidden status code if the limit is exceeded.
This operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.
Authentication
[
{
"personalAccessToken": []
},
{
"oauth2": []
}
]
Request, responses and operation details
{
"summary": "Initiate a resource export",
"description": "Initiates a bulk export of resources for a workspace. The export will be processed asynchronously. Once the export has been requested, its progress can be monitored using the [jobs](/reference/getjob) endpoint.\n\n## Supported resource types\nThis endpoint currently supports exporting tasks, teams and messages within a workspace. Resources can be requested to be part of the export by providing the `export_request_parameters` parameter. The following resource types are supported:\n\n### Tasks:\nTasks are formatted for exports with some differences from their documented [schema](/reference/tasks):\n - `attachments` are included by default and returns an array of associated attachments.\n - Attachment objects do not include `download_url` or `view_url`. The `attachments` [endpoint](/reference/attachment) should be queried for up-to-date URLs.\n - `stories` are included by default and returns an array of comments and other changes made to a task\n\n### Teams:\nTeams are formatted for exports with these differences from their documented [schema](/reference/teams):\n - `members` are included by default and returns an array of Users that are members of the team\n - Filtering is not supported for teams.\n\n### Messages:\nThe returned schema encompasses both default messages and status updates and is similar to the status update schema.\nThe available fields for messages are:\n - `gid` - The globally unique identifier for the message.\n - `resource_type` - The type of resource, which is always \"message\".\n - `resource_subtype` - Optional. The subtype of the message, which can be \"default\" or \"status_update\".\n - `status_type` - The type associated with the status update. This can be one of: “on_track”, “at_risk”, “off_track”, “on_hold”, “complete”, “achieved”, “partial”, “missed”, “dropped”\n - `created_by` - The user who created the message.\n - `created_at` - The time at which this resource was created and sent available to other users.\n - `modified_at` - The time at which this resource was last modified.\n - `title` - The title of the message.\n - `text` - The text content of the message.\n - `html_notes` - The text content of the message with formatting as HTML. Not included by default. Can be included by using “fields” in the initial request.\n - `num_likes` - The number of users who have liked this message.\n - `likes` - An array of users who have liked this message.\n - `stories` - Optional. Array of stories applied to the message.\n - `attachments` - Optional. Array of attachments added to the message.\n - `followers` - Optional. Array of users currently following the message. Users that were sent the message are treated as followers.\n - `parents` - Array of objects the message was sent to. Can be a Project, Portfolio, Team or Goal. Limited to a single object for status updates.\n\n\n## Export file\nThe final export file will be in JSON Lines format and compressed in a gzip container.\n\nObjects are formatted according to their corresponding API schema, or limited to the fields\nincluded in the `fields` parameter. Exports currently include undeleted objects.\n\nAn object in the export will be up to date anywhere between the exports `created_at` and `completed_at`. There is no guaranteed ordering of objects in the export.\n\nAccess to the export file expires 30 days after its completion.\n\n## Exporting specific fields\nBy default, each object in an export includes a predefined set of fields based on its schema. If a more limited set of fields\nor fields not included by default are required, the Export API allows for specifying which fields to include in the requested export.\n\nFields can be specified using the `fields` parameter. The fields parameter conforms to the fields\noptional parameter available for all Asana endpoints which is documented [here](https://developers.asana.com/docs/inputoutput-options).\n\nUtilizing the `fields` parameter is recommended if the full object is not required, especially when a large number of objects are being exported, to reduce the overall export time.\n\n## Filtering resources\nA disjunction of two or more filters can be achieved by providing multiple `export_request_parameters` for the same resource, each with different filters.\nHowever, this approach may result in duplicate resources being returned.\n\n## Rate Limits\nA workspace is currently limited to *one* in progress export request at a given time. The request will return with a 403 Forbidden status code if the limit is exceeded.\n\nThis operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.",
"tags": [
"Exports"
],
"operationId": "createResourceExport",
"requestBody": {
"description": "A JSON payload specifying the resources to export, including filters to apply and fields to be exported.",
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"$ref": "#/components/schemas/ResourceExportRequest"
}
}
}
}
}
},
"responses": {
"201": {
"description": "Successfully created a Resource export request.",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"$ref": "#/components/schemas/ResourceExportResponse"
}
}
}
}
}
},
"400": {
"$ref": "#/components/responses/BadRequest"
},
"401": {
"$ref": "#/components/responses/Unauthorized"
},
"403": {
"$ref": "#/components/responses/Forbidden"
},
"404": {
"$ref": "#/components/responses/NotFound"
},
"500": {
"$ref": "#/components/responses/InternalServerError"
}
},
"security": [
{
"personalAccessToken": []
},
{
"oauth2": []
}
],
"x-readme": {
"code-samples": [
{
"language": "node",
"install": "npm install asana",
"code": "const Asana = require('asana');\n\nlet client = new Asana.ApiClient();\nclient.authentications.token.accessToken = '<YOUR_ACCESS_TOKEN>';\n\nlet exportsApiInstance = new Asana.ExportsApi(client);\nlet body = {\"data\": {\"<PARAM_1>\": \"<VALUE_1>\", \"<PARAM_2>\": \"<VALUE_2>\",}}; // Object | A JSON payload specifying the resources to export, including filters to apply and fields to be exported.\n\nexportsApiInstance.createResourceExport(body).then((result) => {\n console.log('API called successfully. Returned data: ' + JSON.stringify(result.data, null, 2));\n}, (error) => {\n console.error(error.response.body);\n});",
"name": "node-sdk-v3"
},
{
"language": "python",
"install": "pip install asana",
"code": "import asana\nfrom asana.rest import ApiException\nfrom pprint import pprint\n\nconfiguration = asana.Configuration()\nconfiguration.access_token = '<YOUR_ACCESS_TOKEN>'\napi_client = asana.ApiClient(configuration)\n\n# create an instance of the API class\nexports_api_instance = asana.ExportsApi(api_client)\nbody = {\"data\": {\"<PARAM_1>\": \"<VALUE_1>\", \"<PARAM_2>\": \"<VALUE_2>\",}} # dict | A JSON payload specifying the resources to export, including filters to apply and fields to be exported.\n\n\ntry:\n # Initiate a resource export\n api_response = exports_api_instance.create_resource_export(body)\n pprint(api_response)\nexcept ApiException as e:\n print(\"Exception when calling ExportsApi->create_resource_export: %s\\n\" % e)",
"name": "python-sdk-v5"
}
]
},
"x-purple-suite-runtime": "unavailable"
}
GET /api/1.0/goal_relationships/{goal_relationship_gid}
Get a goal relationship
Returns the complete updated goal relationship record for a single goal relationship.
This operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.
Authentication
[
{
"personalAccessToken": []
},
{
"oauth2": []
}
]
Path-level parameters and metadata
{
"parameters": [
{
"$ref": "#/components/parameters/goal_relationship_path_gid"
},
{
"$ref": "#/components/parameters/pretty"
}
]
}
Request, responses and operation details
{
"summary": "Get a goal relationship",
"description": "Returns the complete updated goal relationship record for a single goal relationship.\n\nThis operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.",
"tags": [
"Goal relationships"
],
"operationId": "getGoalRelationship",
"parameters": [
{
"name": "opt_fields",
"in": "query",
"description": "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. Properties can include nested fields. To learn more, see the [input/output options guide](/docs/inputoutput-options#selecting-nested-fields).",
"required": false,
"example": [
"contribution_weight",
"resource_subtype",
"supported_goal",
"supported_goal.name",
"supported_goal.owner",
"supported_goal.owner.name",
"supporting_resource",
"supporting_resource.name",
"supporting_resource.resource_subtype"
],
"schema": {
"type": "array",
"items": {
"type": "string",
"enum": [
"contribution_weight",
"resource_subtype",
"supported_goal",
"supported_goal.name",
"supported_goal.owner",
"supported_goal.owner.name",
"supporting_resource",
"supporting_resource.name",
"supporting_resource.resource_subtype"
]
}
},
"style": "form",
"explode": false
}
],
"responses": {
"200": {
"description": "Successfully retrieved the record for the goal relationship.",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"$ref": "#/components/schemas/GoalRelationshipResponse"
}
}
}
}
}
},
"400": {
"$ref": "#/components/responses/BadRequest"
},
"401": {
"$ref": "#/components/responses/Unauthorized"
},
"403": {
"$ref": "#/components/responses/Forbidden"
},
"404": {
"$ref": "#/components/responses/NotFound"
},
"500": {
"$ref": "#/components/responses/InternalServerError"
}
},
"security": [
{
"personalAccessToken": []
},
{
"oauth2": []
}
],
"x-readme": {
"code-samples": [
{
"language": "java",
"install": "<dependency><groupId>com.asana</groupId><artifactId>asana</artifactId><version>1.0.0</version></dependency>",
"code": "import com.asana.Client;\n\nClient client = Client.accessToken(\"PERSONAL_ACCESS_TOKEN\");\n\nJsonElement result = client.goalrelationships.getGoalRelationship(goalRelationshipGid)\n .option(\"pretty\", true)\n .execute();"
},
{
"language": "node",
"install": "npm install asana",
"code": "const Asana = require('asana');\n\nlet client = new Asana.ApiClient();\nclient.authentications.token.accessToken = '<YOUR_ACCESS_TOKEN>';\n\nlet goalRelationshipsApiInstance = new Asana.GoalRelationshipsApi(client);\nlet goal_relationship_gid = \"12345\"; // String | Globally unique identifier for the goal relationship.\nlet opts = { \n 'opt_fields': \"contribution_weight,resource_subtype,supported_goal,supported_goal.name,supported_goal.owner,supported_goal.owner.name,supporting_resource,supporting_resource.name,supporting_resource.resource_subtype\"\n};\ngoalRelationshipsApiInstance.getGoalRelationship(goal_relationship_gid, opts).then((result) => {\n console.log('API called successfully. Returned data: ' + JSON.stringify(result.data, null, 2));\n}, (error) => {\n console.error(error.response.body);\n});",
"name": "node-sdk-v3"
},
{
"language": "node",
"install": "npm install asana@1.0.5",
"code": "const asana = require('asana');\n\nconst client = asana.Client.create().useAccessToken('PERSONAL_ACCESS_TOKEN');\n\nclient.goalrelationships.getGoalRelationship(goalRelationshipGid, {param: \"value\", param: \"value\", opt_pretty: true})\n .then((result) => {\n console.log(result);\n });",
"name": "node-sdk-v1"
},
{
"language": "python",
"install": "pip install asana",
"code": "import asana\nfrom asana.rest import ApiException\nfrom pprint import pprint\n\nconfiguration = asana.Configuration()\nconfiguration.access_token = '<YOUR_ACCESS_TOKEN>'\napi_client = asana.ApiClient(configuration)\n\n# create an instance of the API class\ngoal_relationships_api_instance = asana.GoalRelationshipsApi(api_client)\ngoal_relationship_gid = \"12345\" # str | Globally unique identifier for the goal relationship.\nopts = {\n 'opt_fields': \"contribution_weight,resource_subtype,supported_goal,supported_goal.name,supported_goal.owner,supported_goal.owner.name,supporting_resource,supporting_resource.name,supporting_resource.resource_subtype\", # list[str] | 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.\n}\n\ntry:\n # Get a goal relationship\n api_response = goal_relationships_api_instance.get_goal_relationship(goal_relationship_gid, opts)\n pprint(api_response)\nexcept ApiException as e:\n print(\"Exception when calling GoalRelationshipsApi->get_goal_relationship: %s\\n\" % e)",
"name": "python-sdk-v5"
},
{
"language": "python",
"install": "pip install asana==3.2.3",
"code": "import asana\n\nclient = asana.Client.access_token('PERSONAL_ACCESS_TOKEN')\n\nresult = client.goal_relationships.get_goal_relationship(goal_relationship_gid, {'param': 'value', 'param': 'value'}, opt_pretty=True)",
"name": "python-sdk-v3"
},
{
"language": "php",
"install": "composer require asana/asana",
"code": "<?php\nrequire 'vendor/autoload.php';\n\n$client = Asana\\Client::accessToken('PERSONAL_ACCESS_TOKEN');\n\n$result = $client->goalrelationships->getGoalRelationship($goal_relationship_gid, array('param' => 'value', 'param' => 'value'), array('opt_pretty' => 'true'))"
},
{
"language": "ruby",
"install": "gem install asana",
"code": "require 'asana'\n\nclient = Asana::Client.new do |c|\n c.authentication :access_token, 'PERSONAL_ACCESS_TOKEN'\nend\n\nresult = client.goal_relationships.get_goal_relationship(goal_relationship_gid: 'goal_relationship_gid', param: \"value\", param: \"value\", options: {pretty: true})"
}
]
},
"x-purple-suite-runtime": "unavailable"
}
PUT /api/1.0/goal_relationships/{goal_relationship_gid}
Update a goal relationship
An existing goal relationship can be updated by making a PUT request on the URL for
that goal relationship. Only the fields provided in the `data` block will be updated;
any unspecified fields will remain unchanged.
Returns the complete updated goal relationship record.
This operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.
Authentication
[
{
"personalAccessToken": []
},
{
"oauth2": []
}
]
Path-level parameters and metadata
{
"parameters": [
{
"$ref": "#/components/parameters/goal_relationship_path_gid"
},
{
"$ref": "#/components/parameters/pretty"
}
]
}
Request, responses and operation details
{
"summary": "Update a goal relationship",
"description": "An existing goal relationship can be updated by making a PUT request on the URL for\nthat goal relationship. Only the fields provided in the `data` block will be updated;\nany unspecified fields will remain unchanged.\n\nReturns the complete updated goal relationship record.\n\nThis operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.",
"tags": [
"Goal relationships"
],
"operationId": "updateGoalRelationship",
"parameters": [
{
"name": "opt_fields",
"in": "query",
"description": "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. Properties can include nested fields. To learn more, see the [input/output options guide](/docs/inputoutput-options#selecting-nested-fields).",
"required": false,
"example": [
"contribution_weight",
"resource_subtype",
"supported_goal",
"supported_goal.name",
"supported_goal.owner",
"supported_goal.owner.name",
"supporting_resource",
"supporting_resource.name",
"supporting_resource.resource_subtype"
],
"schema": {
"type": "array",
"items": {
"type": "string",
"enum": [
"contribution_weight",
"resource_subtype",
"supported_goal",
"supported_goal.name",
"supported_goal.owner",
"supported_goal.owner.name",
"supporting_resource",
"supporting_resource.name",
"supporting_resource.resource_subtype"
]
}
},
"style": "form",
"explode": false
}
],
"requestBody": {
"description": "The updated fields for the goal relationship.",
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"$ref": "#/components/schemas/GoalRelationshipRequest"
}
}
}
}
}
},
"responses": {
"200": {
"description": "Successfully updated the goal relationship.",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"$ref": "#/components/schemas/GoalRelationshipResponse"
}
}
}
}
}
},
"400": {
"$ref": "#/components/responses/BadRequest"
},
"401": {
"$ref": "#/components/responses/Unauthorized"
},
"403": {
"$ref": "#/components/responses/Forbidden"
},
"404": {
"$ref": "#/components/responses/NotFound"
},
"500": {
"$ref": "#/components/responses/InternalServerError"
}
},
"security": [
{
"personalAccessToken": []
},
{
"oauth2": []
}
],
"x-readme": {
"code-samples": [
{
"language": "java",
"install": "<dependency><groupId>com.asana</groupId><artifactId>asana</artifactId><version>1.0.0</version></dependency>",
"code": "import com.asana.Client;\n\nClient client = Client.accessToken(\"PERSONAL_ACCESS_TOKEN\");\n\nJsonElement result = client.goalrelationships.updateGoalRelationship(goalRelationshipGid)\n .data(\"field\", \"value\")\n .data(\"field\", \"value\")\n .option(\"pretty\", true)\n .execute();"
},
{
"language": "node",
"install": "npm install asana",
"code": "const Asana = require('asana');\n\nlet client = new Asana.ApiClient();\nclient.authentications.token.accessToken = '<YOUR_ACCESS_TOKEN>';\n\nlet goalRelationshipsApiInstance = new Asana.GoalRelationshipsApi(client);\nlet body = {\"data\": {\"<PARAM_1>\": \"<VALUE_1>\", \"<PARAM_2>\": \"<VALUE_2>\",}}; // Object | The updated fields for the goal relationship.\nlet goal_relationship_gid = \"12345\"; // String | Globally unique identifier for the goal relationship.\nlet opts = { \n 'opt_fields': \"contribution_weight,resource_subtype,supported_goal,supported_goal.name,supported_goal.owner,supported_goal.owner.name,supporting_resource,supporting_resource.name,supporting_resource.resource_subtype\"\n};\ngoalRelationshipsApiInstance.updateGoalRelationship(body, goal_relationship_gid, opts).then((result) => {\n console.log('API called successfully. Returned data: ' + JSON.stringify(result.data, null, 2));\n}, (error) => {\n console.error(error.response.body);\n});",
"name": "node-sdk-v3"
},
{
"language": "node",
"install": "npm install asana@1.0.5",
"code": "const asana = require('asana');\n\nconst client = asana.Client.create().useAccessToken('PERSONAL_ACCESS_TOKEN');\n\nclient.goalrelationships.updateGoalRelationship(goalRelationshipGid, {field: \"value\", field: \"value\", pretty: true})\n .then((result) => {\n console.log(result);\n });",
"name": "node-sdk-v1"
},
{
"language": "python",
"install": "pip install asana",
"code": "import asana\nfrom asana.rest import ApiException\nfrom pprint import pprint\n\nconfiguration = asana.Configuration()\nconfiguration.access_token = '<YOUR_ACCESS_TOKEN>'\napi_client = asana.ApiClient(configuration)\n\n# create an instance of the API class\ngoal_relationships_api_instance = asana.GoalRelationshipsApi(api_client)\nbody = {\"data\": {\"<PARAM_1>\": \"<VALUE_1>\", \"<PARAM_2>\": \"<VALUE_2>\",}} # dict | The updated fields for the goal relationship.\ngoal_relationship_gid = \"12345\" # str | Globally unique identifier for the goal relationship.\nopts = {\n 'opt_fields': \"contribution_weight,resource_subtype,supported_goal,supported_goal.name,supported_goal.owner,supported_goal.owner.name,supporting_resource,supporting_resource.name,supporting_resource.resource_subtype\", # list[str] | 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.\n}\n\ntry:\n # Update a goal relationship\n api_response = goal_relationships_api_instance.update_goal_relationship(body, goal_relationship_gid, opts)\n pprint(api_response)\nexcept ApiException as e:\n print(\"Exception when calling GoalRelationshipsApi->update_goal_relationship: %s\\n\" % e)",
"name": "python-sdk-v5"
},
{
"language": "python",
"install": "pip install asana==3.2.3",
"code": "import asana\n\nclient = asana.Client.access_token('PERSONAL_ACCESS_TOKEN')\n\nresult = client.goal_relationships.update_goal_relationship(goal_relationship_gid, {'field': 'value', 'field': 'value'}, opt_pretty=True)",
"name": "python-sdk-v3"
},
{
"language": "php",
"install": "composer require asana/asana",
"code": "<?php\nrequire 'vendor/autoload.php';\n\n$client = Asana\\Client::accessToken('PERSONAL_ACCESS_TOKEN');\n\n$result = $client->goalrelationships->updateGoalRelationship($goal_relationship_gid, array('field' => 'value', 'field' => 'value'), array('opt_pretty' => 'true'))"
},
{
"language": "ruby",
"install": "gem install asana",
"code": "require 'asana'\n\nclient = Asana::Client.new do |c|\n c.authentication :access_token, 'PERSONAL_ACCESS_TOKEN'\nend\n\nresult = client.goal_relationships.update_goal_relationship(goal_relationship_gid: 'goal_relationship_gid', field: \"value\", field: \"value\", options: {pretty: true})"
}
]
},
"x-purple-suite-runtime": "unavailable"
}
GET /api/1.0/goal_relationships
Get goal relationships
Returns compact goal relationship records.
This operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.
Authentication
[
{
"personalAccessToken": []
},
{
"oauth2": []
}
]
Request, responses and operation details
{
"summary": "Get goal relationships",
"description": "Returns compact goal relationship records.\n\nThis operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.",
"tags": [
"Goal relationships"
],
"operationId": "getGoalRelationships",
"parameters": [
{
"$ref": "#/components/parameters/pretty"
},
{
"$ref": "#/components/parameters/limit"
},
{
"$ref": "#/components/parameters/offset"
},
{
"name": "supported_goal",
"required": true,
"in": "query",
"description": "Globally unique identifier for the supported goal in the goal relationship.",
"schema": {
"type": "string"
},
"example": "12345"
},
{
"name": "resource_subtype",
"in": "query",
"description": "If provided, filter to goal relationships with a given resource_subtype.",
"schema": {
"type": "string"
},
"example": "subgoal"
},
{
"name": "opt_fields",
"in": "query",
"description": "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. Properties can include nested fields. To learn more, see the [input/output options guide](/docs/inputoutput-options#selecting-nested-fields).",
"required": false,
"example": [
"contribution_weight",
"offset",
"path",
"resource_subtype",
"supported_goal",
"supported_goal.name",
"supported_goal.owner",
"supported_goal.owner.name",
"supporting_resource",
"supporting_resource.name",
"supporting_resource.resource_subtype",
"uri"
],
"schema": {
"type": "array",
"items": {
"type": "string",
"enum": [
"contribution_weight",
"offset",
"path",
"resource_subtype",
"supported_goal",
"supported_goal.name",
"supported_goal.owner",
"supported_goal.owner.name",
"supporting_resource",
"supporting_resource.name",
"supporting_resource.resource_subtype",
"uri"
]
}
},
"style": "form",
"explode": false
}
],
"responses": {
"200": {
"description": "Successfully retrieved the requested goal relationships.",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"type": "array",
"items": {
"$ref": "#/components/schemas/GoalRelationshipCompact"
}
},
"next_page": {
"$ref": "#/components/schemas/NextPage"
}
}
}
}
}
},
"400": {
"$ref": "#/components/responses/BadRequest"
},
"401": {
"$ref": "#/components/responses/Unauthorized"
},
"403": {
"$ref": "#/components/responses/Forbidden"
},
"404": {
"$ref": "#/components/responses/NotFound"
},
"500": {
"$ref": "#/components/responses/InternalServerError"
}
},
"security": [
{
"personalAccessToken": []
},
{
"oauth2": []
}
],
"x-readme": {
"code-samples": [
{
"language": "java",
"install": "<dependency><groupId>com.asana</groupId><artifactId>asana</artifactId><version>1.0.0</version></dependency>",
"code": "import com.asana.Client;\n\nClient client = Client.accessToken(\"PERSONAL_ACCESS_TOKEN\");\n\nList<JsonElement> result = client.goalrelationships.getGoalRelationships(resourceSubtype, supportedGoal)\n .option(\"pretty\", true)\n .execute();"
},
{
"language": "node",
"install": "npm install asana",
"code": "const Asana = require('asana');\n\nlet client = new Asana.ApiClient();\nclient.authentications.token.accessToken = '<YOUR_ACCESS_TOKEN>';\n\nlet goalRelationshipsApiInstance = new Asana.GoalRelationshipsApi(client);\nlet supported_goal = \"12345\"; // String | Globally unique identifier for the supported goal in the goal relationship.\nlet opts = { \n 'limit': 50, \n 'offset': \"eyJ0eXAiOJiKV1iQLCJhbGciOiJIUzI1NiJ9\", \n 'resource_subtype': \"subgoal\", \n 'opt_fields': \"contribution_weight,offset,path,resource_subtype,supported_goal,supported_goal.name,supported_goal.owner,supported_goal.owner.name,supporting_resource,supporting_resource.name,supporting_resource.resource_subtype,uri\"\n};\ngoalRelationshipsApiInstance.getGoalRelationships(supported_goal, opts).then((result) => {\n console.log('API called successfully. Returned data: ' + JSON.stringify(result.data, null, 2));\n}, (error) => {\n console.error(error.response.body);\n});",
"name": "node-sdk-v3"
},
{
"language": "node",
"install": "npm install asana@1.0.5",
"code": "const asana = require('asana');\n\nconst client = asana.Client.create().useAccessToken('PERSONAL_ACCESS_TOKEN');\n\nclient.goalrelationships.getGoalRelationships({param: \"value\", param: \"value\", opt_pretty: true})\n .then((result) => {\n console.log(result);\n });",
"name": "node-sdk-v1"
},
{
"language": "python",
"install": "pip install asana",
"code": "import asana\nfrom asana.rest import ApiException\nfrom pprint import pprint\n\nconfiguration = asana.Configuration()\nconfiguration.access_token = '<YOUR_ACCESS_TOKEN>'\napi_client = asana.ApiClient(configuration)\n\n# create an instance of the API class\ngoal_relationships_api_instance = asana.GoalRelationshipsApi(api_client)\nsupported_goal = \"12345\" # str | Globally unique identifier for the supported goal in the goal relationship.\nopts = {\n 'limit': 50, # int | Results per page. The number of objects to return per page. The value must be between 1 and 100.\n 'offset': \"eyJ0eXAiOJiKV1iQLCJhbGciOiJIUzI1NiJ9\", # str | 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.*\n 'resource_subtype': \"subgoal\", # str | If provided, filter to goal relationships with a given resource_subtype.\n 'opt_fields': \"contribution_weight,offset,path,resource_subtype,supported_goal,supported_goal.name,supported_goal.owner,supported_goal.owner.name,supporting_resource,supporting_resource.name,supporting_resource.resource_subtype,uri\", # list[str] | 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.\n}\n\ntry:\n # Get goal relationships\n api_response = goal_relationships_api_instance.get_goal_relationships(supported_goal, opts)\n for data in api_response:\n pprint(data)\nexcept ApiException as e:\n print(\"Exception when calling GoalRelationshipsApi->get_goal_relationships: %s\\n\" % e)",
"name": "python-sdk-v5"
},
{
"language": "python",
"install": "pip install asana==3.2.3",
"code": "import asana\n\nclient = asana.Client.access_token('PERSONAL_ACCESS_TOKEN')\n\nresult = client.goal_relationships.get_goal_relationships({'param': 'value', 'param': 'value'}, opt_pretty=True)",
"name": "python-sdk-v3"
},
{
"language": "php",
"install": "composer require asana/asana",
"code": "<?php\nrequire 'vendor/autoload.php';\n\n$client = Asana\\Client::accessToken('PERSONAL_ACCESS_TOKEN');\n\n$result = $client->goalrelationships->getGoalRelationships(array('param' => 'value', 'param' => 'value'), array('opt_pretty' => 'true'))"
},
{
"language": "ruby",
"install": "gem install asana",
"code": "require 'asana'\n\nclient = Asana::Client.new do |c|\n c.authentication :access_token, 'PERSONAL_ACCESS_TOKEN'\nend\n\nresult = client.goal_relationships.get_goal_relationships(supported_goal: ''supported_goal_example'', param: \"value\", param: \"value\", options: {pretty: true})"
}
]
},
"x-purple-suite-runtime": "unavailable"
}
POST /api/1.0/goals/{goal_gid}/addSupportingRelationship
Add a supporting goal relationship
Creates a goal relationship by adding a supporting resource to a given goal.
Returns the newly created goal relationship record.
This operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.
Authentication
[
{
"personalAccessToken": []
},
{
"oauth2": []
}
]
Path-level parameters and metadata
{
"parameters": [
{
"$ref": "#/components/parameters/goal_path_gid"
},
{
"$ref": "#/components/parameters/pretty"
}
]
}
Request, responses and operation details
{
"summary": "Add a supporting goal relationship",
"description": "Creates a goal relationship by adding a supporting resource to a given goal.\n\nReturns the newly created goal relationship record.\n\nThis operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.",
"tags": [
"Goal relationships"
],
"operationId": "addSupportingRelationship",
"parameters": [
{
"name": "opt_fields",
"in": "query",
"description": "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. Properties can include nested fields. To learn more, see the [input/output options guide](/docs/inputoutput-options#selecting-nested-fields).",
"required": false,
"example": [
"contribution_weight",
"resource_subtype",
"supported_goal",
"supported_goal.name",
"supported_goal.owner",
"supported_goal.owner.name",
"supporting_resource",
"supporting_resource.name",
"supporting_resource.resource_subtype"
],
"schema": {
"type": "array",
"items": {
"type": "string",
"enum": [
"contribution_weight",
"resource_subtype",
"supported_goal",
"supported_goal.name",
"supported_goal.owner",
"supported_goal.owner.name",
"supporting_resource",
"supporting_resource.name",
"supporting_resource.resource_subtype"
]
}
},
"style": "form",
"explode": false
}
],
"requestBody": {
"description": "The supporting resource to be added to the goal",
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"$ref": "#/components/schemas/GoalAddSupportingRelationshipRequest"
}
}
}
}
}
},
"responses": {
"200": {
"description": "Successfully created the goal relationship.",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"$ref": "#/components/schemas/GoalRelationshipResponse"
}
}
}
}
}
},
"400": {
"$ref": "#/components/responses/BadRequest"
},
"401": {
"$ref": "#/components/responses/Unauthorized"
},
"403": {
"$ref": "#/components/responses/Forbidden"
},
"404": {
"$ref": "#/components/responses/NotFound"
},
"500": {
"$ref": "#/components/responses/InternalServerError"
}
},
"security": [
{
"personalAccessToken": []
},
{
"oauth2": []
}
],
"x-readme": {
"code-samples": [
{
"language": "java",
"install": "<dependency><groupId>com.asana</groupId><artifactId>asana</artifactId><version>1.0.0</version></dependency>",
"code": "import com.asana.Client;\n\nClient client = Client.accessToken(\"PERSONAL_ACCESS_TOKEN\");\n\nJsonElement result = client.goalrelationships.addSupportingRelationship(goalGid)\n .data(\"field\", \"value\")\n .data(\"field\", \"value\")\n .option(\"pretty\", true)\n .execute();"
},
{
"language": "node",
"install": "npm install asana",
"code": "const Asana = require('asana');\n\nlet client = new Asana.ApiClient();\nclient.authentications.token.accessToken = '<YOUR_ACCESS_TOKEN>';\n\nlet goalRelationshipsApiInstance = new Asana.GoalRelationshipsApi(client);\nlet body = {\"data\": {\"<PARAM_1>\": \"<VALUE_1>\", \"<PARAM_2>\": \"<VALUE_2>\",}}; // Object | The supporting resource to be added to the goal\nlet goal_gid = \"12345\"; // String | Globally unique identifier for the goal.\nlet opts = { \n 'opt_fields': \"contribution_weight,resource_subtype,supported_goal,supported_goal.name,supported_goal.owner,supported_goal.owner.name,supporting_resource,supporting_resource.name,supporting_resource.resource_subtype\"\n};\ngoalRelationshipsApiInstance.addSupportingRelationship(body, goal_gid, opts).then((result) => {\n console.log('API called successfully. Returned data: ' + JSON.stringify(result.data, null, 2));\n}, (error) => {\n console.error(error.response.body);\n});",
"name": "node-sdk-v3"
},
{
"language": "node",
"install": "npm install asana@1.0.5",
"code": "const asana = require('asana');\n\nconst client = asana.Client.create().useAccessToken('PERSONAL_ACCESS_TOKEN');\n\nclient.goalrelationships.addSupportingRelationship(goalGid, {field: \"value\", field: \"value\", pretty: true})\n .then((result) => {\n console.log(result);\n });",
"name": "node-sdk-v1"
},
{
"language": "python",
"install": "pip install asana",
"code": "import asana\nfrom asana.rest import ApiException\nfrom pprint import pprint\n\nconfiguration = asana.Configuration()\nconfiguration.access_token = '<YOUR_ACCESS_TOKEN>'\napi_client = asana.ApiClient(configuration)\n\n# create an instance of the API class\ngoal_relationships_api_instance = asana.GoalRelationshipsApi(api_client)\nbody = {\"data\": {\"<PARAM_1>\": \"<VALUE_1>\", \"<PARAM_2>\": \"<VALUE_2>\",}} # dict | The supporting resource to be added to the goal\ngoal_gid = \"12345\" # str | Globally unique identifier for the goal.\nopts = {\n 'opt_fields': \"contribution_weight,resource_subtype,supported_goal,supported_goal.name,supported_goal.owner,supported_goal.owner.name,supporting_resource,supporting_resource.name,supporting_resource.resource_subtype\", # list[str] | 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.\n}\n\ntry:\n # Add a supporting goal relationship\n api_response = goal_relationships_api_instance.add_supporting_relationship(body, goal_gid, opts)\n pprint(api_response)\nexcept ApiException as e:\n print(\"Exception when calling GoalRelationshipsApi->add_supporting_relationship: %s\\n\" % e)",
"name": "python-sdk-v5"
},
{
"language": "python",
"install": "pip install asana==3.2.3",
"code": "import asana\n\nclient = asana.Client.access_token('PERSONAL_ACCESS_TOKEN')\n\nresult = client.goal_relationships.add_supporting_relationship(goal_gid, {'field': 'value', 'field': 'value'}, opt_pretty=True)",
"name": "python-sdk-v3"
},
{
"language": "php",
"install": "composer require asana/asana",
"code": "<?php\nrequire 'vendor/autoload.php';\n\n$client = Asana\\Client::accessToken('PERSONAL_ACCESS_TOKEN');\n\n$result = $client->goalrelationships->addSupportingRelationship($goal_gid, array('field' => 'value', 'field' => 'value'), array('opt_pretty' => 'true'))"
},
{
"language": "ruby",
"install": "gem install asana",
"code": "require 'asana'\n\nclient = Asana::Client.new do |c|\n c.authentication :access_token, 'PERSONAL_ACCESS_TOKEN'\nend\n\nresult = client.goal_relationships.add_supporting_relationship(goal_gid: 'goal_gid', field: \"value\", field: \"value\", options: {pretty: true})"
}
]
},
"x-purple-suite-runtime": "unavailable"
}
POST /api/1.0/goals/{goal_gid}/removeSupportingRelationship
Removes a supporting goal relationship
Removes a goal relationship for a given parent goal.
This operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.
Authentication
[
{
"personalAccessToken": []
},
{
"oauth2": []
}
]
Path-level parameters and metadata
{
"parameters": [
{
"$ref": "#/components/parameters/goal_path_gid"
},
{
"$ref": "#/components/parameters/pretty"
}
]
}
Request, responses and operation details
{
"summary": "Removes a supporting goal relationship",
"description": "Removes a goal relationship for a given parent goal.\n\nThis operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.",
"tags": [
"Goal relationships"
],
"operationId": "removeSupportingRelationship",
"requestBody": {
"description": "The supporting resource to be removed from the goal",
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"$ref": "#/components/schemas/GoalRemoveSupportingRelationshipRequest"
}
}
}
}
}
},
"responses": {
"200": {
"description": "Successfully removed the goal relationship.",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"$ref": "#/components/schemas/EmptyResponse"
}
}
}
}
}
},
"400": {
"$ref": "#/components/responses/BadRequest"
},
"401": {
"$ref": "#/components/responses/Unauthorized"
},
"403": {
"$ref": "#/components/responses/Forbidden"
},
"404": {
"$ref": "#/components/responses/NotFound"
},
"500": {
"$ref": "#/components/responses/InternalServerError"
}
},
"security": [
{
"personalAccessToken": []
},
{
"oauth2": []
}
],
"x-readme": {
"code-samples": [
{
"language": "java",
"install": "<dependency><groupId>com.asana</groupId><artifactId>asana</artifactId><version>1.0.0</version></dependency>",
"code": "import com.asana.Client;\n\nClient client = Client.accessToken(\"PERSONAL_ACCESS_TOKEN\");\n\nJsonElement result = client.goalrelationships.removeSupportingRelationship(goalGid)\n .data(\"field\", \"value\")\n .data(\"field\", \"value\")\n .option(\"pretty\", true)\n .execute();"
},
{
"language": "node",
"install": "npm install asana",
"code": "const Asana = require('asana');\n\nlet client = new Asana.ApiClient();\nclient.authentications.token.accessToken = '<YOUR_ACCESS_TOKEN>';\n\nlet goalRelationshipsApiInstance = new Asana.GoalRelationshipsApi(client);\nlet body = {\"data\": {\"<PARAM_1>\": \"<VALUE_1>\", \"<PARAM_2>\": \"<VALUE_2>\",}}; // Object | The supporting resource to be removed from the goal\nlet goal_gid = \"12345\"; // String | Globally unique identifier for the goal.\n\ngoalRelationshipsApiInstance.removeSupportingRelationship(body, goal_gid).then((result) => {\n console.log('API called successfully. Returned data: ' + JSON.stringify(result.data, null, 2));\n}, (error) => {\n console.error(error.response.body);\n});",
"name": "node-sdk-v3"
},
{
"language": "node",
"install": "npm install asana@1.0.5",
"code": "const asana = require('asana');\n\nconst client = asana.Client.create().useAccessToken('PERSONAL_ACCESS_TOKEN');\n\nclient.goalrelationships.removeSupportingRelationship(goalGid, {field: \"value\", field: \"value\", pretty: true})\n .then((result) => {\n console.log(result);\n });",
"name": "node-sdk-v1"
},
{
"language": "python",
"install": "pip install asana",
"code": "import asana\nfrom asana.rest import ApiException\nfrom pprint import pprint\n\nconfiguration = asana.Configuration()\nconfiguration.access_token = '<YOUR_ACCESS_TOKEN>'\napi_client = asana.ApiClient(configuration)\n\n# create an instance of the API class\ngoal_relationships_api_instance = asana.GoalRelationshipsApi(api_client)\nbody = {\"data\": {\"<PARAM_1>\": \"<VALUE_1>\", \"<PARAM_2>\": \"<VALUE_2>\",}} # dict | The supporting resource to be removed from the goal\ngoal_gid = \"12345\" # str | Globally unique identifier for the goal.\n\n\ntry:\n # Removes a supporting goal relationship\n api_response = goal_relationships_api_instance.remove_supporting_relationship(body, goal_gid)\n pprint(api_response)\nexcept ApiException as e:\n print(\"Exception when calling GoalRelationshipsApi->remove_supporting_relationship: %s\\n\" % e)",
"name": "python-sdk-v5"
},
{
"language": "python",
"install": "pip install asana==3.2.3",
"code": "import asana\n\nclient = asana.Client.access_token('PERSONAL_ACCESS_TOKEN')\n\nresult = client.goal_relationships.remove_supporting_relationship(goal_gid, {'field': 'value', 'field': 'value'}, opt_pretty=True)",
"name": "python-sdk-v3"
},
{
"language": "php",
"install": "composer require asana/asana",
"code": "<?php\nrequire 'vendor/autoload.php';\n\n$client = Asana\\Client::accessToken('PERSONAL_ACCESS_TOKEN');\n\n$result = $client->goalrelationships->removeSupportingRelationship($goal_gid, array('field' => 'value', 'field' => 'value'), array('opt_pretty' => 'true'))"
},
{
"language": "ruby",
"install": "gem install asana",
"code": "require 'asana'\n\nclient = Asana::Client.new do |c|\n c.authentication :access_token, 'PERSONAL_ACCESS_TOKEN'\nend\n\nresult = client.goal_relationships.remove_supporting_relationship(goal_gid: 'goal_gid', field: \"value\", field: \"value\", options: {pretty: true})"
}
]
},
"x-purple-suite-runtime": "unavailable"
}
GET /api/1.0/goals/{goal_gid}
Get a goal
<b>Required scope: </b><code>goals:read</code>
<table>
<tr>
<th>Field</th>
<th>Required Scope</th>
</tr>
<tr>
<td><code>time_period</code></td>
<td><code>time_periods:read</code></td>
</tr>
</table>
Returns the complete goal record for a single goal.
This operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.
Authentication
[
{
"personalAccessToken": []
},
{
"oauth2": [
"goals:read"
]
}
]
Path-level parameters and metadata
{
"parameters": [
{
"$ref": "#/components/parameters/goal_path_gid"
},
{
"$ref": "#/components/parameters/pretty"
}
]
}
Request, responses and operation details
{
"summary": "Get a goal",
"description": "<b>Required scope: </b><code>goals:read</code>\n\n<table>\n <tr>\n <th>Field</th>\n <th>Required Scope</th>\n </tr>\n <tr>\n <td><code>time_period</code></td>\n <td><code>time_periods:read</code></td>\n </tr>\n</table>\n\nReturns the complete goal record for a single goal.\n\nThis operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.",
"tags": [
"Goals"
],
"operationId": "getGoal",
"parameters": [
{
"name": "opt_fields",
"in": "query",
"description": "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. Properties can include nested fields. To learn more, see the [input/output options guide](/docs/inputoutput-options#selecting-nested-fields).",
"required": false,
"example": [
"current_status_update",
"current_status_update.resource_subtype",
"current_status_update.title",
"custom_field_settings",
"custom_field_settings.custom_field",
"custom_field_settings.custom_field.asana_created_field",
"custom_field_settings.custom_field.created_by",
"custom_field_settings.custom_field.created_by.name",
"custom_field_settings.custom_field.currency_code",
"custom_field_settings.custom_field.custom_label",
"custom_field_settings.custom_field.custom_label_position",
"custom_field_settings.custom_field.date_value",
"custom_field_settings.custom_field.date_value.date",
"custom_field_settings.custom_field.date_value.date_time",
"custom_field_settings.custom_field.default_access_level",
"custom_field_settings.custom_field.description",
"custom_field_settings.custom_field.display_value",
"custom_field_settings.custom_field.enabled",
"custom_field_settings.custom_field.enum_options",
"custom_field_settings.custom_field.enum_options.color",
"custom_field_settings.custom_field.enum_options.enabled",
"custom_field_settings.custom_field.enum_options.name",
"custom_field_settings.custom_field.enum_value",
"custom_field_settings.custom_field.enum_value.color",
"custom_field_settings.custom_field.enum_value.enabled",
"custom_field_settings.custom_field.enum_value.name",
"custom_field_settings.custom_field.format",
"custom_field_settings.custom_field.has_notifications_enabled",
"custom_field_settings.custom_field.html_text_value",
"custom_field_settings.custom_field.id_prefix",
"custom_field_settings.custom_field.input_restrictions",
"custom_field_settings.custom_field.is_formula_field",
"custom_field_settings.custom_field.is_global_to_workspace",
"custom_field_settings.custom_field.is_value_read_only",
"custom_field_settings.custom_field.multi_enum_values",
"custom_field_settings.custom_field.multi_enum_values.color",
"custom_field_settings.custom_field.multi_enum_values.enabled",
"custom_field_settings.custom_field.multi_enum_values.name",
"custom_field_settings.custom_field.name",
"custom_field_settings.custom_field.number_value",
"custom_field_settings.custom_field.people_value",
"custom_field_settings.custom_field.people_value.name",
"custom_field_settings.custom_field.precision",
"custom_field_settings.custom_field.privacy_setting",
"custom_field_settings.custom_field.reference_value",
"custom_field_settings.custom_field.reference_value.name",
"custom_field_settings.custom_field.representation_type",
"custom_field_settings.custom_field.resource_subtype",
"custom_field_settings.custom_field.text_value",
"custom_field_settings.custom_field.type",
"custom_field_settings.is_important",
"custom_field_settings.parent",
"custom_field_settings.parent.name",
"custom_field_settings.parent.resource_subtype",
"custom_field_settings.project",
"custom_field_settings.project.name",
"custom_field_settings.project.resource_subtype",
"custom_fields",
"custom_fields.date_value",
"custom_fields.date_value.date",
"custom_fields.date_value.date_time",
"custom_fields.display_value",
"custom_fields.enabled",
"custom_fields.enum_options",
"custom_fields.enum_options.color",
"custom_fields.enum_options.enabled",
"custom_fields.enum_options.name",
"custom_fields.enum_value",
"custom_fields.enum_value.color",
"custom_fields.enum_value.enabled",
"custom_fields.enum_value.name",
"custom_fields.id_prefix",
"custom_fields.input_restrictions",
"custom_fields.is_formula_field",
"custom_fields.multi_enum_values",
"custom_fields.multi_enum_values.color",
"custom_fields.multi_enum_values.enabled",
"custom_fields.multi_enum_values.name",
"custom_fields.name",
"custom_fields.number_value",
"custom_fields.representation_type",
"custom_fields.text_value",
"custom_fields.type",
"default_access_level",
"due_on",
"followers",
"followers.name",
"html_notes",
"is_workspace_level",
"liked",
"likes",
"likes.user",
"likes.user.name",
"metric",
"metric.can_manage",
"metric.currency_code",
"metric.current_display_value",
"metric.current_number_value",
"metric.initial_number_value",
"metric.is_custom_weight",
"metric.precision",
"metric.progress_source",
"metric.resource_subtype",
"metric.target_number_value",
"metric.unit",
"name",
"notes",
"num_likes",
"owner",
"owner.name",
"privacy_setting",
"start_on",
"status",
"team",
"team.name",
"time_period",
"time_period.display_name",
"time_period.end_on",
"time_period.period",
"time_period.start_on",
"workspace",
"workspace.name"
],
"schema": {
"type": "array",
"items": {
"type": "string",
"enum": [
"current_status_update",
"current_status_update.resource_subtype",
"current_status_update.title",
"custom_field_settings",
"custom_field_settings.custom_field",
"custom_field_settings.custom_field.asana_created_field",
"custom_field_settings.custom_field.created_by",
"custom_field_settings.custom_field.created_by.name",
"custom_field_settings.custom_field.currency_code",
"custom_field_settings.custom_field.custom_label",
"custom_field_settings.custom_field.custom_label_position",
"custom_field_settings.custom_field.date_value",
"custom_field_settings.custom_field.date_value.date",
"custom_field_settings.custom_field.date_value.date_time",
"custom_field_settings.custom_field.default_access_level",
"custom_field_settings.custom_field.description",
"custom_field_settings.custom_field.display_value",
"custom_field_settings.custom_field.enabled",
"custom_field_settings.custom_field.enum_options",
"custom_field_settings.custom_field.enum_options.color",
"custom_field_settings.custom_field.enum_options.enabled",
"custom_field_settings.custom_field.enum_options.name",
"custom_field_settings.custom_field.enum_value",
"custom_field_settings.custom_field.enum_value.color",
"custom_field_settings.custom_field.enum_value.enabled",
"custom_field_settings.custom_field.enum_value.name",
"custom_field_settings.custom_field.format",
"custom_field_settings.custom_field.has_notifications_enabled",
"custom_field_settings.custom_field.html_text_value",
"custom_field_settings.custom_field.id_prefix",
"custom_field_settings.custom_field.input_restrictions",
"custom_field_settings.custom_field.is_formula_field",
"custom_field_settings.custom_field.is_global_to_workspace",
"custom_field_settings.custom_field.is_value_read_only",
"custom_field_settings.custom_field.multi_enum_values",
"custom_field_settings.custom_field.multi_enum_values.color",
"custom_field_settings.custom_field.multi_enum_values.enabled",
"custom_field_settings.custom_field.multi_enum_values.name",
"custom_field_settings.custom_field.name",
"custom_field_settings.custom_field.number_value",
"custom_field_settings.custom_field.people_value",
"custom_field_settings.custom_field.people_value.name",
"custom_field_settings.custom_field.precision",
"custom_field_settings.custom_field.privacy_setting",
"custom_field_settings.custom_field.reference_value",
"custom_field_settings.custom_field.reference_value.name",
"custom_field_settings.custom_field.representation_type",
"custom_field_settings.custom_field.resource_subtype",
"custom_field_settings.custom_field.text_value",
"custom_field_settings.custom_field.type",
"custom_field_settings.is_important",
"custom_field_settings.parent",
"custom_field_settings.parent.name",
"custom_field_settings.parent.resource_subtype",
"custom_field_settings.project",
"custom_field_settings.project.name",
"custom_field_settings.project.resource_subtype",
"custom_fields",
"custom_fields.date_value",
"custom_fields.date_value.date",
"custom_fields.date_value.date_time",
"custom_fields.display_value",
"custom_fields.enabled",
"custom_fields.enum_options",
"custom_fields.enum_options.color",
"custom_fields.enum_options.enabled",
"custom_fields.enum_options.name",
"custom_fields.enum_value",
"custom_fields.enum_value.color",
"custom_fields.enum_value.enabled",
"custom_fields.enum_value.name",
"custom_fields.id_prefix",
"custom_fields.input_restrictions",
"custom_fields.is_formula_field",
"custom_fields.multi_enum_values",
"custom_fields.multi_enum_values.color",
"custom_fields.multi_enum_values.enabled",
"custom_fields.multi_enum_values.name",
"custom_fields.name",
"custom_fields.number_value",
"custom_fields.representation_type",
"custom_fields.text_value",
"custom_fields.type",
"default_access_level",
"due_on",
"followers",
"followers.name",
"html_notes",
"is_workspace_level",
"liked",
"likes",
"likes.user",
"likes.user.name",
"metric",
"metric.can_manage",
"metric.currency_code",
"metric.current_display_value",
"metric.current_number_value",
"metric.initial_number_value",
"metric.is_custom_weight",
"metric.precision",
"metric.progress_source",
"metric.resource_subtype",
"metric.target_number_value",
"metric.unit",
"name",
"notes",
"num_likes",
"owner",
"owner.name",
"privacy_setting",
"start_on",
"status",
"team",
"team.name",
"time_period",
"time_period.display_name",
"time_period.end_on",
"time_period.period",
"time_period.start_on",
"workspace",
"workspace.name"
]
}
},
"style": "form",
"explode": false
}
],
"responses": {
"200": {
"description": "Successfully retrieved the record for a single goal.",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"$ref": "#/components/schemas/GoalResponse"
}
}
}
}
}
},
"400": {
"$ref": "#/components/responses/BadRequest"
},
"401": {
"$ref": "#/components/responses/Unauthorized"
},
"402": {
"$ref": "#/components/responses/PaymentRequired"
},
"403": {
"$ref": "#/components/responses/Forbidden"
},
"404": {
"$ref": "#/components/responses/NotFound"
},
"500": {
"$ref": "#/components/responses/InternalServerError"
}
},
"security": [
{
"personalAccessToken": []
},
{
"oauth2": [
"goals:read"
]
}
],
"x-readme": {
"code-samples": [
{
"language": "java",
"install": "<dependency><groupId>com.asana</groupId><artifactId>asana</artifactId><version>1.0.0</version></dependency>",
"code": "import com.asana.Client;\n\nClient client = Client.accessToken(\"PERSONAL_ACCESS_TOKEN\");\n\nJsonElement result = client.goals.getGoal(goalGid)\n .option(\"pretty\", true)\n .execute();"
},
{
"language": "node",
"install": "npm install asana",
"code": "const Asana = require('asana');\n\nlet client = new Asana.ApiClient();\nclient.authentications.token.accessToken = '<YOUR_ACCESS_TOKEN>';\n\nlet goalsApiInstance = new Asana.GoalsApi(client);\nlet goal_gid = \"12345\"; // String | Globally unique identifier for the goal.\nlet opts = { \n 'opt_fields': \"current_status_update,current_status_update.resource_subtype,current_status_update.title,custom_field_settings,custom_field_settings.custom_field,custom_field_settings.custom_field.asana_created_field,custom_field_settings.custom_field.created_by,custom_field_settings.custom_field.created_by.name,custom_field_settings.custom_field.currency_code,custom_field_settings.custom_field.custom_label,custom_field_settings.custom_field.custom_label_position,custom_field_settings.custom_field.date_value,custom_field_settings.custom_field.date_value.date,custom_field_settings.custom_field.date_value.date_time,custom_field_settings.custom_field.default_access_level,custom_field_settings.custom_field.description,custom_field_settings.custom_field.display_value,custom_field_settings.custom_field.enabled,custom_field_settings.custom_field.enum_options,custom_field_settings.custom_field.enum_options.color,custom_field_settings.custom_field.enum_options.enabled,custom_field_settings.custom_field.enum_options.name,custom_field_settings.custom_field.enum_value,custom_field_settings.custom_field.enum_value.color,custom_field_settings.custom_field.enum_value.enabled,custom_field_settings.custom_field.enum_value.name,custom_field_settings.custom_field.format,custom_field_settings.custom_field.has_notifications_enabled,custom_field_settings.custom_field.html_text_value,custom_field_settings.custom_field.id_prefix,custom_field_settings.custom_field.input_restrictions,custom_field_settings.custom_field.is_formula_field,custom_field_settings.custom_field.is_global_to_workspace,custom_field_settings.custom_field.is_value_read_only,custom_field_settings.custom_field.multi_enum_values,custom_field_settings.custom_field.multi_enum_values.color,custom_field_settings.custom_field.multi_enum_values.enabled,custom_field_settings.custom_field.multi_enum_values.name,custom_field_settings.custom_field.name,custom_field_settings.custom_field.number_value,custom_field_settings.custom_field.people_value,custom_field_settings.custom_field.people_value.name,custom_field_settings.custom_field.precision,custom_field_settings.custom_field.privacy_setting,custom_field_settings.custom_field.reference_value,custom_field_settings.custom_field.reference_value.name,custom_field_settings.custom_field.representation_type,custom_field_settings.custom_field.resource_subtype,custom_field_settings.custom_field.text_value,custom_field_settings.custom_field.type,custom_field_settings.is_important,custom_field_settings.parent,custom_field_settings.parent.name,custom_field_settings.parent.resource_subtype,custom_field_settings.project,custom_field_settings.project.name,custom_field_settings.project.resource_subtype,custom_fields,custom_fields.date_value,custom_fields.date_value.date,custom_fields.date_value.date_time,custom_fields.display_value,custom_fields.enabled,custom_fields.enum_options,custom_fields.enum_options.color,custom_fields.enum_options.enabled,custom_fields.enum_options.name,custom_fields.enum_value,custom_fields.enum_value.color,custom_fields.enum_value.enabled,custom_fields.enum_value.name,custom_fields.id_prefix,custom_fields.input_restrictions,custom_fields.is_formula_field,custom_fields.multi_enum_values,custom_fields.multi_enum_values.color,custom_fields.multi_enum_values.enabled,custom_fields.multi_enum_values.name,custom_fields.name,custom_fields.number_value,custom_fields.representation_type,custom_fields.text_value,custom_fields.type,default_access_level,due_on,followers,followers.name,html_notes,is_workspace_level,liked,likes,likes.user,likes.user.name,metric,metric.can_manage,metric.currency_code,metric.current_display_value,metric.current_number_value,metric.initial_number_value,metric.is_custom_weight,metric.precision,metric.progress_source,metric.resource_subtype,metric.target_number_value,metric.unit,name,notes,num_likes,owner,owner.name,privacy_setting,start_on,status,team,team.name,time_period,time_period.display_name,time_period.end_on,time_period.period,time_period.start_on,workspace,workspace.name\"\n};\ngoalsApiInstance.getGoal(goal_gid, opts).then((result) => {\n console.log('API called successfully. Returned data: ' + JSON.stringify(result.data, null, 2));\n}, (error) => {\n console.error(error.response.body);\n});",
"name": "node-sdk-v3"
},
{
"language": "node",
"install": "npm install asana@1.0.5",
"code": "const asana = require('asana');\n\nconst client = asana.Client.create().useAccessToken('PERSONAL_ACCESS_TOKEN');\n\nclient.goals.getGoal(goalGid, {param: \"value\", param: \"value\", opt_pretty: true})\n .then((result) => {\n console.log(result);\n });",
"name": "node-sdk-v1"
},
{
"language": "python",
"install": "pip install asana",
"code": "import asana\nfrom asana.rest import ApiException\nfrom pprint import pprint\n\nconfiguration = asana.Configuration()\nconfiguration.access_token = '<YOUR_ACCESS_TOKEN>'\napi_client = asana.ApiClient(configuration)\n\n# create an instance of the API class\ngoals_api_instance = asana.GoalsApi(api_client)\ngoal_gid = \"12345\" # str | Globally unique identifier for the goal.\nopts = {\n 'opt_fields': \"current_status_update,current_status_update.resource_subtype,current_status_update.title,custom_field_settings,custom_field_settings.custom_field,custom_field_settings.custom_field.asana_created_field,custom_field_settings.custom_field.created_by,custom_field_settings.custom_field.created_by.name,custom_field_settings.custom_field.currency_code,custom_field_settings.custom_field.custom_label,custom_field_settings.custom_field.custom_label_position,custom_field_settings.custom_field.date_value,custom_field_settings.custom_field.date_value.date,custom_field_settings.custom_field.date_value.date_time,custom_field_settings.custom_field.default_access_level,custom_field_settings.custom_field.description,custom_field_settings.custom_field.display_value,custom_field_settings.custom_field.enabled,custom_field_settings.custom_field.enum_options,custom_field_settings.custom_field.enum_options.color,custom_field_settings.custom_field.enum_options.enabled,custom_field_settings.custom_field.enum_options.name,custom_field_settings.custom_field.enum_value,custom_field_settings.custom_field.enum_value.color,custom_field_settings.custom_field.enum_value.enabled,custom_field_settings.custom_field.enum_value.name,custom_field_settings.custom_field.format,custom_field_settings.custom_field.has_notifications_enabled,custom_field_settings.custom_field.html_text_value,custom_field_settings.custom_field.id_prefix,custom_field_settings.custom_field.input_restrictions,custom_field_settings.custom_field.is_formula_field,custom_field_settings.custom_field.is_global_to_workspace,custom_field_settings.custom_field.is_value_read_only,custom_field_settings.custom_field.multi_enum_values,custom_field_settings.custom_field.multi_enum_values.color,custom_field_settings.custom_field.multi_enum_values.enabled,custom_field_settings.custom_field.multi_enum_values.name,custom_field_settings.custom_field.name,custom_field_settings.custom_field.number_value,custom_field_settings.custom_field.people_value,custom_field_settings.custom_field.people_value.name,custom_field_settings.custom_field.precision,custom_field_settings.custom_field.privacy_setting,custom_field_settings.custom_field.reference_value,custom_field_settings.custom_field.reference_value.name,custom_field_settings.custom_field.representation_type,custom_field_settings.custom_field.resource_subtype,custom_field_settings.custom_field.text_value,custom_field_settings.custom_field.type,custom_field_settings.is_important,custom_field_settings.parent,custom_field_settings.parent.name,custom_field_settings.parent.resource_subtype,custom_field_settings.project,custom_field_settings.project.name,custom_field_settings.project.resource_subtype,custom_fields,custom_fields.date_value,custom_fields.date_value.date,custom_fields.date_value.date_time,custom_fields.display_value,custom_fields.enabled,custom_fields.enum_options,custom_fields.enum_options.color,custom_fields.enum_options.enabled,custom_fields.enum_options.name,custom_fields.enum_value,custom_fields.enum_value.color,custom_fields.enum_value.enabled,custom_fields.enum_value.name,custom_fields.id_prefix,custom_fields.input_restrictions,custom_fields.is_formula_field,custom_fields.multi_enum_values,custom_fields.multi_enum_values.color,custom_fields.multi_enum_values.enabled,custom_fields.multi_enum_values.name,custom_fields.name,custom_fields.number_value,custom_fields.representation_type,custom_fields.text_value,custom_fields.type,default_access_level,due_on,followers,followers.name,html_notes,is_workspace_level,liked,likes,likes.user,likes.user.name,metric,metric.can_manage,metric.currency_code,metric.current_display_value,metric.current_number_value,metric.initial_number_value,metric.is_custom_weight,metric.precision,metric.progress_source,metric.resource_subtype,metric.target_number_value,metric.unit,name,notes,num_likes,owner,owner.name,privacy_setting,start_on,status,team,team.name,time_period,time_period.display_name,time_period.end_on,time_period.period,time_period.start_on,workspace,workspace.name\", # list[str] | 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.\n}\n\ntry:\n # Get a goal\n api_response = goals_api_instance.get_goal(goal_gid, opts)\n pprint(api_response)\nexcept ApiException as e:\n print(\"Exception when calling GoalsApi->get_goal: %s\\n\" % e)",
"name": "python-sdk-v5"
},
{
"language": "python",
"install": "pip install asana==3.2.3",
"code": "import asana\n\nclient = asana.Client.access_token('PERSONAL_ACCESS_TOKEN')\n\nresult = client.goals.get_goal(goal_gid, {'param': 'value', 'param': 'value'}, opt_pretty=True)",
"name": "python-sdk-v3"
},
{
"language": "php",
"install": "composer require asana/asana",
"code": "<?php\nrequire 'vendor/autoload.php';\n\n$client = Asana\\Client::accessToken('PERSONAL_ACCESS_TOKEN');\n\n$result = $client->goals->getGoal($goal_gid, array('param' => 'value', 'param' => 'value'), array('opt_pretty' => 'true'))"
},
{
"language": "ruby",
"install": "gem install asana",
"code": "require 'asana'\n\nclient = Asana::Client.new do |c|\n c.authentication :access_token, 'PERSONAL_ACCESS_TOKEN'\nend\n\nresult = client.goals.get_goal(goal_gid: 'goal_gid', param: \"value\", param: \"value\", options: {pretty: true})"
}
]
},
"x-purple-suite-runtime": "unavailable"
}
PUT /api/1.0/goals/{goal_gid}
Update a goal
An existing goal can be updated by making a PUT request on the URL for
that goal. Only the fields provided in the `data` block will be updated;
any unspecified fields will remain unchanged.
Returns the complete updated goal record.
This operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.
Authentication
[
{
"personalAccessToken": []
},
{
"oauth2": []
}
]
Path-level parameters and metadata
{
"parameters": [
{
"$ref": "#/components/parameters/goal_path_gid"
},
{
"$ref": "#/components/parameters/pretty"
}
]
}
Request, responses and operation details
{
"summary": "Update a goal",
"description": "An existing goal can be updated by making a PUT request on the URL for\nthat goal. Only the fields provided in the `data` block will be updated;\nany unspecified fields will remain unchanged.\n\nReturns the complete updated goal record.\n\nThis operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.",
"tags": [
"Goals"
],
"operationId": "updateGoal",
"parameters": [
{
"name": "opt_fields",
"in": "query",
"description": "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. Properties can include nested fields. To learn more, see the [input/output options guide](/docs/inputoutput-options#selecting-nested-fields).",
"required": false,
"example": [
"current_status_update",
"current_status_update.resource_subtype",
"current_status_update.title",
"custom_field_settings",
"custom_field_settings.custom_field",
"custom_field_settings.custom_field.asana_created_field",
"custom_field_settings.custom_field.created_by",
"custom_field_settings.custom_field.created_by.name",
"custom_field_settings.custom_field.currency_code",
"custom_field_settings.custom_field.custom_label",
"custom_field_settings.custom_field.custom_label_position",
"custom_field_settings.custom_field.date_value",
"custom_field_settings.custom_field.date_value.date",
"custom_field_settings.custom_field.date_value.date_time",
"custom_field_settings.custom_field.default_access_level",
"custom_field_settings.custom_field.description",
"custom_field_settings.custom_field.display_value",
"custom_field_settings.custom_field.enabled",
"custom_field_settings.custom_field.enum_options",
"custom_field_settings.custom_field.enum_options.color",
"custom_field_settings.custom_field.enum_options.enabled",
"custom_field_settings.custom_field.enum_options.name",
"custom_field_settings.custom_field.enum_value",
"custom_field_settings.custom_field.enum_value.color",
"custom_field_settings.custom_field.enum_value.enabled",
"custom_field_settings.custom_field.enum_value.name",
"custom_field_settings.custom_field.format",
"custom_field_settings.custom_field.has_notifications_enabled",
"custom_field_settings.custom_field.html_text_value",
"custom_field_settings.custom_field.id_prefix",
"custom_field_settings.custom_field.input_restrictions",
"custom_field_settings.custom_field.is_formula_field",
"custom_field_settings.custom_field.is_global_to_workspace",
"custom_field_settings.custom_field.is_value_read_only",
"custom_field_settings.custom_field.multi_enum_values",
"custom_field_settings.custom_field.multi_enum_values.color",
"custom_field_settings.custom_field.multi_enum_values.enabled",
"custom_field_settings.custom_field.multi_enum_values.name",
"custom_field_settings.custom_field.name",
"custom_field_settings.custom_field.number_value",
"custom_field_settings.custom_field.people_value",
"custom_field_settings.custom_field.people_value.name",
"custom_field_settings.custom_field.precision",
"custom_field_settings.custom_field.privacy_setting",
"custom_field_settings.custom_field.reference_value",
"custom_field_settings.custom_field.reference_value.name",
"custom_field_settings.custom_field.representation_type",
"custom_field_settings.custom_field.resource_subtype",
"custom_field_settings.custom_field.text_value",
"custom_field_settings.custom_field.type",
"custom_field_settings.is_important",
"custom_field_settings.parent",
"custom_field_settings.parent.name",
"custom_field_settings.parent.resource_subtype",
"custom_field_settings.project",
"custom_field_settings.project.name",
"custom_field_settings.project.resource_subtype",
"custom_fields",
"custom_fields.date_value",
"custom_fields.date_value.date",
"custom_fields.date_value.date_time",
"custom_fields.display_value",
"custom_fields.enabled",
"custom_fields.enum_options",
"custom_fields.enum_options.color",
"custom_fields.enum_options.enabled",
"custom_fields.enum_options.name",
"custom_fields.enum_value",
"custom_fields.enum_value.color",
"custom_fields.enum_value.enabled",
"custom_fields.enum_value.name",
"custom_fields.id_prefix",
"custom_fields.input_restrictions",
"custom_fields.is_formula_field",
"custom_fields.multi_enum_values",
"custom_fields.multi_enum_values.color",
"custom_fields.multi_enum_values.enabled",
"custom_fields.multi_enum_values.name",
"custom_fields.name",
"custom_fields.number_value",
"custom_fields.representation_type",
"custom_fields.text_value",
"custom_fields.type",
"default_access_level",
"due_on",
"followers",
"followers.name",
"html_notes",
"is_workspace_level",
"liked",
"likes",
"likes.user",
"likes.user.name",
"metric",
"metric.can_manage",
"metric.currency_code",
"metric.current_display_value",
"metric.current_number_value",
"metric.initial_number_value",
"metric.is_custom_weight",
"metric.precision",
"metric.progress_source",
"metric.resource_subtype",
"metric.target_number_value",
"metric.unit",
"name",
"notes",
"num_likes",
"owner",
"owner.name",
"privacy_setting",
"start_on",
"status",
"team",
"team.name",
"time_period",
"time_period.display_name",
"time_period.end_on",
"time_period.period",
"time_period.start_on",
"workspace",
"workspace.name"
],
"schema": {
"type": "array",
"items": {
"type": "string",
"enum": [
"current_status_update",
"current_status_update.resource_subtype",
"current_status_update.title",
"custom_field_settings",
"custom_field_settings.custom_field",
"custom_field_settings.custom_field.asana_created_field",
"custom_field_settings.custom_field.created_by",
"custom_field_settings.custom_field.created_by.name",
"custom_field_settings.custom_field.currency_code",
"custom_field_settings.custom_field.custom_label",
"custom_field_settings.custom_field.custom_label_position",
"custom_field_settings.custom_field.date_value",
"custom_field_settings.custom_field.date_value.date",
"custom_field_settings.custom_field.date_value.date_time",
"custom_field_settings.custom_field.default_access_level",
"custom_field_settings.custom_field.description",
"custom_field_settings.custom_field.display_value",
"custom_field_settings.custom_field.enabled",
"custom_field_settings.custom_field.enum_options",
"custom_field_settings.custom_field.enum_options.color",
"custom_field_settings.custom_field.enum_options.enabled",
"custom_field_settings.custom_field.enum_options.name",
"custom_field_settings.custom_field.enum_value",
"custom_field_settings.custom_field.enum_value.color",
"custom_field_settings.custom_field.enum_value.enabled",
"custom_field_settings.custom_field.enum_value.name",
"custom_field_settings.custom_field.format",
"custom_field_settings.custom_field.has_notifications_enabled",
"custom_field_settings.custom_field.html_text_value",
"custom_field_settings.custom_field.id_prefix",
"custom_field_settings.custom_field.input_restrictions",
"custom_field_settings.custom_field.is_formula_field",
"custom_field_settings.custom_field.is_global_to_workspace",
"custom_field_settings.custom_field.is_value_read_only",
"custom_field_settings.custom_field.multi_enum_values",
"custom_field_settings.custom_field.multi_enum_values.color",
"custom_field_settings.custom_field.multi_enum_values.enabled",
"custom_field_settings.custom_field.multi_enum_values.name",
"custom_field_settings.custom_field.name",
"custom_field_settings.custom_field.number_value",
"custom_field_settings.custom_field.people_value",
"custom_field_settings.custom_field.people_value.name",
"custom_field_settings.custom_field.precision",
"custom_field_settings.custom_field.privacy_setting",
"custom_field_settings.custom_field.reference_value",
"custom_field_settings.custom_field.reference_value.name",
"custom_field_settings.custom_field.representation_type",
"custom_field_settings.custom_field.resource_subtype",
"custom_field_settings.custom_field.text_value",
"custom_field_settings.custom_field.type",
"custom_field_settings.is_important",
"custom_field_settings.parent",
"custom_field_settings.parent.name",
"custom_field_settings.parent.resource_subtype",
"custom_field_settings.project",
"custom_field_settings.project.name",
"custom_field_settings.project.resource_subtype",
"custom_fields",
"custom_fields.date_value",
"custom_fields.date_value.date",
"custom_fields.date_value.date_time",
"custom_fields.display_value",
"custom_fields.enabled",
"custom_fields.enum_options",
"custom_fields.enum_options.color",
"custom_fields.enum_options.enabled",
"custom_fields.enum_options.name",
"custom_fields.enum_value",
"custom_fields.enum_value.color",
"custom_fields.enum_value.enabled",
"custom_fields.enum_value.name",
"custom_fields.id_prefix",
"custom_fields.input_restrictions",
"custom_fields.is_formula_field",
"custom_fields.multi_enum_values",
"custom_fields.multi_enum_values.color",
"custom_fields.multi_enum_values.enabled",
"custom_fields.multi_enum_values.name",
"custom_fields.name",
"custom_fields.number_value",
"custom_fields.representation_type",
"custom_fields.text_value",
"custom_fields.type",
"default_access_level",
"due_on",
"followers",
"followers.name",
"html_notes",
"is_workspace_level",
"liked",
"likes",
"likes.user",
"likes.user.name",
"metric",
"metric.can_manage",
"metric.currency_code",
"metric.current_display_value",
"metric.current_number_value",
"metric.initial_number_value",
"metric.is_custom_weight",
"metric.precision",
"metric.progress_source",
"metric.resource_subtype",
"metric.target_number_value",
"metric.unit",
"name",
"notes",
"num_likes",
"owner",
"owner.name",
"privacy_setting",
"start_on",
"status",
"team",
"team.name",
"time_period",
"time_period.display_name",
"time_period.end_on",
"time_period.period",
"time_period.start_on",
"workspace",
"workspace.name"
]
}
},
"style": "form",
"explode": false
}
],
"requestBody": {
"description": "The updated fields for the goal.",
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"$ref": "#/components/schemas/GoalUpdateRequest"
}
}
}
}
}
},
"responses": {
"200": {
"description": "Successfully updated the goal.",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"$ref": "#/components/schemas/GoalResponse"
}
}
}
}
}
},
"400": {
"$ref": "#/components/responses/BadRequest"
},
"401": {
"$ref": "#/components/responses/Unauthorized"
},
"403": {
"$ref": "#/components/responses/Forbidden"
},
"404": {
"$ref": "#/components/responses/NotFound"
},
"500": {
"$ref": "#/components/responses/InternalServerError"
}
},
"security": [
{
"personalAccessToken": []
},
{
"oauth2": []
}
],
"x-readme": {
"code-samples": [
{
"language": "java",
"install": "<dependency><groupId>com.asana</groupId><artifactId>asana</artifactId><version>1.0.0</version></dependency>",
"code": "import com.asana.Client;\n\nClient client = Client.accessToken(\"PERSONAL_ACCESS_TOKEN\");\n\nJsonElement result = client.goals.updateGoal(goalGid)\n .data(\"field\", \"value\")\n .data(\"field\", \"value\")\n .option(\"pretty\", true)\n .execute();"
},
{
"language": "node",
"install": "npm install asana",
"code": "const Asana = require('asana');\n\nlet client = new Asana.ApiClient();\nclient.authentications.token.accessToken = '<YOUR_ACCESS_TOKEN>';\n\nlet goalsApiInstance = new Asana.GoalsApi(client);\nlet body = {\"data\": {\"<PARAM_1>\": \"<VALUE_1>\", \"<PARAM_2>\": \"<VALUE_2>\",}}; // Object | The updated fields for the goal.\nlet goal_gid = \"12345\"; // String | Globally unique identifier for the goal.\nlet opts = { \n 'opt_fields': \"current_status_update,current_status_update.resource_subtype,current_status_update.title,custom_field_settings,custom_field_settings.custom_field,custom_field_settings.custom_field.asana_created_field,custom_field_settings.custom_field.created_by,custom_field_settings.custom_field.created_by.name,custom_field_settings.custom_field.currency_code,custom_field_settings.custom_field.custom_label,custom_field_settings.custom_field.custom_label_position,custom_field_settings.custom_field.date_value,custom_field_settings.custom_field.date_value.date,custom_field_settings.custom_field.date_value.date_time,custom_field_settings.custom_field.default_access_level,custom_field_settings.custom_field.description,custom_field_settings.custom_field.display_value,custom_field_settings.custom_field.enabled,custom_field_settings.custom_field.enum_options,custom_field_settings.custom_field.enum_options.color,custom_field_settings.custom_field.enum_options.enabled,custom_field_settings.custom_field.enum_options.name,custom_field_settings.custom_field.enum_value,custom_field_settings.custom_field.enum_value.color,custom_field_settings.custom_field.enum_value.enabled,custom_field_settings.custom_field.enum_value.name,custom_field_settings.custom_field.format,custom_field_settings.custom_field.has_notifications_enabled,custom_field_settings.custom_field.html_text_value,custom_field_settings.custom_field.id_prefix,custom_field_settings.custom_field.input_restrictions,custom_field_settings.custom_field.is_formula_field,custom_field_settings.custom_field.is_global_to_workspace,custom_field_settings.custom_field.is_value_read_only,custom_field_settings.custom_field.multi_enum_values,custom_field_settings.custom_field.multi_enum_values.color,custom_field_settings.custom_field.multi_enum_values.enabled,custom_field_settings.custom_field.multi_enum_values.name,custom_field_settings.custom_field.name,custom_field_settings.custom_field.number_value,custom_field_settings.custom_field.people_value,custom_field_settings.custom_field.people_value.name,custom_field_settings.custom_field.precision,custom_field_settings.custom_field.privacy_setting,custom_field_settings.custom_field.reference_value,custom_field_settings.custom_field.reference_value.name,custom_field_settings.custom_field.representation_type,custom_field_settings.custom_field.resource_subtype,custom_field_settings.custom_field.text_value,custom_field_settings.custom_field.type,custom_field_settings.is_important,custom_field_settings.parent,custom_field_settings.parent.name,custom_field_settings.parent.resource_subtype,custom_field_settings.project,custom_field_settings.project.name,custom_field_settings.project.resource_subtype,custom_fields,custom_fields.date_value,custom_fields.date_value.date,custom_fields.date_value.date_time,custom_fields.display_value,custom_fields.enabled,custom_fields.enum_options,custom_fields.enum_options.color,custom_fields.enum_options.enabled,custom_fields.enum_options.name,custom_fields.enum_value,custom_fields.enum_value.color,custom_fields.enum_value.enabled,custom_fields.enum_value.name,custom_fields.id_prefix,custom_fields.input_restrictions,custom_fields.is_formula_field,custom_fields.multi_enum_values,custom_fields.multi_enum_values.color,custom_fields.multi_enum_values.enabled,custom_fields.multi_enum_values.name,custom_fields.name,custom_fields.number_value,custom_fields.representation_type,custom_fields.text_value,custom_fields.type,default_access_level,due_on,followers,followers.name,html_notes,is_workspace_level,liked,likes,likes.user,likes.user.name,metric,metric.can_manage,metric.currency_code,metric.current_display_value,metric.current_number_value,metric.initial_number_value,metric.is_custom_weight,metric.precision,metric.progress_source,metric.resource_subtype,metric.target_number_value,metric.unit,name,notes,num_likes,owner,owner.name,privacy_setting,start_on,status,team,team.name,time_period,time_period.display_name,time_period.end_on,time_period.period,time_period.start_on,workspace,workspace.name\"\n};\ngoalsApiInstance.updateGoal(body, goal_gid, opts).then((result) => {\n console.log('API called successfully. Returned data: ' + JSON.stringify(result.data, null, 2));\n}, (error) => {\n console.error(error.response.body);\n});",
"name": "node-sdk-v3"
},
{
"language": "node",
"install": "npm install asana@1.0.5",
"code": "const asana = require('asana');\n\nconst client = asana.Client.create().useAccessToken('PERSONAL_ACCESS_TOKEN');\n\nclient.goals.updateGoal(goalGid, {field: \"value\", field: \"value\", pretty: true})\n .then((result) => {\n console.log(result);\n });",
"name": "node-sdk-v1"
},
{
"language": "python",
"install": "pip install asana",
"code": "import asana\nfrom asana.rest import ApiException\nfrom pprint import pprint\n\nconfiguration = asana.Configuration()\nconfiguration.access_token = '<YOUR_ACCESS_TOKEN>'\napi_client = asana.ApiClient(configuration)\n\n# create an instance of the API class\ngoals_api_instance = asana.GoalsApi(api_client)\nbody = {\"data\": {\"<PARAM_1>\": \"<VALUE_1>\", \"<PARAM_2>\": \"<VALUE_2>\",}} # dict | The updated fields for the goal.\ngoal_gid = \"12345\" # str | Globally unique identifier for the goal.\nopts = {\n 'opt_fields': \"current_status_update,current_status_update.resource_subtype,current_status_update.title,custom_field_settings,custom_field_settings.custom_field,custom_field_settings.custom_field.asana_created_field,custom_field_settings.custom_field.created_by,custom_field_settings.custom_field.created_by.name,custom_field_settings.custom_field.currency_code,custom_field_settings.custom_field.custom_label,custom_field_settings.custom_field.custom_label_position,custom_field_settings.custom_field.date_value,custom_field_settings.custom_field.date_value.date,custom_field_settings.custom_field.date_value.date_time,custom_field_settings.custom_field.default_access_level,custom_field_settings.custom_field.description,custom_field_settings.custom_field.display_value,custom_field_settings.custom_field.enabled,custom_field_settings.custom_field.enum_options,custom_field_settings.custom_field.enum_options.color,custom_field_settings.custom_field.enum_options.enabled,custom_field_settings.custom_field.enum_options.name,custom_field_settings.custom_field.enum_value,custom_field_settings.custom_field.enum_value.color,custom_field_settings.custom_field.enum_value.enabled,custom_field_settings.custom_field.enum_value.name,custom_field_settings.custom_field.format,custom_field_settings.custom_field.has_notifications_enabled,custom_field_settings.custom_field.html_text_value,custom_field_settings.custom_field.id_prefix,custom_field_settings.custom_field.input_restrictions,custom_field_settings.custom_field.is_formula_field,custom_field_settings.custom_field.is_global_to_workspace,custom_field_settings.custom_field.is_value_read_only,custom_field_settings.custom_field.multi_enum_values,custom_field_settings.custom_field.multi_enum_values.color,custom_field_settings.custom_field.multi_enum_values.enabled,custom_field_settings.custom_field.multi_enum_values.name,custom_field_settings.custom_field.name,custom_field_settings.custom_field.number_value,custom_field_settings.custom_field.people_value,custom_field_settings.custom_field.people_value.name,custom_field_settings.custom_field.precision,custom_field_settings.custom_field.privacy_setting,custom_field_settings.custom_field.reference_value,custom_field_settings.custom_field.reference_value.name,custom_field_settings.custom_field.representation_type,custom_field_settings.custom_field.resource_subtype,custom_field_settings.custom_field.text_value,custom_field_settings.custom_field.type,custom_field_settings.is_important,custom_field_settings.parent,custom_field_settings.parent.name,custom_field_settings.parent.resource_subtype,custom_field_settings.project,custom_field_settings.project.name,custom_field_settings.project.resource_subtype,custom_fields,custom_fields.date_value,custom_fields.date_value.date,custom_fields.date_value.date_time,custom_fields.display_value,custom_fields.enabled,custom_fields.enum_options,custom_fields.enum_options.color,custom_fields.enum_options.enabled,custom_fields.enum_options.name,custom_fields.enum_value,custom_fields.enum_value.color,custom_fields.enum_value.enabled,custom_fields.enum_value.name,custom_fields.id_prefix,custom_fields.input_restrictions,custom_fields.is_formula_field,custom_fields.multi_enum_values,custom_fields.multi_enum_values.color,custom_fields.multi_enum_values.enabled,custom_fields.multi_enum_values.name,custom_fields.name,custom_fields.number_value,custom_fields.representation_type,custom_fields.text_value,custom_fields.type,default_access_level,due_on,followers,followers.name,html_notes,is_workspace_level,liked,likes,likes.user,likes.user.name,metric,metric.can_manage,metric.currency_code,metric.current_display_value,metric.current_number_value,metric.initial_number_value,metric.is_custom_weight,metric.precision,metric.progress_source,metric.resource_subtype,metric.target_number_value,metric.unit,name,notes,num_likes,owner,owner.name,privacy_setting,start_on,status,team,team.name,time_period,time_period.display_name,time_period.end_on,time_period.period,time_period.start_on,workspace,workspace.name\", # list[str] | 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.\n}\n\ntry:\n # Update a goal\n api_response = goals_api_instance.update_goal(body, goal_gid, opts)\n pprint(api_response)\nexcept ApiException as e:\n print(\"Exception when calling GoalsApi->update_goal: %s\\n\" % e)",
"name": "python-sdk-v5"
},
{
"language": "python",
"install": "pip install asana==3.2.3",
"code": "import asana\n\nclient = asana.Client.access_token('PERSONAL_ACCESS_TOKEN')\n\nresult = client.goals.update_goal(goal_gid, {'field': 'value', 'field': 'value'}, opt_pretty=True)",
"name": "python-sdk-v3"
},
{
"language": "php",
"install": "composer require asana/asana",
"code": "<?php\nrequire 'vendor/autoload.php';\n\n$client = Asana\\Client::accessToken('PERSONAL_ACCESS_TOKEN');\n\n$result = $client->goals->updateGoal($goal_gid, array('field' => 'value', 'field' => 'value'), array('opt_pretty' => 'true'))"
},
{
"language": "ruby",
"install": "gem install asana",
"code": "require 'asana'\n\nclient = Asana::Client.new do |c|\n c.authentication :access_token, 'PERSONAL_ACCESS_TOKEN'\nend\n\nresult = client.goals.update_goal(goal_gid: 'goal_gid', field: \"value\", field: \"value\", options: {pretty: true})"
}
]
},
"x-purple-suite-runtime": "unavailable"
}
DELETE /api/1.0/goals/{goal_gid}
Delete a goal
A specific, existing goal can be deleted by making a DELETE request on the URL for that goal.
Returns an empty data record.
This operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.
Authentication
[
{
"personalAccessToken": []
},
{
"oauth2": []
}
]
Path-level parameters and metadata
{
"parameters": [
{
"$ref": "#/components/parameters/goal_path_gid"
},
{
"$ref": "#/components/parameters/pretty"
}
]
}
Request, responses and operation details
{
"summary": "Delete a goal",
"description": "A specific, existing goal can be deleted by making a DELETE request on the URL for that goal.\n\nReturns an empty data record.\n\nThis operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.",
"tags": [
"Goals"
],
"operationId": "deleteGoal",
"responses": {
"200": {
"description": "Successfully deleted the specified goal.",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"$ref": "#/components/schemas/EmptyResponse"
}
}
}
}
}
},
"400": {
"$ref": "#/components/responses/BadRequest"
},
"401": {
"$ref": "#/components/responses/Unauthorized"
},
"402": {
"$ref": "#/components/responses/PaymentRequired"
},
"403": {
"$ref": "#/components/responses/Forbidden"
},
"404": {
"$ref": "#/components/responses/NotFound"
},
"500": {
"$ref": "#/components/responses/InternalServerError"
}
},
"security": [
{
"personalAccessToken": []
},
{
"oauth2": []
}
],
"x-readme": {
"code-samples": [
{
"language": "java",
"install": "<dependency><groupId>com.asana</groupId><artifactId>asana</artifactId><version>1.0.0</version></dependency>",
"code": "import com.asana.Client;\n\nClient client = Client.accessToken(\"PERSONAL_ACCESS_TOKEN\");\n\nJsonElement result = client.goals.deleteGoal(goalGid)\n .option(\"pretty\", true)\n .execute();"
},
{
"language": "node",
"install": "npm install asana",
"code": "const Asana = require('asana');\n\nlet client = new Asana.ApiClient();\nclient.authentications.token.accessToken = '<YOUR_ACCESS_TOKEN>';\n\nlet goalsApiInstance = new Asana.GoalsApi(client);\nlet goal_gid = \"12345\"; // String | Globally unique identifier for the goal.\n\ngoalsApiInstance.deleteGoal(goal_gid).then((result) => {\n console.log('API called successfully. Returned data: ' + JSON.stringify(result.data, null, 2));\n}, (error) => {\n console.error(error.response.body);\n});",
"name": "node-sdk-v3"
},
{
"language": "node",
"install": "npm install asana@1.0.5",
"code": "const asana = require('asana');\n\nconst client = asana.Client.create().useAccessToken('PERSONAL_ACCESS_TOKEN');\n\nclient.goals.deleteGoal(goalGid)\n .then((result) => {\n console.log(result);\n });",
"name": "node-sdk-v1"
},
{
"language": "python",
"install": "pip install asana",
"code": "import asana\nfrom asana.rest import ApiException\nfrom pprint import pprint\n\nconfiguration = asana.Configuration()\nconfiguration.access_token = '<YOUR_ACCESS_TOKEN>'\napi_client = asana.ApiClient(configuration)\n\n# create an instance of the API class\ngoals_api_instance = asana.GoalsApi(api_client)\ngoal_gid = \"12345\" # str | Globally unique identifier for the goal.\n\n\ntry:\n # Delete a goal\n api_response = goals_api_instance.delete_goal(goal_gid)\n pprint(api_response)\nexcept ApiException as e:\n print(\"Exception when calling GoalsApi->delete_goal: %s\\n\" % e)",
"name": "python-sdk-v5"
},
{
"language": "python",
"install": "pip install asana==3.2.3",
"code": "import asana\n\nclient = asana.Client.access_token('PERSONAL_ACCESS_TOKEN')\n\nresult = client.goals.delete_goal(goal_gid, opt_pretty=True)",
"name": "python-sdk-v3"
},
{
"language": "php",
"install": "composer require asana/asana",
"code": "<?php\nrequire 'vendor/autoload.php';\n\n$client = Asana\\Client::accessToken('PERSONAL_ACCESS_TOKEN');\n\n$result = $client->goals->deleteGoal($goal_gid, array('opt_pretty' => 'true'))"
},
{
"language": "ruby",
"install": "gem install asana",
"code": "require 'asana'\n\nclient = Asana::Client.new do |c|\n c.authentication :access_token, 'PERSONAL_ACCESS_TOKEN'\nend\n\nresult = client.goals.delete_goal(goal_gid: 'goal_gid', options: {pretty: true})"
}
]
},
"x-purple-suite-runtime": "unavailable"
}
GET /api/1.0/goals
Get goals
<b>Required scope: </b><code>goals:read</code>
Returns compact goal records.
This operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.
Authentication
[
{
"personalAccessToken": []
},
{
"oauth2": [
"goals:read"
]
}
]
Path-level parameters and metadata
{
"parameters": [
{
"$ref": "#/components/parameters/pretty"
}
]
}
Request, responses and operation details
{
"summary": "Get goals",
"description": "<b>Required scope: </b><code>goals:read</code>\n\nReturns compact goal records.\n\nThis operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.",
"tags": [
"Goals"
],
"operationId": "getGoals",
"parameters": [
{
"name": "portfolio",
"in": "query",
"description": "Globally unique identifier for supporting portfolio.",
"schema": {
"type": "string"
},
"example": "159874"
},
{
"name": "project",
"in": "query",
"description": "Globally unique identifier for supporting project.",
"schema": {
"type": "string"
},
"example": "512241"
},
{
"name": "task",
"in": "query",
"description": "Globally unique identifier for supporting task.",
"schema": {
"type": "string"
},
"example": "78424"
},
{
"name": "is_workspace_level",
"in": "query",
"description": "Filter to goals with is_workspace_level set to query value. Must be used with the workspace parameter.",
"schema": {
"type": "boolean"
},
"example": false
},
{
"name": "team",
"in": "query",
"description": "Globally unique identifier for the team.",
"schema": {
"type": "string"
},
"example": "31326"
},
{
"name": "workspace",
"in": "query",
"description": "Globally unique identifier for the workspace.",
"schema": {
"type": "string"
},
"example": "31326"
},
{
"name": "time_periods",
"in": "query",
"description": "Globally unique identifiers for the time periods.",
"schema": {
"type": "array",
"items": {
"type": "string"
}
},
"example": "221693,506165"
},
{
"$ref": "#/components/parameters/limit"
},
{
"$ref": "#/components/parameters/offset"
},
{
"name": "opt_fields",
"in": "query",
"description": "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. Properties can include nested fields. To learn more, see the [input/output options guide](/docs/inputoutput-options#selecting-nested-fields).",
"required": false,
"example": [
"current_status_update",
"current_status_update.resource_subtype",
"current_status_update.title",
"custom_field_settings",
"custom_field_settings.custom_field",
"custom_field_settings.custom_field.asana_created_field",
"custom_field_settings.custom_field.created_by",
"custom_field_settings.custom_field.created_by.name",
"custom_field_settings.custom_field.currency_code",
"custom_field_settings.custom_field.custom_label",
"custom_field_settings.custom_field.custom_label_position",
"custom_field_settings.custom_field.date_value",
"custom_field_settings.custom_field.date_value.date",
"custom_field_settings.custom_field.date_value.date_time",
"custom_field_settings.custom_field.default_access_level",
"custom_field_settings.custom_field.description",
"custom_field_settings.custom_field.display_value",
"custom_field_settings.custom_field.enabled",
"custom_field_settings.custom_field.enum_options",
"custom_field_settings.custom_field.enum_options.color",
"custom_field_settings.custom_field.enum_options.enabled",
"custom_field_settings.custom_field.enum_options.name",
"custom_field_settings.custom_field.enum_value",
"custom_field_settings.custom_field.enum_value.color",
"custom_field_settings.custom_field.enum_value.enabled",
"custom_field_settings.custom_field.enum_value.name",
"custom_field_settings.custom_field.format",
"custom_field_settings.custom_field.has_notifications_enabled",
"custom_field_settings.custom_field.html_text_value",
"custom_field_settings.custom_field.id_prefix",
"custom_field_settings.custom_field.input_restrictions",
"custom_field_settings.custom_field.is_formula_field",
"custom_field_settings.custom_field.is_global_to_workspace",
"custom_field_settings.custom_field.is_value_read_only",
"custom_field_settings.custom_field.multi_enum_values",
"custom_field_settings.custom_field.multi_enum_values.color",
"custom_field_settings.custom_field.multi_enum_values.enabled",
"custom_field_settings.custom_field.multi_enum_values.name",
"custom_field_settings.custom_field.name",
"custom_field_settings.custom_field.number_value",
"custom_field_settings.custom_field.people_value",
"custom_field_settings.custom_field.people_value.name",
"custom_field_settings.custom_field.precision",
"custom_field_settings.custom_field.privacy_setting",
"custom_field_settings.custom_field.reference_value",
"custom_field_settings.custom_field.reference_value.name",
"custom_field_settings.custom_field.representation_type",
"custom_field_settings.custom_field.resource_subtype",
"custom_field_settings.custom_field.text_value",
"custom_field_settings.custom_field.type",
"custom_field_settings.is_important",
"custom_field_settings.parent",
"custom_field_settings.parent.name",
"custom_field_settings.parent.resource_subtype",
"custom_field_settings.project",
"custom_field_settings.project.name",
"custom_field_settings.project.resource_subtype",
"custom_fields",
"custom_fields.date_value",
"custom_fields.date_value.date",
"custom_fields.date_value.date_time",
"custom_fields.display_value",
"custom_fields.enabled",
"custom_fields.enum_options",
"custom_fields.enum_options.color",
"custom_fields.enum_options.enabled",
"custom_fields.enum_options.name",
"custom_fields.enum_value",
"custom_fields.enum_value.color",
"custom_fields.enum_value.enabled",
"custom_fields.enum_value.name",
"custom_fields.id_prefix",
"custom_fields.input_restrictions",
"custom_fields.is_formula_field",
"custom_fields.multi_enum_values",
"custom_fields.multi_enum_values.color",
"custom_fields.multi_enum_values.enabled",
"custom_fields.multi_enum_values.name",
"custom_fields.name",
"custom_fields.number_value",
"custom_fields.representation_type",
"custom_fields.text_value",
"custom_fields.type",
"default_access_level",
"due_on",
"followers",
"followers.name",
"html_notes",
"is_workspace_level",
"liked",
"likes",
"likes.user",
"likes.user.name",
"metric",
"metric.can_manage",
"metric.currency_code",
"metric.current_display_value",
"metric.current_number_value",
"metric.initial_number_value",
"metric.is_custom_weight",
"metric.precision",
"metric.progress_source",
"metric.resource_subtype",
"metric.target_number_value",
"metric.unit",
"name",
"notes",
"num_likes",
"offset",
"owner",
"owner.name",
"path",
"privacy_setting",
"start_on",
"status",
"team",
"team.name",
"time_period",
"time_period.display_name",
"time_period.end_on",
"time_period.period",
"time_period.start_on",
"uri",
"workspace",
"workspace.name"
],
"schema": {
"type": "array",
"items": {
"type": "string",
"enum": [
"current_status_update",
"current_status_update.resource_subtype",
"current_status_update.title",
"custom_field_settings",
"custom_field_settings.custom_field",
"custom_field_settings.custom_field.asana_created_field",
"custom_field_settings.custom_field.created_by",
"custom_field_settings.custom_field.created_by.name",
"custom_field_settings.custom_field.currency_code",
"custom_field_settings.custom_field.custom_label",
"custom_field_settings.custom_field.custom_label_position",
"custom_field_settings.custom_field.date_value",
"custom_field_settings.custom_field.date_value.date",
"custom_field_settings.custom_field.date_value.date_time",
"custom_field_settings.custom_field.default_access_level",
"custom_field_settings.custom_field.description",
"custom_field_settings.custom_field.display_value",
"custom_field_settings.custom_field.enabled",
"custom_field_settings.custom_field.enum_options",
"custom_field_settings.custom_field.enum_options.color",
"custom_field_settings.custom_field.enum_options.enabled",
"custom_field_settings.custom_field.enum_options.name",
"custom_field_settings.custom_field.enum_value",
"custom_field_settings.custom_field.enum_value.color",
"custom_field_settings.custom_field.enum_value.enabled",
"custom_field_settings.custom_field.enum_value.name",
"custom_field_settings.custom_field.format",
"custom_field_settings.custom_field.has_notifications_enabled",
"custom_field_settings.custom_field.html_text_value",
"custom_field_settings.custom_field.id_prefix",
"custom_field_settings.custom_field.input_restrictions",
"custom_field_settings.custom_field.is_formula_field",
"custom_field_settings.custom_field.is_global_to_workspace",
"custom_field_settings.custom_field.is_value_read_only",
"custom_field_settings.custom_field.multi_enum_values",
"custom_field_settings.custom_field.multi_enum_values.color",
"custom_field_settings.custom_field.multi_enum_values.enabled",
"custom_field_settings.custom_field.multi_enum_values.name",
"custom_field_settings.custom_field.name",
"custom_field_settings.custom_field.number_value",
"custom_field_settings.custom_field.people_value",
"custom_field_settings.custom_field.people_value.name",
"custom_field_settings.custom_field.precision",
"custom_field_settings.custom_field.privacy_setting",
"custom_field_settings.custom_field.reference_value",
"custom_field_settings.custom_field.reference_value.name",
"custom_field_settings.custom_field.representation_type",
"custom_field_settings.custom_field.resource_subtype",
"custom_field_settings.custom_field.text_value",
"custom_field_settings.custom_field.type",
"custom_field_settings.is_important",
"custom_field_settings.parent",
"custom_field_settings.parent.name",
"custom_field_settings.parent.resource_subtype",
"custom_field_settings.project",
"custom_field_settings.project.name",
"custom_field_settings.project.resource_subtype",
"custom_fields",
"custom_fields.date_value",
"custom_fields.date_value.date",
"custom_fields.date_value.date_time",
"custom_fields.display_value",
"custom_fields.enabled",
"custom_fields.enum_options",
"custom_fields.enum_options.color",
"custom_fields.enum_options.enabled",
"custom_fields.enum_options.name",
"custom_fields.enum_value",
"custom_fields.enum_value.color",
"custom_fields.enum_value.enabled",
"custom_fields.enum_value.name",
"custom_fields.id_prefix",
"custom_fields.input_restrictions",
"custom_fields.is_formula_field",
"custom_fields.multi_enum_values",
"custom_fields.multi_enum_values.color",
"custom_fields.multi_enum_values.enabled",
"custom_fields.multi_enum_values.name",
"custom_fields.name",
"custom_fields.number_value",
"custom_fields.representation_type",
"custom_fields.text_value",
"custom_fields.type",
"default_access_level",
"due_on",
"followers",
"followers.name",
"html_notes",
"is_workspace_level",
"liked",
"likes",
"likes.user",
"likes.user.name",
"metric",
"metric.can_manage",
"metric.currency_code",
"metric.current_display_value",
"metric.current_number_value",
"metric.initial_number_value",
"metric.is_custom_weight",
"metric.precision",
"metric.progress_source",
"metric.resource_subtype",
"metric.target_number_value",
"metric.unit",
"name",
"notes",
"num_likes",
"offset",
"owner",
"owner.name",
"path",
"privacy_setting",
"start_on",
"status",
"team",
"team.name",
"time_period",
"time_period.display_name",
"time_period.end_on",
"time_period.period",
"time_period.start_on",
"uri",
"workspace",
"workspace.name"
]
}
},
"style": "form",
"explode": false
}
],
"responses": {
"200": {
"description": "Successfully retrieved the requested goals.",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"type": "array",
"items": {
"$ref": "#/components/schemas/GoalCompact"
}
},
"next_page": {
"$ref": "#/components/schemas/NextPage"
}
}
}
}
}
},
"400": {
"$ref": "#/components/responses/BadRequest"
},
"401": {
"$ref": "#/components/responses/Unauthorized"
},
"402": {
"$ref": "#/components/responses/PaymentRequired"
},
"403": {
"$ref": "#/components/responses/Forbidden"
},
"404": {
"$ref": "#/components/responses/NotFound"
},
"500": {
"$ref": "#/components/responses/InternalServerError"
}
},
"security": [
{
"personalAccessToken": []
},
{
"oauth2": [
"goals:read"
]
}
],
"x-readme": {
"code-samples": [
{
"language": "java",
"install": "<dependency><groupId>com.asana</groupId><artifactId>asana</artifactId><version>1.0.0</version></dependency>",
"code": "import com.asana.Client;\n\nClient client = Client.accessToken(\"PERSONAL_ACCESS_TOKEN\");\n\nList<JsonElement> result = client.goals.getGoals(timePeriods, workspace, team, isWorkspaceLevel, project, portfolio)\n .option(\"pretty\", true)\n .execute();"
},
{
"language": "node",
"install": "npm install asana",
"code": "const Asana = require('asana');\n\nlet client = new Asana.ApiClient();\nclient.authentications.token.accessToken = '<YOUR_ACCESS_TOKEN>';\n\nlet goalsApiInstance = new Asana.GoalsApi(client);\nlet opts = { \n 'portfolio': \"159874\", \n 'project': \"512241\", \n 'task': \"78424\", \n 'is_workspace_level': false, \n 'team': \"31326\", \n 'workspace': \"31326\", \n 'time_periods': \"221693,506165\", \n 'limit': 50, \n 'offset': \"eyJ0eXAiOJiKV1iQLCJhbGciOiJIUzI1NiJ9\", \n 'opt_fields': \"current_status_update,current_status_update.resource_subtype,current_status_update.title,custom_field_settings,custom_field_settings.custom_field,custom_field_settings.custom_field.asana_created_field,custom_field_settings.custom_field.created_by,custom_field_settings.custom_field.created_by.name,custom_field_settings.custom_field.currency_code,custom_field_settings.custom_field.custom_label,custom_field_settings.custom_field.custom_label_position,custom_field_settings.custom_field.date_value,custom_field_settings.custom_field.date_value.date,custom_field_settings.custom_field.date_value.date_time,custom_field_settings.custom_field.default_access_level,custom_field_settings.custom_field.description,custom_field_settings.custom_field.display_value,custom_field_settings.custom_field.enabled,custom_field_settings.custom_field.enum_options,custom_field_settings.custom_field.enum_options.color,custom_field_settings.custom_field.enum_options.enabled,custom_field_settings.custom_field.enum_options.name,custom_field_settings.custom_field.enum_value,custom_field_settings.custom_field.enum_value.color,custom_field_settings.custom_field.enum_value.enabled,custom_field_settings.custom_field.enum_value.name,custom_field_settings.custom_field.format,custom_field_settings.custom_field.has_notifications_enabled,custom_field_settings.custom_field.html_text_value,custom_field_settings.custom_field.id_prefix,custom_field_settings.custom_field.input_restrictions,custom_field_settings.custom_field.is_formula_field,custom_field_settings.custom_field.is_global_to_workspace,custom_field_settings.custom_field.is_value_read_only,custom_field_settings.custom_field.multi_enum_values,custom_field_settings.custom_field.multi_enum_values.color,custom_field_settings.custom_field.multi_enum_values.enabled,custom_field_settings.custom_field.multi_enum_values.name,custom_field_settings.custom_field.name,custom_field_settings.custom_field.number_value,custom_field_settings.custom_field.people_value,custom_field_settings.custom_field.people_value.name,custom_field_settings.custom_field.precision,custom_field_settings.custom_field.privacy_setting,custom_field_settings.custom_field.reference_value,custom_field_settings.custom_field.reference_value.name,custom_field_settings.custom_field.representation_type,custom_field_settings.custom_field.resource_subtype,custom_field_settings.custom_field.text_value,custom_field_settings.custom_field.type,custom_field_settings.is_important,custom_field_settings.parent,custom_field_settings.parent.name,custom_field_settings.parent.resource_subtype,custom_field_settings.project,custom_field_settings.project.name,custom_field_settings.project.resource_subtype,custom_fields,custom_fields.date_value,custom_fields.date_value.date,custom_fields.date_value.date_time,custom_fields.display_value,custom_fields.enabled,custom_fields.enum_options,custom_fields.enum_options.color,custom_fields.enum_options.enabled,custom_fields.enum_options.name,custom_fields.enum_value,custom_fields.enum_value.color,custom_fields.enum_value.enabled,custom_fields.enum_value.name,custom_fields.id_prefix,custom_fields.input_restrictions,custom_fields.is_formula_field,custom_fields.multi_enum_values,custom_fields.multi_enum_values.color,custom_fields.multi_enum_values.enabled,custom_fields.multi_enum_values.name,custom_fields.name,custom_fields.number_value,custom_fields.representation_type,custom_fields.text_value,custom_fields.type,default_access_level,due_on,followers,followers.name,html_notes,is_workspace_level,liked,likes,likes.user,likes.user.name,metric,metric.can_manage,metric.currency_code,metric.current_display_value,metric.current_number_value,metric.initial_number_value,metric.is_custom_weight,metric.precision,metric.progress_source,metric.resource_subtype,metric.target_number_value,metric.unit,name,notes,num_likes,offset,owner,owner.name,path,privacy_setting,start_on,status,team,team.name,time_period,time_period.display_name,time_period.end_on,time_period.period,time_period.start_on,uri,workspace,workspace.name\"\n};\ngoalsApiInstance.getGoals(opts).then((result) => {\n console.log('API called successfully. Returned data: ' + JSON.stringify(result.data, null, 2));\n}, (error) => {\n console.error(error.response.body);\n});",
"name": "node-sdk-v3"
},
{
"language": "node",
"install": "npm install asana@1.0.5",
"code": "const asana = require('asana');\n\nconst client = asana.Client.create().useAccessToken('PERSONAL_ACCESS_TOKEN');\n\nclient.goals.getGoals({param: \"value\", param: \"value\", opt_pretty: true})\n .then((result) => {\n console.log(result);\n });",
"name": "node-sdk-v1"
},
{
"language": "python",
"install": "pip install asana",
"code": "import asana\nfrom asana.rest import ApiException\nfrom pprint import pprint\n\nconfiguration = asana.Configuration()\nconfiguration.access_token = '<YOUR_ACCESS_TOKEN>'\napi_client = asana.ApiClient(configuration)\n\n# create an instance of the API class\ngoals_api_instance = asana.GoalsApi(api_client)\nopts = {\n 'portfolio': \"159874\", # str | Globally unique identifier for supporting portfolio.\n 'project': \"512241\", # str | Globally unique identifier for supporting project.\n 'task': \"78424\", # str | Globally unique identifier for supporting task.\n 'is_workspace_level': False, # bool | Filter to goals with is_workspace_level set to query value. Must be used with the workspace parameter.\n 'team': \"31326\", # str | Globally unique identifier for the team.\n 'workspace': \"31326\", # str | Globally unique identifier for the workspace.\n 'time_periods': \"221693,506165\", # list[str] | Globally unique identifiers for the time periods.\n 'limit': 50, # int | Results per page. The number of objects to return per page. The value must be between 1 and 100.\n 'offset': \"eyJ0eXAiOJiKV1iQLCJhbGciOiJIUzI1NiJ9\", # str | 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.*\n 'opt_fields': \"current_status_update,current_status_update.resource_subtype,current_status_update.title,custom_field_settings,custom_field_settings.custom_field,custom_field_settings.custom_field.asana_created_field,custom_field_settings.custom_field.created_by,custom_field_settings.custom_field.created_by.name,custom_field_settings.custom_field.currency_code,custom_field_settings.custom_field.custom_label,custom_field_settings.custom_field.custom_label_position,custom_field_settings.custom_field.date_value,custom_field_settings.custom_field.date_value.date,custom_field_settings.custom_field.date_value.date_time,custom_field_settings.custom_field.default_access_level,custom_field_settings.custom_field.description,custom_field_settings.custom_field.display_value,custom_field_settings.custom_field.enabled,custom_field_settings.custom_field.enum_options,custom_field_settings.custom_field.enum_options.color,custom_field_settings.custom_field.enum_options.enabled,custom_field_settings.custom_field.enum_options.name,custom_field_settings.custom_field.enum_value,custom_field_settings.custom_field.enum_value.color,custom_field_settings.custom_field.enum_value.enabled,custom_field_settings.custom_field.enum_value.name,custom_field_settings.custom_field.format,custom_field_settings.custom_field.has_notifications_enabled,custom_field_settings.custom_field.html_text_value,custom_field_settings.custom_field.id_prefix,custom_field_settings.custom_field.input_restrictions,custom_field_settings.custom_field.is_formula_field,custom_field_settings.custom_field.is_global_to_workspace,custom_field_settings.custom_field.is_value_read_only,custom_field_settings.custom_field.multi_enum_values,custom_field_settings.custom_field.multi_enum_values.color,custom_field_settings.custom_field.multi_enum_values.enabled,custom_field_settings.custom_field.multi_enum_values.name,custom_field_settings.custom_field.name,custom_field_settings.custom_field.number_value,custom_field_settings.custom_field.people_value,custom_field_settings.custom_field.people_value.name,custom_field_settings.custom_field.precision,custom_field_settings.custom_field.privacy_setting,custom_field_settings.custom_field.reference_value,custom_field_settings.custom_field.reference_value.name,custom_field_settings.custom_field.representation_type,custom_field_settings.custom_field.resource_subtype,custom_field_settings.custom_field.text_value,custom_field_settings.custom_field.type,custom_field_settings.is_important,custom_field_settings.parent,custom_field_settings.parent.name,custom_field_settings.parent.resource_subtype,custom_field_settings.project,custom_field_settings.project.name,custom_field_settings.project.resource_subtype,custom_fields,custom_fields.date_value,custom_fields.date_value.date,custom_fields.date_value.date_time,custom_fields.display_value,custom_fields.enabled,custom_fields.enum_options,custom_fields.enum_options.color,custom_fields.enum_options.enabled,custom_fields.enum_options.name,custom_fields.enum_value,custom_fields.enum_value.color,custom_fields.enum_value.enabled,custom_fields.enum_value.name,custom_fields.id_prefix,custom_fields.input_restrictions,custom_fields.is_formula_field,custom_fields.multi_enum_values,custom_fields.multi_enum_values.color,custom_fields.multi_enum_values.enabled,custom_fields.multi_enum_values.name,custom_fields.name,custom_fields.number_value,custom_fields.representation_type,custom_fields.text_value,custom_fields.type,default_access_level,due_on,followers,followers.name,html_notes,is_workspace_level,liked,likes,likes.user,likes.user.name,metric,metric.can_manage,metric.currency_code,metric.current_display_value,metric.current_number_value,metric.initial_number_value,metric.is_custom_weight,metric.precision,metric.progress_source,metric.resource_subtype,metric.target_number_value,metric.unit,name,notes,num_likes,offset,owner,owner.name,path,privacy_setting,start_on,status,team,team.name,time_period,time_period.display_name,time_period.end_on,time_period.period,time_period.start_on,uri,workspace,workspace.name\", # list[str] | 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.\n}\n\ntry:\n # Get goals\n api_response = goals_api_instance.get_goals(opts)\n for data in api_response:\n pprint(data)\nexcept ApiException as e:\n print(\"Exception when calling GoalsApi->get_goals: %s\\n\" % e)",
"name": "python-sdk-v5"
},
{
"language": "python",
"install": "pip install asana==3.2.3",
"code": "import asana\n\nclient = asana.Client.access_token('PERSONAL_ACCESS_TOKEN')\n\nresult = client.goals.get_goals({'param': 'value', 'param': 'value'}, opt_pretty=True)",
"name": "python-sdk-v3"
},
{
"language": "php",
"install": "composer require asana/asana",
"code": "<?php\nrequire 'vendor/autoload.php';\n\n$client = Asana\\Client::accessToken('PERSONAL_ACCESS_TOKEN');\n\n$result = $client->goals->getGoals(array('param' => 'value', 'param' => 'value'), array('opt_pretty' => 'true'))"
},
{
"language": "ruby",
"install": "gem install asana",
"code": "require 'asana'\n\nclient = Asana::Client.new do |c|\n c.authentication :access_token, 'PERSONAL_ACCESS_TOKEN'\nend\n\nresult = client.goals.get_goals(param: \"value\", param: \"value\", options: {pretty: true})"
}
]
},
"x-purple-suite-runtime": "unavailable"
}
POST /api/1.0/goals
Create a goal
Creates a new goal in a workspace or team.
Returns the full record of the newly created goal.
This operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.
Authentication
[
{
"personalAccessToken": []
},
{
"oauth2": []
}
]
Path-level parameters and metadata
{
"parameters": [
{
"$ref": "#/components/parameters/pretty"
}
]
}
Request, responses and operation details
{
"summary": "Create a goal",
"description": "Creates a new goal in a workspace or team.\n\nReturns the full record of the newly created goal.\n\nThis operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.",
"tags": [
"Goals"
],
"operationId": "createGoal",
"parameters": [
{
"name": "opt_fields",
"in": "query",
"description": "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. Properties can include nested fields. To learn more, see the [input/output options guide](/docs/inputoutput-options#selecting-nested-fields).",
"required": false,
"example": [
"current_status_update",
"current_status_update.resource_subtype",
"current_status_update.title",
"custom_field_settings",
"custom_field_settings.custom_field",
"custom_field_settings.custom_field.asana_created_field",
"custom_field_settings.custom_field.created_by",
"custom_field_settings.custom_field.created_by.name",
"custom_field_settings.custom_field.currency_code",
"custom_field_settings.custom_field.custom_label",
"custom_field_settings.custom_field.custom_label_position",
"custom_field_settings.custom_field.date_value",
"custom_field_settings.custom_field.date_value.date",
"custom_field_settings.custom_field.date_value.date_time",
"custom_field_settings.custom_field.default_access_level",
"custom_field_settings.custom_field.description",
"custom_field_settings.custom_field.display_value",
"custom_field_settings.custom_field.enabled",
"custom_field_settings.custom_field.enum_options",
"custom_field_settings.custom_field.enum_options.color",
"custom_field_settings.custom_field.enum_options.enabled",
"custom_field_settings.custom_field.enum_options.name",
"custom_field_settings.custom_field.enum_value",
"custom_field_settings.custom_field.enum_value.color",
"custom_field_settings.custom_field.enum_value.enabled",
"custom_field_settings.custom_field.enum_value.name",
"custom_field_settings.custom_field.format",
"custom_field_settings.custom_field.has_notifications_enabled",
"custom_field_settings.custom_field.html_text_value",
"custom_field_settings.custom_field.id_prefix",
"custom_field_settings.custom_field.input_restrictions",
"custom_field_settings.custom_field.is_formula_field",
"custom_field_settings.custom_field.is_global_to_workspace",
"custom_field_settings.custom_field.is_value_read_only",
"custom_field_settings.custom_field.multi_enum_values",
"custom_field_settings.custom_field.multi_enum_values.color",
"custom_field_settings.custom_field.multi_enum_values.enabled",
"custom_field_settings.custom_field.multi_enum_values.name",
"custom_field_settings.custom_field.name",
"custom_field_settings.custom_field.number_value",
"custom_field_settings.custom_field.people_value",
"custom_field_settings.custom_field.people_value.name",
"custom_field_settings.custom_field.precision",
"custom_field_settings.custom_field.privacy_setting",
"custom_field_settings.custom_field.reference_value",
"custom_field_settings.custom_field.reference_value.name",
"custom_field_settings.custom_field.representation_type",
"custom_field_settings.custom_field.resource_subtype",
"custom_field_settings.custom_field.text_value",
"custom_field_settings.custom_field.type",
"custom_field_settings.is_important",
"custom_field_settings.parent",
"custom_field_settings.parent.name",
"custom_field_settings.parent.resource_subtype",
"custom_field_settings.project",
"custom_field_settings.project.name",
"custom_field_settings.project.resource_subtype",
"custom_fields",
"custom_fields.date_value",
"custom_fields.date_value.date",
"custom_fields.date_value.date_time",
"custom_fields.display_value",
"custom_fields.enabled",
"custom_fields.enum_options",
"custom_fields.enum_options.color",
"custom_fields.enum_options.enabled",
"custom_fields.enum_options.name",
"custom_fields.enum_value",
"custom_fields.enum_value.color",
"custom_fields.enum_value.enabled",
"custom_fields.enum_value.name",
"custom_fields.id_prefix",
"custom_fields.input_restrictions",
"custom_fields.is_formula_field",
"custom_fields.multi_enum_values",
"custom_fields.multi_enum_values.color",
"custom_fields.multi_enum_values.enabled",
"custom_fields.multi_enum_values.name",
"custom_fields.name",
"custom_fields.number_value",
"custom_fields.representation_type",
"custom_fields.text_value",
"custom_fields.type",
"default_access_level",
"due_on",
"followers",
"followers.name",
"html_notes",
"is_workspace_level",
"liked",
"likes",
"likes.user",
"likes.user.name",
"metric",
"metric.can_manage",
"metric.currency_code",
"metric.current_display_value",
"metric.current_number_value",
"metric.initial_number_value",
"metric.is_custom_weight",
"metric.precision",
"metric.progress_source",
"metric.resource_subtype",
"metric.target_number_value",
"metric.unit",
"name",
"notes",
"num_likes",
"owner",
"owner.name",
"privacy_setting",
"start_on",
"status",
"team",
"team.name",
"time_period",
"time_period.display_name",
"time_period.end_on",
"time_period.period",
"time_period.start_on",
"workspace",
"workspace.name"
],
"schema": {
"type": "array",
"items": {
"type": "string",
"enum": [
"current_status_update",
"current_status_update.resource_subtype",
"current_status_update.title",
"custom_field_settings",
"custom_field_settings.custom_field",
"custom_field_settings.custom_field.asana_created_field",
"custom_field_settings.custom_field.created_by",
"custom_field_settings.custom_field.created_by.name",
"custom_field_settings.custom_field.currency_code",
"custom_field_settings.custom_field.custom_label",
"custom_field_settings.custom_field.custom_label_position",
"custom_field_settings.custom_field.date_value",
"custom_field_settings.custom_field.date_value.date",
"custom_field_settings.custom_field.date_value.date_time",
"custom_field_settings.custom_field.default_access_level",
"custom_field_settings.custom_field.description",
"custom_field_settings.custom_field.display_value",
"custom_field_settings.custom_field.enabled",
"custom_field_settings.custom_field.enum_options",
"custom_field_settings.custom_field.enum_options.color",
"custom_field_settings.custom_field.enum_options.enabled",
"custom_field_settings.custom_field.enum_options.name",
"custom_field_settings.custom_field.enum_value",
"custom_field_settings.custom_field.enum_value.color",
"custom_field_settings.custom_field.enum_value.enabled",
"custom_field_settings.custom_field.enum_value.name",
"custom_field_settings.custom_field.format",
"custom_field_settings.custom_field.has_notifications_enabled",
"custom_field_settings.custom_field.html_text_value",
"custom_field_settings.custom_field.id_prefix",
"custom_field_settings.custom_field.input_restrictions",
"custom_field_settings.custom_field.is_formula_field",
"custom_field_settings.custom_field.is_global_to_workspace",
"custom_field_settings.custom_field.is_value_read_only",
"custom_field_settings.custom_field.multi_enum_values",
"custom_field_settings.custom_field.multi_enum_values.color",
"custom_field_settings.custom_field.multi_enum_values.enabled",
"custom_field_settings.custom_field.multi_enum_values.name",
"custom_field_settings.custom_field.name",
"custom_field_settings.custom_field.number_value",
"custom_field_settings.custom_field.people_value",
"custom_field_settings.custom_field.people_value.name",
"custom_field_settings.custom_field.precision",
"custom_field_settings.custom_field.privacy_setting",
"custom_field_settings.custom_field.reference_value",
"custom_field_settings.custom_field.reference_value.name",
"custom_field_settings.custom_field.representation_type",
"custom_field_settings.custom_field.resource_subtype",
"custom_field_settings.custom_field.text_value",
"custom_field_settings.custom_field.type",
"custom_field_settings.is_important",
"custom_field_settings.parent",
"custom_field_settings.parent.name",
"custom_field_settings.parent.resource_subtype",
"custom_field_settings.project",
"custom_field_settings.project.name",
"custom_field_settings.project.resource_subtype",
"custom_fields",
"custom_fields.date_value",
"custom_fields.date_value.date",
"custom_fields.date_value.date_time",
"custom_fields.display_value",
"custom_fields.enabled",
"custom_fields.enum_options",
"custom_fields.enum_options.color",
"custom_fields.enum_options.enabled",
"custom_fields.enum_options.name",
"custom_fields.enum_value",
"custom_fields.enum_value.color",
"custom_fields.enum_value.enabled",
"custom_fields.enum_value.name",
"custom_fields.id_prefix",
"custom_fields.input_restrictions",
"custom_fields.is_formula_field",
"custom_fields.multi_enum_values",
"custom_fields.multi_enum_values.color",
"custom_fields.multi_enum_values.enabled",
"custom_fields.multi_enum_values.name",
"custom_fields.name",
"custom_fields.number_value",
"custom_fields.representation_type",
"custom_fields.text_value",
"custom_fields.type",
"default_access_level",
"due_on",
"followers",
"followers.name",
"html_notes",
"is_workspace_level",
"liked",
"likes",
"likes.user",
"likes.user.name",
"metric",
"metric.can_manage",
"metric.currency_code",
"metric.current_display_value",
"metric.current_number_value",
"metric.initial_number_value",
"metric.is_custom_weight",
"metric.precision",
"metric.progress_source",
"metric.resource_subtype",
"metric.target_number_value",
"metric.unit",
"name",
"notes",
"num_likes",
"owner",
"owner.name",
"privacy_setting",
"start_on",
"status",
"team",
"team.name",
"time_period",
"time_period.display_name",
"time_period.end_on",
"time_period.period",
"time_period.start_on",
"workspace",
"workspace.name"
]
}
},
"style": "form",
"explode": false
}
],
"requestBody": {
"description": "The goal to create.",
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"$ref": "#/components/schemas/GoalRequest"
}
}
}
}
}
},
"responses": {
"201": {
"description": "Successfully created a new goal.",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"$ref": "#/components/schemas/GoalResponse"
}
}
}
}
}
},
"400": {
"$ref": "#/components/responses/BadRequest"
},
"401": {
"$ref": "#/components/responses/Unauthorized"
},
"402": {
"$ref": "#/components/responses/PaymentRequired"
},
"403": {
"$ref": "#/components/responses/Forbidden"
},
"404": {
"$ref": "#/components/responses/NotFound"
},
"500": {
"$ref": "#/components/responses/InternalServerError"
}
},
"security": [
{
"personalAccessToken": []
},
{
"oauth2": []
}
],
"x-readme": {
"code-samples": [
{
"language": "java",
"install": "<dependency><groupId>com.asana</groupId><artifactId>asana</artifactId><version>1.0.0</version></dependency>",
"code": "import com.asana.Client;\n\nClient client = Client.accessToken(\"PERSONAL_ACCESS_TOKEN\");\n\nJsonElement result = client.goals.createGoal()\n .data(\"field\", \"value\")\n .data(\"field\", \"value\")\n .option(\"pretty\", true)\n .execute();"
},
{
"language": "node",
"install": "npm install asana",
"code": "const Asana = require('asana');\n\nlet client = new Asana.ApiClient();\nclient.authentications.token.accessToken = '<YOUR_ACCESS_TOKEN>';\n\nlet goalsApiInstance = new Asana.GoalsApi(client);\nlet body = {\"data\": {\"<PARAM_1>\": \"<VALUE_1>\", \"<PARAM_2>\": \"<VALUE_2>\",}}; // Object | The goal to create.\nlet opts = { \n 'opt_fields': \"current_status_update,current_status_update.resource_subtype,current_status_update.title,custom_field_settings,custom_field_settings.custom_field,custom_field_settings.custom_field.asana_created_field,custom_field_settings.custom_field.created_by,custom_field_settings.custom_field.created_by.name,custom_field_settings.custom_field.currency_code,custom_field_settings.custom_field.custom_label,custom_field_settings.custom_field.custom_label_position,custom_field_settings.custom_field.date_value,custom_field_settings.custom_field.date_value.date,custom_field_settings.custom_field.date_value.date_time,custom_field_settings.custom_field.default_access_level,custom_field_settings.custom_field.description,custom_field_settings.custom_field.display_value,custom_field_settings.custom_field.enabled,custom_field_settings.custom_field.enum_options,custom_field_settings.custom_field.enum_options.color,custom_field_settings.custom_field.enum_options.enabled,custom_field_settings.custom_field.enum_options.name,custom_field_settings.custom_field.enum_value,custom_field_settings.custom_field.enum_value.color,custom_field_settings.custom_field.enum_value.enabled,custom_field_settings.custom_field.enum_value.name,custom_field_settings.custom_field.format,custom_field_settings.custom_field.has_notifications_enabled,custom_field_settings.custom_field.html_text_value,custom_field_settings.custom_field.id_prefix,custom_field_settings.custom_field.input_restrictions,custom_field_settings.custom_field.is_formula_field,custom_field_settings.custom_field.is_global_to_workspace,custom_field_settings.custom_field.is_value_read_only,custom_field_settings.custom_field.multi_enum_values,custom_field_settings.custom_field.multi_enum_values.color,custom_field_settings.custom_field.multi_enum_values.enabled,custom_field_settings.custom_field.multi_enum_values.name,custom_field_settings.custom_field.name,custom_field_settings.custom_field.number_value,custom_field_settings.custom_field.people_value,custom_field_settings.custom_field.people_value.name,custom_field_settings.custom_field.precision,custom_field_settings.custom_field.privacy_setting,custom_field_settings.custom_field.reference_value,custom_field_settings.custom_field.reference_value.name,custom_field_settings.custom_field.representation_type,custom_field_settings.custom_field.resource_subtype,custom_field_settings.custom_field.text_value,custom_field_settings.custom_field.type,custom_field_settings.is_important,custom_field_settings.parent,custom_field_settings.parent.name,custom_field_settings.parent.resource_subtype,custom_field_settings.project,custom_field_settings.project.name,custom_field_settings.project.resource_subtype,custom_fields,custom_fields.date_value,custom_fields.date_value.date,custom_fields.date_value.date_time,custom_fields.display_value,custom_fields.enabled,custom_fields.enum_options,custom_fields.enum_options.color,custom_fields.enum_options.enabled,custom_fields.enum_options.name,custom_fields.enum_value,custom_fields.enum_value.color,custom_fields.enum_value.enabled,custom_fields.enum_value.name,custom_fields.id_prefix,custom_fields.input_restrictions,custom_fields.is_formula_field,custom_fields.multi_enum_values,custom_fields.multi_enum_values.color,custom_fields.multi_enum_values.enabled,custom_fields.multi_enum_values.name,custom_fields.name,custom_fields.number_value,custom_fields.representation_type,custom_fields.text_value,custom_fields.type,default_access_level,due_on,followers,followers.name,html_notes,is_workspace_level,liked,likes,likes.user,likes.user.name,metric,metric.can_manage,metric.currency_code,metric.current_display_value,metric.current_number_value,metric.initial_number_value,metric.is_custom_weight,metric.precision,metric.progress_source,metric.resource_subtype,metric.target_number_value,metric.unit,name,notes,num_likes,owner,owner.name,privacy_setting,start_on,status,team,team.name,time_period,time_period.display_name,time_period.end_on,time_period.period,time_period.start_on,workspace,workspace.name\"\n};\ngoalsApiInstance.createGoal(body, opts).then((result) => {\n console.log('API called successfully. Returned data: ' + JSON.stringify(result.data, null, 2));\n}, (error) => {\n console.error(error.response.body);\n});",
"name": "node-sdk-v3"
},
{
"language": "node",
"install": "npm install asana@1.0.5",
"code": "const asana = require('asana');\n\nconst client = asana.Client.create().useAccessToken('PERSONAL_ACCESS_TOKEN');\n\nclient.goals.createGoal({field: \"value\", field: \"value\", pretty: true})\n .then((result) => {\n console.log(result);\n });",
"name": "node-sdk-v1"
},
{
"language": "python",
"install": "pip install asana",
"code": "import asana\nfrom asana.rest import ApiException\nfrom pprint import pprint\n\nconfiguration = asana.Configuration()\nconfiguration.access_token = '<YOUR_ACCESS_TOKEN>'\napi_client = asana.ApiClient(configuration)\n\n# create an instance of the API class\ngoals_api_instance = asana.GoalsApi(api_client)\nbody = {\"data\": {\"<PARAM_1>\": \"<VALUE_1>\", \"<PARAM_2>\": \"<VALUE_2>\",}} # dict | The goal to create.\nopts = {\n 'opt_fields': \"current_status_update,current_status_update.resource_subtype,current_status_update.title,custom_field_settings,custom_field_settings.custom_field,custom_field_settings.custom_field.asana_created_field,custom_field_settings.custom_field.created_by,custom_field_settings.custom_field.created_by.name,custom_field_settings.custom_field.currency_code,custom_field_settings.custom_field.custom_label,custom_field_settings.custom_field.custom_label_position,custom_field_settings.custom_field.date_value,custom_field_settings.custom_field.date_value.date,custom_field_settings.custom_field.date_value.date_time,custom_field_settings.custom_field.default_access_level,custom_field_settings.custom_field.description,custom_field_settings.custom_field.display_value,custom_field_settings.custom_field.enabled,custom_field_settings.custom_field.enum_options,custom_field_settings.custom_field.enum_options.color,custom_field_settings.custom_field.enum_options.enabled,custom_field_settings.custom_field.enum_options.name,custom_field_settings.custom_field.enum_value,custom_field_settings.custom_field.enum_value.color,custom_field_settings.custom_field.enum_value.enabled,custom_field_settings.custom_field.enum_value.name,custom_field_settings.custom_field.format,custom_field_settings.custom_field.has_notifications_enabled,custom_field_settings.custom_field.html_text_value,custom_field_settings.custom_field.id_prefix,custom_field_settings.custom_field.input_restrictions,custom_field_settings.custom_field.is_formula_field,custom_field_settings.custom_field.is_global_to_workspace,custom_field_settings.custom_field.is_value_read_only,custom_field_settings.custom_field.multi_enum_values,custom_field_settings.custom_field.multi_enum_values.color,custom_field_settings.custom_field.multi_enum_values.enabled,custom_field_settings.custom_field.multi_enum_values.name,custom_field_settings.custom_field.name,custom_field_settings.custom_field.number_value,custom_field_settings.custom_field.people_value,custom_field_settings.custom_field.people_value.name,custom_field_settings.custom_field.precision,custom_field_settings.custom_field.privacy_setting,custom_field_settings.custom_field.reference_value,custom_field_settings.custom_field.reference_value.name,custom_field_settings.custom_field.representation_type,custom_field_settings.custom_field.resource_subtype,custom_field_settings.custom_field.text_value,custom_field_settings.custom_field.type,custom_field_settings.is_important,custom_field_settings.parent,custom_field_settings.parent.name,custom_field_settings.parent.resource_subtype,custom_field_settings.project,custom_field_settings.project.name,custom_field_settings.project.resource_subtype,custom_fields,custom_fields.date_value,custom_fields.date_value.date,custom_fields.date_value.date_time,custom_fields.display_value,custom_fields.enabled,custom_fields.enum_options,custom_fields.enum_options.color,custom_fields.enum_options.enabled,custom_fields.enum_options.name,custom_fields.enum_value,custom_fields.enum_value.color,custom_fields.enum_value.enabled,custom_fields.enum_value.name,custom_fields.id_prefix,custom_fields.input_restrictions,custom_fields.is_formula_field,custom_fields.multi_enum_values,custom_fields.multi_enum_values.color,custom_fields.multi_enum_values.enabled,custom_fields.multi_enum_values.name,custom_fields.name,custom_fields.number_value,custom_fields.representation_type,custom_fields.text_value,custom_fields.type,default_access_level,due_on,followers,followers.name,html_notes,is_workspace_level,liked,likes,likes.user,likes.user.name,metric,metric.can_manage,metric.currency_code,metric.current_display_value,metric.current_number_value,metric.initial_number_value,metric.is_custom_weight,metric.precision,metric.progress_source,metric.resource_subtype,metric.target_number_value,metric.unit,name,notes,num_likes,owner,owner.name,privacy_setting,start_on,status,team,team.name,time_period,time_period.display_name,time_period.end_on,time_period.period,time_period.start_on,workspace,workspace.name\", # list[str] | 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.\n}\n\ntry:\n # Create a goal\n api_response = goals_api_instance.create_goal(body, opts)\n pprint(api_response)\nexcept ApiException as e:\n print(\"Exception when calling GoalsApi->create_goal: %s\\n\" % e)",
"name": "python-sdk-v5"
},
{
"language": "python",
"install": "pip install asana==3.2.3",
"code": "import asana\n\nclient = asana.Client.access_token('PERSONAL_ACCESS_TOKEN')\n\nresult = client.goals.create_goal({'field': 'value', 'field': 'value'}, opt_pretty=True)",
"name": "python-sdk-v3"
},
{
"language": "php",
"install": "composer require asana/asana",
"code": "<?php\nrequire 'vendor/autoload.php';\n\n$client = Asana\\Client::accessToken('PERSONAL_ACCESS_TOKEN');\n\n$result = $client->goals->createGoal(array('field' => 'value', 'field' => 'value'), array('opt_pretty' => 'true'))"
},
{
"language": "ruby",
"install": "gem install asana",
"code": "require 'asana'\n\nclient = Asana::Client.new do |c|\n c.authentication :access_token, 'PERSONAL_ACCESS_TOKEN'\nend\n\nresult = client.goals.create_goal(field: \"value\", field: \"value\", options: {pretty: true})"
}
]
},
"x-purple-suite-runtime": "unavailable"
}
POST /api/1.0/goals/{goal_gid}/setMetric
Create a goal metric
Creates and adds a goal metric to a specified goal. Note that this replaces an existing goal metric if one already exists.
This operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.
Authentication
[
{
"personalAccessToken": []
},
{
"oauth2": []
}
]
Path-level parameters and metadata
{
"parameters": [
{
"$ref": "#/components/parameters/goal_path_gid"
},
{
"$ref": "#/components/parameters/pretty"
}
]
}
Request, responses and operation details
{
"summary": "Create a goal metric",
"description": "Creates and adds a goal metric to a specified goal. Note that this replaces an existing goal metric if one already exists.\n\nThis operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.",
"tags": [
"Goals"
],
"operationId": "createGoalMetric",
"parameters": [
{
"name": "opt_fields",
"in": "query",
"description": "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. Properties can include nested fields. To learn more, see the [input/output options guide](/docs/inputoutput-options#selecting-nested-fields).",
"required": false,
"example": [
"current_status_update",
"current_status_update.resource_subtype",
"current_status_update.title",
"custom_field_settings",
"custom_field_settings.custom_field",
"custom_field_settings.custom_field.asana_created_field",
"custom_field_settings.custom_field.created_by",
"custom_field_settings.custom_field.created_by.name",
"custom_field_settings.custom_field.currency_code",
"custom_field_settings.custom_field.custom_label",
"custom_field_settings.custom_field.custom_label_position",
"custom_field_settings.custom_field.date_value",
"custom_field_settings.custom_field.date_value.date",
"custom_field_settings.custom_field.date_value.date_time",
"custom_field_settings.custom_field.default_access_level",
"custom_field_settings.custom_field.description",
"custom_field_settings.custom_field.display_value",
"custom_field_settings.custom_field.enabled",
"custom_field_settings.custom_field.enum_options",
"custom_field_settings.custom_field.enum_options.color",
"custom_field_settings.custom_field.enum_options.enabled",
"custom_field_settings.custom_field.enum_options.name",
"custom_field_settings.custom_field.enum_value",
"custom_field_settings.custom_field.enum_value.color",
"custom_field_settings.custom_field.enum_value.enabled",
"custom_field_settings.custom_field.enum_value.name",
"custom_field_settings.custom_field.format",
"custom_field_settings.custom_field.has_notifications_enabled",
"custom_field_settings.custom_field.html_text_value",
"custom_field_settings.custom_field.id_prefix",
"custom_field_settings.custom_field.input_restrictions",
"custom_field_settings.custom_field.is_formula_field",
"custom_field_settings.custom_field.is_global_to_workspace",
"custom_field_settings.custom_field.is_value_read_only",
"custom_field_settings.custom_field.multi_enum_values",
"custom_field_settings.custom_field.multi_enum_values.color",
"custom_field_settings.custom_field.multi_enum_values.enabled",
"custom_field_settings.custom_field.multi_enum_values.name",
"custom_field_settings.custom_field.name",
"custom_field_settings.custom_field.number_value",
"custom_field_settings.custom_field.people_value",
"custom_field_settings.custom_field.people_value.name",
"custom_field_settings.custom_field.precision",
"custom_field_settings.custom_field.privacy_setting",
"custom_field_settings.custom_field.reference_value",
"custom_field_settings.custom_field.reference_value.name",
"custom_field_settings.custom_field.representation_type",
"custom_field_settings.custom_field.resource_subtype",
"custom_field_settings.custom_field.text_value",
"custom_field_settings.custom_field.type",
"custom_field_settings.is_important",
"custom_field_settings.parent",
"custom_field_settings.parent.name",
"custom_field_settings.parent.resource_subtype",
"custom_field_settings.project",
"custom_field_settings.project.name",
"custom_field_settings.project.resource_subtype",
"custom_fields",
"custom_fields.date_value",
"custom_fields.date_value.date",
"custom_fields.date_value.date_time",
"custom_fields.display_value",
"custom_fields.enabled",
"custom_fields.enum_options",
"custom_fields.enum_options.color",
"custom_fields.enum_options.enabled",
"custom_fields.enum_options.name",
"custom_fields.enum_value",
"custom_fields.enum_value.color",
"custom_fields.enum_value.enabled",
"custom_fields.enum_value.name",
"custom_fields.id_prefix",
"custom_fields.input_restrictions",
"custom_fields.is_formula_field",
"custom_fields.multi_enum_values",
"custom_fields.multi_enum_values.color",
"custom_fields.multi_enum_values.enabled",
"custom_fields.multi_enum_values.name",
"custom_fields.name",
"custom_fields.number_value",
"custom_fields.representation_type",
"custom_fields.text_value",
"custom_fields.type",
"default_access_level",
"due_on",
"followers",
"followers.name",
"html_notes",
"is_workspace_level",
"liked",
"likes",
"likes.user",
"likes.user.name",
"metric",
"metric.can_manage",
"metric.currency_code",
"metric.current_display_value",
"metric.current_number_value",
"metric.initial_number_value",
"metric.is_custom_weight",
"metric.precision",
"metric.progress_source",
"metric.resource_subtype",
"metric.target_number_value",
"metric.unit",
"name",
"notes",
"num_likes",
"owner",
"owner.name",
"privacy_setting",
"start_on",
"status",
"team",
"team.name",
"time_period",
"time_period.display_name",
"time_period.end_on",
"time_period.period",
"time_period.start_on",
"workspace",
"workspace.name"
],
"schema": {
"type": "array",
"items": {
"type": "string",
"enum": [
"current_status_update",
"current_status_update.resource_subtype",
"current_status_update.title",
"custom_field_settings",
"custom_field_settings.custom_field",
"custom_field_settings.custom_field.asana_created_field",
"custom_field_settings.custom_field.created_by",
"custom_field_settings.custom_field.created_by.name",
"custom_field_settings.custom_field.currency_code",
"custom_field_settings.custom_field.custom_label",
"custom_field_settings.custom_field.custom_label_position",
"custom_field_settings.custom_field.date_value",
"custom_field_settings.custom_field.date_value.date",
"custom_field_settings.custom_field.date_value.date_time",
"custom_field_settings.custom_field.default_access_level",
"custom_field_settings.custom_field.description",
"custom_field_settings.custom_field.display_value",
"custom_field_settings.custom_field.enabled",
"custom_field_settings.custom_field.enum_options",
"custom_field_settings.custom_field.enum_options.color",
"custom_field_settings.custom_field.enum_options.enabled",
"custom_field_settings.custom_field.enum_options.name",
"custom_field_settings.custom_field.enum_value",
"custom_field_settings.custom_field.enum_value.color",
"custom_field_settings.custom_field.enum_value.enabled",
"custom_field_settings.custom_field.enum_value.name",
"custom_field_settings.custom_field.format",
"custom_field_settings.custom_field.has_notifications_enabled",
"custom_field_settings.custom_field.html_text_value",
"custom_field_settings.custom_field.id_prefix",
"custom_field_settings.custom_field.input_restrictions",
"custom_field_settings.custom_field.is_formula_field",
"custom_field_settings.custom_field.is_global_to_workspace",
"custom_field_settings.custom_field.is_value_read_only",
"custom_field_settings.custom_field.multi_enum_values",
"custom_field_settings.custom_field.multi_enum_values.color",
"custom_field_settings.custom_field.multi_enum_values.enabled",
"custom_field_settings.custom_field.multi_enum_values.name",
"custom_field_settings.custom_field.name",
"custom_field_settings.custom_field.number_value",
"custom_field_settings.custom_field.people_value",
"custom_field_settings.custom_field.people_value.name",
"custom_field_settings.custom_field.precision",
"custom_field_settings.custom_field.privacy_setting",
"custom_field_settings.custom_field.reference_value",
"custom_field_settings.custom_field.reference_value.name",
"custom_field_settings.custom_field.representation_type",
"custom_field_settings.custom_field.resource_subtype",
"custom_field_settings.custom_field.text_value",
"custom_field_settings.custom_field.type",
"custom_field_settings.is_important",
"custom_field_settings.parent",
"custom_field_settings.parent.name",
"custom_field_settings.parent.resource_subtype",
"custom_field_settings.project",
"custom_field_settings.project.name",
"custom_field_settings.project.resource_subtype",
"custom_fields",
"custom_fields.date_value",
"custom_fields.date_value.date",
"custom_fields.date_value.date_time",
"custom_fields.display_value",
"custom_fields.enabled",
"custom_fields.enum_options",
"custom_fields.enum_options.color",
"custom_fields.enum_options.enabled",
"custom_fields.enum_options.name",
"custom_fields.enum_value",
"custom_fields.enum_value.color",
"custom_fields.enum_value.enabled",
"custom_fields.enum_value.name",
"custom_fields.id_prefix",
"custom_fields.input_restrictions",
"custom_fields.is_formula_field",
"custom_fields.multi_enum_values",
"custom_fields.multi_enum_values.color",
"custom_fields.multi_enum_values.enabled",
"custom_fields.multi_enum_values.name",
"custom_fields.name",
"custom_fields.number_value",
"custom_fields.representation_type",
"custom_fields.text_value",
"custom_fields.type",
"default_access_level",
"due_on",
"followers",
"followers.name",
"html_notes",
"is_workspace_level",
"liked",
"likes",
"likes.user",
"likes.user.name",
"metric",
"metric.can_manage",
"metric.currency_code",
"metric.current_display_value",
"metric.current_number_value",
"metric.initial_number_value",
"metric.is_custom_weight",
"metric.precision",
"metric.progress_source",
"metric.resource_subtype",
"metric.target_number_value",
"metric.unit",
"name",
"notes",
"num_likes",
"owner",
"owner.name",
"privacy_setting",
"start_on",
"status",
"team",
"team.name",
"time_period",
"time_period.display_name",
"time_period.end_on",
"time_period.period",
"time_period.start_on",
"workspace",
"workspace.name"
]
}
},
"style": "form",
"explode": false
}
],
"requestBody": {
"description": "The goal metric to create.",
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"$ref": "#/components/schemas/GoalMetricRequest"
}
}
}
}
}
},
"responses": {
"200": {
"description": "Successfully created a new goal metric.",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"$ref": "#/components/schemas/GoalResponse"
}
}
}
}
}
},
"400": {
"$ref": "#/components/responses/BadRequest"
},
"401": {
"$ref": "#/components/responses/Unauthorized"
},
"402": {
"$ref": "#/components/responses/PaymentRequired"
},
"403": {
"$ref": "#/components/responses/Forbidden"
},
"404": {
"$ref": "#/components/responses/NotFound"
},
"500": {
"$ref": "#/components/responses/InternalServerError"
}
},
"security": [
{
"personalAccessToken": []
},
{
"oauth2": []
}
],
"x-readme": {
"code-samples": [
{
"language": "java",
"install": "<dependency><groupId>com.asana</groupId><artifactId>asana</artifactId><version>1.0.0</version></dependency>",
"code": "import com.asana.Client;\n\nClient client = Client.accessToken(\"PERSONAL_ACCESS_TOKEN\");\n\nJsonElement result = client.goals.createGoalMetric(goalGid)\n .data(\"field\", \"value\")\n .data(\"field\", \"value\")\n .option(\"pretty\", true)\n .execute();"
},
{
"language": "node",
"install": "npm install asana",
"code": "const Asana = require('asana');\n\nlet client = new Asana.ApiClient();\nclient.authentications.token.accessToken = '<YOUR_ACCESS_TOKEN>';\n\nlet goalsApiInstance = new Asana.GoalsApi(client);\nlet body = {\"data\": {\"<PARAM_1>\": \"<VALUE_1>\", \"<PARAM_2>\": \"<VALUE_2>\",}}; // Object | The goal metric to create.\nlet goal_gid = \"12345\"; // String | Globally unique identifier for the goal.\nlet opts = { \n 'opt_fields': \"current_status_update,current_status_update.resource_subtype,current_status_update.title,custom_field_settings,custom_field_settings.custom_field,custom_field_settings.custom_field.asana_created_field,custom_field_settings.custom_field.created_by,custom_field_settings.custom_field.created_by.name,custom_field_settings.custom_field.currency_code,custom_field_settings.custom_field.custom_label,custom_field_settings.custom_field.custom_label_position,custom_field_settings.custom_field.date_value,custom_field_settings.custom_field.date_value.date,custom_field_settings.custom_field.date_value.date_time,custom_field_settings.custom_field.default_access_level,custom_field_settings.custom_field.description,custom_field_settings.custom_field.display_value,custom_field_settings.custom_field.enabled,custom_field_settings.custom_field.enum_options,custom_field_settings.custom_field.enum_options.color,custom_field_settings.custom_field.enum_options.enabled,custom_field_settings.custom_field.enum_options.name,custom_field_settings.custom_field.enum_value,custom_field_settings.custom_field.enum_value.color,custom_field_settings.custom_field.enum_value.enabled,custom_field_settings.custom_field.enum_value.name,custom_field_settings.custom_field.format,custom_field_settings.custom_field.has_notifications_enabled,custom_field_settings.custom_field.html_text_value,custom_field_settings.custom_field.id_prefix,custom_field_settings.custom_field.input_restrictions,custom_field_settings.custom_field.is_formula_field,custom_field_settings.custom_field.is_global_to_workspace,custom_field_settings.custom_field.is_value_read_only,custom_field_settings.custom_field.multi_enum_values,custom_field_settings.custom_field.multi_enum_values.color,custom_field_settings.custom_field.multi_enum_values.enabled,custom_field_settings.custom_field.multi_enum_values.name,custom_field_settings.custom_field.name,custom_field_settings.custom_field.number_value,custom_field_settings.custom_field.people_value,custom_field_settings.custom_field.people_value.name,custom_field_settings.custom_field.precision,custom_field_settings.custom_field.privacy_setting,custom_field_settings.custom_field.reference_value,custom_field_settings.custom_field.reference_value.name,custom_field_settings.custom_field.representation_type,custom_field_settings.custom_field.resource_subtype,custom_field_settings.custom_field.text_value,custom_field_settings.custom_field.type,custom_field_settings.is_important,custom_field_settings.parent,custom_field_settings.parent.name,custom_field_settings.parent.resource_subtype,custom_field_settings.project,custom_field_settings.project.name,custom_field_settings.project.resource_subtype,custom_fields,custom_fields.date_value,custom_fields.date_value.date,custom_fields.date_value.date_time,custom_fields.display_value,custom_fields.enabled,custom_fields.enum_options,custom_fields.enum_options.color,custom_fields.enum_options.enabled,custom_fields.enum_options.name,custom_fields.enum_value,custom_fields.enum_value.color,custom_fields.enum_value.enabled,custom_fields.enum_value.name,custom_fields.id_prefix,custom_fields.input_restrictions,custom_fields.is_formula_field,custom_fields.multi_enum_values,custom_fields.multi_enum_values.color,custom_fields.multi_enum_values.enabled,custom_fields.multi_enum_values.name,custom_fields.name,custom_fields.number_value,custom_fields.representation_type,custom_fields.text_value,custom_fields.type,default_access_level,due_on,followers,followers.name,html_notes,is_workspace_level,liked,likes,likes.user,likes.user.name,metric,metric.can_manage,metric.currency_code,metric.current_display_value,metric.current_number_value,metric.initial_number_value,metric.is_custom_weight,metric.precision,metric.progress_source,metric.resource_subtype,metric.target_number_value,metric.unit,name,notes,num_likes,owner,owner.name,privacy_setting,start_on,status,team,team.name,time_period,time_period.display_name,time_period.end_on,time_period.period,time_period.start_on,workspace,workspace.name\"\n};\ngoalsApiInstance.createGoalMetric(body, goal_gid, opts).then((result) => {\n console.log('API called successfully. Returned data: ' + JSON.stringify(result.data, null, 2));\n}, (error) => {\n console.error(error.response.body);\n});",
"name": "node-sdk-v3"
},
{
"language": "node",
"install": "npm install asana@1.0.5",
"code": "const asana = require('asana');\n\nconst client = asana.Client.create().useAccessToken('PERSONAL_ACCESS_TOKEN');\n\nclient.goals.createGoalMetric(goalGid, {field: \"value\", field: \"value\", pretty: true})\n .then((result) => {\n console.log(result);\n });",
"name": "node-sdk-v1"
},
{
"language": "python",
"install": "pip install asana",
"code": "import asana\nfrom asana.rest import ApiException\nfrom pprint import pprint\n\nconfiguration = asana.Configuration()\nconfiguration.access_token = '<YOUR_ACCESS_TOKEN>'\napi_client = asana.ApiClient(configuration)\n\n# create an instance of the API class\ngoals_api_instance = asana.GoalsApi(api_client)\nbody = {\"data\": {\"<PARAM_1>\": \"<VALUE_1>\", \"<PARAM_2>\": \"<VALUE_2>\",}} # dict | The goal metric to create.\ngoal_gid = \"12345\" # str | Globally unique identifier for the goal.\nopts = {\n 'opt_fields': \"current_status_update,current_status_update.resource_subtype,current_status_update.title,custom_field_settings,custom_field_settings.custom_field,custom_field_settings.custom_field.asana_created_field,custom_field_settings.custom_field.created_by,custom_field_settings.custom_field.created_by.name,custom_field_settings.custom_field.currency_code,custom_field_settings.custom_field.custom_label,custom_field_settings.custom_field.custom_label_position,custom_field_settings.custom_field.date_value,custom_field_settings.custom_field.date_value.date,custom_field_settings.custom_field.date_value.date_time,custom_field_settings.custom_field.default_access_level,custom_field_settings.custom_field.description,custom_field_settings.custom_field.display_value,custom_field_settings.custom_field.enabled,custom_field_settings.custom_field.enum_options,custom_field_settings.custom_field.enum_options.color,custom_field_settings.custom_field.enum_options.enabled,custom_field_settings.custom_field.enum_options.name,custom_field_settings.custom_field.enum_value,custom_field_settings.custom_field.enum_value.color,custom_field_settings.custom_field.enum_value.enabled,custom_field_settings.custom_field.enum_value.name,custom_field_settings.custom_field.format,custom_field_settings.custom_field.has_notifications_enabled,custom_field_settings.custom_field.html_text_value,custom_field_settings.custom_field.id_prefix,custom_field_settings.custom_field.input_restrictions,custom_field_settings.custom_field.is_formula_field,custom_field_settings.custom_field.is_global_to_workspace,custom_field_settings.custom_field.is_value_read_only,custom_field_settings.custom_field.multi_enum_values,custom_field_settings.custom_field.multi_enum_values.color,custom_field_settings.custom_field.multi_enum_values.enabled,custom_field_settings.custom_field.multi_enum_values.name,custom_field_settings.custom_field.name,custom_field_settings.custom_field.number_value,custom_field_settings.custom_field.people_value,custom_field_settings.custom_field.people_value.name,custom_field_settings.custom_field.precision,custom_field_settings.custom_field.privacy_setting,custom_field_settings.custom_field.reference_value,custom_field_settings.custom_field.reference_value.name,custom_field_settings.custom_field.representation_type,custom_field_settings.custom_field.resource_subtype,custom_field_settings.custom_field.text_value,custom_field_settings.custom_field.type,custom_field_settings.is_important,custom_field_settings.parent,custom_field_settings.parent.name,custom_field_settings.parent.resource_subtype,custom_field_settings.project,custom_field_settings.project.name,custom_field_settings.project.resource_subtype,custom_fields,custom_fields.date_value,custom_fields.date_value.date,custom_fields.date_value.date_time,custom_fields.display_value,custom_fields.enabled,custom_fields.enum_options,custom_fields.enum_options.color,custom_fields.enum_options.enabled,custom_fields.enum_options.name,custom_fields.enum_value,custom_fields.enum_value.color,custom_fields.enum_value.enabled,custom_fields.enum_value.name,custom_fields.id_prefix,custom_fields.input_restrictions,custom_fields.is_formula_field,custom_fields.multi_enum_values,custom_fields.multi_enum_values.color,custom_fields.multi_enum_values.enabled,custom_fields.multi_enum_values.name,custom_fields.name,custom_fields.number_value,custom_fields.representation_type,custom_fields.text_value,custom_fields.type,default_access_level,due_on,followers,followers.name,html_notes,is_workspace_level,liked,likes,likes.user,likes.user.name,metric,metric.can_manage,metric.currency_code,metric.current_display_value,metric.current_number_value,metric.initial_number_value,metric.is_custom_weight,metric.precision,metric.progress_source,metric.resource_subtype,metric.target_number_value,metric.unit,name,notes,num_likes,owner,owner.name,privacy_setting,start_on,status,team,team.name,time_period,time_period.display_name,time_period.end_on,time_period.period,time_period.start_on,workspace,workspace.name\", # list[str] | 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.\n}\n\ntry:\n # Create a goal metric\n api_response = goals_api_instance.create_goal_metric(body, goal_gid, opts)\n pprint(api_response)\nexcept ApiException as e:\n print(\"Exception when calling GoalsApi->create_goal_metric: %s\\n\" % e)",
"name": "python-sdk-v5"
},
{
"language": "python",
"install": "pip install asana==3.2.3",
"code": "import asana\n\nclient = asana.Client.access_token('PERSONAL_ACCESS_TOKEN')\n\nresult = client.goals.create_goal_metric(goal_gid, {'field': 'value', 'field': 'value'}, opt_pretty=True)",
"name": "python-sdk-v3"
},
{
"language": "php",
"install": "composer require asana/asana",
"code": "<?php\nrequire 'vendor/autoload.php';\n\n$client = Asana\\Client::accessToken('PERSONAL_ACCESS_TOKEN');\n\n$result = $client->goals->createGoalMetric($goal_gid, array('field' => 'value', 'field' => 'value'), array('opt_pretty' => 'true'))"
},
{
"language": "ruby",
"install": "gem install asana",
"code": "require 'asana'\n\nclient = Asana::Client.new do |c|\n c.authentication :access_token, 'PERSONAL_ACCESS_TOKEN'\nend\n\nresult = client.goals.create_goal_metric(goal_gid: 'goal_gid', field: \"value\", field: \"value\", options: {pretty: true})"
}
]
},
"x-purple-suite-runtime": "unavailable"
}
POST /api/1.0/goals/{goal_gid}/setMetricCurrentValue
Update a goal metric
Updates a goal's existing metric's `current_number_value` if one exists,
otherwise responds with a 400 status code.
Returns the complete updated goal metric record.
This operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.
Authentication
[
{
"personalAccessToken": []
},
{
"oauth2": []
}
]
Path-level parameters and metadata
{
"parameters": [
{
"$ref": "#/components/parameters/goal_path_gid"
},
{
"$ref": "#/components/parameters/pretty"
}
]
}
Request, responses and operation details
{
"summary": "Update a goal metric",
"description": "Updates a goal's existing metric's `current_number_value` if one exists,\notherwise responds with a 400 status code.\n\nReturns the complete updated goal metric record.\n\nThis operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.",
"tags": [
"Goals"
],
"operationId": "updateGoalMetric",
"parameters": [
{
"name": "opt_fields",
"in": "query",
"description": "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. Properties can include nested fields. To learn more, see the [input/output options guide](/docs/inputoutput-options#selecting-nested-fields).",
"required": false,
"example": [
"current_status_update",
"current_status_update.resource_subtype",
"current_status_update.title",
"custom_field_settings",
"custom_field_settings.custom_field",
"custom_field_settings.custom_field.asana_created_field",
"custom_field_settings.custom_field.created_by",
"custom_field_settings.custom_field.created_by.name",
"custom_field_settings.custom_field.currency_code",
"custom_field_settings.custom_field.custom_label",
"custom_field_settings.custom_field.custom_label_position",
"custom_field_settings.custom_field.date_value",
"custom_field_settings.custom_field.date_value.date",
"custom_field_settings.custom_field.date_value.date_time",
"custom_field_settings.custom_field.default_access_level",
"custom_field_settings.custom_field.description",
"custom_field_settings.custom_field.display_value",
"custom_field_settings.custom_field.enabled",
"custom_field_settings.custom_field.enum_options",
"custom_field_settings.custom_field.enum_options.color",
"custom_field_settings.custom_field.enum_options.enabled",
"custom_field_settings.custom_field.enum_options.name",
"custom_field_settings.custom_field.enum_value",
"custom_field_settings.custom_field.enum_value.color",
"custom_field_settings.custom_field.enum_value.enabled",
"custom_field_settings.custom_field.enum_value.name",
"custom_field_settings.custom_field.format",
"custom_field_settings.custom_field.has_notifications_enabled",
"custom_field_settings.custom_field.html_text_value",
"custom_field_settings.custom_field.id_prefix",
"custom_field_settings.custom_field.input_restrictions",
"custom_field_settings.custom_field.is_formula_field",
"custom_field_settings.custom_field.is_global_to_workspace",
"custom_field_settings.custom_field.is_value_read_only",
"custom_field_settings.custom_field.multi_enum_values",
"custom_field_settings.custom_field.multi_enum_values.color",
"custom_field_settings.custom_field.multi_enum_values.enabled",
"custom_field_settings.custom_field.multi_enum_values.name",
"custom_field_settings.custom_field.name",
"custom_field_settings.custom_field.number_value",
"custom_field_settings.custom_field.people_value",
"custom_field_settings.custom_field.people_value.name",
"custom_field_settings.custom_field.precision",
"custom_field_settings.custom_field.privacy_setting",
"custom_field_settings.custom_field.reference_value",
"custom_field_settings.custom_field.reference_value.name",
"custom_field_settings.custom_field.representation_type",
"custom_field_settings.custom_field.resource_subtype",
"custom_field_settings.custom_field.text_value",
"custom_field_settings.custom_field.type",
"custom_field_settings.is_important",
"custom_field_settings.parent",
"custom_field_settings.parent.name",
"custom_field_settings.parent.resource_subtype",
"custom_field_settings.project",
"custom_field_settings.project.name",
"custom_field_settings.project.resource_subtype",
"custom_fields",
"custom_fields.date_value",
"custom_fields.date_value.date",
"custom_fields.date_value.date_time",
"custom_fields.display_value",
"custom_fields.enabled",
"custom_fields.enum_options",
"custom_fields.enum_options.color",
"custom_fields.enum_options.enabled",
"custom_fields.enum_options.name",
"custom_fields.enum_value",
"custom_fields.enum_value.color",
"custom_fields.enum_value.enabled",
"custom_fields.enum_value.name",
"custom_fields.id_prefix",
"custom_fields.input_restrictions",
"custom_fields.is_formula_field",
"custom_fields.multi_enum_values",
"custom_fields.multi_enum_values.color",
"custom_fields.multi_enum_values.enabled",
"custom_fields.multi_enum_values.name",
"custom_fields.name",
"custom_fields.number_value",
"custom_fields.representation_type",
"custom_fields.text_value",
"custom_fields.type",
"default_access_level",
"due_on",
"followers",
"followers.name",
"html_notes",
"is_workspace_level",
"liked",
"likes",
"likes.user",
"likes.user.name",
"metric",
"metric.can_manage",
"metric.currency_code",
"metric.current_display_value",
"metric.current_number_value",
"metric.initial_number_value",
"metric.is_custom_weight",
"metric.precision",
"metric.progress_source",
"metric.resource_subtype",
"metric.target_number_value",
"metric.unit",
"name",
"notes",
"num_likes",
"owner",
"owner.name",
"privacy_setting",
"start_on",
"status",
"team",
"team.name",
"time_period",
"time_period.display_name",
"time_period.end_on",
"time_period.period",
"time_period.start_on",
"workspace",
"workspace.name"
],
"schema": {
"type": "array",
"items": {
"type": "string",
"enum": [
"current_status_update",
"current_status_update.resource_subtype",
"current_status_update.title",
"custom_field_settings",
"custom_field_settings.custom_field",
"custom_field_settings.custom_field.asana_created_field",
"custom_field_settings.custom_field.created_by",
"custom_field_settings.custom_field.created_by.name",
"custom_field_settings.custom_field.currency_code",
"custom_field_settings.custom_field.custom_label",
"custom_field_settings.custom_field.custom_label_position",
"custom_field_settings.custom_field.date_value",
"custom_field_settings.custom_field.date_value.date",
"custom_field_settings.custom_field.date_value.date_time",
"custom_field_settings.custom_field.default_access_level",
"custom_field_settings.custom_field.description",
"custom_field_settings.custom_field.display_value",
"custom_field_settings.custom_field.enabled",
"custom_field_settings.custom_field.enum_options",
"custom_field_settings.custom_field.enum_options.color",
"custom_field_settings.custom_field.enum_options.enabled",
"custom_field_settings.custom_field.enum_options.name",
"custom_field_settings.custom_field.enum_value",
"custom_field_settings.custom_field.enum_value.color",
"custom_field_settings.custom_field.enum_value.enabled",
"custom_field_settings.custom_field.enum_value.name",
"custom_field_settings.custom_field.format",
"custom_field_settings.custom_field.has_notifications_enabled",
"custom_field_settings.custom_field.html_text_value",
"custom_field_settings.custom_field.id_prefix",
"custom_field_settings.custom_field.input_restrictions",
"custom_field_settings.custom_field.is_formula_field",
"custom_field_settings.custom_field.is_global_to_workspace",
"custom_field_settings.custom_field.is_value_read_only",
"custom_field_settings.custom_field.multi_enum_values",
"custom_field_settings.custom_field.multi_enum_values.color",
"custom_field_settings.custom_field.multi_enum_values.enabled",
"custom_field_settings.custom_field.multi_enum_values.name",
"custom_field_settings.custom_field.name",
"custom_field_settings.custom_field.number_value",
"custom_field_settings.custom_field.people_value",
"custom_field_settings.custom_field.people_value.name",
"custom_field_settings.custom_field.precision",
"custom_field_settings.custom_field.privacy_setting",
"custom_field_settings.custom_field.reference_value",
"custom_field_settings.custom_field.reference_value.name",
"custom_field_settings.custom_field.representation_type",
"custom_field_settings.custom_field.resource_subtype",
"custom_field_settings.custom_field.text_value",
"custom_field_settings.custom_field.type",
"custom_field_settings.is_important",
"custom_field_settings.parent",
"custom_field_settings.parent.name",
"custom_field_settings.parent.resource_subtype",
"custom_field_settings.project",
"custom_field_settings.project.name",
"custom_field_settings.project.resource_subtype",
"custom_fields",
"custom_fields.date_value",
"custom_fields.date_value.date",
"custom_fields.date_value.date_time",
"custom_fields.display_value",
"custom_fields.enabled",
"custom_fields.enum_options",
"custom_fields.enum_options.color",
"custom_fields.enum_options.enabled",
"custom_fields.enum_options.name",
"custom_fields.enum_value",
"custom_fields.enum_value.color",
"custom_fields.enum_value.enabled",
"custom_fields.enum_value.name",
"custom_fields.id_prefix",
"custom_fields.input_restrictions",
"custom_fields.is_formula_field",
"custom_fields.multi_enum_values",
"custom_fields.multi_enum_values.color",
"custom_fields.multi_enum_values.enabled",
"custom_fields.multi_enum_values.name",
"custom_fields.name",
"custom_fields.number_value",
"custom_fields.representation_type",
"custom_fields.text_value",
"custom_fields.type",
"default_access_level",
"due_on",
"followers",
"followers.name",
"html_notes",
"is_workspace_level",
"liked",
"likes",
"likes.user",
"likes.user.name",
"metric",
"metric.can_manage",
"metric.currency_code",
"metric.current_display_value",
"metric.current_number_value",
"metric.initial_number_value",
"metric.is_custom_weight",
"metric.precision",
"metric.progress_source",
"metric.resource_subtype",
"metric.target_number_value",
"metric.unit",
"name",
"notes",
"num_likes",
"owner",
"owner.name",
"privacy_setting",
"start_on",
"status",
"team",
"team.name",
"time_period",
"time_period.display_name",
"time_period.end_on",
"time_period.period",
"time_period.start_on",
"workspace",
"workspace.name"
]
}
},
"style": "form",
"explode": false
}
],
"requestBody": {
"description": "The updated fields for the goal metric.",
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"$ref": "#/components/schemas/GoalMetricCurrentValueRequest"
}
}
}
}
}
},
"responses": {
"200": {
"description": "Successfully updated the goal metric.",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"$ref": "#/components/schemas/GoalResponse"
}
}
}
}
}
},
"400": {
"$ref": "#/components/responses/BadRequest"
},
"401": {
"$ref": "#/components/responses/Unauthorized"
},
"402": {
"$ref": "#/components/responses/PaymentRequired"
},
"403": {
"$ref": "#/components/responses/Forbidden"
},
"404": {
"$ref": "#/components/responses/NotFound"
},
"500": {
"$ref": "#/components/responses/InternalServerError"
}
},
"security": [
{
"personalAccessToken": []
},
{
"oauth2": []
}
],
"x-readme": {
"code-samples": [
{
"language": "java",
"install": "<dependency><groupId>com.asana</groupId><artifactId>asana</artifactId><version>1.0.0</version></dependency>",
"code": "import com.asana.Client;\n\nClient client = Client.accessToken(\"PERSONAL_ACCESS_TOKEN\");\n\nJsonElement result = client.goals.updateGoalMetric(goalGid)\n .data(\"field\", \"value\")\n .data(\"field\", \"value\")\n .option(\"pretty\", true)\n .execute();"
},
{
"language": "node",
"install": "npm install asana",
"code": "const Asana = require('asana');\n\nlet client = new Asana.ApiClient();\nclient.authentications.token.accessToken = '<YOUR_ACCESS_TOKEN>';\n\nlet goalsApiInstance = new Asana.GoalsApi(client);\nlet body = {\"data\": {\"<PARAM_1>\": \"<VALUE_1>\", \"<PARAM_2>\": \"<VALUE_2>\",}}; // Object | The updated fields for the goal metric.\nlet goal_gid = \"12345\"; // String | Globally unique identifier for the goal.\nlet opts = { \n 'opt_fields': \"current_status_update,current_status_update.resource_subtype,current_status_update.title,custom_field_settings,custom_field_settings.custom_field,custom_field_settings.custom_field.asana_created_field,custom_field_settings.custom_field.created_by,custom_field_settings.custom_field.created_by.name,custom_field_settings.custom_field.currency_code,custom_field_settings.custom_field.custom_label,custom_field_settings.custom_field.custom_label_position,custom_field_settings.custom_field.date_value,custom_field_settings.custom_field.date_value.date,custom_field_settings.custom_field.date_value.date_time,custom_field_settings.custom_field.default_access_level,custom_field_settings.custom_field.description,custom_field_settings.custom_field.display_value,custom_field_settings.custom_field.enabled,custom_field_settings.custom_field.enum_options,custom_field_settings.custom_field.enum_options.color,custom_field_settings.custom_field.enum_options.enabled,custom_field_settings.custom_field.enum_options.name,custom_field_settings.custom_field.enum_value,custom_field_settings.custom_field.enum_value.color,custom_field_settings.custom_field.enum_value.enabled,custom_field_settings.custom_field.enum_value.name,custom_field_settings.custom_field.format,custom_field_settings.custom_field.has_notifications_enabled,custom_field_settings.custom_field.html_text_value,custom_field_settings.custom_field.id_prefix,custom_field_settings.custom_field.input_restrictions,custom_field_settings.custom_field.is_formula_field,custom_field_settings.custom_field.is_global_to_workspace,custom_field_settings.custom_field.is_value_read_only,custom_field_settings.custom_field.multi_enum_values,custom_field_settings.custom_field.multi_enum_values.color,custom_field_settings.custom_field.multi_enum_values.enabled,custom_field_settings.custom_field.multi_enum_values.name,custom_field_settings.custom_field.name,custom_field_settings.custom_field.number_value,custom_field_settings.custom_field.people_value,custom_field_settings.custom_field.people_value.name,custom_field_settings.custom_field.precision,custom_field_settings.custom_field.privacy_setting,custom_field_settings.custom_field.reference_value,custom_field_settings.custom_field.reference_value.name,custom_field_settings.custom_field.representation_type,custom_field_settings.custom_field.resource_subtype,custom_field_settings.custom_field.text_value,custom_field_settings.custom_field.type,custom_field_settings.is_important,custom_field_settings.parent,custom_field_settings.parent.name,custom_field_settings.parent.resource_subtype,custom_field_settings.project,custom_field_settings.project.name,custom_field_settings.project.resource_subtype,custom_fields,custom_fields.date_value,custom_fields.date_value.date,custom_fields.date_value.date_time,custom_fields.display_value,custom_fields.enabled,custom_fields.enum_options,custom_fields.enum_options.color,custom_fields.enum_options.enabled,custom_fields.enum_options.name,custom_fields.enum_value,custom_fields.enum_value.color,custom_fields.enum_value.enabled,custom_fields.enum_value.name,custom_fields.id_prefix,custom_fields.input_restrictions,custom_fields.is_formula_field,custom_fields.multi_enum_values,custom_fields.multi_enum_values.color,custom_fields.multi_enum_values.enabled,custom_fields.multi_enum_values.name,custom_fields.name,custom_fields.number_value,custom_fields.representation_type,custom_fields.text_value,custom_fields.type,default_access_level,due_on,followers,followers.name,html_notes,is_workspace_level,liked,likes,likes.user,likes.user.name,metric,metric.can_manage,metric.currency_code,metric.current_display_value,metric.current_number_value,metric.initial_number_value,metric.is_custom_weight,metric.precision,metric.progress_source,metric.resource_subtype,metric.target_number_value,metric.unit,name,notes,num_likes,owner,owner.name,privacy_setting,start_on,status,team,team.name,time_period,time_period.display_name,time_period.end_on,time_period.period,time_period.start_on,workspace,workspace.name\"\n};\ngoalsApiInstance.updateGoalMetric(body, goal_gid, opts).then((result) => {\n console.log('API called successfully. Returned data: ' + JSON.stringify(result.data, null, 2));\n}, (error) => {\n console.error(error.response.body);\n});",
"name": "node-sdk-v3"
},
{
"language": "node",
"install": "npm install asana@1.0.5",
"code": "const asana = require('asana');\n\nconst client = asana.Client.create().useAccessToken('PERSONAL_ACCESS_TOKEN');\n\nclient.goals.updateGoalMetric(goalGid, {field: \"value\", field: \"value\", pretty: true})\n .then((result) => {\n console.log(result);\n });",
"name": "node-sdk-v1"
},
{
"language": "python",
"install": "pip install asana",
"code": "import asana\nfrom asana.rest import ApiException\nfrom pprint import pprint\n\nconfiguration = asana.Configuration()\nconfiguration.access_token = '<YOUR_ACCESS_TOKEN>'\napi_client = asana.ApiClient(configuration)\n\n# create an instance of the API class\ngoals_api_instance = asana.GoalsApi(api_client)\nbody = {\"data\": {\"<PARAM_1>\": \"<VALUE_1>\", \"<PARAM_2>\": \"<VALUE_2>\",}} # dict | The updated fields for the goal metric.\ngoal_gid = \"12345\" # str | Globally unique identifier for the goal.\nopts = {\n 'opt_fields': \"current_status_update,current_status_update.resource_subtype,current_status_update.title,custom_field_settings,custom_field_settings.custom_field,custom_field_settings.custom_field.asana_created_field,custom_field_settings.custom_field.created_by,custom_field_settings.custom_field.created_by.name,custom_field_settings.custom_field.currency_code,custom_field_settings.custom_field.custom_label,custom_field_settings.custom_field.custom_label_position,custom_field_settings.custom_field.date_value,custom_field_settings.custom_field.date_value.date,custom_field_settings.custom_field.date_value.date_time,custom_field_settings.custom_field.default_access_level,custom_field_settings.custom_field.description,custom_field_settings.custom_field.display_value,custom_field_settings.custom_field.enabled,custom_field_settings.custom_field.enum_options,custom_field_settings.custom_field.enum_options.color,custom_field_settings.custom_field.enum_options.enabled,custom_field_settings.custom_field.enum_options.name,custom_field_settings.custom_field.enum_value,custom_field_settings.custom_field.enum_value.color,custom_field_settings.custom_field.enum_value.enabled,custom_field_settings.custom_field.enum_value.name,custom_field_settings.custom_field.format,custom_field_settings.custom_field.has_notifications_enabled,custom_field_settings.custom_field.html_text_value,custom_field_settings.custom_field.id_prefix,custom_field_settings.custom_field.input_restrictions,custom_field_settings.custom_field.is_formula_field,custom_field_settings.custom_field.is_global_to_workspace,custom_field_settings.custom_field.is_value_read_only,custom_field_settings.custom_field.multi_enum_values,custom_field_settings.custom_field.multi_enum_values.color,custom_field_settings.custom_field.multi_enum_values.enabled,custom_field_settings.custom_field.multi_enum_values.name,custom_field_settings.custom_field.name,custom_field_settings.custom_field.number_value,custom_field_settings.custom_field.people_value,custom_field_settings.custom_field.people_value.name,custom_field_settings.custom_field.precision,custom_field_settings.custom_field.privacy_setting,custom_field_settings.custom_field.reference_value,custom_field_settings.custom_field.reference_value.name,custom_field_settings.custom_field.representation_type,custom_field_settings.custom_field.resource_subtype,custom_field_settings.custom_field.text_value,custom_field_settings.custom_field.type,custom_field_settings.is_important,custom_field_settings.parent,custom_field_settings.parent.name,custom_field_settings.parent.resource_subtype,custom_field_settings.project,custom_field_settings.project.name,custom_field_settings.project.resource_subtype,custom_fields,custom_fields.date_value,custom_fields.date_value.date,custom_fields.date_value.date_time,custom_fields.display_value,custom_fields.enabled,custom_fields.enum_options,custom_fields.enum_options.color,custom_fields.enum_options.enabled,custom_fields.enum_options.name,custom_fields.enum_value,custom_fields.enum_value.color,custom_fields.enum_value.enabled,custom_fields.enum_value.name,custom_fields.id_prefix,custom_fields.input_restrictions,custom_fields.is_formula_field,custom_fields.multi_enum_values,custom_fields.multi_enum_values.color,custom_fields.multi_enum_values.enabled,custom_fields.multi_enum_values.name,custom_fields.name,custom_fields.number_value,custom_fields.representation_type,custom_fields.text_value,custom_fields.type,default_access_level,due_on,followers,followers.name,html_notes,is_workspace_level,liked,likes,likes.user,likes.user.name,metric,metric.can_manage,metric.currency_code,metric.current_display_value,metric.current_number_value,metric.initial_number_value,metric.is_custom_weight,metric.precision,metric.progress_source,metric.resource_subtype,metric.target_number_value,metric.unit,name,notes,num_likes,owner,owner.name,privacy_setting,start_on,status,team,team.name,time_period,time_period.display_name,time_period.end_on,time_period.period,time_period.start_on,workspace,workspace.name\", # list[str] | 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.\n}\n\ntry:\n # Update a goal metric\n api_response = goals_api_instance.update_goal_metric(body, goal_gid, opts)\n pprint(api_response)\nexcept ApiException as e:\n print(\"Exception when calling GoalsApi->update_goal_metric: %s\\n\" % e)",
"name": "python-sdk-v5"
},
{
"language": "python",
"install": "pip install asana==3.2.3",
"code": "import asana\n\nclient = asana.Client.access_token('PERSONAL_ACCESS_TOKEN')\n\nresult = client.goals.update_goal_metric(goal_gid, {'field': 'value', 'field': 'value'}, opt_pretty=True)",
"name": "python-sdk-v3"
},
{
"language": "php",
"install": "composer require asana/asana",
"code": "<?php\nrequire 'vendor/autoload.php';\n\n$client = Asana\\Client::accessToken('PERSONAL_ACCESS_TOKEN');\n\n$result = $client->goals->updateGoalMetric($goal_gid, array('field' => 'value', 'field' => 'value'), array('opt_pretty' => 'true'))"
},
{
"language": "ruby",
"install": "gem install asana",
"code": "require 'asana'\n\nclient = Asana::Client.new do |c|\n c.authentication :access_token, 'PERSONAL_ACCESS_TOKEN'\nend\n\nresult = client.goals.update_goal_metric(goal_gid: 'goal_gid', field: \"value\", field: \"value\", options: {pretty: true})"
}
]
},
"x-purple-suite-runtime": "unavailable"
}
POST /api/1.0/goals/{goal_gid}/addFollowers
Add a collaborator to a goal
Adds followers to a goal. Returns the goal the followers were added to.
Each goal can be associated with zero or more followers in the system.
Requests to add/remove followers, if successful, will return the complete updated goal record, described above.
This operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.
Authentication
[
{
"personalAccessToken": []
},
{
"oauth2": []
}
]
Path-level parameters and metadata
{
"parameters": [
{
"$ref": "#/components/parameters/goal_path_gid"
},
{
"$ref": "#/components/parameters/pretty"
}
]
}
Request, responses and operation details
{
"summary": "Add a collaborator to a goal",
"description": "Adds followers to a goal. Returns the goal the followers were added to.\nEach goal can be associated with zero or more followers in the system.\nRequests to add/remove followers, if successful, will return the complete updated goal record, described above.\n\nThis operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.",
"tags": [
"Goals"
],
"operationId": "addFollowers",
"parameters": [
{
"name": "opt_fields",
"in": "query",
"description": "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. Properties can include nested fields. To learn more, see the [input/output options guide](/docs/inputoutput-options#selecting-nested-fields).",
"required": false,
"example": [
"current_status_update",
"current_status_update.resource_subtype",
"current_status_update.title",
"custom_field_settings",
"custom_field_settings.custom_field",
"custom_field_settings.custom_field.asana_created_field",
"custom_field_settings.custom_field.created_by",
"custom_field_settings.custom_field.created_by.name",
"custom_field_settings.custom_field.currency_code",
"custom_field_settings.custom_field.custom_label",
"custom_field_settings.custom_field.custom_label_position",
"custom_field_settings.custom_field.date_value",
"custom_field_settings.custom_field.date_value.date",
"custom_field_settings.custom_field.date_value.date_time",
"custom_field_settings.custom_field.default_access_level",
"custom_field_settings.custom_field.description",
"custom_field_settings.custom_field.display_value",
"custom_field_settings.custom_field.enabled",
"custom_field_settings.custom_field.enum_options",
"custom_field_settings.custom_field.enum_options.color",
"custom_field_settings.custom_field.enum_options.enabled",
"custom_field_settings.custom_field.enum_options.name",
"custom_field_settings.custom_field.enum_value",
"custom_field_settings.custom_field.enum_value.color",
"custom_field_settings.custom_field.enum_value.enabled",
"custom_field_settings.custom_field.enum_value.name",
"custom_field_settings.custom_field.format",
"custom_field_settings.custom_field.has_notifications_enabled",
"custom_field_settings.custom_field.html_text_value",
"custom_field_settings.custom_field.id_prefix",
"custom_field_settings.custom_field.input_restrictions",
"custom_field_settings.custom_field.is_formula_field",
"custom_field_settings.custom_field.is_global_to_workspace",
"custom_field_settings.custom_field.is_value_read_only",
"custom_field_settings.custom_field.multi_enum_values",
"custom_field_settings.custom_field.multi_enum_values.color",
"custom_field_settings.custom_field.multi_enum_values.enabled",
"custom_field_settings.custom_field.multi_enum_values.name",
"custom_field_settings.custom_field.name",
"custom_field_settings.custom_field.number_value",
"custom_field_settings.custom_field.people_value",
"custom_field_settings.custom_field.people_value.name",
"custom_field_settings.custom_field.precision",
"custom_field_settings.custom_field.privacy_setting",
"custom_field_settings.custom_field.reference_value",
"custom_field_settings.custom_field.reference_value.name",
"custom_field_settings.custom_field.representation_type",
"custom_field_settings.custom_field.resource_subtype",
"custom_field_settings.custom_field.text_value",
"custom_field_settings.custom_field.type",
"custom_field_settings.is_important",
"custom_field_settings.parent",
"custom_field_settings.parent.name",
"custom_field_settings.parent.resource_subtype",
"custom_field_settings.project",
"custom_field_settings.project.name",
"custom_field_settings.project.resource_subtype",
"custom_fields",
"custom_fields.date_value",
"custom_fields.date_value.date",
"custom_fields.date_value.date_time",
"custom_fields.display_value",
"custom_fields.enabled",
"custom_fields.enum_options",
"custom_fields.enum_options.color",
"custom_fields.enum_options.enabled",
"custom_fields.enum_options.name",
"custom_fields.enum_value",
"custom_fields.enum_value.color",
"custom_fields.enum_value.enabled",
"custom_fields.enum_value.name",
"custom_fields.id_prefix",
"custom_fields.input_restrictions",
"custom_fields.is_formula_field",
"custom_fields.multi_enum_values",
"custom_fields.multi_enum_values.color",
"custom_fields.multi_enum_values.enabled",
"custom_fields.multi_enum_values.name",
"custom_fields.name",
"custom_fields.number_value",
"custom_fields.representation_type",
"custom_fields.text_value",
"custom_fields.type",
"default_access_level",
"due_on",
"followers",
"followers.name",
"html_notes",
"is_workspace_level",
"liked",
"likes",
"likes.user",
"likes.user.name",
"metric",
"metric.can_manage",
"metric.currency_code",
"metric.current_display_value",
"metric.current_number_value",
"metric.initial_number_value",
"metric.is_custom_weight",
"metric.precision",
"metric.progress_source",
"metric.resource_subtype",
"metric.target_number_value",
"metric.unit",
"name",
"notes",
"num_likes",
"owner",
"owner.name",
"privacy_setting",
"start_on",
"status",
"team",
"team.name",
"time_period",
"time_period.display_name",
"time_period.end_on",
"time_period.period",
"time_period.start_on",
"workspace",
"workspace.name"
],
"schema": {
"type": "array",
"items": {
"type": "string",
"enum": [
"current_status_update",
"current_status_update.resource_subtype",
"current_status_update.title",
"custom_field_settings",
"custom_field_settings.custom_field",
"custom_field_settings.custom_field.asana_created_field",
"custom_field_settings.custom_field.created_by",
"custom_field_settings.custom_field.created_by.name",
"custom_field_settings.custom_field.currency_code",
"custom_field_settings.custom_field.custom_label",
"custom_field_settings.custom_field.custom_label_position",
"custom_field_settings.custom_field.date_value",
"custom_field_settings.custom_field.date_value.date",
"custom_field_settings.custom_field.date_value.date_time",
"custom_field_settings.custom_field.default_access_level",
"custom_field_settings.custom_field.description",
"custom_field_settings.custom_field.display_value",
"custom_field_settings.custom_field.enabled",
"custom_field_settings.custom_field.enum_options",
"custom_field_settings.custom_field.enum_options.color",
"custom_field_settings.custom_field.enum_options.enabled",
"custom_field_settings.custom_field.enum_options.name",
"custom_field_settings.custom_field.enum_value",
"custom_field_settings.custom_field.enum_value.color",
"custom_field_settings.custom_field.enum_value.enabled",
"custom_field_settings.custom_field.enum_value.name",
"custom_field_settings.custom_field.format",
"custom_field_settings.custom_field.has_notifications_enabled",
"custom_field_settings.custom_field.html_text_value",
"custom_field_settings.custom_field.id_prefix",
"custom_field_settings.custom_field.input_restrictions",
"custom_field_settings.custom_field.is_formula_field",
"custom_field_settings.custom_field.is_global_to_workspace",
"custom_field_settings.custom_field.is_value_read_only",
"custom_field_settings.custom_field.multi_enum_values",
"custom_field_settings.custom_field.multi_enum_values.color",
"custom_field_settings.custom_field.multi_enum_values.enabled",
"custom_field_settings.custom_field.multi_enum_values.name",
"custom_field_settings.custom_field.name",
"custom_field_settings.custom_field.number_value",
"custom_field_settings.custom_field.people_value",
"custom_field_settings.custom_field.people_value.name",
"custom_field_settings.custom_field.precision",
"custom_field_settings.custom_field.privacy_setting",
"custom_field_settings.custom_field.reference_value",
"custom_field_settings.custom_field.reference_value.name",
"custom_field_settings.custom_field.representation_type",
"custom_field_settings.custom_field.resource_subtype",
"custom_field_settings.custom_field.text_value",
"custom_field_settings.custom_field.type",
"custom_field_settings.is_important",
"custom_field_settings.parent",
"custom_field_settings.parent.name",
"custom_field_settings.parent.resource_subtype",
"custom_field_settings.project",
"custom_field_settings.project.name",
"custom_field_settings.project.resource_subtype",
"custom_fields",
"custom_fields.date_value",
"custom_fields.date_value.date",
"custom_fields.date_value.date_time",
"custom_fields.display_value",
"custom_fields.enabled",
"custom_fields.enum_options",
"custom_fields.enum_options.color",
"custom_fields.enum_options.enabled",
"custom_fields.enum_options.name",
"custom_fields.enum_value",
"custom_fields.enum_value.color",
"custom_fields.enum_value.enabled",
"custom_fields.enum_value.name",
"custom_fields.id_prefix",
"custom_fields.input_restrictions",
"custom_fields.is_formula_field",
"custom_fields.multi_enum_values",
"custom_fields.multi_enum_values.color",
"custom_fields.multi_enum_values.enabled",
"custom_fields.multi_enum_values.name",
"custom_fields.name",
"custom_fields.number_value",
"custom_fields.representation_type",
"custom_fields.text_value",
"custom_fields.type",
"default_access_level",
"due_on",
"followers",
"followers.name",
"html_notes",
"is_workspace_level",
"liked",
"likes",
"likes.user",
"likes.user.name",
"metric",
"metric.can_manage",
"metric.currency_code",
"metric.current_display_value",
"metric.current_number_value",
"metric.initial_number_value",
"metric.is_custom_weight",
"metric.precision",
"metric.progress_source",
"metric.resource_subtype",
"metric.target_number_value",
"metric.unit",
"name",
"notes",
"num_likes",
"owner",
"owner.name",
"privacy_setting",
"start_on",
"status",
"team",
"team.name",
"time_period",
"time_period.display_name",
"time_period.end_on",
"time_period.period",
"time_period.start_on",
"workspace",
"workspace.name"
]
}
},
"style": "form",
"explode": false
}
],
"requestBody": {
"description": "The followers to be added as collaborators",
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"$ref": "#/components/schemas/TaskAddFollowersRequest"
}
}
}
}
}
},
"responses": {
"200": {
"description": "Successfully added users as collaborators.",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"$ref": "#/components/schemas/GoalResponse"
}
}
}
}
}
},
"400": {
"$ref": "#/components/responses/BadRequest"
},
"401": {
"$ref": "#/components/responses/Unauthorized"
},
"402": {
"$ref": "#/components/responses/PaymentRequired"
},
"403": {
"$ref": "#/components/responses/Forbidden"
},
"404": {
"$ref": "#/components/responses/NotFound"
},
"500": {
"$ref": "#/components/responses/InternalServerError"
}
},
"security": [
{
"personalAccessToken": []
},
{
"oauth2": []
}
],
"x-readme": {
"code-samples": [
{
"language": "java",
"install": "<dependency><groupId>com.asana</groupId><artifactId>asana</artifactId><version>1.0.0</version></dependency>",
"code": "import com.asana.Client;\n\nClient client = Client.accessToken(\"PERSONAL_ACCESS_TOKEN\");\n\nJsonElement result = client.goals.addFollowers(goalGid)\n .data(\"field\", \"value\")\n .data(\"field\", \"value\")\n .option(\"pretty\", true)\n .execute();"
},
{
"language": "node",
"install": "npm install asana",
"code": "const Asana = require('asana');\n\nlet client = new Asana.ApiClient();\nclient.authentications.token.accessToken = '<YOUR_ACCESS_TOKEN>';\n\nlet goalsApiInstance = new Asana.GoalsApi(client);\nlet body = {\"data\": {\"<PARAM_1>\": \"<VALUE_1>\", \"<PARAM_2>\": \"<VALUE_2>\",}}; // Object | The followers to be added as collaborators\nlet goal_gid = \"12345\"; // String | Globally unique identifier for the goal.\nlet opts = { \n 'opt_fields': \"current_status_update,current_status_update.resource_subtype,current_status_update.title,custom_field_settings,custom_field_settings.custom_field,custom_field_settings.custom_field.asana_created_field,custom_field_settings.custom_field.created_by,custom_field_settings.custom_field.created_by.name,custom_field_settings.custom_field.currency_code,custom_field_settings.custom_field.custom_label,custom_field_settings.custom_field.custom_label_position,custom_field_settings.custom_field.date_value,custom_field_settings.custom_field.date_value.date,custom_field_settings.custom_field.date_value.date_time,custom_field_settings.custom_field.default_access_level,custom_field_settings.custom_field.description,custom_field_settings.custom_field.display_value,custom_field_settings.custom_field.enabled,custom_field_settings.custom_field.enum_options,custom_field_settings.custom_field.enum_options.color,custom_field_settings.custom_field.enum_options.enabled,custom_field_settings.custom_field.enum_options.name,custom_field_settings.custom_field.enum_value,custom_field_settings.custom_field.enum_value.color,custom_field_settings.custom_field.enum_value.enabled,custom_field_settings.custom_field.enum_value.name,custom_field_settings.custom_field.format,custom_field_settings.custom_field.has_notifications_enabled,custom_field_settings.custom_field.html_text_value,custom_field_settings.custom_field.id_prefix,custom_field_settings.custom_field.input_restrictions,custom_field_settings.custom_field.is_formula_field,custom_field_settings.custom_field.is_global_to_workspace,custom_field_settings.custom_field.is_value_read_only,custom_field_settings.custom_field.multi_enum_values,custom_field_settings.custom_field.multi_enum_values.color,custom_field_settings.custom_field.multi_enum_values.enabled,custom_field_settings.custom_field.multi_enum_values.name,custom_field_settings.custom_field.name,custom_field_settings.custom_field.number_value,custom_field_settings.custom_field.people_value,custom_field_settings.custom_field.people_value.name,custom_field_settings.custom_field.precision,custom_field_settings.custom_field.privacy_setting,custom_field_settings.custom_field.reference_value,custom_field_settings.custom_field.reference_value.name,custom_field_settings.custom_field.representation_type,custom_field_settings.custom_field.resource_subtype,custom_field_settings.custom_field.text_value,custom_field_settings.custom_field.type,custom_field_settings.is_important,custom_field_settings.parent,custom_field_settings.parent.name,custom_field_settings.parent.resource_subtype,custom_field_settings.project,custom_field_settings.project.name,custom_field_settings.project.resource_subtype,custom_fields,custom_fields.date_value,custom_fields.date_value.date,custom_fields.date_value.date_time,custom_fields.display_value,custom_fields.enabled,custom_fields.enum_options,custom_fields.enum_options.color,custom_fields.enum_options.enabled,custom_fields.enum_options.name,custom_fields.enum_value,custom_fields.enum_value.color,custom_fields.enum_value.enabled,custom_fields.enum_value.name,custom_fields.id_prefix,custom_fields.input_restrictions,custom_fields.is_formula_field,custom_fields.multi_enum_values,custom_fields.multi_enum_values.color,custom_fields.multi_enum_values.enabled,custom_fields.multi_enum_values.name,custom_fields.name,custom_fields.number_value,custom_fields.representation_type,custom_fields.text_value,custom_fields.type,default_access_level,due_on,followers,followers.name,html_notes,is_workspace_level,liked,likes,likes.user,likes.user.name,metric,metric.can_manage,metric.currency_code,metric.current_display_value,metric.current_number_value,metric.initial_number_value,metric.is_custom_weight,metric.precision,metric.progress_source,metric.resource_subtype,metric.target_number_value,metric.unit,name,notes,num_likes,owner,owner.name,privacy_setting,start_on,status,team,team.name,time_period,time_period.display_name,time_period.end_on,time_period.period,time_period.start_on,workspace,workspace.name\"\n};\ngoalsApiInstance.addFollowers(body, goal_gid, opts).then((result) => {\n console.log('API called successfully. Returned data: ' + JSON.stringify(result.data, null, 2));\n}, (error) => {\n console.error(error.response.body);\n});",
"name": "node-sdk-v3"
},
{
"language": "node",
"install": "npm install asana@1.0.5",
"code": "const asana = require('asana');\n\nconst client = asana.Client.create().useAccessToken('PERSONAL_ACCESS_TOKEN');\n\nclient.goals.addFollowers(goalGid, {field: \"value\", field: \"value\", pretty: true})\n .then((result) => {\n console.log(result);\n });",
"name": "node-sdk-v1"
},
{
"language": "python",
"install": "pip install asana",
"code": "import asana\nfrom asana.rest import ApiException\nfrom pprint import pprint\n\nconfiguration = asana.Configuration()\nconfiguration.access_token = '<YOUR_ACCESS_TOKEN>'\napi_client = asana.ApiClient(configuration)\n\n# create an instance of the API class\ngoals_api_instance = asana.GoalsApi(api_client)\nbody = {\"data\": {\"<PARAM_1>\": \"<VALUE_1>\", \"<PARAM_2>\": \"<VALUE_2>\",}} # dict | The followers to be added as collaborators\ngoal_gid = \"12345\" # str | Globally unique identifier for the goal.\nopts = {\n 'opt_fields': \"current_status_update,current_status_update.resource_subtype,current_status_update.title,custom_field_settings,custom_field_settings.custom_field,custom_field_settings.custom_field.asana_created_field,custom_field_settings.custom_field.created_by,custom_field_settings.custom_field.created_by.name,custom_field_settings.custom_field.currency_code,custom_field_settings.custom_field.custom_label,custom_field_settings.custom_field.custom_label_position,custom_field_settings.custom_field.date_value,custom_field_settings.custom_field.date_value.date,custom_field_settings.custom_field.date_value.date_time,custom_field_settings.custom_field.default_access_level,custom_field_settings.custom_field.description,custom_field_settings.custom_field.display_value,custom_field_settings.custom_field.enabled,custom_field_settings.custom_field.enum_options,custom_field_settings.custom_field.enum_options.color,custom_field_settings.custom_field.enum_options.enabled,custom_field_settings.custom_field.enum_options.name,custom_field_settings.custom_field.enum_value,custom_field_settings.custom_field.enum_value.color,custom_field_settings.custom_field.enum_value.enabled,custom_field_settings.custom_field.enum_value.name,custom_field_settings.custom_field.format,custom_field_settings.custom_field.has_notifications_enabled,custom_field_settings.custom_field.html_text_value,custom_field_settings.custom_field.id_prefix,custom_field_settings.custom_field.input_restrictions,custom_field_settings.custom_field.is_formula_field,custom_field_settings.custom_field.is_global_to_workspace,custom_field_settings.custom_field.is_value_read_only,custom_field_settings.custom_field.multi_enum_values,custom_field_settings.custom_field.multi_enum_values.color,custom_field_settings.custom_field.multi_enum_values.enabled,custom_field_settings.custom_field.multi_enum_values.name,custom_field_settings.custom_field.name,custom_field_settings.custom_field.number_value,custom_field_settings.custom_field.people_value,custom_field_settings.custom_field.people_value.name,custom_field_settings.custom_field.precision,custom_field_settings.custom_field.privacy_setting,custom_field_settings.custom_field.reference_value,custom_field_settings.custom_field.reference_value.name,custom_field_settings.custom_field.representation_type,custom_field_settings.custom_field.resource_subtype,custom_field_settings.custom_field.text_value,custom_field_settings.custom_field.type,custom_field_settings.is_important,custom_field_settings.parent,custom_field_settings.parent.name,custom_field_settings.parent.resource_subtype,custom_field_settings.project,custom_field_settings.project.name,custom_field_settings.project.resource_subtype,custom_fields,custom_fields.date_value,custom_fields.date_value.date,custom_fields.date_value.date_time,custom_fields.display_value,custom_fields.enabled,custom_fields.enum_options,custom_fields.enum_options.color,custom_fields.enum_options.enabled,custom_fields.enum_options.name,custom_fields.enum_value,custom_fields.enum_value.color,custom_fields.enum_value.enabled,custom_fields.enum_value.name,custom_fields.id_prefix,custom_fields.input_restrictions,custom_fields.is_formula_field,custom_fields.multi_enum_values,custom_fields.multi_enum_values.color,custom_fields.multi_enum_values.enabled,custom_fields.multi_enum_values.name,custom_fields.name,custom_fields.number_value,custom_fields.representation_type,custom_fields.text_value,custom_fields.type,default_access_level,due_on,followers,followers.name,html_notes,is_workspace_level,liked,likes,likes.user,likes.user.name,metric,metric.can_manage,metric.currency_code,metric.current_display_value,metric.current_number_value,metric.initial_number_value,metric.is_custom_weight,metric.precision,metric.progress_source,metric.resource_subtype,metric.target_number_value,metric.unit,name,notes,num_likes,owner,owner.name,privacy_setting,start_on,status,team,team.name,time_period,time_period.display_name,time_period.end_on,time_period.period,time_period.start_on,workspace,workspace.name\", # list[str] | 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.\n}\n\ntry:\n # Add a collaborator to a goal\n api_response = goals_api_instance.add_followers(body, goal_gid, opts)\n pprint(api_response)\nexcept ApiException as e:\n print(\"Exception when calling GoalsApi->add_followers: %s\\n\" % e)",
"name": "python-sdk-v5"
},
{
"language": "python",
"install": "pip install asana==3.2.3",
"code": "import asana\n\nclient = asana.Client.access_token('PERSONAL_ACCESS_TOKEN')\n\nresult = client.goals.add_followers(goal_gid, {'field': 'value', 'field': 'value'}, opt_pretty=True)",
"name": "python-sdk-v3"
},
{
"language": "php",
"install": "composer require asana/asana",
"code": "<?php\nrequire 'vendor/autoload.php';\n\n$client = Asana\\Client::accessToken('PERSONAL_ACCESS_TOKEN');\n\n$result = $client->goals->addFollowers($goal_gid, array('field' => 'value', 'field' => 'value'), array('opt_pretty' => 'true'))"
},
{
"language": "ruby",
"install": "gem install asana",
"code": "require 'asana'\n\nclient = Asana::Client.new do |c|\n c.authentication :access_token, 'PERSONAL_ACCESS_TOKEN'\nend\n\nresult = client.goals.add_followers(goal_gid: 'goal_gid', field: \"value\", field: \"value\", options: {pretty: true})"
}
]
},
"x-purple-suite-runtime": "unavailable"
}
POST /api/1.0/goals/{goal_gid}/removeFollowers
Remove a collaborator from a goal
Removes followers from a goal. Returns the goal the followers were removed from.
Each goal can be associated with zero or more followers in the system.
Requests to add/remove followers, if successful, will return the complete updated goal record, described above.
This operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.
Authentication
[
{
"personalAccessToken": []
},
{
"oauth2": []
}
]
Path-level parameters and metadata
{
"parameters": [
{
"$ref": "#/components/parameters/goal_path_gid"
},
{
"$ref": "#/components/parameters/pretty"
}
]
}
Request, responses and operation details
{
"summary": "Remove a collaborator from a goal",
"description": "Removes followers from a goal. Returns the goal the followers were removed from.\nEach goal can be associated with zero or more followers in the system.\nRequests to add/remove followers, if successful, will return the complete updated goal record, described above.\n\nThis operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.",
"tags": [
"Goals"
],
"operationId": "removeFollowers",
"parameters": [
{
"name": "opt_fields",
"in": "query",
"description": "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. Properties can include nested fields. To learn more, see the [input/output options guide](/docs/inputoutput-options#selecting-nested-fields).",
"required": false,
"example": [
"current_status_update",
"current_status_update.resource_subtype",
"current_status_update.title",
"custom_field_settings",
"custom_field_settings.custom_field",
"custom_field_settings.custom_field.asana_created_field",
"custom_field_settings.custom_field.created_by",
"custom_field_settings.custom_field.created_by.name",
"custom_field_settings.custom_field.currency_code",
"custom_field_settings.custom_field.custom_label",
"custom_field_settings.custom_field.custom_label_position",
"custom_field_settings.custom_field.date_value",
"custom_field_settings.custom_field.date_value.date",
"custom_field_settings.custom_field.date_value.date_time",
"custom_field_settings.custom_field.default_access_level",
"custom_field_settings.custom_field.description",
"custom_field_settings.custom_field.display_value",
"custom_field_settings.custom_field.enabled",
"custom_field_settings.custom_field.enum_options",
"custom_field_settings.custom_field.enum_options.color",
"custom_field_settings.custom_field.enum_options.enabled",
"custom_field_settings.custom_field.enum_options.name",
"custom_field_settings.custom_field.enum_value",
"custom_field_settings.custom_field.enum_value.color",
"custom_field_settings.custom_field.enum_value.enabled",
"custom_field_settings.custom_field.enum_value.name",
"custom_field_settings.custom_field.format",
"custom_field_settings.custom_field.has_notifications_enabled",
"custom_field_settings.custom_field.html_text_value",
"custom_field_settings.custom_field.id_prefix",
"custom_field_settings.custom_field.input_restrictions",
"custom_field_settings.custom_field.is_formula_field",
"custom_field_settings.custom_field.is_global_to_workspace",
"custom_field_settings.custom_field.is_value_read_only",
"custom_field_settings.custom_field.multi_enum_values",
"custom_field_settings.custom_field.multi_enum_values.color",
"custom_field_settings.custom_field.multi_enum_values.enabled",
"custom_field_settings.custom_field.multi_enum_values.name",
"custom_field_settings.custom_field.name",
"custom_field_settings.custom_field.number_value",
"custom_field_settings.custom_field.people_value",
"custom_field_settings.custom_field.people_value.name",
"custom_field_settings.custom_field.precision",
"custom_field_settings.custom_field.privacy_setting",
"custom_field_settings.custom_field.reference_value",
"custom_field_settings.custom_field.reference_value.name",
"custom_field_settings.custom_field.representation_type",
"custom_field_settings.custom_field.resource_subtype",
"custom_field_settings.custom_field.text_value",
"custom_field_settings.custom_field.type",
"custom_field_settings.is_important",
"custom_field_settings.parent",
"custom_field_settings.parent.name",
"custom_field_settings.parent.resource_subtype",
"custom_field_settings.project",
"custom_field_settings.project.name",
"custom_field_settings.project.resource_subtype",
"custom_fields",
"custom_fields.date_value",
"custom_fields.date_value.date",
"custom_fields.date_value.date_time",
"custom_fields.display_value",
"custom_fields.enabled",
"custom_fields.enum_options",
"custom_fields.enum_options.color",
"custom_fields.enum_options.enabled",
"custom_fields.enum_options.name",
"custom_fields.enum_value",
"custom_fields.enum_value.color",
"custom_fields.enum_value.enabled",
"custom_fields.enum_value.name",
"custom_fields.id_prefix",
"custom_fields.input_restrictions",
"custom_fields.is_formula_field",
"custom_fields.multi_enum_values",
"custom_fields.multi_enum_values.color",
"custom_fields.multi_enum_values.enabled",
"custom_fields.multi_enum_values.name",
"custom_fields.name",
"custom_fields.number_value",
"custom_fields.representation_type",
"custom_fields.text_value",
"custom_fields.type",
"default_access_level",
"due_on",
"followers",
"followers.name",
"html_notes",
"is_workspace_level",
"liked",
"likes",
"likes.user",
"likes.user.name",
"metric",
"metric.can_manage",
"metric.currency_code",
"metric.current_display_value",
"metric.current_number_value",
"metric.initial_number_value",
"metric.is_custom_weight",
"metric.precision",
"metric.progress_source",
"metric.resource_subtype",
"metric.target_number_value",
"metric.unit",
"name",
"notes",
"num_likes",
"owner",
"owner.name",
"privacy_setting",
"start_on",
"status",
"team",
"team.name",
"time_period",
"time_period.display_name",
"time_period.end_on",
"time_period.period",
"time_period.start_on",
"workspace",
"workspace.name"
],
"schema": {
"type": "array",
"items": {
"type": "string",
"enum": [
"current_status_update",
"current_status_update.resource_subtype",
"current_status_update.title",
"custom_field_settings",
"custom_field_settings.custom_field",
"custom_field_settings.custom_field.asana_created_field",
"custom_field_settings.custom_field.created_by",
"custom_field_settings.custom_field.created_by.name",
"custom_field_settings.custom_field.currency_code",
"custom_field_settings.custom_field.custom_label",
"custom_field_settings.custom_field.custom_label_position",
"custom_field_settings.custom_field.date_value",
"custom_field_settings.custom_field.date_value.date",
"custom_field_settings.custom_field.date_value.date_time",
"custom_field_settings.custom_field.default_access_level",
"custom_field_settings.custom_field.description",
"custom_field_settings.custom_field.display_value",
"custom_field_settings.custom_field.enabled",
"custom_field_settings.custom_field.enum_options",
"custom_field_settings.custom_field.enum_options.color",
"custom_field_settings.custom_field.enum_options.enabled",
"custom_field_settings.custom_field.enum_options.name",
"custom_field_settings.custom_field.enum_value",
"custom_field_settings.custom_field.enum_value.color",
"custom_field_settings.custom_field.enum_value.enabled",
"custom_field_settings.custom_field.enum_value.name",
"custom_field_settings.custom_field.format",
"custom_field_settings.custom_field.has_notifications_enabled",
"custom_field_settings.custom_field.html_text_value",
"custom_field_settings.custom_field.id_prefix",
"custom_field_settings.custom_field.input_restrictions",
"custom_field_settings.custom_field.is_formula_field",
"custom_field_settings.custom_field.is_global_to_workspace",
"custom_field_settings.custom_field.is_value_read_only",
"custom_field_settings.custom_field.multi_enum_values",
"custom_field_settings.custom_field.multi_enum_values.color",
"custom_field_settings.custom_field.multi_enum_values.enabled",
"custom_field_settings.custom_field.multi_enum_values.name",
"custom_field_settings.custom_field.name",
"custom_field_settings.custom_field.number_value",
"custom_field_settings.custom_field.people_value",
"custom_field_settings.custom_field.people_value.name",
"custom_field_settings.custom_field.precision",
"custom_field_settings.custom_field.privacy_setting",
"custom_field_settings.custom_field.reference_value",
"custom_field_settings.custom_field.reference_value.name",
"custom_field_settings.custom_field.representation_type",
"custom_field_settings.custom_field.resource_subtype",
"custom_field_settings.custom_field.text_value",
"custom_field_settings.custom_field.type",
"custom_field_settings.is_important",
"custom_field_settings.parent",
"custom_field_settings.parent.name",
"custom_field_settings.parent.resource_subtype",
"custom_field_settings.project",
"custom_field_settings.project.name",
"custom_field_settings.project.resource_subtype",
"custom_fields",
"custom_fields.date_value",
"custom_fields.date_value.date",
"custom_fields.date_value.date_time",
"custom_fields.display_value",
"custom_fields.enabled",
"custom_fields.enum_options",
"custom_fields.enum_options.color",
"custom_fields.enum_options.enabled",
"custom_fields.enum_options.name",
"custom_fields.enum_value",
"custom_fields.enum_value.color",
"custom_fields.enum_value.enabled",
"custom_fields.enum_value.name",
"custom_fields.id_prefix",
"custom_fields.input_restrictions",
"custom_fields.is_formula_field",
"custom_fields.multi_enum_values",
"custom_fields.multi_enum_values.color",
"custom_fields.multi_enum_values.enabled",
"custom_fields.multi_enum_values.name",
"custom_fields.name",
"custom_fields.number_value",
"custom_fields.representation_type",
"custom_fields.text_value",
"custom_fields.type",
"default_access_level",
"due_on",
"followers",
"followers.name",
"html_notes",
"is_workspace_level",
"liked",
"likes",
"likes.user",
"likes.user.name",
"metric",
"metric.can_manage",
"metric.currency_code",
"metric.current_display_value",
"metric.current_number_value",
"metric.initial_number_value",
"metric.is_custom_weight",
"metric.precision",
"metric.progress_source",
"metric.resource_subtype",
"metric.target_number_value",
"metric.unit",
"name",
"notes",
"num_likes",
"owner",
"owner.name",
"privacy_setting",
"start_on",
"status",
"team",
"team.name",
"time_period",
"time_period.display_name",
"time_period.end_on",
"time_period.period",
"time_period.start_on",
"workspace",
"workspace.name"
]
}
},
"style": "form",
"explode": false
}
],
"requestBody": {
"description": "The followers to be removed as collaborators",
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"$ref": "#/components/schemas/TaskAddFollowersRequest"
}
}
}
}
}
},
"responses": {
"200": {
"description": "Successfully removed users as collaborators.",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"$ref": "#/components/schemas/GoalResponse"
}
}
}
}
}
},
"400": {
"$ref": "#/components/responses/BadRequest"
},
"401": {
"$ref": "#/components/responses/Unauthorized"
},
"402": {
"$ref": "#/components/responses/PaymentRequired"
},
"403": {
"$ref": "#/components/responses/Forbidden"
},
"404": {
"$ref": "#/components/responses/NotFound"
},
"500": {
"$ref": "#/components/responses/InternalServerError"
}
},
"security": [
{
"personalAccessToken": []
},
{
"oauth2": []
}
],
"x-readme": {
"code-samples": [
{
"language": "java",
"install": "<dependency><groupId>com.asana</groupId><artifactId>asana</artifactId><version>1.0.0</version></dependency>",
"code": "import com.asana.Client;\n\nClient client = Client.accessToken(\"PERSONAL_ACCESS_TOKEN\");\n\nJsonElement result = client.goals.removeFollowers(goalGid)\n .data(\"field\", \"value\")\n .data(\"field\", \"value\")\n .option(\"pretty\", true)\n .execute();"
},
{
"language": "node",
"install": "npm install asana",
"code": "const Asana = require('asana');\n\nlet client = new Asana.ApiClient();\nclient.authentications.token.accessToken = '<YOUR_ACCESS_TOKEN>';\n\nlet goalsApiInstance = new Asana.GoalsApi(client);\nlet body = {\"data\": {\"<PARAM_1>\": \"<VALUE_1>\", \"<PARAM_2>\": \"<VALUE_2>\",}}; // Object | The followers to be removed as collaborators\nlet goal_gid = \"12345\"; // String | Globally unique identifier for the goal.\nlet opts = { \n 'opt_fields': \"current_status_update,current_status_update.resource_subtype,current_status_update.title,custom_field_settings,custom_field_settings.custom_field,custom_field_settings.custom_field.asana_created_field,custom_field_settings.custom_field.created_by,custom_field_settings.custom_field.created_by.name,custom_field_settings.custom_field.currency_code,custom_field_settings.custom_field.custom_label,custom_field_settings.custom_field.custom_label_position,custom_field_settings.custom_field.date_value,custom_field_settings.custom_field.date_value.date,custom_field_settings.custom_field.date_value.date_time,custom_field_settings.custom_field.default_access_level,custom_field_settings.custom_field.description,custom_field_settings.custom_field.display_value,custom_field_settings.custom_field.enabled,custom_field_settings.custom_field.enum_options,custom_field_settings.custom_field.enum_options.color,custom_field_settings.custom_field.enum_options.enabled,custom_field_settings.custom_field.enum_options.name,custom_field_settings.custom_field.enum_value,custom_field_settings.custom_field.enum_value.color,custom_field_settings.custom_field.enum_value.enabled,custom_field_settings.custom_field.enum_value.name,custom_field_settings.custom_field.format,custom_field_settings.custom_field.has_notifications_enabled,custom_field_settings.custom_field.html_text_value,custom_field_settings.custom_field.id_prefix,custom_field_settings.custom_field.input_restrictions,custom_field_settings.custom_field.is_formula_field,custom_field_settings.custom_field.is_global_to_workspace,custom_field_settings.custom_field.is_value_read_only,custom_field_settings.custom_field.multi_enum_values,custom_field_settings.custom_field.multi_enum_values.color,custom_field_settings.custom_field.multi_enum_values.enabled,custom_field_settings.custom_field.multi_enum_values.name,custom_field_settings.custom_field.name,custom_field_settings.custom_field.number_value,custom_field_settings.custom_field.people_value,custom_field_settings.custom_field.people_value.name,custom_field_settings.custom_field.precision,custom_field_settings.custom_field.privacy_setting,custom_field_settings.custom_field.reference_value,custom_field_settings.custom_field.reference_value.name,custom_field_settings.custom_field.representation_type,custom_field_settings.custom_field.resource_subtype,custom_field_settings.custom_field.text_value,custom_field_settings.custom_field.type,custom_field_settings.is_important,custom_field_settings.parent,custom_field_settings.parent.name,custom_field_settings.parent.resource_subtype,custom_field_settings.project,custom_field_settings.project.name,custom_field_settings.project.resource_subtype,custom_fields,custom_fields.date_value,custom_fields.date_value.date,custom_fields.date_value.date_time,custom_fields.display_value,custom_fields.enabled,custom_fields.enum_options,custom_fields.enum_options.color,custom_fields.enum_options.enabled,custom_fields.enum_options.name,custom_fields.enum_value,custom_fields.enum_value.color,custom_fields.enum_value.enabled,custom_fields.enum_value.name,custom_fields.id_prefix,custom_fields.input_restrictions,custom_fields.is_formula_field,custom_fields.multi_enum_values,custom_fields.multi_enum_values.color,custom_fields.multi_enum_values.enabled,custom_fields.multi_enum_values.name,custom_fields.name,custom_fields.number_value,custom_fields.representation_type,custom_fields.text_value,custom_fields.type,default_access_level,due_on,followers,followers.name,html_notes,is_workspace_level,liked,likes,likes.user,likes.user.name,metric,metric.can_manage,metric.currency_code,metric.current_display_value,metric.current_number_value,metric.initial_number_value,metric.is_custom_weight,metric.precision,metric.progress_source,metric.resource_subtype,metric.target_number_value,metric.unit,name,notes,num_likes,owner,owner.name,privacy_setting,start_on,status,team,team.name,time_period,time_period.display_name,time_period.end_on,time_period.period,time_period.start_on,workspace,workspace.name\"\n};\ngoalsApiInstance.removeFollowers(body, goal_gid, opts).then((result) => {\n console.log('API called successfully. Returned data: ' + JSON.stringify(result.data, null, 2));\n}, (error) => {\n console.error(error.response.body);\n});",
"name": "node-sdk-v3"
},
{
"language": "node",
"install": "npm install asana@1.0.5",
"code": "const asana = require('asana');\n\nconst client = asana.Client.create().useAccessToken('PERSONAL_ACCESS_TOKEN');\n\nclient.goals.removeFollowers(goalGid, {field: \"value\", field: \"value\", pretty: true})\n .then((result) => {\n console.log(result);\n });",
"name": "node-sdk-v1"
},
{
"language": "python",
"install": "pip install asana",
"code": "import asana\nfrom asana.rest import ApiException\nfrom pprint import pprint\n\nconfiguration = asana.Configuration()\nconfiguration.access_token = '<YOUR_ACCESS_TOKEN>'\napi_client = asana.ApiClient(configuration)\n\n# create an instance of the API class\ngoals_api_instance = asana.GoalsApi(api_client)\nbody = {\"data\": {\"<PARAM_1>\": \"<VALUE_1>\", \"<PARAM_2>\": \"<VALUE_2>\",}} # dict | The followers to be removed as collaborators\ngoal_gid = \"12345\" # str | Globally unique identifier for the goal.\nopts = {\n 'opt_fields': \"current_status_update,current_status_update.resource_subtype,current_status_update.title,custom_field_settings,custom_field_settings.custom_field,custom_field_settings.custom_field.asana_created_field,custom_field_settings.custom_field.created_by,custom_field_settings.custom_field.created_by.name,custom_field_settings.custom_field.currency_code,custom_field_settings.custom_field.custom_label,custom_field_settings.custom_field.custom_label_position,custom_field_settings.custom_field.date_value,custom_field_settings.custom_field.date_value.date,custom_field_settings.custom_field.date_value.date_time,custom_field_settings.custom_field.default_access_level,custom_field_settings.custom_field.description,custom_field_settings.custom_field.display_value,custom_field_settings.custom_field.enabled,custom_field_settings.custom_field.enum_options,custom_field_settings.custom_field.enum_options.color,custom_field_settings.custom_field.enum_options.enabled,custom_field_settings.custom_field.enum_options.name,custom_field_settings.custom_field.enum_value,custom_field_settings.custom_field.enum_value.color,custom_field_settings.custom_field.enum_value.enabled,custom_field_settings.custom_field.enum_value.name,custom_field_settings.custom_field.format,custom_field_settings.custom_field.has_notifications_enabled,custom_field_settings.custom_field.html_text_value,custom_field_settings.custom_field.id_prefix,custom_field_settings.custom_field.input_restrictions,custom_field_settings.custom_field.is_formula_field,custom_field_settings.custom_field.is_global_to_workspace,custom_field_settings.custom_field.is_value_read_only,custom_field_settings.custom_field.multi_enum_values,custom_field_settings.custom_field.multi_enum_values.color,custom_field_settings.custom_field.multi_enum_values.enabled,custom_field_settings.custom_field.multi_enum_values.name,custom_field_settings.custom_field.name,custom_field_settings.custom_field.number_value,custom_field_settings.custom_field.people_value,custom_field_settings.custom_field.people_value.name,custom_field_settings.custom_field.precision,custom_field_settings.custom_field.privacy_setting,custom_field_settings.custom_field.reference_value,custom_field_settings.custom_field.reference_value.name,custom_field_settings.custom_field.representation_type,custom_field_settings.custom_field.resource_subtype,custom_field_settings.custom_field.text_value,custom_field_settings.custom_field.type,custom_field_settings.is_important,custom_field_settings.parent,custom_field_settings.parent.name,custom_field_settings.parent.resource_subtype,custom_field_settings.project,custom_field_settings.project.name,custom_field_settings.project.resource_subtype,custom_fields,custom_fields.date_value,custom_fields.date_value.date,custom_fields.date_value.date_time,custom_fields.display_value,custom_fields.enabled,custom_fields.enum_options,custom_fields.enum_options.color,custom_fields.enum_options.enabled,custom_fields.enum_options.name,custom_fields.enum_value,custom_fields.enum_value.color,custom_fields.enum_value.enabled,custom_fields.enum_value.name,custom_fields.id_prefix,custom_fields.input_restrictions,custom_fields.is_formula_field,custom_fields.multi_enum_values,custom_fields.multi_enum_values.color,custom_fields.multi_enum_values.enabled,custom_fields.multi_enum_values.name,custom_fields.name,custom_fields.number_value,custom_fields.representation_type,custom_fields.text_value,custom_fields.type,default_access_level,due_on,followers,followers.name,html_notes,is_workspace_level,liked,likes,likes.user,likes.user.name,metric,metric.can_manage,metric.currency_code,metric.current_display_value,metric.current_number_value,metric.initial_number_value,metric.is_custom_weight,metric.precision,metric.progress_source,metric.resource_subtype,metric.target_number_value,metric.unit,name,notes,num_likes,owner,owner.name,privacy_setting,start_on,status,team,team.name,time_period,time_period.display_name,time_period.end_on,time_period.period,time_period.start_on,workspace,workspace.name\", # list[str] | 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.\n}\n\ntry:\n # Remove a collaborator from a goal\n api_response = goals_api_instance.remove_followers(body, goal_gid, opts)\n pprint(api_response)\nexcept ApiException as e:\n print(\"Exception when calling GoalsApi->remove_followers: %s\\n\" % e)",
"name": "python-sdk-v5"
},
{
"language": "python",
"install": "pip install asana==3.2.3",
"code": "import asana\n\nclient = asana.Client.access_token('PERSONAL_ACCESS_TOKEN')\n\nresult = client.goals.remove_followers(goal_gid, {'field': 'value', 'field': 'value'}, opt_pretty=True)",
"name": "python-sdk-v3"
},
{
"language": "php",
"install": "composer require asana/asana",
"code": "<?php\nrequire 'vendor/autoload.php';\n\n$client = Asana\\Client::accessToken('PERSONAL_ACCESS_TOKEN');\n\n$result = $client->goals->removeFollowers($goal_gid, array('field' => 'value', 'field' => 'value'), array('opt_pretty' => 'true'))"
},
{
"language": "ruby",
"install": "gem install asana",
"code": "require 'asana'\n\nclient = Asana::Client.new do |c|\n c.authentication :access_token, 'PERSONAL_ACCESS_TOKEN'\nend\n\nresult = client.goals.remove_followers(goal_gid: 'goal_gid', field: \"value\", field: \"value\", options: {pretty: true})"
}
]
},
"x-purple-suite-runtime": "unavailable"
}
GET /api/1.0/goals/{goal_gid}/parentGoals
Get parent goals from a goal
<b>Required scope: </b><code>goals:read</code>
Returns a compact representation of all of the parent goals of a goal.
This operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.
Authentication
[
{
"personalAccessToken": []
},
{
"oauth2": [
"goals:read"
]
}
]
Path-level parameters and metadata
{
"parameters": [
{
"$ref": "#/components/parameters/goal_path_gid"
},
{
"$ref": "#/components/parameters/pretty"
}
]
}
Request, responses and operation details
{
"summary": "Get parent goals from a goal",
"description": "<b>Required scope: </b><code>goals:read</code>\n\nReturns a compact representation of all of the parent goals of a goal.\n\nThis operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.",
"tags": [
"Goals"
],
"operationId": "getParentGoalsForGoal",
"parameters": [
{
"name": "opt_fields",
"in": "query",
"description": "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. Properties can include nested fields. To learn more, see the [input/output options guide](/docs/inputoutput-options#selecting-nested-fields).",
"required": false,
"example": [
"current_status_update",
"current_status_update.resource_subtype",
"current_status_update.title",
"custom_field_settings",
"custom_field_settings.custom_field",
"custom_field_settings.custom_field.asana_created_field",
"custom_field_settings.custom_field.created_by",
"custom_field_settings.custom_field.created_by.name",
"custom_field_settings.custom_field.currency_code",
"custom_field_settings.custom_field.custom_label",
"custom_field_settings.custom_field.custom_label_position",
"custom_field_settings.custom_field.date_value",
"custom_field_settings.custom_field.date_value.date",
"custom_field_settings.custom_field.date_value.date_time",
"custom_field_settings.custom_field.default_access_level",
"custom_field_settings.custom_field.description",
"custom_field_settings.custom_field.display_value",
"custom_field_settings.custom_field.enabled",
"custom_field_settings.custom_field.enum_options",
"custom_field_settings.custom_field.enum_options.color",
"custom_field_settings.custom_field.enum_options.enabled",
"custom_field_settings.custom_field.enum_options.name",
"custom_field_settings.custom_field.enum_value",
"custom_field_settings.custom_field.enum_value.color",
"custom_field_settings.custom_field.enum_value.enabled",
"custom_field_settings.custom_field.enum_value.name",
"custom_field_settings.custom_field.format",
"custom_field_settings.custom_field.has_notifications_enabled",
"custom_field_settings.custom_field.html_text_value",
"custom_field_settings.custom_field.id_prefix",
"custom_field_settings.custom_field.input_restrictions",
"custom_field_settings.custom_field.is_formula_field",
"custom_field_settings.custom_field.is_global_to_workspace",
"custom_field_settings.custom_field.is_value_read_only",
"custom_field_settings.custom_field.multi_enum_values",
"custom_field_settings.custom_field.multi_enum_values.color",
"custom_field_settings.custom_field.multi_enum_values.enabled",
"custom_field_settings.custom_field.multi_enum_values.name",
"custom_field_settings.custom_field.name",
"custom_field_settings.custom_field.number_value",
"custom_field_settings.custom_field.people_value",
"custom_field_settings.custom_field.people_value.name",
"custom_field_settings.custom_field.precision",
"custom_field_settings.custom_field.privacy_setting",
"custom_field_settings.custom_field.reference_value",
"custom_field_settings.custom_field.reference_value.name",
"custom_field_settings.custom_field.representation_type",
"custom_field_settings.custom_field.resource_subtype",
"custom_field_settings.custom_field.text_value",
"custom_field_settings.custom_field.type",
"custom_field_settings.is_important",
"custom_field_settings.parent",
"custom_field_settings.parent.name",
"custom_field_settings.parent.resource_subtype",
"custom_field_settings.project",
"custom_field_settings.project.name",
"custom_field_settings.project.resource_subtype",
"custom_fields",
"custom_fields.date_value",
"custom_fields.date_value.date",
"custom_fields.date_value.date_time",
"custom_fields.display_value",
"custom_fields.enabled",
"custom_fields.enum_options",
"custom_fields.enum_options.color",
"custom_fields.enum_options.enabled",
"custom_fields.enum_options.name",
"custom_fields.enum_value",
"custom_fields.enum_value.color",
"custom_fields.enum_value.enabled",
"custom_fields.enum_value.name",
"custom_fields.id_prefix",
"custom_fields.input_restrictions",
"custom_fields.is_formula_field",
"custom_fields.multi_enum_values",
"custom_fields.multi_enum_values.color",
"custom_fields.multi_enum_values.enabled",
"custom_fields.multi_enum_values.name",
"custom_fields.name",
"custom_fields.number_value",
"custom_fields.representation_type",
"custom_fields.text_value",
"custom_fields.type",
"default_access_level",
"due_on",
"followers",
"followers.name",
"html_notes",
"is_workspace_level",
"liked",
"likes",
"likes.user",
"likes.user.name",
"metric",
"metric.can_manage",
"metric.currency_code",
"metric.current_display_value",
"metric.current_number_value",
"metric.initial_number_value",
"metric.is_custom_weight",
"metric.precision",
"metric.progress_source",
"metric.resource_subtype",
"metric.target_number_value",
"metric.unit",
"name",
"notes",
"num_likes",
"owner",
"owner.name",
"privacy_setting",
"start_on",
"status",
"team",
"team.name",
"time_period",
"time_period.display_name",
"time_period.end_on",
"time_period.period",
"time_period.start_on",
"workspace",
"workspace.name"
],
"schema": {
"type": "array",
"items": {
"type": "string",
"enum": [
"current_status_update",
"current_status_update.resource_subtype",
"current_status_update.title",
"custom_field_settings",
"custom_field_settings.custom_field",
"custom_field_settings.custom_field.asana_created_field",
"custom_field_settings.custom_field.created_by",
"custom_field_settings.custom_field.created_by.name",
"custom_field_settings.custom_field.currency_code",
"custom_field_settings.custom_field.custom_label",
"custom_field_settings.custom_field.custom_label_position",
"custom_field_settings.custom_field.date_value",
"custom_field_settings.custom_field.date_value.date",
"custom_field_settings.custom_field.date_value.date_time",
"custom_field_settings.custom_field.default_access_level",
"custom_field_settings.custom_field.description",
"custom_field_settings.custom_field.display_value",
"custom_field_settings.custom_field.enabled",
"custom_field_settings.custom_field.enum_options",
"custom_field_settings.custom_field.enum_options.color",
"custom_field_settings.custom_field.enum_options.enabled",
"custom_field_settings.custom_field.enum_options.name",
"custom_field_settings.custom_field.enum_value",
"custom_field_settings.custom_field.enum_value.color",
"custom_field_settings.custom_field.enum_value.enabled",
"custom_field_settings.custom_field.enum_value.name",
"custom_field_settings.custom_field.format",
"custom_field_settings.custom_field.has_notifications_enabled",
"custom_field_settings.custom_field.html_text_value",
"custom_field_settings.custom_field.id_prefix",
"custom_field_settings.custom_field.input_restrictions",
"custom_field_settings.custom_field.is_formula_field",
"custom_field_settings.custom_field.is_global_to_workspace",
"custom_field_settings.custom_field.is_value_read_only",
"custom_field_settings.custom_field.multi_enum_values",
"custom_field_settings.custom_field.multi_enum_values.color",
"custom_field_settings.custom_field.multi_enum_values.enabled",
"custom_field_settings.custom_field.multi_enum_values.name",
"custom_field_settings.custom_field.name",
"custom_field_settings.custom_field.number_value",
"custom_field_settings.custom_field.people_value",
"custom_field_settings.custom_field.people_value.name",
"custom_field_settings.custom_field.precision",
"custom_field_settings.custom_field.privacy_setting",
"custom_field_settings.custom_field.reference_value",
"custom_field_settings.custom_field.reference_value.name",
"custom_field_settings.custom_field.representation_type",
"custom_field_settings.custom_field.resource_subtype",
"custom_field_settings.custom_field.text_value",
"custom_field_settings.custom_field.type",
"custom_field_settings.is_important",
"custom_field_settings.parent",
"custom_field_settings.parent.name",
"custom_field_settings.parent.resource_subtype",
"custom_field_settings.project",
"custom_field_settings.project.name",
"custom_field_settings.project.resource_subtype",
"custom_fields",
"custom_fields.date_value",
"custom_fields.date_value.date",
"custom_fields.date_value.date_time",
"custom_fields.display_value",
"custom_fields.enabled",
"custom_fields.enum_options",
"custom_fields.enum_options.color",
"custom_fields.enum_options.enabled",
"custom_fields.enum_options.name",
"custom_fields.enum_value",
"custom_fields.enum_value.color",
"custom_fields.enum_value.enabled",
"custom_fields.enum_value.name",
"custom_fields.id_prefix",
"custom_fields.input_restrictions",
"custom_fields.is_formula_field",
"custom_fields.multi_enum_values",
"custom_fields.multi_enum_values.color",
"custom_fields.multi_enum_values.enabled",
"custom_fields.multi_enum_values.name",
"custom_fields.name",
"custom_fields.number_value",
"custom_fields.representation_type",
"custom_fields.text_value",
"custom_fields.type",
"default_access_level",
"due_on",
"followers",
"followers.name",
"html_notes",
"is_workspace_level",
"liked",
"likes",
"likes.user",
"likes.user.name",
"metric",
"metric.can_manage",
"metric.currency_code",
"metric.current_display_value",
"metric.current_number_value",
"metric.initial_number_value",
"metric.is_custom_weight",
"metric.precision",
"metric.progress_source",
"metric.resource_subtype",
"metric.target_number_value",
"metric.unit",
"name",
"notes",
"num_likes",
"owner",
"owner.name",
"privacy_setting",
"start_on",
"status",
"team",
"team.name",
"time_period",
"time_period.display_name",
"time_period.end_on",
"time_period.period",
"time_period.start_on",
"workspace",
"workspace.name"
]
}
},
"style": "form",
"explode": false
}
],
"responses": {
"200": {
"description": "Successfully retrieved the specified goal's parent goals.",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"type": "array",
"items": {
"$ref": "#/components/schemas/GoalCompact"
}
}
}
}
}
}
},
"400": {
"$ref": "#/components/responses/BadRequest"
},
"401": {
"$ref": "#/components/responses/Unauthorized"
},
"402": {
"$ref": "#/components/responses/PaymentRequired"
},
"403": {
"$ref": "#/components/responses/Forbidden"
},
"404": {
"$ref": "#/components/responses/NotFound"
},
"500": {
"$ref": "#/components/responses/InternalServerError"
}
},
"security": [
{
"personalAccessToken": []
},
{
"oauth2": [
"goals:read"
]
}
],
"x-readme": {
"code-samples": [
{
"language": "java",
"install": "<dependency><groupId>com.asana</groupId><artifactId>asana</artifactId><version>1.0.0</version></dependency>",
"code": "import com.asana.Client;\n\nClient client = Client.accessToken(\"PERSONAL_ACCESS_TOKEN\");\n\nList<JsonElement> result = client.goals.getParentGoalsForGoal(goalGid)\n .option(\"pretty\", true)\n .execute();"
},
{
"language": "node",
"install": "npm install asana",
"code": "const Asana = require('asana');\n\nlet client = new Asana.ApiClient();\nclient.authentications.token.accessToken = '<YOUR_ACCESS_TOKEN>';\n\nlet goalsApiInstance = new Asana.GoalsApi(client);\nlet goal_gid = \"12345\"; // String | Globally unique identifier for the goal.\nlet opts = { \n 'opt_fields': \"current_status_update,current_status_update.resource_subtype,current_status_update.title,custom_field_settings,custom_field_settings.custom_field,custom_field_settings.custom_field.asana_created_field,custom_field_settings.custom_field.created_by,custom_field_settings.custom_field.created_by.name,custom_field_settings.custom_field.currency_code,custom_field_settings.custom_field.custom_label,custom_field_settings.custom_field.custom_label_position,custom_field_settings.custom_field.date_value,custom_field_settings.custom_field.date_value.date,custom_field_settings.custom_field.date_value.date_time,custom_field_settings.custom_field.default_access_level,custom_field_settings.custom_field.description,custom_field_settings.custom_field.display_value,custom_field_settings.custom_field.enabled,custom_field_settings.custom_field.enum_options,custom_field_settings.custom_field.enum_options.color,custom_field_settings.custom_field.enum_options.enabled,custom_field_settings.custom_field.enum_options.name,custom_field_settings.custom_field.enum_value,custom_field_settings.custom_field.enum_value.color,custom_field_settings.custom_field.enum_value.enabled,custom_field_settings.custom_field.enum_value.name,custom_field_settings.custom_field.format,custom_field_settings.custom_field.has_notifications_enabled,custom_field_settings.custom_field.html_text_value,custom_field_settings.custom_field.id_prefix,custom_field_settings.custom_field.input_restrictions,custom_field_settings.custom_field.is_formula_field,custom_field_settings.custom_field.is_global_to_workspace,custom_field_settings.custom_field.is_value_read_only,custom_field_settings.custom_field.multi_enum_values,custom_field_settings.custom_field.multi_enum_values.color,custom_field_settings.custom_field.multi_enum_values.enabled,custom_field_settings.custom_field.multi_enum_values.name,custom_field_settings.custom_field.name,custom_field_settings.custom_field.number_value,custom_field_settings.custom_field.people_value,custom_field_settings.custom_field.people_value.name,custom_field_settings.custom_field.precision,custom_field_settings.custom_field.privacy_setting,custom_field_settings.custom_field.reference_value,custom_field_settings.custom_field.reference_value.name,custom_field_settings.custom_field.representation_type,custom_field_settings.custom_field.resource_subtype,custom_field_settings.custom_field.text_value,custom_field_settings.custom_field.type,custom_field_settings.is_important,custom_field_settings.parent,custom_field_settings.parent.name,custom_field_settings.parent.resource_subtype,custom_field_settings.project,custom_field_settings.project.name,custom_field_settings.project.resource_subtype,custom_fields,custom_fields.date_value,custom_fields.date_value.date,custom_fields.date_value.date_time,custom_fields.display_value,custom_fields.enabled,custom_fields.enum_options,custom_fields.enum_options.color,custom_fields.enum_options.enabled,custom_fields.enum_options.name,custom_fields.enum_value,custom_fields.enum_value.color,custom_fields.enum_value.enabled,custom_fields.enum_value.name,custom_fields.id_prefix,custom_fields.input_restrictions,custom_fields.is_formula_field,custom_fields.multi_enum_values,custom_fields.multi_enum_values.color,custom_fields.multi_enum_values.enabled,custom_fields.multi_enum_values.name,custom_fields.name,custom_fields.number_value,custom_fields.representation_type,custom_fields.text_value,custom_fields.type,default_access_level,due_on,followers,followers.name,html_notes,is_workspace_level,liked,likes,likes.user,likes.user.name,metric,metric.can_manage,metric.currency_code,metric.current_display_value,metric.current_number_value,metric.initial_number_value,metric.is_custom_weight,metric.precision,metric.progress_source,metric.resource_subtype,metric.target_number_value,metric.unit,name,notes,num_likes,owner,owner.name,privacy_setting,start_on,status,team,team.name,time_period,time_period.display_name,time_period.end_on,time_period.period,time_period.start_on,workspace,workspace.name\"\n};\ngoalsApiInstance.getParentGoalsForGoal(goal_gid, opts).then((result) => {\n console.log('API called successfully. Returned data: ' + JSON.stringify(result.data, null, 2));\n}, (error) => {\n console.error(error.response.body);\n});",
"name": "node-sdk-v3"
},
{
"language": "node",
"install": "npm install asana@1.0.5",
"code": "const asana = require('asana');\n\nconst client = asana.Client.create().useAccessToken('PERSONAL_ACCESS_TOKEN');\n\nclient.goals.getParentGoalsForGoal(goalGid, {param: \"value\", param: \"value\", opt_pretty: true})\n .then((result) => {\n console.log(result);\n });",
"name": "node-sdk-v1"
},
{
"language": "python",
"install": "pip install asana",
"code": "import asana\nfrom asana.rest import ApiException\nfrom pprint import pprint\n\nconfiguration = asana.Configuration()\nconfiguration.access_token = '<YOUR_ACCESS_TOKEN>'\napi_client = asana.ApiClient(configuration)\n\n# create an instance of the API class\ngoals_api_instance = asana.GoalsApi(api_client)\ngoal_gid = \"12345\" # str | Globally unique identifier for the goal.\nopts = {\n 'opt_fields': \"current_status_update,current_status_update.resource_subtype,current_status_update.title,custom_field_settings,custom_field_settings.custom_field,custom_field_settings.custom_field.asana_created_field,custom_field_settings.custom_field.created_by,custom_field_settings.custom_field.created_by.name,custom_field_settings.custom_field.currency_code,custom_field_settings.custom_field.custom_label,custom_field_settings.custom_field.custom_label_position,custom_field_settings.custom_field.date_value,custom_field_settings.custom_field.date_value.date,custom_field_settings.custom_field.date_value.date_time,custom_field_settings.custom_field.default_access_level,custom_field_settings.custom_field.description,custom_field_settings.custom_field.display_value,custom_field_settings.custom_field.enabled,custom_field_settings.custom_field.enum_options,custom_field_settings.custom_field.enum_options.color,custom_field_settings.custom_field.enum_options.enabled,custom_field_settings.custom_field.enum_options.name,custom_field_settings.custom_field.enum_value,custom_field_settings.custom_field.enum_value.color,custom_field_settings.custom_field.enum_value.enabled,custom_field_settings.custom_field.enum_value.name,custom_field_settings.custom_field.format,custom_field_settings.custom_field.has_notifications_enabled,custom_field_settings.custom_field.html_text_value,custom_field_settings.custom_field.id_prefix,custom_field_settings.custom_field.input_restrictions,custom_field_settings.custom_field.is_formula_field,custom_field_settings.custom_field.is_global_to_workspace,custom_field_settings.custom_field.is_value_read_only,custom_field_settings.custom_field.multi_enum_values,custom_field_settings.custom_field.multi_enum_values.color,custom_field_settings.custom_field.multi_enum_values.enabled,custom_field_settings.custom_field.multi_enum_values.name,custom_field_settings.custom_field.name,custom_field_settings.custom_field.number_value,custom_field_settings.custom_field.people_value,custom_field_settings.custom_field.people_value.name,custom_field_settings.custom_field.precision,custom_field_settings.custom_field.privacy_setting,custom_field_settings.custom_field.reference_value,custom_field_settings.custom_field.reference_value.name,custom_field_settings.custom_field.representation_type,custom_field_settings.custom_field.resource_subtype,custom_field_settings.custom_field.text_value,custom_field_settings.custom_field.type,custom_field_settings.is_important,custom_field_settings.parent,custom_field_settings.parent.name,custom_field_settings.parent.resource_subtype,custom_field_settings.project,custom_field_settings.project.name,custom_field_settings.project.resource_subtype,custom_fields,custom_fields.date_value,custom_fields.date_value.date,custom_fields.date_value.date_time,custom_fields.display_value,custom_fields.enabled,custom_fields.enum_options,custom_fields.enum_options.color,custom_fields.enum_options.enabled,custom_fields.enum_options.name,custom_fields.enum_value,custom_fields.enum_value.color,custom_fields.enum_value.enabled,custom_fields.enum_value.name,custom_fields.id_prefix,custom_fields.input_restrictions,custom_fields.is_formula_field,custom_fields.multi_enum_values,custom_fields.multi_enum_values.color,custom_fields.multi_enum_values.enabled,custom_fields.multi_enum_values.name,custom_fields.name,custom_fields.number_value,custom_fields.representation_type,custom_fields.text_value,custom_fields.type,default_access_level,due_on,followers,followers.name,html_notes,is_workspace_level,liked,likes,likes.user,likes.user.name,metric,metric.can_manage,metric.currency_code,metric.current_display_value,metric.current_number_value,metric.initial_number_value,metric.is_custom_weight,metric.precision,metric.progress_source,metric.resource_subtype,metric.target_number_value,metric.unit,name,notes,num_likes,owner,owner.name,privacy_setting,start_on,status,team,team.name,time_period,time_period.display_name,time_period.end_on,time_period.period,time_period.start_on,workspace,workspace.name\", # list[str] | 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.\n}\n\ntry:\n # Get parent goals from a goal\n api_response = goals_api_instance.get_parent_goals_for_goal(goal_gid, opts)\n for data in api_response:\n pprint(data)\nexcept ApiException as e:\n print(\"Exception when calling GoalsApi->get_parent_goals_for_goal: %s\\n\" % e)",
"name": "python-sdk-v5"
},
{
"language": "python",
"install": "pip install asana==3.2.3",
"code": "import asana\n\nclient = asana.Client.access_token('PERSONAL_ACCESS_TOKEN')\n\nresult = client.goals.get_parent_goals_for_goal(goal_gid, {'param': 'value', 'param': 'value'}, opt_pretty=True)",
"name": "python-sdk-v3"
},
{
"language": "php",
"install": "composer require asana/asana",
"code": "<?php\nrequire 'vendor/autoload.php';\n\n$client = Asana\\Client::accessToken('PERSONAL_ACCESS_TOKEN');\n\n$result = $client->goals->getParentGoalsForGoal($goal_gid, array('param' => 'value', 'param' => 'value'), array('opt_pretty' => 'true'))"
},
{
"language": "ruby",
"install": "gem install asana",
"code": "require 'asana'\n\nclient = Asana::Client.new do |c|\n c.authentication :access_token, 'PERSONAL_ACCESS_TOKEN'\nend\n\nresult = client.goals.get_parent_goals_for_goal(goal_gid: 'goal_gid', param: \"value\", param: \"value\", options: {pretty: true})"
}
]
},
"x-purple-suite-runtime": "unavailable"
}
POST /api/1.0/goals/{goal_gid}/addCustomFieldSetting
Add a custom field to a goal
<b>Required scope: </b><code>goals:write</code>
Custom fields are associated with goals by way of custom field settings. This method creates a setting for the goal.
This operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.
Authentication
[
{
"personalAccessToken": []
},
{
"oauth2": [
"goals:write"
]
}
]
Path-level parameters and metadata
{
"parameters": [
{
"$ref": "#/components/parameters/goal_path_gid"
},
{
"$ref": "#/components/parameters/pretty"
}
]
}
Request, responses and operation details
{
"summary": "Add a custom field to a goal",
"description": "<b>Required scope: </b><code>goals:write</code>\n\nCustom fields are associated with goals by way of custom field settings. This method creates a setting for the goal.\n\nThis operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.",
"tags": [
"Goals"
],
"operationId": "addCustomFieldSettingForGoal",
"security": [
{
"personalAccessToken": []
},
{
"oauth2": [
"goals:write"
]
}
],
"requestBody": {
"description": "Information about the custom field setting.",
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"$ref": "#/components/schemas/AddCustomFieldSettingRequest"
}
}
}
}
}
},
"responses": {
"200": {
"description": "Successfully added the custom field to the goal.",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"$ref": "#/components/schemas/CustomFieldSettingResponse"
}
}
}
}
}
},
"400": {
"$ref": "#/components/responses/BadRequest"
},
"401": {
"$ref": "#/components/responses/Unauthorized"
},
"403": {
"$ref": "#/components/responses/Forbidden"
},
"404": {
"$ref": "#/components/responses/NotFound"
},
"500": {
"$ref": "#/components/responses/InternalServerError"
}
},
"x-readme": {
"code-samples": [
{
"language": "node",
"install": "npm install asana",
"code": "const Asana = require('asana');\n\nlet client = new Asana.ApiClient();\nclient.authentications.token.accessToken = '<YOUR_ACCESS_TOKEN>';\n\nlet goalsApiInstance = new Asana.GoalsApi(client);\nlet body = {\"data\": {\"<PARAM_1>\": \"<VALUE_1>\", \"<PARAM_2>\": \"<VALUE_2>\",}}; // Object | Information about the custom field setting.\nlet goal_gid = \"12345\"; // String | Globally unique identifier for the goal.\n\ngoalsApiInstance.addCustomFieldSettingForGoal(body, goal_gid).then((result) => {\n console.log('API called successfully. Returned data: ' + JSON.stringify(result.data, null, 2));\n}, (error) => {\n console.error(error.response.body);\n});",
"name": "node-sdk-v3"
},
{
"language": "python",
"install": "pip install asana",
"code": "import asana\nfrom asana.rest import ApiException\nfrom pprint import pprint\n\nconfiguration = asana.Configuration()\nconfiguration.access_token = '<YOUR_ACCESS_TOKEN>'\napi_client = asana.ApiClient(configuration)\n\n# create an instance of the API class\ngoals_api_instance = asana.GoalsApi(api_client)\nbody = {\"data\": {\"<PARAM_1>\": \"<VALUE_1>\", \"<PARAM_2>\": \"<VALUE_2>\",}} # dict | Information about the custom field setting.\ngoal_gid = \"12345\" # str | Globally unique identifier for the goal.\n\n\ntry:\n # Add a custom field to a goal\n api_response = goals_api_instance.add_custom_field_setting_for_goal(body, goal_gid)\n pprint(api_response)\nexcept ApiException as e:\n print(\"Exception when calling GoalsApi->add_custom_field_setting_for_goal: %s\\n\" % e)",
"name": "python-sdk-v5"
}
]
},
"x-purple-suite-runtime": "unavailable"
}
POST /api/1.0/goals/{goal_gid}/removeCustomFieldSetting
Remove a custom field from a goal
<b>Required scope: </b><code>goals:write</code>
Removes a custom field setting from a goal.
This operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.
Authentication
[
{
"personalAccessToken": []
},
{
"oauth2": [
"goals:write"
]
}
]
Path-level parameters and metadata
{
"parameters": [
{
"$ref": "#/components/parameters/goal_path_gid"
},
{
"$ref": "#/components/parameters/pretty"
}
]
}
Request, responses and operation details
{
"summary": "Remove a custom field from a goal",
"description": "<b>Required scope: </b><code>goals:write</code>\n\nRemoves a custom field setting from a goal.\n\nThis operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.",
"tags": [
"Goals"
],
"operationId": "removeCustomFieldSettingForGoal",
"security": [
{
"personalAccessToken": []
},
{
"oauth2": [
"goals:write"
]
}
],
"requestBody": {
"description": "Information about the custom field setting being removed.",
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"$ref": "#/components/schemas/RemoveCustomFieldSettingRequest"
}
}
}
}
}
},
"responses": {
"200": {
"description": "Successfully removed the custom field from the goal.",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"$ref": "#/components/schemas/EmptyResponse"
}
}
}
}
}
},
"400": {
"$ref": "#/components/responses/BadRequest"
},
"401": {
"$ref": "#/components/responses/Unauthorized"
},
"403": {
"$ref": "#/components/responses/Forbidden"
},
"404": {
"$ref": "#/components/responses/NotFound"
},
"500": {
"$ref": "#/components/responses/InternalServerError"
}
},
"x-readme": {
"code-samples": [
{
"language": "node",
"install": "npm install asana",
"code": "const Asana = require('asana');\n\nlet client = new Asana.ApiClient();\nclient.authentications.token.accessToken = '<YOUR_ACCESS_TOKEN>';\n\nlet goalsApiInstance = new Asana.GoalsApi(client);\nlet body = {\"data\": {\"<PARAM_1>\": \"<VALUE_1>\", \"<PARAM_2>\": \"<VALUE_2>\",}}; // Object | Information about the custom field setting being removed.\nlet goal_gid = \"12345\"; // String | Globally unique identifier for the goal.\n\ngoalsApiInstance.removeCustomFieldSettingForGoal(body, goal_gid).then((result) => {\n console.log('API called successfully. Returned data: ' + JSON.stringify(result.data, null, 2));\n}, (error) => {\n console.error(error.response.body);\n});",
"name": "node-sdk-v3"
},
{
"language": "python",
"install": "pip install asana",
"code": "import asana\nfrom asana.rest import ApiException\nfrom pprint import pprint\n\nconfiguration = asana.Configuration()\nconfiguration.access_token = '<YOUR_ACCESS_TOKEN>'\napi_client = asana.ApiClient(configuration)\n\n# create an instance of the API class\ngoals_api_instance = asana.GoalsApi(api_client)\nbody = {\"data\": {\"<PARAM_1>\": \"<VALUE_1>\", \"<PARAM_2>\": \"<VALUE_2>\",}} # dict | Information about the custom field setting being removed.\ngoal_gid = \"12345\" # str | Globally unique identifier for the goal.\n\n\ntry:\n # Remove a custom field from a goal\n api_response = goals_api_instance.remove_custom_field_setting_for_goal(body, goal_gid)\n pprint(api_response)\nexcept ApiException as e:\n print(\"Exception when calling GoalsApi->remove_custom_field_setting_for_goal: %s\\n\" % e)",
"name": "python-sdk-v5"
}
]
},
"x-purple-suite-runtime": "unavailable"
}
GET /api/1.0/jobs/{job_gid}
Get a job by id
<b>Required scope: </b><code>jobs:read</code>
Returns the full record for a job.
This operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.
Authentication
[
{
"personalAccessToken": []
},
{
"oauth2": [
"jobs:read"
]
}
]
Path-level parameters and metadata
{
"parameters": [
{
"$ref": "#/components/parameters/job_path_gid"
},
{
"$ref": "#/components/parameters/pretty"
}
]
}
Request, responses and operation details
{
"summary": "Get a job by id",
"description": "<b>Required scope: </b><code>jobs:read</code>\n\nReturns the full record for a job.\n\nThis operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.",
"tags": [
"Jobs"
],
"operationId": "getJob",
"parameters": [
{
"name": "opt_fields",
"in": "query",
"description": "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. Properties can include nested fields. To learn more, see the [input/output options guide](/docs/inputoutput-options#selecting-nested-fields).",
"required": false,
"example": [
"new_graph_export",
"new_graph_export.completed_at",
"new_graph_export.created_at",
"new_graph_export.download_url",
"new_portfolio",
"new_portfolio.name",
"new_portfolio.resource_subtype",
"new_project",
"new_project.name",
"new_project.resource_subtype",
"new_project_template",
"new_project_template.name",
"new_resource_export",
"new_resource_export.completed_at",
"new_resource_export.created_at",
"new_resource_export.download_url",
"new_task",
"new_task.created_by",
"new_task.name",
"new_task.resource_subtype",
"resource_subtype",
"status"
],
"schema": {
"type": "array",
"items": {
"type": "string",
"enum": [
"new_graph_export",
"new_graph_export.completed_at",
"new_graph_export.created_at",
"new_graph_export.download_url",
"new_portfolio",
"new_portfolio.name",
"new_portfolio.resource_subtype",
"new_project",
"new_project.name",
"new_project.resource_subtype",
"new_project_template",
"new_project_template.name",
"new_resource_export",
"new_resource_export.completed_at",
"new_resource_export.created_at",
"new_resource_export.download_url",
"new_task",
"new_task.created_by",
"new_task.name",
"new_task.resource_subtype",
"resource_subtype",
"status"
]
}
},
"style": "form",
"explode": false
}
],
"responses": {
"200": {
"description": "Successfully retrieved Job.",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"$ref": "#/components/schemas/JobResponse"
}
}
}
}
}
},
"400": {
"$ref": "#/components/responses/BadRequest"
},
"401": {
"$ref": "#/components/responses/Unauthorized"
},
"403": {
"$ref": "#/components/responses/Forbidden"
},
"404": {
"$ref": "#/components/responses/NotFound"
},
"500": {
"$ref": "#/components/responses/InternalServerError"
}
},
"security": [
{
"personalAccessToken": []
},
{
"oauth2": [
"jobs:read"
]
}
],
"x-readme": {
"code-samples": [
{
"language": "java",
"install": "<dependency><groupId>com.asana</groupId><artifactId>asana</artifactId><version>1.0.0</version></dependency>",
"code": "import com.asana.Client;\n\nClient client = Client.accessToken(\"PERSONAL_ACCESS_TOKEN\");\n\nJob result = client.jobs.getJob(jobGid)\n .option(\"pretty\", true)\n .execute();"
},
{
"language": "node",
"install": "npm install asana",
"code": "const Asana = require('asana');\n\nlet client = new Asana.ApiClient();\nclient.authentications.token.accessToken = '<YOUR_ACCESS_TOKEN>';\n\nlet jobsApiInstance = new Asana.JobsApi(client);\nlet job_gid = \"12345\"; // String | Globally unique identifier for the job.\nlet opts = { \n 'opt_fields': \"new_graph_export,new_graph_export.completed_at,new_graph_export.created_at,new_graph_export.download_url,new_portfolio,new_portfolio.name,new_portfolio.resource_subtype,new_project,new_project.name,new_project.resource_subtype,new_project_template,new_project_template.name,new_resource_export,new_resource_export.completed_at,new_resource_export.created_at,new_resource_export.download_url,new_task,new_task.created_by,new_task.name,new_task.resource_subtype,resource_subtype,status\"\n};\njobsApiInstance.getJob(job_gid, opts).then((result) => {\n console.log('API called successfully. Returned data: ' + JSON.stringify(result.data, null, 2));\n}, (error) => {\n console.error(error.response.body);\n});",
"name": "node-sdk-v3"
},
{
"language": "node",
"install": "npm install asana@1.0.5",
"code": "const asana = require('asana');\n\nconst client = asana.Client.create().useAccessToken('PERSONAL_ACCESS_TOKEN');\n\nclient.jobs.getJob(jobGid, {param: \"value\", param: \"value\", opt_pretty: true})\n .then((result) => {\n console.log(result);\n });",
"name": "node-sdk-v1"
},
{
"language": "python",
"install": "pip install asana",
"code": "import asana\nfrom asana.rest import ApiException\nfrom pprint import pprint\n\nconfiguration = asana.Configuration()\nconfiguration.access_token = '<YOUR_ACCESS_TOKEN>'\napi_client = asana.ApiClient(configuration)\n\n# create an instance of the API class\njobs_api_instance = asana.JobsApi(api_client)\njob_gid = \"12345\" # str | Globally unique identifier for the job.\nopts = {\n 'opt_fields': \"new_graph_export,new_graph_export.completed_at,new_graph_export.created_at,new_graph_export.download_url,new_portfolio,new_portfolio.name,new_portfolio.resource_subtype,new_project,new_project.name,new_project.resource_subtype,new_project_template,new_project_template.name,new_resource_export,new_resource_export.completed_at,new_resource_export.created_at,new_resource_export.download_url,new_task,new_task.created_by,new_task.name,new_task.resource_subtype,resource_subtype,status\", # list[str] | 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.\n}\n\ntry:\n # Get a job by id\n api_response = jobs_api_instance.get_job(job_gid, opts)\n pprint(api_response)\nexcept ApiException as e:\n print(\"Exception when calling JobsApi->get_job: %s\\n\" % e)",
"name": "python-sdk-v5"
},
{
"language": "python",
"install": "pip install asana==3.2.3",
"code": "import asana\n\nclient = asana.Client.access_token('PERSONAL_ACCESS_TOKEN')\n\nresult = client.jobs.get_job(job_gid, {'param': 'value', 'param': 'value'}, opt_pretty=True)",
"name": "python-sdk-v3"
},
{
"language": "php",
"install": "composer require asana/asana",
"code": "<?php\nrequire 'vendor/autoload.php';\n\n$client = Asana\\Client::accessToken('PERSONAL_ACCESS_TOKEN');\n\n$result = $client->jobs->getJob($job_gid, array('param' => 'value', 'param' => 'value'), array('opt_pretty' => 'true'))"
},
{
"language": "ruby",
"install": "gem install asana",
"code": "require 'asana'\n\nclient = Asana::Client.new do |c|\n c.authentication :access_token, 'PERSONAL_ACCESS_TOKEN'\nend\n\nresult = client.jobs.get_job(job_gid: 'job_gid', param: \"value\", param: \"value\", options: {pretty: true})"
}
]
},
"x-purple-suite-runtime": "unavailable"
}
GET /api/1.0/memberships
Get multiple memberships
Returns compact `goal_membership`, `project_membership`, `portfolio_membership`, `custom_type_membership`, or `custom_field_membership` records. The possible types for `parent` in this request are `goal`, `project`, `portfolio`, `custom_type`, or `custom_field`. An additional member (user GID or team GID) can be passed in to filter to a specific membership.
Alternatively, when `parent` is absent, you can use the `member` and `resource_subtype` parameters together to fetch all memberships of a specific type for a given member. For example, passing `member` as a team GID and `resource_subtype` as `project_membership` will return all project memberships for that team.
This operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.
Authentication
[
{
"personalAccessToken": []
},
{
"oauth2": []
}
]
Path-level parameters and metadata
{
"parameters": [
{
"$ref": "#/components/parameters/pretty"
}
]
}
Request, responses and operation details
{
"summary": "Get multiple memberships",
"description": "Returns compact `goal_membership`, `project_membership`, `portfolio_membership`, `custom_type_membership`, or `custom_field_membership` records. The possible types for `parent` in this request are `goal`, `project`, `portfolio`, `custom_type`, or `custom_field`. An additional member (user GID or team GID) can be passed in to filter to a specific membership.\n\nAlternatively, when `parent` is absent, you can use the `member` and `resource_subtype` parameters together to fetch all memberships of a specific type for a given member. For example, passing `member` as a team GID and `resource_subtype` as `project_membership` will return all project memberships for that team.\n\nThis operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.",
"tags": [
"Memberships"
],
"operationId": "getMemberships",
"parameters": [
{
"name": "parent",
"in": "query",
"description": "Globally unique identifier for `goal`, `project`, `portfolio`, `custom_type`, or `custom_field`. This parameter is optional when `resource_subtype` is provided along with `member` of type `team`.",
"schema": {
"type": "string"
},
"example": "159874"
},
{
"name": "member",
"in": "query",
"description": "Globally unique identifier for `team` or `user`. When used with `resource_subtype` and without `parent`, `member` must be of type `team`. For user-type memberships `parent` parameter is required to disambiguate the workspace from which memberships should be retrieved.",
"schema": {
"type": "string"
},
"example": "1061493"
},
{
"name": "resource_subtype",
"in": "query",
"description": "The type of membership to return. Required when `parent` is absent. Currently supported value is `project_membership` (when `member` is a team GID, returns all project memberships for that team).",
"schema": {
"type": "string",
"enum": [
"project_membership"
]
},
"example": "project_membership"
},
{
"$ref": "#/components/parameters/limit"
},
{
"$ref": "#/components/parameters/offset"
},
{
"name": "opt_fields",
"in": "query",
"description": "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. Properties can include nested fields. To learn more, see the [input/output options guide](/docs/inputoutput-options#selecting-nested-fields).",
"required": false,
"example": [
"offset",
"path",
"uri"
],
"schema": {
"type": "array",
"items": {
"type": "string",
"enum": [
"offset",
"path",
"uri"
]
}
},
"style": "form",
"explode": false
}
],
"responses": {
"200": {
"description": "Successfully retrieved the requested membership.",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"type": "array",
"items": {
"$ref": "#/components/schemas/MembershipCompact"
}
},
"next_page": {
"$ref": "#/components/schemas/NextPage"
}
}
}
}
}
},
"400": {
"$ref": "#/components/responses/BadRequest"
},
"401": {
"$ref": "#/components/responses/Unauthorized"
},
"403": {
"$ref": "#/components/responses/Forbidden"
},
"404": {
"$ref": "#/components/responses/NotFound"
},
"500": {
"$ref": "#/components/responses/InternalServerError"
}
},
"security": [
{
"personalAccessToken": []
},
{
"oauth2": []
}
],
"x-readme": {
"code-samples": [
{
"language": "node",
"install": "npm install asana",
"code": "const Asana = require('asana');\n\nlet client = new Asana.ApiClient();\nclient.authentications.token.accessToken = '<YOUR_ACCESS_TOKEN>';\n\nlet membershipsApiInstance = new Asana.MembershipsApi(client);\nlet opts = { \n 'parent': \"159874\", \n 'member': \"1061493\", \n 'resource_subtype': \"project_membership\", \n 'limit': 50, \n 'offset': \"eyJ0eXAiOJiKV1iQLCJhbGciOiJIUzI1NiJ9\", \n 'opt_fields': \"offset,path,uri\"\n};\nmembershipsApiInstance.getMemberships(opts).then((result) => {\n console.log('API called successfully. Returned data: ' + JSON.stringify(result.data, null, 2));\n}, (error) => {\n console.error(error.response.body);\n});",
"name": "node-sdk-v3"
},
{
"language": "node",
"install": "npm install asana@1.0.5",
"code": "const asana = require('asana');\n\nconst client = asana.Client.create().useAccessToken('PERSONAL_ACCESS_TOKEN');\n\nclient.memberships.getMemberships({param: \"value\", param: \"value\", opt_pretty: true})\n .then((result) => {\n console.log(result);\n });",
"name": "node-sdk-v1"
},
{
"language": "python",
"install": "pip install asana",
"code": "import asana\nfrom asana.rest import ApiException\nfrom pprint import pprint\n\nconfiguration = asana.Configuration()\nconfiguration.access_token = '<YOUR_ACCESS_TOKEN>'\napi_client = asana.ApiClient(configuration)\n\n# create an instance of the API class\nmemberships_api_instance = asana.MembershipsApi(api_client)\nopts = {\n 'parent': \"159874\", # str | Globally unique identifier for `goal`, `project`, `portfolio`, `custom_type`, or `custom_field`. This parameter is optional when `resource_subtype` is provided along with `member` of type `team`.\n 'member': \"1061493\", # str | Globally unique identifier for `team` or `user`. When used with `resource_subtype` and without `parent`, `member` must be of type `team`. For user-type memberships `parent` parameter is required to disambiguate the workspace from which memberships should be retrieved.\n 'resource_subtype': \"project_membership\", # str | The type of membership to return. Required when `parent` is absent. Currently supported value is `project_membership` (when `member` is a team GID, returns all project memberships for that team).\n 'limit': 50, # int | Results per page. The number of objects to return per page. The value must be between 1 and 100.\n 'offset': \"eyJ0eXAiOJiKV1iQLCJhbGciOiJIUzI1NiJ9\", # str | 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.*\n 'opt_fields': \"offset,path,uri\", # list[str] | 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.\n}\n\ntry:\n # Get multiple memberships\n api_response = memberships_api_instance.get_memberships(opts)\n for data in api_response:\n pprint(data)\nexcept ApiException as e:\n print(\"Exception when calling MembershipsApi->get_memberships: %s\\n\" % e)",
"name": "python-sdk-v5"
},
{
"language": "python",
"install": "pip install asana==3.2.3",
"code": "import asana\n\nclient = asana.Client.access_token('PERSONAL_ACCESS_TOKEN')\n\nresult = client.memberships.get_memberships({'param': 'value', 'param': 'value'}, opt_pretty=True)",
"name": "python-sdk-v3"
},
{
"language": "php",
"install": "composer require asana/asana",
"code": "<?php\nrequire 'vendor/autoload.php';\n\n$client = Asana\\Client::accessToken('PERSONAL_ACCESS_TOKEN');\n\n$result = $client->memberships->getMemberships(array('param' => 'value', 'param' => 'value'), array('opt_pretty' => 'true'))"
},
{
"language": "ruby",
"install": "gem install asana",
"code": "require 'asana'\n\nclient = Asana::Client.new do |c|\n c.authentication :access_token, 'PERSONAL_ACCESS_TOKEN'\nend\n\nresult = client.memberships.get_memberships(parent: ''parent_example'', param: \"value\", param: \"value\", options: {pretty: true})"
}
]
},
"x-purple-suite-runtime": "unavailable"
}
POST /api/1.0/memberships
Create a membership
Creates a new membership in a `goal`, `project`, `portfolio`, `custom_type`, or `custom_field`, where members can be Teams or Users.
Returns the full record of the newly created membership.
This operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.
Authentication
[
{
"personalAccessToken": []
},
{
"oauth2": []
}
]
Path-level parameters and metadata
{
"parameters": [
{
"$ref": "#/components/parameters/pretty"
}
]
}
Request, responses and operation details
{
"summary": "Create a membership",
"description": "Creates a new membership in a `goal`, `project`, `portfolio`, `custom_type`, or `custom_field`, where members can be Teams or Users.\n\nReturns the full record of the newly created membership.\n\nThis operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.",
"tags": [
"Memberships"
],
"operationId": "createMembership",
"requestBody": {
"description": "The updated fields for the membership.",
"required": false,
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"$ref": "#/components/schemas/CreateMembershipRequest"
}
}
}
}
}
},
"responses": {
"201": {
"description": "Successfully created the requested membership.",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"type": "object",
"$ref": "#/components/schemas/MembershipResponse"
}
}
}
}
}
},
"400": {
"$ref": "#/components/responses/BadRequest"
},
"401": {
"$ref": "#/components/responses/Unauthorized"
},
"403": {
"$ref": "#/components/responses/Forbidden"
},
"404": {
"$ref": "#/components/responses/NotFound"
},
"500": {
"$ref": "#/components/responses/InternalServerError"
}
},
"security": [
{
"personalAccessToken": []
},
{
"oauth2": []
}
],
"x-readme": {
"code-samples": [
{
"language": "node",
"install": "npm install asana",
"code": "const Asana = require('asana');\n\nlet client = new Asana.ApiClient();\nclient.authentications.token.accessToken = '<YOUR_ACCESS_TOKEN>';\n\nlet membershipsApiInstance = new Asana.MembershipsApi(client);\nlet opts = { \n 'body': {\"data\": {\"<PARAM_1>\": \"<VALUE_1>\", \"<PARAM_2>\": \"<VALUE_2>\",}}\n};\nmembershipsApiInstance.createMembership(opts).then((result) => {\n console.log('API called successfully. Returned data: ' + JSON.stringify(result.data, null, 2));\n}, (error) => {\n console.error(error.response.body);\n});",
"name": "node-sdk-v3"
},
{
"language": "node",
"install": "npm install asana@1.0.5",
"code": "const asana = require('asana');\n\nconst client = asana.Client.create().useAccessToken('PERSONAL_ACCESS_TOKEN');\n\nclient.memberships.createMembership({field: \"value\", field: \"value\", pretty: true})\n .then((result) => {\n console.log(result);\n });",
"name": "node-sdk-v1"
},
{
"language": "python",
"install": "pip install asana",
"code": "import asana\nfrom asana.rest import ApiException\nfrom pprint import pprint\n\nconfiguration = asana.Configuration()\nconfiguration.access_token = '<YOUR_ACCESS_TOKEN>'\napi_client = asana.ApiClient(configuration)\n\n# create an instance of the API class\nmemberships_api_instance = asana.MembershipsApi(api_client)\nopts = {\n 'body': {\"data\": {\"<PARAM_1>\": \"<VALUE_1>\", \"<PARAM_2>\": \"<VALUE_2>\",}}, # dict | The updated fields for the membership.\n}\n\ntry:\n # Create a membership\n api_response = memberships_api_instance.create_membership(opts)\n pprint(api_response)\nexcept ApiException as e:\n print(\"Exception when calling MembershipsApi->create_membership: %s\\n\" % e)",
"name": "python-sdk-v5"
},
{
"language": "python",
"install": "pip install asana==3.2.3",
"code": "import asana\n\nclient = asana.Client.access_token('PERSONAL_ACCESS_TOKEN')\n\nresult = client.memberships.create_membership({'field': 'value', 'field': 'value'}, opt_pretty=True)",
"name": "python-sdk-v3"
},
{
"language": "php",
"install": "composer require asana/asana",
"code": "<?php\nrequire 'vendor/autoload.php';\n\n$client = Asana\\Client::accessToken('PERSONAL_ACCESS_TOKEN');\n\n$result = $client->memberships->createMembership(array('field' => 'value', 'field' => 'value'), array('opt_pretty' => 'true'))"
},
{
"language": "ruby",
"install": "gem install asana",
"code": "require 'asana'\n\nclient = Asana::Client.new do |c|\n c.authentication :access_token, 'PERSONAL_ACCESS_TOKEN'\nend\n\nresult = client.memberships.create_membership(field: \"value\", field: \"value\", options: {pretty: true})"
}
]
},
"x-purple-suite-runtime": "unavailable"
}
GET /api/1.0/memberships/{membership_gid}
Get a membership
Returns a `project_membership`, `goal_membership`, `portfolio_membership`, `custom_type_membership`, or `custom_field_membership` record for a membership id.
This operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.
Authentication
[
{
"personalAccessToken": []
},
{
"oauth2": []
}
]
Path-level parameters and metadata
{
"parameters": [
{
"$ref": "#/components/parameters/membership_path_gid"
},
{
"$ref": "#/components/parameters/pretty"
}
]
}
Request, responses and operation details
{
"summary": "Get a membership",
"description": "Returns a `project_membership`, `goal_membership`, `portfolio_membership`, `custom_type_membership`, or `custom_field_membership` record for a membership id.\n\nThis operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.",
"tags": [
"Memberships"
],
"operationId": "getMembership",
"responses": {
"200": {
"description": "Successfully retrieved the record for a single membership.",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"type": "object",
"$ref": "#/components/schemas/MembershipResponse"
}
}
}
}
}
},
"400": {
"$ref": "#/components/responses/BadRequest"
},
"401": {
"$ref": "#/components/responses/Unauthorized"
},
"403": {
"$ref": "#/components/responses/Forbidden"
},
"404": {
"$ref": "#/components/responses/NotFound"
},
"500": {
"$ref": "#/components/responses/InternalServerError"
}
},
"security": [
{
"personalAccessToken": []
},
{
"oauth2": []
}
],
"x-readme": {
"code-samples": [
{
"language": "node",
"install": "npm install asana",
"code": "const Asana = require('asana');\n\nlet client = new Asana.ApiClient();\nclient.authentications.token.accessToken = '<YOUR_ACCESS_TOKEN>';\n\nlet membershipsApiInstance = new Asana.MembershipsApi(client);\nlet membership_gid = \"12345\"; // String | Globally unique identifier for the membership.\n\nmembershipsApiInstance.getMembership(membership_gid).then((result) => {\n console.log('API called successfully. Returned data: ' + JSON.stringify(result.data, null, 2));\n}, (error) => {\n console.error(error.response.body);\n});",
"name": "node-sdk-v3"
},
{
"language": "node",
"install": "npm install asana@1.0.5",
"code": "const asana = require('asana');\n\nconst client = asana.Client.create().useAccessToken('PERSONAL_ACCESS_TOKEN');\n\nclient.memberships.getMembership(membershipGid, {param: \"value\", param: \"value\", opt_pretty: true})\n .then((result) => {\n console.log(result);\n });",
"name": "node-sdk-v1"
},
{
"language": "python",
"install": "pip install asana",
"code": "import asana\nfrom asana.rest import ApiException\nfrom pprint import pprint\n\nconfiguration = asana.Configuration()\nconfiguration.access_token = '<YOUR_ACCESS_TOKEN>'\napi_client = asana.ApiClient(configuration)\n\n# create an instance of the API class\nmemberships_api_instance = asana.MembershipsApi(api_client)\nmembership_gid = \"12345\" # str | Globally unique identifier for the membership.\n\n\ntry:\n # Get a membership\n api_response = memberships_api_instance.get_membership(membership_gid)\n pprint(api_response)\nexcept ApiException as e:\n print(\"Exception when calling MembershipsApi->get_membership: %s\\n\" % e)",
"name": "python-sdk-v5"
},
{
"language": "python",
"install": "pip install asana==3.2.3",
"code": "import asana\n\nclient = asana.Client.access_token('PERSONAL_ACCESS_TOKEN')\n\nresult = client.memberships.get_membership(membership_gid, {'param': 'value', 'param': 'value'}, opt_pretty=True)",
"name": "python-sdk-v3"
}
]
},
"x-purple-suite-runtime": "unavailable"
}
PUT /api/1.0/memberships/{membership_gid}
Update a membership
An existing membership can be updated by making a `PUT` request on the membership. Only the fields provided in the `data` block will be updated;
any unspecified fields will remain unchanged. Memberships on `goals`, `projects`, `portfolios`, `custom_types`, and `custom_fields` can be updated.
Returns the full record of the updated membership.
This operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.
Authentication
[
{
"personalAccessToken": []
},
{
"oauth2": []
}
]
Path-level parameters and metadata
{
"parameters": [
{
"$ref": "#/components/parameters/membership_path_gid"
},
{
"$ref": "#/components/parameters/pretty"
}
]
}
Request, responses and operation details
{
"summary": "Update a membership",
"description": "An existing membership can be updated by making a `PUT` request on the membership. Only the fields provided in the `data` block will be updated;\nany unspecified fields will remain unchanged. Memberships on `goals`, `projects`, `portfolios`, `custom_types`, and `custom_fields` can be updated.\n\nReturns the full record of the updated membership.\n\nThis operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.",
"tags": [
"Memberships"
],
"operationId": "updateMembership",
"requestBody": {
"description": "The membership to update.",
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"$ref": "#/components/schemas/MembershipRequest"
}
}
}
}
}
},
"responses": {
"200": {
"description": "Successfully updated the requested membership.",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"$ref": "#/components/schemas/MembershipResponse"
}
}
}
}
}
},
"400": {
"$ref": "#/components/responses/BadRequest"
},
"401": {
"$ref": "#/components/responses/Unauthorized"
},
"403": {
"$ref": "#/components/responses/Forbidden"
},
"404": {
"$ref": "#/components/responses/NotFound"
},
"500": {
"$ref": "#/components/responses/InternalServerError"
}
},
"security": [
{
"personalAccessToken": []
},
{
"oauth2": []
}
],
"x-readme": {
"code-samples": [
{
"language": "node",
"install": "npm install asana",
"code": "const Asana = require('asana');\n\nlet client = new Asana.ApiClient();\nclient.authentications.token.accessToken = '<YOUR_ACCESS_TOKEN>';\n\nlet membershipsApiInstance = new Asana.MembershipsApi(client);\nlet body = {\"data\": {\"<PARAM_1>\": \"<VALUE_1>\", \"<PARAM_2>\": \"<VALUE_2>\",}}; // Object | The membership to update.\nlet membership_gid = \"12345\"; // String | Globally unique identifier for the membership.\n\nmembershipsApiInstance.updateMembership(body, membership_gid).then((result) => {\n console.log('API called successfully. Returned data: ' + JSON.stringify(result.data, null, 2));\n}, (error) => {\n console.error(error.response.body);\n});",
"name": "node-sdk-v3"
},
{
"language": "node",
"install": "npm install asana@1.0.5",
"code": "const asana = require('asana');\n\nconst client = asana.Client.create().useAccessToken('PERSONAL_ACCESS_TOKEN');\n\nclient.memberships.updateMembership(membershipGid, {field: \"value\", field: \"value\", pretty: true})\n .then((result) => {\n console.log(result);\n });",
"name": "node-sdk-v1"
},
{
"language": "python",
"install": "pip install asana",
"code": "import asana\nfrom asana.rest import ApiException\nfrom pprint import pprint\n\nconfiguration = asana.Configuration()\nconfiguration.access_token = '<YOUR_ACCESS_TOKEN>'\napi_client = asana.ApiClient(configuration)\n\n# create an instance of the API class\nmemberships_api_instance = asana.MembershipsApi(api_client)\nbody = {\"data\": {\"<PARAM_1>\": \"<VALUE_1>\", \"<PARAM_2>\": \"<VALUE_2>\",}} # dict | The membership to update.\nmembership_gid = \"12345\" # str | Globally unique identifier for the membership.\n\n\ntry:\n # Update a membership\n api_response = memberships_api_instance.update_membership(body, membership_gid)\n pprint(api_response)\nexcept ApiException as e:\n print(\"Exception when calling MembershipsApi->update_membership: %s\\n\" % e)",
"name": "python-sdk-v5"
},
{
"language": "python",
"install": "pip install asana==3.2.3",
"code": "import asana\n\nclient = asana.Client.access_token('PERSONAL_ACCESS_TOKEN')\n\nresult = client.memberships.update_membership(membership_gid, {'field': 'value', 'field': 'value'}, opt_pretty=True)",
"name": "python-sdk-v3"
},
{
"language": "php",
"install": "composer require asana/asana",
"code": "<?php\nrequire 'vendor/autoload.php';\n\n$client = Asana\\Client::accessToken('PERSONAL_ACCESS_TOKEN');\n\n$result = $client->memberships->updateMembership($membership_gid, array('field' => 'value', 'field' => 'value'), array('opt_pretty' => 'true'))"
},
{
"language": "ruby",
"install": "gem install asana",
"code": "require 'asana'\n\nclient = Asana::Client.new do |c|\n c.authentication :access_token, 'PERSONAL_ACCESS_TOKEN'\nend\n\nresult = client.memberships.update_membership(membership_gid: 'membership_gid', field: \"value\", field: \"value\", options: {pretty: true})"
}
]
},
"x-purple-suite-runtime": "unavailable"
}
DELETE /api/1.0/memberships/{membership_gid}
Delete a membership
A specific, existing membership for a `goal`, `project`, `portfolio`, `custom_type`, or `custom_field` can be deleted by making a `DELETE` request
on the URL for that membership.
Returns an empty data record.
This operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.
Authentication
[
{
"personalAccessToken": []
},
{
"oauth2": []
}
]
Path-level parameters and metadata
{
"parameters": [
{
"$ref": "#/components/parameters/membership_path_gid"
},
{
"$ref": "#/components/parameters/pretty"
}
]
}
Request, responses and operation details
{
"summary": "Delete a membership",
"description": "A specific, existing membership for a `goal`, `project`, `portfolio`, `custom_type`, or `custom_field` can be deleted by making a `DELETE` request\non the URL for that membership.\n\nReturns an empty data record.\n\nThis operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.",
"tags": [
"Memberships"
],
"operationId": "deleteMembership",
"responses": {
"200": {
"description": "Successfully deleted the requested membership.",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"$ref": "#/components/schemas/EmptyResponse"
}
}
}
}
}
},
"400": {
"$ref": "#/components/responses/BadRequest"
},
"401": {
"$ref": "#/components/responses/Unauthorized"
},
"403": {
"$ref": "#/components/responses/Forbidden"
},
"404": {
"$ref": "#/components/responses/NotFound"
},
"500": {
"$ref": "#/components/responses/InternalServerError"
}
},
"security": [
{
"personalAccessToken": []
},
{
"oauth2": []
}
],
"x-readme": {
"code-samples": [
{
"language": "node",
"install": "npm install asana",
"code": "const Asana = require('asana');\n\nlet client = new Asana.ApiClient();\nclient.authentications.token.accessToken = '<YOUR_ACCESS_TOKEN>';\n\nlet membershipsApiInstance = new Asana.MembershipsApi(client);\nlet membership_gid = \"12345\"; // String | Globally unique identifier for the membership.\n\nmembershipsApiInstance.deleteMembership(membership_gid).then((result) => {\n console.log('API called successfully. Returned data: ' + JSON.stringify(result.data, null, 2));\n}, (error) => {\n console.error(error.response.body);\n});",
"name": "node-sdk-v3"
},
{
"language": "node",
"install": "npm install asana@1.0.5",
"code": "const asana = require('asana');\n\nconst client = asana.Client.create().useAccessToken('PERSONAL_ACCESS_TOKEN');\n\nclient.memberships.deleteMembership(membershipGid)\n .then((result) => {\n console.log(result);\n });",
"name": "node-sdk-v1"
},
{
"language": "python",
"install": "pip install asana",
"code": "import asana\nfrom asana.rest import ApiException\nfrom pprint import pprint\n\nconfiguration = asana.Configuration()\nconfiguration.access_token = '<YOUR_ACCESS_TOKEN>'\napi_client = asana.ApiClient(configuration)\n\n# create an instance of the API class\nmemberships_api_instance = asana.MembershipsApi(api_client)\nmembership_gid = \"12345\" # str | Globally unique identifier for the membership.\n\n\ntry:\n # Delete a membership\n api_response = memberships_api_instance.delete_membership(membership_gid)\n pprint(api_response)\nexcept ApiException as e:\n print(\"Exception when calling MembershipsApi->delete_membership: %s\\n\" % e)",
"name": "python-sdk-v5"
},
{
"language": "python",
"install": "pip install asana==3.2.3",
"code": "import asana\n\nclient = asana.Client.access_token('PERSONAL_ACCESS_TOKEN')\n\nresult = client.memberships.delete_membership(membership_gid, opt_pretty=True)",
"name": "python-sdk-v3"
},
{
"language": "php",
"install": "composer require asana/asana",
"code": "<?php\nrequire 'vendor/autoload.php';\n\n$client = Asana\\Client::accessToken('PERSONAL_ACCESS_TOKEN');\n\n$result = $client->memberships->deleteMembership($membership_gid, array('opt_pretty' => 'true'))"
},
{
"language": "ruby",
"install": "gem install asana",
"code": "require 'asana'\n\nclient = Asana::Client.new do |c|\n c.authentication :access_token, 'PERSONAL_ACCESS_TOKEN'\nend\n\nresult = client.memberships.delete_membership(membership_gid: 'membership_gid', options: {pretty: true})"
}
]
},
"x-purple-suite-runtime": "unavailable"
}
GET /api/1.0/ooo_entries/{ooo_entry_gid}
Get an OOO entry
<b>Required scope: </b><code>ooo_entries:read</code>
Returns the complete OOO entry record for a single OOO entry.
This operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.
Authentication
[
{
"personalAccessToken": []
},
{
"oauth2": [
"ooo_entries:read"
]
}
]
Path-level parameters and metadata
{
"parameters": [
{
"$ref": "#/components/parameters/ooo_entry_path_gid"
},
{
"$ref": "#/components/parameters/pretty"
}
]
}
Request, responses and operation details
{
"summary": "Get an OOO entry",
"description": "<b>Required scope: </b><code>ooo_entries:read</code>\n\nReturns the complete OOO entry record for a single OOO entry.\n\nThis operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.",
"tags": [
"Ooo entries"
],
"operationId": "getOooEntry",
"parameters": [
{
"name": "opt_fields",
"in": "query",
"description": "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. Properties can include nested fields. To learn more, see the [input/output options guide](/docs/inputoutput-options#selecting-nested-fields).",
"required": false,
"example": [
"created_by",
"created_by.name",
"end_date",
"start_date",
"user",
"user.name"
],
"schema": {
"type": "array",
"items": {
"type": "string",
"enum": [
"created_by",
"created_by.name",
"end_date",
"start_date",
"user",
"user.name"
]
}
},
"style": "form",
"explode": false
}
],
"responses": {
"200": {
"description": "Successfully retrieved the record for a single OOO entry.",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"$ref": "#/components/schemas/OooEntryResponse"
}
}
}
}
}
},
"400": {
"$ref": "#/components/responses/BadRequest"
},
"401": {
"$ref": "#/components/responses/Unauthorized"
},
"403": {
"$ref": "#/components/responses/Forbidden"
},
"404": {
"$ref": "#/components/responses/NotFound"
},
"500": {
"$ref": "#/components/responses/InternalServerError"
}
},
"security": [
{
"personalAccessToken": []
},
{
"oauth2": [
"ooo_entries:read"
]
}
],
"x-readme": {
"code-samples": [
{
"language": "node",
"install": "npm install asana",
"code": "const Asana = require('asana');\n\nlet client = new Asana.ApiClient();\nclient.authentications.token.accessToken = '<YOUR_ACCESS_TOKEN>';\n\nlet oooEntriesApiInstance = new Asana.OooEntriesApi(client);\nlet ooo_entry_gid = \"12345\"; // String | Globally unique identifier for the OOO entry.\nlet opts = { \n 'opt_fields': \"created_by,created_by.name,end_date,start_date,user,user.name\"\n};\noooEntriesApiInstance.getOooEntry(ooo_entry_gid, opts).then((result) => {\n console.log('API called successfully. Returned data: ' + JSON.stringify(result.data, null, 2));\n}, (error) => {\n console.error(error.response.body);\n});",
"name": "node-sdk-v3"
},
{
"language": "python",
"install": "pip install asana",
"code": "import asana\nfrom asana.rest import ApiException\nfrom pprint import pprint\n\nconfiguration = asana.Configuration()\nconfiguration.access_token = '<YOUR_ACCESS_TOKEN>'\napi_client = asana.ApiClient(configuration)\n\n# create an instance of the API class\nooo_entries_api_instance = asana.OooEntriesApi(api_client)\nooo_entry_gid = \"12345\" # str | Globally unique identifier for the OOO entry.\nopts = {\n 'opt_fields': \"created_by,created_by.name,end_date,start_date,user,user.name\", # list[str] | 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.\n}\n\ntry:\n # Get an OOO entry\n api_response = ooo_entries_api_instance.get_ooo_entry(ooo_entry_gid, opts)\n pprint(api_response)\nexcept ApiException as e:\n print(\"Exception when calling OooEntriesApi->get_ooo_entry: %s\\n\" % e)",
"name": "python-sdk-v5"
}
]
},
"x-purple-suite-runtime": "unavailable"
}
PUT /api/1.0/ooo_entries/{ooo_entry_gid}
Update an OOO entry
<b>Required scope: </b><code>ooo_entries:write</code>
An existing OOO entry can be updated by making a PUT request on the URL for
that OOO entry. Only the fields provided in the `data` block will be updated;
any unspecified fields will remain unchanged.
Returns the complete updated OOO entry record.
This operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.
Authentication
[
{
"personalAccessToken": []
},
{
"oauth2": [
"ooo_entries:write"
]
}
]
Path-level parameters and metadata
{
"parameters": [
{
"$ref": "#/components/parameters/ooo_entry_path_gid"
},
{
"$ref": "#/components/parameters/pretty"
}
]
}
Request, responses and operation details
{
"summary": "Update an OOO entry",
"description": "<b>Required scope: </b><code>ooo_entries:write</code>\n\nAn existing OOO entry can be updated by making a PUT request on the URL for\nthat OOO entry. Only the fields provided in the `data` block will be updated;\nany unspecified fields will remain unchanged.\n\nReturns the complete updated OOO entry record.\n\nThis operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.",
"tags": [
"Ooo entries"
],
"operationId": "updateOooEntry",
"parameters": [
{
"name": "opt_fields",
"in": "query",
"description": "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. Properties can include nested fields. To learn more, see the [input/output options guide](/docs/inputoutput-options#selecting-nested-fields).",
"required": false,
"example": [
"created_by",
"created_by.name",
"end_date",
"start_date",
"user",
"user.name"
],
"schema": {
"type": "array",
"items": {
"type": "string",
"enum": [
"created_by",
"created_by.name",
"end_date",
"start_date",
"user",
"user.name"
]
}
},
"style": "form",
"explode": false
}
],
"requestBody": {
"description": "The updated fields for the OOO entry.",
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"$ref": "#/components/schemas/OooEntryUpdateRequest"
}
}
}
}
}
},
"responses": {
"200": {
"description": "Successfully updated the OOO entry.",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"$ref": "#/components/schemas/OooEntryResponse"
}
}
}
}
}
},
"400": {
"$ref": "#/components/responses/BadRequest"
},
"401": {
"$ref": "#/components/responses/Unauthorized"
},
"403": {
"$ref": "#/components/responses/Forbidden"
},
"404": {
"$ref": "#/components/responses/NotFound"
},
"500": {
"$ref": "#/components/responses/InternalServerError"
}
},
"security": [
{
"personalAccessToken": []
},
{
"oauth2": [
"ooo_entries:write"
]
}
],
"x-readme": {
"code-samples": [
{
"language": "node",
"install": "npm install asana",
"code": "const Asana = require('asana');\n\nlet client = new Asana.ApiClient();\nclient.authentications.token.accessToken = '<YOUR_ACCESS_TOKEN>';\n\nlet oooEntriesApiInstance = new Asana.OooEntriesApi(client);\nlet body = {\"data\": {\"<PARAM_1>\": \"<VALUE_1>\", \"<PARAM_2>\": \"<VALUE_2>\",}}; // Object | The updated fields for the OOO entry.\nlet ooo_entry_gid = \"12345\"; // String | Globally unique identifier for the OOO entry.\nlet opts = { \n 'opt_fields': \"created_by,created_by.name,end_date,start_date,user,user.name\"\n};\noooEntriesApiInstance.updateOooEntry(body, ooo_entry_gid, opts).then((result) => {\n console.log('API called successfully. Returned data: ' + JSON.stringify(result.data, null, 2));\n}, (error) => {\n console.error(error.response.body);\n});",
"name": "node-sdk-v3"
},
{
"language": "python",
"install": "pip install asana",
"code": "import asana\nfrom asana.rest import ApiException\nfrom pprint import pprint\n\nconfiguration = asana.Configuration()\nconfiguration.access_token = '<YOUR_ACCESS_TOKEN>'\napi_client = asana.ApiClient(configuration)\n\n# create an instance of the API class\nooo_entries_api_instance = asana.OooEntriesApi(api_client)\nbody = {\"data\": {\"<PARAM_1>\": \"<VALUE_1>\", \"<PARAM_2>\": \"<VALUE_2>\",}} # dict | The updated fields for the OOO entry.\nooo_entry_gid = \"12345\" # str | Globally unique identifier for the OOO entry.\nopts = {\n 'opt_fields': \"created_by,created_by.name,end_date,start_date,user,user.name\", # list[str] | 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.\n}\n\ntry:\n # Update an OOO entry\n api_response = ooo_entries_api_instance.update_ooo_entry(body, ooo_entry_gid, opts)\n pprint(api_response)\nexcept ApiException as e:\n print(\"Exception when calling OooEntriesApi->update_ooo_entry: %s\\n\" % e)",
"name": "python-sdk-v5"
}
]
},
"x-purple-suite-runtime": "unavailable"
}
DELETE /api/1.0/ooo_entries/{ooo_entry_gid}
Delete an OOO entry
<b>Required scope: </b><code>ooo_entries:delete</code>
A specific, existing OOO entry can be deleted by making a DELETE request on the URL for that OOO entry.
Returns an empty data record.
This operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.
Authentication
[
{
"personalAccessToken": []
},
{
"oauth2": [
"ooo_entries:delete"
]
}
]
Path-level parameters and metadata
{
"parameters": [
{
"$ref": "#/components/parameters/ooo_entry_path_gid"
},
{
"$ref": "#/components/parameters/pretty"
}
]
}
Request, responses and operation details
{
"summary": "Delete an OOO entry",
"description": "<b>Required scope: </b><code>ooo_entries:delete</code>\n\nA specific, existing OOO entry can be deleted by making a DELETE request on the URL for that OOO entry.\n\nReturns an empty data record.\n\nThis operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.",
"tags": [
"Ooo entries"
],
"operationId": "deleteOooEntry",
"responses": {
"200": {
"description": "Successfully deleted the specified OOO entry.",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"$ref": "#/components/schemas/EmptyResponse"
}
}
}
}
}
},
"400": {
"$ref": "#/components/responses/BadRequest"
},
"401": {
"$ref": "#/components/responses/Unauthorized"
},
"403": {
"$ref": "#/components/responses/Forbidden"
},
"404": {
"$ref": "#/components/responses/NotFound"
},
"500": {
"$ref": "#/components/responses/InternalServerError"
}
},
"security": [
{
"personalAccessToken": []
},
{
"oauth2": [
"ooo_entries:delete"
]
}
],
"x-readme": {
"code-samples": [
{
"language": "node",
"install": "npm install asana",
"code": "const Asana = require('asana');\n\nlet client = new Asana.ApiClient();\nclient.authentications.token.accessToken = '<YOUR_ACCESS_TOKEN>';\n\nlet oooEntriesApiInstance = new Asana.OooEntriesApi(client);\nlet ooo_entry_gid = \"12345\"; // String | Globally unique identifier for the OOO entry.\n\noooEntriesApiInstance.deleteOooEntry(ooo_entry_gid).then((result) => {\n console.log('API called successfully. Returned data: ' + JSON.stringify(result.data, null, 2));\n}, (error) => {\n console.error(error.response.body);\n});",
"name": "node-sdk-v3"
},
{
"language": "python",
"install": "pip install asana",
"code": "import asana\nfrom asana.rest import ApiException\nfrom pprint import pprint\n\nconfiguration = asana.Configuration()\nconfiguration.access_token = '<YOUR_ACCESS_TOKEN>'\napi_client = asana.ApiClient(configuration)\n\n# create an instance of the API class\nooo_entries_api_instance = asana.OooEntriesApi(api_client)\nooo_entry_gid = \"12345\" # str | Globally unique identifier for the OOO entry.\n\n\ntry:\n # Delete an OOO entry\n api_response = ooo_entries_api_instance.delete_ooo_entry(ooo_entry_gid)\n pprint(api_response)\nexcept ApiException as e:\n print(\"Exception when calling OooEntriesApi->delete_ooo_entry: %s\\n\" % e)",
"name": "python-sdk-v5"
}
]
},
"x-purple-suite-runtime": "unavailable"
}
GET /api/1.0/ooo_entries
Get OOO entries for a user
<b>Required scope: </b><code>ooo_entries:read</code>
Returns a list of OOO entries for the specified user.
This operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.
Authentication
[
{
"personalAccessToken": []
},
{
"oauth2": [
"ooo_entries:read"
]
}
]
Path-level parameters and metadata
{
"parameters": [
{
"$ref": "#/components/parameters/pretty"
}
]
}
Request, responses and operation details
{
"summary": "Get OOO entries for a user",
"description": "<b>Required scope: </b><code>ooo_entries:read</code>\n\nReturns a list of OOO entries for the specified user.\n\nThis operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.",
"tags": [
"Ooo entries"
],
"operationId": "getOooEntries",
"parameters": [
{
"name": "user",
"in": "query",
"description": "Globally unique identifier for the user to filter OOO entries by.",
"required": true,
"schema": {
"type": "string"
},
"example": "12345"
},
{
"name": "workspace",
"in": "query",
"description": "Globally unique identifier for the workspace.",
"required": true,
"schema": {
"type": "string"
},
"example": "98765"
},
{
"$ref": "#/components/parameters/limit"
},
{
"$ref": "#/components/parameters/offset"
},
{
"name": "start_date",
"in": "query",
"description": "An ISO 8601 date string. Filters to OOO entries that overlap with or end after this date.",
"required": false,
"schema": {
"type": "string",
"format": "date"
},
"example": "2025-01-01"
},
{
"name": "end_date",
"in": "query",
"description": "An ISO 8601 date string. Filters to OOO entries that overlap with or start before this date.",
"required": false,
"schema": {
"type": "string",
"format": "date"
},
"example": "2025-12-31"
},
{
"name": "opt_fields",
"in": "query",
"description": "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. Properties can include nested fields. To learn more, see the [input/output options guide](/docs/inputoutput-options#selecting-nested-fields).",
"required": false,
"example": [
"created_by",
"created_by.name",
"end_date",
"offset",
"path",
"start_date",
"uri",
"user",
"user.name"
],
"schema": {
"type": "array",
"items": {
"type": "string",
"enum": [
"created_by",
"created_by.name",
"end_date",
"offset",
"path",
"start_date",
"uri",
"user",
"user.name"
]
}
},
"style": "form",
"explode": false
}
],
"responses": {
"200": {
"description": "Successfully retrieved the requested OOO entries.",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"type": "array",
"items": {
"$ref": "#/components/schemas/OooEntryResponse"
}
},
"next_page": {
"$ref": "#/components/schemas/NextPage"
}
}
}
}
}
},
"400": {
"$ref": "#/components/responses/BadRequest"
},
"401": {
"$ref": "#/components/responses/Unauthorized"
},
"403": {
"$ref": "#/components/responses/Forbidden"
},
"404": {
"$ref": "#/components/responses/NotFound"
},
"500": {
"$ref": "#/components/responses/InternalServerError"
}
},
"security": [
{
"personalAccessToken": []
},
{
"oauth2": [
"ooo_entries:read"
]
}
],
"x-readme": {
"code-samples": [
{
"language": "node",
"install": "npm install asana",
"code": "const Asana = require('asana');\n\nlet client = new Asana.ApiClient();\nclient.authentications.token.accessToken = '<YOUR_ACCESS_TOKEN>';\n\nlet oooEntriesApiInstance = new Asana.OooEntriesApi(client);\nlet user = \"12345\"; // String | Globally unique identifier for the user to filter OOO entries by.\nlet workspace = \"98765\"; // String | Globally unique identifier for the workspace.\nlet opts = { \n 'limit': 50, \n 'offset': \"eyJ0eXAiOJiKV1iQLCJhbGciOiJIUzI1NiJ9\", \n 'start_date': \"2025-01-01\", \n 'end_date': \"2025-12-31\", \n 'opt_fields': \"created_by,created_by.name,end_date,offset,path,start_date,uri,user,user.name\"\n};\noooEntriesApiInstance.getOooEntries(user, workspace, opts).then((result) => {\n console.log('API called successfully. Returned data: ' + JSON.stringify(result.data, null, 2));\n}, (error) => {\n console.error(error.response.body);\n});",
"name": "node-sdk-v3"
},
{
"language": "python",
"install": "pip install asana",
"code": "import asana\nfrom asana.rest import ApiException\nfrom pprint import pprint\n\nconfiguration = asana.Configuration()\nconfiguration.access_token = '<YOUR_ACCESS_TOKEN>'\napi_client = asana.ApiClient(configuration)\n\n# create an instance of the API class\nooo_entries_api_instance = asana.OooEntriesApi(api_client)\nuser = \"12345\" # str | Globally unique identifier for the user to filter OOO entries by.\nworkspace = \"98765\" # str | Globally unique identifier for the workspace.\nopts = {\n 'limit': 50, # int | Results per page. The number of objects to return per page. The value must be between 1 and 100.\n 'offset': \"eyJ0eXAiOJiKV1iQLCJhbGciOiJIUzI1NiJ9\", # str | 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.*\n 'start_date': '2025-01-01', # date | An ISO 8601 date string. Filters to OOO entries that overlap with or end after this date.\n 'end_date': '2025-12-31', # date | An ISO 8601 date string. Filters to OOO entries that overlap with or start before this date.\n 'opt_fields': \"created_by,created_by.name,end_date,offset,path,start_date,uri,user,user.name\", # list[str] | 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.\n}\n\ntry:\n # Get OOO entries for a user\n api_response = ooo_entries_api_instance.get_ooo_entries(user, workspace, opts)\n for data in api_response:\n pprint(data)\nexcept ApiException as e:\n print(\"Exception when calling OooEntriesApi->get_ooo_entries: %s\\n\" % e)",
"name": "python-sdk-v5"
}
]
},
"x-purple-suite-runtime": "unavailable"
}
POST /api/1.0/ooo_entries
Create an OOO entry
<b>Required scope: </b><code>ooo_entries:write</code>
Creates a new OOO entry.
Returns the full record of the newly created OOO entry.
This operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.
Authentication
[
{
"personalAccessToken": []
},
{
"oauth2": [
"ooo_entries:write"
]
}
]
Path-level parameters and metadata
{
"parameters": [
{
"$ref": "#/components/parameters/pretty"
}
]
}
Request, responses and operation details
{
"summary": "Create an OOO entry",
"description": "<b>Required scope: </b><code>ooo_entries:write</code>\n\nCreates a new OOO entry.\n\nReturns the full record of the newly created OOO entry.\n\nThis operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.",
"tags": [
"Ooo entries"
],
"operationId": "createOooEntry",
"parameters": [
{
"name": "opt_fields",
"in": "query",
"description": "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. Properties can include nested fields. To learn more, see the [input/output options guide](/docs/inputoutput-options#selecting-nested-fields).",
"required": false,
"example": [
"created_by",
"created_by.name",
"end_date",
"start_date",
"user",
"user.name"
],
"schema": {
"type": "array",
"items": {
"type": "string",
"enum": [
"created_by",
"created_by.name",
"end_date",
"start_date",
"user",
"user.name"
]
}
},
"style": "form",
"explode": false
}
],
"requestBody": {
"description": "The OOO entry to create.",
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"allOf": [
{
"$ref": "#/components/schemas/OooEntryCreateRequest"
},
{
"type": "object",
"required": [
"user",
"workspace",
"start_date",
"end_date"
]
}
]
}
}
}
}
}
},
"responses": {
"201": {
"description": "Successfully created a new OOO entry.",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"$ref": "#/components/schemas/OooEntryResponse"
}
}
}
}
}
},
"400": {
"$ref": "#/components/responses/BadRequest"
},
"401": {
"$ref": "#/components/responses/Unauthorized"
},
"403": {
"$ref": "#/components/responses/Forbidden"
},
"404": {
"$ref": "#/components/responses/NotFound"
},
"500": {
"$ref": "#/components/responses/InternalServerError"
}
},
"security": [
{
"personalAccessToken": []
},
{
"oauth2": [
"ooo_entries:write"
]
}
],
"x-readme": {
"code-samples": [
{
"language": "node",
"install": "npm install asana",
"code": "const Asana = require('asana');\n\nlet client = new Asana.ApiClient();\nclient.authentications.token.accessToken = '<YOUR_ACCESS_TOKEN>';\n\nlet oooEntriesApiInstance = new Asana.OooEntriesApi(client);\nlet body = {\"data\": {\"<PARAM_1>\": \"<VALUE_1>\", \"<PARAM_2>\": \"<VALUE_2>\",}}; // Object | The OOO entry to create.\nlet opts = { \n 'opt_fields': \"created_by,created_by.name,end_date,start_date,user,user.name\"\n};\noooEntriesApiInstance.createOooEntry(body, opts).then((result) => {\n console.log('API called successfully. Returned data: ' + JSON.stringify(result.data, null, 2));\n}, (error) => {\n console.error(error.response.body);\n});",
"name": "node-sdk-v3"
},
{
"language": "python",
"install": "pip install asana",
"code": "import asana\nfrom asana.rest import ApiException\nfrom pprint import pprint\n\nconfiguration = asana.Configuration()\nconfiguration.access_token = '<YOUR_ACCESS_TOKEN>'\napi_client = asana.ApiClient(configuration)\n\n# create an instance of the API class\nooo_entries_api_instance = asana.OooEntriesApi(api_client)\nbody = {\"data\": {\"<PARAM_1>\": \"<VALUE_1>\", \"<PARAM_2>\": \"<VALUE_2>\",}} # dict | The OOO entry to create.\nopts = {\n 'opt_fields': \"created_by,created_by.name,end_date,start_date,user,user.name\", # list[str] | 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.\n}\n\ntry:\n # Create an OOO entry\n api_response = ooo_entries_api_instance.create_ooo_entry(body, opts)\n pprint(api_response)\nexcept ApiException as e:\n print(\"Exception when calling OooEntriesApi->create_ooo_entry: %s\\n\" % e)",
"name": "python-sdk-v5"
}
]
},
"x-purple-suite-runtime": "unavailable"
}
POST /api/1.0/organization_exports
Create an organization export request
This method creates a request to export an Organization. Asana will complete the export at some point after you create the request.
This operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.
Authentication
[
{
"personalAccessToken": []
},
{
"oauth2": []
}
]
Path-level parameters and metadata
{
"parameters": [
{
"$ref": "#/components/parameters/pretty"
}
]
}
Request, responses and operation details
{
"summary": "Create an organization export request",
"description": "This method creates a request to export an Organization. Asana will complete the export at some point after you create the request.\n\nThis operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.",
"tags": [
"Organization exports"
],
"operationId": "createOrganizationExport",
"parameters": [
{
"name": "opt_fields",
"in": "query",
"description": "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. Properties can include nested fields. To learn more, see the [input/output options guide](/docs/inputoutput-options#selecting-nested-fields).",
"required": false,
"example": [
"created_at",
"download_url",
"organization",
"organization.name",
"state"
],
"schema": {
"type": "array",
"items": {
"type": "string",
"enum": [
"created_at",
"download_url",
"organization",
"organization.name",
"state"
]
}
},
"style": "form",
"explode": false
}
],
"requestBody": {
"description": "The organization to export.",
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"$ref": "#/components/schemas/OrganizationExportRequest"
}
}
}
}
}
},
"responses": {
"201": {
"description": "Successfully created organization export request.",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"$ref": "#/components/schemas/OrganizationExportResponse"
}
}
}
}
}
},
"400": {
"$ref": "#/components/responses/BadRequest"
},
"401": {
"$ref": "#/components/responses/Unauthorized"
},
"403": {
"$ref": "#/components/responses/Forbidden"
},
"404": {
"$ref": "#/components/responses/NotFound"
},
"500": {
"$ref": "#/components/responses/InternalServerError"
}
},
"security": [
{
"personalAccessToken": []
},
{
"oauth2": []
}
],
"x-readme": {
"code-samples": [
{
"language": "java",
"install": "<dependency><groupId>com.asana</groupId><artifactId>asana</artifactId><version>1.0.0</version></dependency>",
"code": "import com.asana.Client;\n\nClient client = Client.accessToken(\"PERSONAL_ACCESS_TOKEN\");\n\nOrganizationExport result = client.organizationexports.createOrganizationExport()\n .data(\"field\", \"value\")\n .data(\"field\", \"value\")\n .option(\"pretty\", true)\n .execute();"
},
{
"language": "node",
"install": "npm install asana",
"code": "const Asana = require('asana');\n\nlet client = new Asana.ApiClient();\nclient.authentications.token.accessToken = '<YOUR_ACCESS_TOKEN>';\n\nlet organizationExportsApiInstance = new Asana.OrganizationExportsApi(client);\nlet body = {\"data\": {\"<PARAM_1>\": \"<VALUE_1>\", \"<PARAM_2>\": \"<VALUE_2>\",}}; // Object | The organization to export.\nlet opts = { \n 'opt_fields': \"created_at,download_url,organization,organization.name,state\"\n};\norganizationExportsApiInstance.createOrganizationExport(body, opts).then((result) => {\n console.log('API called successfully. Returned data: ' + JSON.stringify(result.data, null, 2));\n}, (error) => {\n console.error(error.response.body);\n});",
"name": "node-sdk-v3"
},
{
"language": "node",
"install": "npm install asana@1.0.5",
"code": "const asana = require('asana');\n\nconst client = asana.Client.create().useAccessToken('PERSONAL_ACCESS_TOKEN');\n\nclient.organizationexports.createOrganizationExport({field: \"value\", field: \"value\", pretty: true})\n .then((result) => {\n console.log(result);\n });",
"name": "node-sdk-v1"
},
{
"language": "python",
"install": "pip install asana",
"code": "import asana\nfrom asana.rest import ApiException\nfrom pprint import pprint\n\nconfiguration = asana.Configuration()\nconfiguration.access_token = '<YOUR_ACCESS_TOKEN>'\napi_client = asana.ApiClient(configuration)\n\n# create an instance of the API class\norganization_exports_api_instance = asana.OrganizationExportsApi(api_client)\nbody = {\"data\": {\"<PARAM_1>\": \"<VALUE_1>\", \"<PARAM_2>\": \"<VALUE_2>\",}} # dict | The organization to export.\nopts = {\n 'opt_fields': \"created_at,download_url,organization,organization.name,state\", # list[str] | 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.\n}\n\ntry:\n # Create an organization export request\n api_response = organization_exports_api_instance.create_organization_export(body, opts)\n pprint(api_response)\nexcept ApiException as e:\n print(\"Exception when calling OrganizationExportsApi->create_organization_export: %s\\n\" % e)",
"name": "python-sdk-v5"
},
{
"language": "python",
"install": "pip install asana==3.2.3",
"code": "import asana\n\nclient = asana.Client.access_token('PERSONAL_ACCESS_TOKEN')\n\nresult = client.organization_exports.create_organization_export({'field': 'value', 'field': 'value'}, opt_pretty=True)",
"name": "python-sdk-v3"
},
{
"language": "php",
"install": "composer require asana/asana",
"code": "<?php\nrequire 'vendor/autoload.php';\n\n$client = Asana\\Client::accessToken('PERSONAL_ACCESS_TOKEN');\n\n$result = $client->organizationexports->createOrganizationExport(array('field' => 'value', 'field' => 'value'), array('opt_pretty' => 'true'))"
},
{
"language": "ruby",
"install": "gem install asana",
"code": "require 'asana'\n\nclient = Asana::Client.new do |c|\n c.authentication :access_token, 'PERSONAL_ACCESS_TOKEN'\nend\n\nresult = client.organization_exports.create_organization_export(field: \"value\", field: \"value\", options: {pretty: true})"
}
]
},
"x-purple-suite-runtime": "unavailable"
}
GET /api/1.0/organization_exports/{organization_export_gid}
Get details on an org export request
Returns details of a previously-requested Organization export.
This operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.
Authentication
[
{
"personalAccessToken": []
},
{
"oauth2": []
}
]
Path-level parameters and metadata
{
"parameters": [
{
"$ref": "#/components/parameters/organization_export_path_gid"
},
{
"$ref": "#/components/parameters/pretty"
}
]
}
Request, responses and operation details
{
"summary": "Get details on an org export request",
"description": "Returns details of a previously-requested Organization export.\n\nThis operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.",
"tags": [
"Organization exports"
],
"operationId": "getOrganizationExport",
"parameters": [
{
"name": "opt_fields",
"in": "query",
"description": "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. Properties can include nested fields. To learn more, see the [input/output options guide](/docs/inputoutput-options#selecting-nested-fields).",
"required": false,
"example": [
"created_at",
"download_url",
"organization",
"organization.name",
"state"
],
"schema": {
"type": "array",
"items": {
"type": "string",
"enum": [
"created_at",
"download_url",
"organization",
"organization.name",
"state"
]
}
},
"style": "form",
"explode": false
}
],
"responses": {
"200": {
"description": "Successfully retrieved organization export object.",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"$ref": "#/components/schemas/OrganizationExportResponse"
}
}
}
}
}
},
"400": {
"$ref": "#/components/responses/BadRequest"
},
"401": {
"$ref": "#/components/responses/Unauthorized"
},
"403": {
"$ref": "#/components/responses/Forbidden"
},
"404": {
"$ref": "#/components/responses/NotFound"
},
"500": {
"$ref": "#/components/responses/InternalServerError"
}
},
"security": [
{
"personalAccessToken": []
},
{
"oauth2": []
}
],
"x-readme": {
"code-samples": [
{
"language": "java",
"install": "<dependency><groupId>com.asana</groupId><artifactId>asana</artifactId><version>1.0.0</version></dependency>",
"code": "import com.asana.Client;\n\nClient client = Client.accessToken(\"PERSONAL_ACCESS_TOKEN\");\n\nOrganizationExport result = client.organizationexports.getOrganizationExport(organizationExportGid)\n .option(\"pretty\", true)\n .execute();"
},
{
"language": "node",
"install": "npm install asana",
"code": "const Asana = require('asana');\n\nlet client = new Asana.ApiClient();\nclient.authentications.token.accessToken = '<YOUR_ACCESS_TOKEN>';\n\nlet organizationExportsApiInstance = new Asana.OrganizationExportsApi(client);\nlet organization_export_gid = \"12345\"; // String | Globally unique identifier for the organization export.\nlet opts = { \n 'opt_fields': \"created_at,download_url,organization,organization.name,state\"\n};\norganizationExportsApiInstance.getOrganizationExport(organization_export_gid, opts).then((result) => {\n console.log('API called successfully. Returned data: ' + JSON.stringify(result.data, null, 2));\n}, (error) => {\n console.error(error.response.body);\n});",
"name": "node-sdk-v3"
},
{
"language": "node",
"install": "npm install asana@1.0.5",
"code": "const asana = require('asana');\n\nconst client = asana.Client.create().useAccessToken('PERSONAL_ACCESS_TOKEN');\n\nclient.organizationexports.getOrganizationExport(organizationExportGid, {param: \"value\", param: \"value\", opt_pretty: true})\n .then((result) => {\n console.log(result);\n });",
"name": "node-sdk-v1"
},
{
"language": "python",
"install": "pip install asana",
"code": "import asana\nfrom asana.rest import ApiException\nfrom pprint import pprint\n\nconfiguration = asana.Configuration()\nconfiguration.access_token = '<YOUR_ACCESS_TOKEN>'\napi_client = asana.ApiClient(configuration)\n\n# create an instance of the API class\norganization_exports_api_instance = asana.OrganizationExportsApi(api_client)\norganization_export_gid = \"12345\" # str | Globally unique identifier for the organization export.\nopts = {\n 'opt_fields': \"created_at,download_url,organization,organization.name,state\", # list[str] | 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.\n}\n\ntry:\n # Get details on an org export request\n api_response = organization_exports_api_instance.get_organization_export(organization_export_gid, opts)\n pprint(api_response)\nexcept ApiException as e:\n print(\"Exception when calling OrganizationExportsApi->get_organization_export: %s\\n\" % e)",
"name": "python-sdk-v5"
},
{
"language": "python",
"install": "pip install asana==3.2.3",
"code": "import asana\n\nclient = asana.Client.access_token('PERSONAL_ACCESS_TOKEN')\n\nresult = client.organization_exports.get_organization_export(organization_export_gid, {'param': 'value', 'param': 'value'}, opt_pretty=True)",
"name": "python-sdk-v3"
},
{
"language": "php",
"install": "composer require asana/asana",
"code": "<?php\nrequire 'vendor/autoload.php';\n\n$client = Asana\\Client::accessToken('PERSONAL_ACCESS_TOKEN');\n\n$result = $client->organizationexports->getOrganizationExport($organization_export_gid, array('param' => 'value', 'param' => 'value'), array('opt_pretty' => 'true'))"
},
{
"language": "ruby",
"install": "gem install asana",
"code": "require 'asana'\n\nclient = Asana::Client.new do |c|\n c.authentication :access_token, 'PERSONAL_ACCESS_TOKEN'\nend\n\nresult = client.organization_exports.get_organization_export(organization_export_gid: 'organization_export_gid', param: \"value\", param: \"value\", options: {pretty: true})"
}
]
},
"x-purple-suite-runtime": "unavailable"
}
GET /api/1.0/portfolio_memberships
Get multiple portfolio memberships
Returns a list of portfolio memberships in compact representation. You must specify `portfolio`, `portfolio` and `user`, or `workspace` and `user`.
This operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.
Authentication
[
{
"personalAccessToken": []
},
{
"oauth2": []
}
]
Path-level parameters and metadata
{
"parameters": [
{
"$ref": "#/components/parameters/portfolio_query_param"
},
{
"$ref": "#/components/parameters/workspace_query_param"
},
{
"$ref": "#/components/parameters/user_query_param"
},
{
"$ref": "#/components/parameters/pretty"
},
{
"$ref": "#/components/parameters/limit"
},
{
"$ref": "#/components/parameters/offset"
}
]
}
Request, responses and operation details
{
"summary": "Get multiple portfolio memberships",
"description": "Returns a list of portfolio memberships in compact representation. You must specify `portfolio`, `portfolio` and `user`, or `workspace` and `user`.\n\nThis operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.",
"tags": [
"Portfolio memberships"
],
"operationId": "getPortfolioMemberships",
"parameters": [
{
"name": "opt_fields",
"in": "query",
"description": "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. Properties can include nested fields. To learn more, see the [input/output options guide](/docs/inputoutput-options#selecting-nested-fields).",
"required": false,
"example": [
"access_level",
"offset",
"path",
"portfolio",
"portfolio.name",
"portfolio.resource_subtype",
"uri",
"user",
"user.name"
],
"schema": {
"type": "array",
"items": {
"type": "string",
"enum": [
"access_level",
"offset",
"path",
"portfolio",
"portfolio.name",
"portfolio.resource_subtype",
"uri",
"user",
"user.name"
]
}
},
"style": "form",
"explode": false
}
],
"responses": {
"200": {
"description": "Successfully retrieved portfolio memberships.",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"type": "array",
"items": {
"$ref": "#/components/schemas/DeprecatedPortfolioMembershipCompact"
}
},
"next_page": {
"$ref": "#/components/schemas/NextPage"
}
}
}
}
}
},
"400": {
"$ref": "#/components/responses/BadRequest"
},
"401": {
"$ref": "#/components/responses/Unauthorized"
},
"403": {
"$ref": "#/components/responses/Forbidden"
},
"404": {
"$ref": "#/components/responses/NotFound"
},
"500": {
"$ref": "#/components/responses/InternalServerError"
}
},
"security": [
{
"personalAccessToken": []
},
{
"oauth2": []
}
],
"x-readme": {
"code-samples": [
{
"language": "java",
"install": "<dependency><groupId>com.asana</groupId><artifactId>asana</artifactId><version>1.0.0</version></dependency>",
"code": "import com.asana.Client;\n\nClient client = Client.accessToken(\"PERSONAL_ACCESS_TOKEN\");\n\nList<PortfolioMembership> result = client.portfoliomemberships.getPortfolioMemberships(user, workspace, portfolio)\n .option(\"pretty\", true)\n .execute();"
},
{
"language": "node",
"install": "npm install asana",
"code": "const Asana = require('asana');\n\nlet client = new Asana.ApiClient();\nclient.authentications.token.accessToken = '<YOUR_ACCESS_TOKEN>';\n\nlet portfolioMembershipsApiInstance = new Asana.PortfolioMembershipsApi(client);\nlet opts = { \n 'portfolio': \"12345\", \n 'workspace': \"12345\", \n 'user': \"me\", \n 'limit': 50, \n 'offset': \"eyJ0eXAiOJiKV1iQLCJhbGciOiJIUzI1NiJ9\", \n 'opt_fields': \"access_level,offset,path,portfolio,portfolio.name,portfolio.resource_subtype,uri,user,user.name\"\n};\nportfolioMembershipsApiInstance.getPortfolioMemberships(opts).then((result) => {\n console.log('API called successfully. Returned data: ' + JSON.stringify(result.data, null, 2));\n}, (error) => {\n console.error(error.response.body);\n});",
"name": "node-sdk-v3"
},
{
"language": "node",
"install": "npm install asana@1.0.5",
"code": "const asana = require('asana');\n\nconst client = asana.Client.create().useAccessToken('PERSONAL_ACCESS_TOKEN');\n\nclient.portfoliomemberships.getPortfolioMemberships({param: \"value\", param: \"value\", opt_pretty: true})\n .then((result) => {\n console.log(result);\n });",
"name": "node-sdk-v1"
},
{
"language": "python",
"install": "pip install asana",
"code": "import asana\nfrom asana.rest import ApiException\nfrom pprint import pprint\n\nconfiguration = asana.Configuration()\nconfiguration.access_token = '<YOUR_ACCESS_TOKEN>'\napi_client = asana.ApiClient(configuration)\n\n# create an instance of the API class\nportfolio_memberships_api_instance = asana.PortfolioMembershipsApi(api_client)\nopts = {\n 'portfolio': \"12345\", # str | The portfolio to filter results on.\n 'workspace': \"12345\", # str | The workspace to filter results on.\n 'user': \"me\", # str | A string identifying a user. This can either be the string \\\"me\\\", an email, or the gid of a user.\n 'limit': 50, # int | Results per page. The number of objects to return per page. The value must be between 1 and 100.\n 'offset': \"eyJ0eXAiOJiKV1iQLCJhbGciOiJIUzI1NiJ9\", # str | 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.*\n 'opt_fields': \"access_level,offset,path,portfolio,portfolio.name,portfolio.resource_subtype,uri,user,user.name\", # list[str] | 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.\n}\n\ntry:\n # Get multiple portfolio memberships\n api_response = portfolio_memberships_api_instance.get_portfolio_memberships(opts)\n for data in api_response:\n pprint(data)\nexcept ApiException as e:\n print(\"Exception when calling PortfolioMembershipsApi->get_portfolio_memberships: %s\\n\" % e)",
"name": "python-sdk-v5"
},
{
"language": "python",
"install": "pip install asana==3.2.3",
"code": "import asana\n\nclient = asana.Client.access_token('PERSONAL_ACCESS_TOKEN')\n\nresult = client.portfolio_memberships.get_portfolio_memberships({'param': 'value', 'param': 'value'}, opt_pretty=True)",
"name": "python-sdk-v3"
},
{
"language": "php",
"install": "composer require asana/asana",
"code": "<?php\nrequire 'vendor/autoload.php';\n\n$client = Asana\\Client::accessToken('PERSONAL_ACCESS_TOKEN');\n\n$result = $client->portfoliomemberships->getPortfolioMemberships(array('param' => 'value', 'param' => 'value'), array('opt_pretty' => 'true'))"
},
{
"language": "ruby",
"install": "gem install asana",
"code": "require 'asana'\n\nclient = Asana::Client.new do |c|\n c.authentication :access_token, 'PERSONAL_ACCESS_TOKEN'\nend\n\nresult = client.portfolio_memberships.get_portfolio_memberships(param: \"value\", param: \"value\", options: {pretty: true})"
}
]
},
"x-purple-suite-runtime": "unavailable"
}
GET /api/1.0/portfolio_memberships/{portfolio_membership_gid}
Get a portfolio membership
Returns the complete portfolio record for a single portfolio membership.
This operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.
Authentication
[
{
"personalAccessToken": []
},
{
"oauth2": []
}
]
Path-level parameters and metadata
{
"parameters": [
{
"$ref": "#/components/parameters/portfolio_membership_path_gid"
},
{
"$ref": "#/components/parameters/pretty"
}
]
}
Request, responses and operation details
{
"summary": "Get a portfolio membership",
"description": "Returns the complete portfolio record for a single portfolio membership.\n\nThis operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.",
"tags": [
"Portfolio memberships"
],
"operationId": "getPortfolioMembership",
"parameters": [
{
"name": "opt_fields",
"in": "query",
"description": "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. Properties can include nested fields. To learn more, see the [input/output options guide](/docs/inputoutput-options#selecting-nested-fields).",
"required": false,
"example": [
"access_level",
"portfolio",
"portfolio.name",
"portfolio.resource_subtype",
"user",
"user.name"
],
"schema": {
"type": "array",
"items": {
"type": "string",
"enum": [
"access_level",
"portfolio",
"portfolio.name",
"portfolio.resource_subtype",
"user",
"user.name"
]
}
},
"style": "form",
"explode": false
}
],
"responses": {
"200": {
"description": "Successfully retrieved the requested portfolio membership.",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"$ref": "#/components/schemas/DeprecatedPortfolioMembershipResponse"
}
}
}
}
}
},
"400": {
"$ref": "#/components/responses/BadRequest"
},
"401": {
"$ref": "#/components/responses/Unauthorized"
},
"403": {
"$ref": "#/components/responses/Forbidden"
},
"404": {
"$ref": "#/components/responses/NotFound"
},
"500": {
"$ref": "#/components/responses/InternalServerError"
}
},
"security": [
{
"personalAccessToken": []
},
{
"oauth2": []
}
],
"x-readme": {
"code-samples": [
{
"language": "java",
"install": "<dependency><groupId>com.asana</groupId><artifactId>asana</artifactId><version>1.0.0</version></dependency>",
"code": "import com.asana.Client;\n\nClient client = Client.accessToken(\"PERSONAL_ACCESS_TOKEN\");\n\nPortfolioMembership result = client.portfoliomemberships.getPortfolioMembership(portfolioMembershipGid)\n .option(\"pretty\", true)\n .execute();"
},
{
"language": "node",
"install": "npm install asana",
"code": "const Asana = require('asana');\n\nlet client = new Asana.ApiClient();\nclient.authentications.token.accessToken = '<YOUR_ACCESS_TOKEN>';\n\nlet portfolioMembershipsApiInstance = new Asana.PortfolioMembershipsApi(client);\nlet portfolio_membership_gid = \"1331\"; // String | \nlet opts = { \n 'opt_fields': \"access_level,portfolio,portfolio.name,portfolio.resource_subtype,user,user.name\"\n};\nportfolioMembershipsApiInstance.getPortfolioMembership(portfolio_membership_gid, opts).then((result) => {\n console.log('API called successfully. Returned data: ' + JSON.stringify(result.data, null, 2));\n}, (error) => {\n console.error(error.response.body);\n});",
"name": "node-sdk-v3"
},
{
"language": "node",
"install": "npm install asana@1.0.5",
"code": "const asana = require('asana');\n\nconst client = asana.Client.create().useAccessToken('PERSONAL_ACCESS_TOKEN');\n\nclient.portfoliomemberships.getPortfolioMembership(portfolioMembershipGid, {param: \"value\", param: \"value\", opt_pretty: true})\n .then((result) => {\n console.log(result);\n });",
"name": "node-sdk-v1"
},
{
"language": "python",
"install": "pip install asana",
"code": "import asana\nfrom asana.rest import ApiException\nfrom pprint import pprint\n\nconfiguration = asana.Configuration()\nconfiguration.access_token = '<YOUR_ACCESS_TOKEN>'\napi_client = asana.ApiClient(configuration)\n\n# create an instance of the API class\nportfolio_memberships_api_instance = asana.PortfolioMembershipsApi(api_client)\nportfolio_membership_gid = \"1331\" # str | \nopts = {\n 'opt_fields': \"access_level,portfolio,portfolio.name,portfolio.resource_subtype,user,user.name\", # list[str] | 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.\n}\n\ntry:\n # Get a portfolio membership\n api_response = portfolio_memberships_api_instance.get_portfolio_membership(portfolio_membership_gid, opts)\n pprint(api_response)\nexcept ApiException as e:\n print(\"Exception when calling PortfolioMembershipsApi->get_portfolio_membership: %s\\n\" % e)",
"name": "python-sdk-v5"
},
{
"language": "python",
"install": "pip install asana==3.2.3",
"code": "import asana\n\nclient = asana.Client.access_token('PERSONAL_ACCESS_TOKEN')\n\nresult = client.portfolio_memberships.get_portfolio_membership(portfolio_membership_gid, {'param': 'value', 'param': 'value'}, opt_pretty=True)",
"name": "python-sdk-v3"
},
{
"language": "php",
"install": "composer require asana/asana",
"code": "<?php\nrequire 'vendor/autoload.php';\n\n$client = Asana\\Client::accessToken('PERSONAL_ACCESS_TOKEN');\n\n$result = $client->portfoliomemberships->getPortfolioMembership($portfolio_membership_gid, array('param' => 'value', 'param' => 'value'), array('opt_pretty' => 'true'))"
},
{
"language": "ruby",
"install": "gem install asana",
"code": "require 'asana'\n\nclient = Asana::Client.new do |c|\n c.authentication :access_token, 'PERSONAL_ACCESS_TOKEN'\nend\n\nresult = client.portfolio_memberships.get_portfolio_membership(portfolio_membership_gid: 'portfolio_membership_gid', param: \"value\", param: \"value\", options: {pretty: true})"
}
]
},
"x-purple-suite-runtime": "unavailable"
}
GET /api/1.0/portfolios/{portfolio_gid}/portfolio_memberships
Get memberships from a portfolio
Returns the compact portfolio membership records for the portfolio.
This operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.
Authentication
[
{
"personalAccessToken": []
},
{
"oauth2": []
}
]
Path-level parameters and metadata
{
"parameters": [
{
"$ref": "#/components/parameters/portfolio_path_gid"
},
{
"$ref": "#/components/parameters/user_query_param"
},
{
"$ref": "#/components/parameters/pretty"
},
{
"$ref": "#/components/parameters/limit"
},
{
"$ref": "#/components/parameters/offset"
}
]
}
Request, responses and operation details
{
"summary": "Get memberships from a portfolio",
"description": "Returns the compact portfolio membership records for the portfolio.\n\nThis operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.",
"tags": [
"Portfolio memberships"
],
"operationId": "getPortfolioMembershipsForPortfolio",
"parameters": [
{
"name": "opt_fields",
"in": "query",
"description": "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. Properties can include nested fields. To learn more, see the [input/output options guide](/docs/inputoutput-options#selecting-nested-fields).",
"required": false,
"example": [
"access_level",
"offset",
"path",
"portfolio",
"portfolio.name",
"portfolio.resource_subtype",
"uri",
"user",
"user.name"
],
"schema": {
"type": "array",
"items": {
"type": "string",
"enum": [
"access_level",
"offset",
"path",
"portfolio",
"portfolio.name",
"portfolio.resource_subtype",
"uri",
"user",
"user.name"
]
}
},
"style": "form",
"explode": false
}
],
"responses": {
"200": {
"description": "Successfully retrieved the requested portfolio's memberships.",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"type": "array",
"items": {
"$ref": "#/components/schemas/DeprecatedPortfolioMembershipCompact"
}
},
"next_page": {
"$ref": "#/components/schemas/NextPage"
}
}
}
}
}
},
"400": {
"$ref": "#/components/responses/BadRequest"
},
"401": {
"$ref": "#/components/responses/Unauthorized"
},
"403": {
"$ref": "#/components/responses/Forbidden"
},
"404": {
"$ref": "#/components/responses/NotFound"
},
"500": {
"$ref": "#/components/responses/InternalServerError"
}
},
"security": [
{
"personalAccessToken": []
},
{
"oauth2": []
}
],
"x-readme": {
"code-samples": [
{
"language": "java",
"install": "<dependency><groupId>com.asana</groupId><artifactId>asana</artifactId><version>1.0.0</version></dependency>",
"code": "import com.asana.Client;\n\nClient client = Client.accessToken(\"PERSONAL_ACCESS_TOKEN\");\n\nList<PortfolioMembership> result = client.portfoliomemberships.getPortfolioMembershipsForPortfolio(portfolioGid, user)\n .option(\"pretty\", true)\n .execute();"
},
{
"language": "node",
"install": "npm install asana",
"code": "const Asana = require('asana');\n\nlet client = new Asana.ApiClient();\nclient.authentications.token.accessToken = '<YOUR_ACCESS_TOKEN>';\n\nlet portfolioMembershipsApiInstance = new Asana.PortfolioMembershipsApi(client);\nlet portfolio_gid = \"12345\"; // String | Globally unique identifier for the portfolio.\nlet opts = { \n 'user': \"me\", \n 'limit': 50, \n 'offset': \"eyJ0eXAiOJiKV1iQLCJhbGciOiJIUzI1NiJ9\", \n 'opt_fields': \"access_level,offset,path,portfolio,portfolio.name,portfolio.resource_subtype,uri,user,user.name\"\n};\nportfolioMembershipsApiInstance.getPortfolioMembershipsForPortfolio(portfolio_gid, opts).then((result) => {\n console.log('API called successfully. Returned data: ' + JSON.stringify(result.data, null, 2));\n}, (error) => {\n console.error(error.response.body);\n});",
"name": "node-sdk-v3"
},
{
"language": "node",
"install": "npm install asana@1.0.5",
"code": "const asana = require('asana');\n\nconst client = asana.Client.create().useAccessToken('PERSONAL_ACCESS_TOKEN');\n\nclient.portfoliomemberships.getPortfolioMembershipsForPortfolio(portfolioGid, {param: \"value\", param: \"value\", opt_pretty: true})\n .then((result) => {\n console.log(result);\n });",
"name": "node-sdk-v1"
},
{
"language": "python",
"install": "pip install asana",
"code": "import asana\nfrom asana.rest import ApiException\nfrom pprint import pprint\n\nconfiguration = asana.Configuration()\nconfiguration.access_token = '<YOUR_ACCESS_TOKEN>'\napi_client = asana.ApiClient(configuration)\n\n# create an instance of the API class\nportfolio_memberships_api_instance = asana.PortfolioMembershipsApi(api_client)\nportfolio_gid = \"12345\" # str | Globally unique identifier for the portfolio.\nopts = {\n 'user': \"me\", # str | A string identifying a user. This can either be the string \\\"me\\\", an email, or the gid of a user.\n 'limit': 50, # int | Results per page. The number of objects to return per page. The value must be between 1 and 100.\n 'offset': \"eyJ0eXAiOJiKV1iQLCJhbGciOiJIUzI1NiJ9\", # str | 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.*\n 'opt_fields': \"access_level,offset,path,portfolio,portfolio.name,portfolio.resource_subtype,uri,user,user.name\", # list[str] | 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.\n}\n\ntry:\n # Get memberships from a portfolio\n api_response = portfolio_memberships_api_instance.get_portfolio_memberships_for_portfolio(portfolio_gid, opts)\n for data in api_response:\n pprint(data)\nexcept ApiException as e:\n print(\"Exception when calling PortfolioMembershipsApi->get_portfolio_memberships_for_portfolio: %s\\n\" % e)",
"name": "python-sdk-v5"
},
{
"language": "python",
"install": "pip install asana==3.2.3",
"code": "import asana\n\nclient = asana.Client.access_token('PERSONAL_ACCESS_TOKEN')\n\nresult = client.portfolio_memberships.get_portfolio_memberships_for_portfolio(portfolio_gid, {'param': 'value', 'param': 'value'}, opt_pretty=True)",
"name": "python-sdk-v3"
},
{
"language": "php",
"install": "composer require asana/asana",
"code": "<?php\nrequire 'vendor/autoload.php';\n\n$client = Asana\\Client::accessToken('PERSONAL_ACCESS_TOKEN');\n\n$result = $client->portfoliomemberships->getPortfolioMembershipsForPortfolio($portfolio_gid, array('param' => 'value', 'param' => 'value'), array('opt_pretty' => 'true'))"
},
{
"language": "ruby",
"install": "gem install asana",
"code": "require 'asana'\n\nclient = Asana::Client.new do |c|\n c.authentication :access_token, 'PERSONAL_ACCESS_TOKEN'\nend\n\nresult = client.portfolio_memberships.get_portfolio_memberships_for_portfolio(portfolio_gid: 'portfolio_gid', param: \"value\", param: \"value\", options: {pretty: true})"
}
]
},
"x-purple-suite-runtime": "unavailable"
}
GET /api/1.0/portfolios
Get multiple portfolios
<b>Required scope: </b><code>portfolios:read</code>
Returns a list of the portfolios in compact representation.
The portfolios are filtered based on the following criteria:
- If the request is made from a regular API user (PAT or OAuth), then only portfolios owned by the current API user are returned.
- If the request is made from a Service Account without the `owner` parameter, then all portfolios across the workspace are returned.
- If the request is made from a Service Account with the `owner` parameter, then only portfolios owned by the specified user are returned.
This operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.
Authentication
[
{
"personalAccessToken": []
},
{
"oauth2": [
"portfolios:read"
]
}
]
Path-level parameters and metadata
{
"parameters": [
{
"$ref": "#/components/parameters/pretty"
}
]
}
Request, responses and operation details
{
"summary": "Get multiple portfolios",
"description": "<b>Required scope: </b><code>portfolios:read</code>\n\nReturns a list of the portfolios in compact representation.\nThe portfolios are filtered based on the following criteria:\n- If the request is made from a regular API user (PAT or OAuth), then only portfolios owned by the current API user are returned.\n- If the request is made from a Service Account without the `owner` parameter, then all portfolios across the workspace are returned.\n- If the request is made from a Service Account with the `owner` parameter, then only portfolios owned by the specified user are returned.\n\nThis operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.",
"tags": [
"Portfolios"
],
"operationId": "getPortfolios",
"parameters": [
{
"$ref": "#/components/parameters/limit"
},
{
"$ref": "#/components/parameters/offset"
},
{
"name": "workspace",
"in": "query",
"required": true,
"description": "The workspace or organization to filter portfolios on.",
"schema": {
"type": "string"
},
"example": "1331"
},
{
"name": "owner",
"in": "query",
"required": false,
"description": "The user who owns the portfolio. Currently, API users can only get a list of portfolios that they themselves own, unless the request is made from a Service Account. In the case of a Service Account, if this parameter is specified, then all portfolios owned by this parameter are returned. Otherwise, all portfolios across the workspace are returned.",
"schema": {
"type": "string"
},
"example": "14916"
},
{
"$ref": "#/components/parameters/custom_type_query_param"
},
{
"name": "opt_fields",
"in": "query",
"description": "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. Properties can include nested fields. To learn more, see the [input/output options guide](/docs/inputoutput-options#selecting-nested-fields).",
"required": false,
"example": [
"archived",
"color",
"created_at",
"created_by",
"created_by.name",
"current_status_update",
"current_status_update.resource_subtype",
"current_status_update.title",
"custom_field_settings",
"custom_field_settings.custom_field",
"custom_field_settings.custom_field.asana_created_field",
"custom_field_settings.custom_field.created_by",
"custom_field_settings.custom_field.created_by.name",
"custom_field_settings.custom_field.currency_code",
"custom_field_settings.custom_field.custom_label",
"custom_field_settings.custom_field.custom_label_position",
"custom_field_settings.custom_field.date_value",
"custom_field_settings.custom_field.date_value.date",
"custom_field_settings.custom_field.date_value.date_time",
"custom_field_settings.custom_field.default_access_level",
"custom_field_settings.custom_field.description",
"custom_field_settings.custom_field.display_value",
"custom_field_settings.custom_field.enabled",
"custom_field_settings.custom_field.enum_options",
"custom_field_settings.custom_field.enum_options.color",
"custom_field_settings.custom_field.enum_options.enabled",
"custom_field_settings.custom_field.enum_options.name",
"custom_field_settings.custom_field.enum_value",
"custom_field_settings.custom_field.enum_value.color",
"custom_field_settings.custom_field.enum_value.enabled",
"custom_field_settings.custom_field.enum_value.name",
"custom_field_settings.custom_field.format",
"custom_field_settings.custom_field.has_notifications_enabled",
"custom_field_settings.custom_field.html_text_value",
"custom_field_settings.custom_field.id_prefix",
"custom_field_settings.custom_field.input_restrictions",
"custom_field_settings.custom_field.is_formula_field",
"custom_field_settings.custom_field.is_global_to_workspace",
"custom_field_settings.custom_field.is_value_read_only",
"custom_field_settings.custom_field.multi_enum_values",
"custom_field_settings.custom_field.multi_enum_values.color",
"custom_field_settings.custom_field.multi_enum_values.enabled",
"custom_field_settings.custom_field.multi_enum_values.name",
"custom_field_settings.custom_field.name",
"custom_field_settings.custom_field.number_value",
"custom_field_settings.custom_field.people_value",
"custom_field_settings.custom_field.people_value.name",
"custom_field_settings.custom_field.precision",
"custom_field_settings.custom_field.privacy_setting",
"custom_field_settings.custom_field.reference_value",
"custom_field_settings.custom_field.reference_value.name",
"custom_field_settings.custom_field.representation_type",
"custom_field_settings.custom_field.resource_subtype",
"custom_field_settings.custom_field.text_value",
"custom_field_settings.custom_field.type",
"custom_field_settings.is_important",
"custom_field_settings.parent",
"custom_field_settings.parent.name",
"custom_field_settings.parent.resource_subtype",
"custom_field_settings.project",
"custom_field_settings.project.name",
"custom_field_settings.project.resource_subtype",
"custom_fields",
"custom_fields.date_value",
"custom_fields.date_value.date",
"custom_fields.date_value.date_time",
"custom_fields.display_value",
"custom_fields.enabled",
"custom_fields.enum_options",
"custom_fields.enum_options.color",
"custom_fields.enum_options.enabled",
"custom_fields.enum_options.name",
"custom_fields.enum_value",
"custom_fields.enum_value.color",
"custom_fields.enum_value.enabled",
"custom_fields.enum_value.name",
"custom_fields.id_prefix",
"custom_fields.input_restrictions",
"custom_fields.is_formula_field",
"custom_fields.multi_enum_values",
"custom_fields.multi_enum_values.color",
"custom_fields.multi_enum_values.enabled",
"custom_fields.multi_enum_values.name",
"custom_fields.name",
"custom_fields.number_value",
"custom_fields.representation_type",
"custom_fields.text_value",
"custom_fields.type",
"custom_type",
"custom_type.asana_created_type_identifier",
"custom_type.name",
"default_access_level",
"due_on",
"members",
"members.name",
"name",
"offset",
"owner",
"owner.name",
"path",
"permalink_url",
"privacy_setting",
"project_templates",
"project_templates.name",
"public",
"resource_subtype",
"start_on",
"uri",
"workspace",
"workspace.name"
],
"schema": {
"type": "array",
"items": {
"type": "string",
"enum": [
"archived",
"color",
"created_at",
"created_by",
"created_by.name",
"current_status_update",
"current_status_update.resource_subtype",
"current_status_update.title",
"custom_field_settings",
"custom_field_settings.custom_field",
"custom_field_settings.custom_field.asana_created_field",
"custom_field_settings.custom_field.created_by",
"custom_field_settings.custom_field.created_by.name",
"custom_field_settings.custom_field.currency_code",
"custom_field_settings.custom_field.custom_label",
"custom_field_settings.custom_field.custom_label_position",
"custom_field_settings.custom_field.date_value",
"custom_field_settings.custom_field.date_value.date",
"custom_field_settings.custom_field.date_value.date_time",
"custom_field_settings.custom_field.default_access_level",
"custom_field_settings.custom_field.description",
"custom_field_settings.custom_field.display_value",
"custom_field_settings.custom_field.enabled",
"custom_field_settings.custom_field.enum_options",
"custom_field_settings.custom_field.enum_options.color",
"custom_field_settings.custom_field.enum_options.enabled",
"custom_field_settings.custom_field.enum_options.name",
"custom_field_settings.custom_field.enum_value",
"custom_field_settings.custom_field.enum_value.color",
"custom_field_settings.custom_field.enum_value.enabled",
"custom_field_settings.custom_field.enum_value.name",
"custom_field_settings.custom_field.format",
"custom_field_settings.custom_field.has_notifications_enabled",
"custom_field_settings.custom_field.html_text_value",
"custom_field_settings.custom_field.id_prefix",
"custom_field_settings.custom_field.input_restrictions",
"custom_field_settings.custom_field.is_formula_field",
"custom_field_settings.custom_field.is_global_to_workspace",
"custom_field_settings.custom_field.is_value_read_only",
"custom_field_settings.custom_field.multi_enum_values",
"custom_field_settings.custom_field.multi_enum_values.color",
"custom_field_settings.custom_field.multi_enum_values.enabled",
"custom_field_settings.custom_field.multi_enum_values.name",
"custom_field_settings.custom_field.name",
"custom_field_settings.custom_field.number_value",
"custom_field_settings.custom_field.people_value",
"custom_field_settings.custom_field.people_value.name",
"custom_field_settings.custom_field.precision",
"custom_field_settings.custom_field.privacy_setting",
"custom_field_settings.custom_field.reference_value",
"custom_field_settings.custom_field.reference_value.name",
"custom_field_settings.custom_field.representation_type",
"custom_field_settings.custom_field.resource_subtype",
"custom_field_settings.custom_field.text_value",
"custom_field_settings.custom_field.type",
"custom_field_settings.is_important",
"custom_field_settings.parent",
"custom_field_settings.parent.name",
"custom_field_settings.parent.resource_subtype",
"custom_field_settings.project",
"custom_field_settings.project.name",
"custom_field_settings.project.resource_subtype",
"custom_fields",
"custom_fields.date_value",
"custom_fields.date_value.date",
"custom_fields.date_value.date_time",
"custom_fields.display_value",
"custom_fields.enabled",
"custom_fields.enum_options",
"custom_fields.enum_options.color",
"custom_fields.enum_options.enabled",
"custom_fields.enum_options.name",
"custom_fields.enum_value",
"custom_fields.enum_value.color",
"custom_fields.enum_value.enabled",
"custom_fields.enum_value.name",
"custom_fields.id_prefix",
"custom_fields.input_restrictions",
"custom_fields.is_formula_field",
"custom_fields.multi_enum_values",
"custom_fields.multi_enum_values.color",
"custom_fields.multi_enum_values.enabled",
"custom_fields.multi_enum_values.name",
"custom_fields.name",
"custom_fields.number_value",
"custom_fields.representation_type",
"custom_fields.text_value",
"custom_fields.type",
"custom_type",
"custom_type.asana_created_type_identifier",
"custom_type.name",
"default_access_level",
"due_on",
"members",
"members.name",
"name",
"offset",
"owner",
"owner.name",
"path",
"permalink_url",
"privacy_setting",
"project_templates",
"project_templates.name",
"public",
"resource_subtype",
"start_on",
"uri",
"workspace",
"workspace.name"
]
}
},
"style": "form",
"explode": false
}
],
"responses": {
"200": {
"description": "Successfully retrieved portfolios.",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"type": "array",
"items": {
"$ref": "#/components/schemas/PortfolioCompact"
}
},
"next_page": {
"$ref": "#/components/schemas/NextPage"
}
}
}
}
}
},
"400": {
"$ref": "#/components/responses/BadRequest"
},
"401": {
"$ref": "#/components/responses/Unauthorized"
},
"403": {
"$ref": "#/components/responses/Forbidden"
},
"404": {
"$ref": "#/components/responses/NotFound"
},
"500": {
"$ref": "#/components/responses/InternalServerError"
}
},
"security": [
{
"personalAccessToken": []
},
{
"oauth2": [
"portfolios:read"
]
}
],
"x-readme": {
"code-samples": [
{
"language": "java",
"install": "<dependency><groupId>com.asana</groupId><artifactId>asana</artifactId><version>1.0.0</version></dependency>",
"code": "import com.asana.Client;\n\nClient client = Client.accessToken(\"PERSONAL_ACCESS_TOKEN\");\n\nList<Portfolio> result = client.portfolios.getPortfolios(owner, workspace)\n .option(\"pretty\", true)\n .execute();"
},
{
"language": "node",
"install": "npm install asana",
"code": "const Asana = require('asana');\n\nlet client = new Asana.ApiClient();\nclient.authentications.token.accessToken = '<YOUR_ACCESS_TOKEN>';\n\nlet portfoliosApiInstance = new Asana.PortfoliosApi(client);\nlet workspace = \"1331\"; // String | The workspace or organization to filter portfolios on.\nlet opts = { \n 'limit': 50, \n 'offset': \"eyJ0eXAiOJiKV1iQLCJhbGciOiJIUzI1NiJ9\", \n 'owner': \"14916\", \n 'custom_type': \"12345\", \n 'opt_fields': \"archived,color,created_at,created_by,created_by.name,current_status_update,current_status_update.resource_subtype,current_status_update.title,custom_field_settings,custom_field_settings.custom_field,custom_field_settings.custom_field.asana_created_field,custom_field_settings.custom_field.created_by,custom_field_settings.custom_field.created_by.name,custom_field_settings.custom_field.currency_code,custom_field_settings.custom_field.custom_label,custom_field_settings.custom_field.custom_label_position,custom_field_settings.custom_field.date_value,custom_field_settings.custom_field.date_value.date,custom_field_settings.custom_field.date_value.date_time,custom_field_settings.custom_field.default_access_level,custom_field_settings.custom_field.description,custom_field_settings.custom_field.display_value,custom_field_settings.custom_field.enabled,custom_field_settings.custom_field.enum_options,custom_field_settings.custom_field.enum_options.color,custom_field_settings.custom_field.enum_options.enabled,custom_field_settings.custom_field.enum_options.name,custom_field_settings.custom_field.enum_value,custom_field_settings.custom_field.enum_value.color,custom_field_settings.custom_field.enum_value.enabled,custom_field_settings.custom_field.enum_value.name,custom_field_settings.custom_field.format,custom_field_settings.custom_field.has_notifications_enabled,custom_field_settings.custom_field.html_text_value,custom_field_settings.custom_field.id_prefix,custom_field_settings.custom_field.input_restrictions,custom_field_settings.custom_field.is_formula_field,custom_field_settings.custom_field.is_global_to_workspace,custom_field_settings.custom_field.is_value_read_only,custom_field_settings.custom_field.multi_enum_values,custom_field_settings.custom_field.multi_enum_values.color,custom_field_settings.custom_field.multi_enum_values.enabled,custom_field_settings.custom_field.multi_enum_values.name,custom_field_settings.custom_field.name,custom_field_settings.custom_field.number_value,custom_field_settings.custom_field.people_value,custom_field_settings.custom_field.people_value.name,custom_field_settings.custom_field.precision,custom_field_settings.custom_field.privacy_setting,custom_field_settings.custom_field.reference_value,custom_field_settings.custom_field.reference_value.name,custom_field_settings.custom_field.representation_type,custom_field_settings.custom_field.resource_subtype,custom_field_settings.custom_field.text_value,custom_field_settings.custom_field.type,custom_field_settings.is_important,custom_field_settings.parent,custom_field_settings.parent.name,custom_field_settings.parent.resource_subtype,custom_field_settings.project,custom_field_settings.project.name,custom_field_settings.project.resource_subtype,custom_fields,custom_fields.date_value,custom_fields.date_value.date,custom_fields.date_value.date_time,custom_fields.display_value,custom_fields.enabled,custom_fields.enum_options,custom_fields.enum_options.color,custom_fields.enum_options.enabled,custom_fields.enum_options.name,custom_fields.enum_value,custom_fields.enum_value.color,custom_fields.enum_value.enabled,custom_fields.enum_value.name,custom_fields.id_prefix,custom_fields.input_restrictions,custom_fields.is_formula_field,custom_fields.multi_enum_values,custom_fields.multi_enum_values.color,custom_fields.multi_enum_values.enabled,custom_fields.multi_enum_values.name,custom_fields.name,custom_fields.number_value,custom_fields.representation_type,custom_fields.text_value,custom_fields.type,custom_type,custom_type.asana_created_type_identifier,custom_type.name,default_access_level,due_on,members,members.name,name,offset,owner,owner.name,path,permalink_url,privacy_setting,project_templates,project_templates.name,public,resource_subtype,start_on,uri,workspace,workspace.name\"\n};\nportfoliosApiInstance.getPortfolios(workspace, opts).then((result) => {\n console.log('API called successfully. Returned data: ' + JSON.stringify(result.data, null, 2));\n}, (error) => {\n console.error(error.response.body);\n});",
"name": "node-sdk-v3"
},
{
"language": "node",
"install": "npm install asana@1.0.5",
"code": "const asana = require('asana');\n\nconst client = asana.Client.create().useAccessToken('PERSONAL_ACCESS_TOKEN');\n\nclient.portfolios.getPortfolios({param: \"value\", param: \"value\", opt_pretty: true})\n .then((result) => {\n console.log(result);\n });",
"name": "node-sdk-v1"
},
{
"language": "python",
"install": "pip install asana",
"code": "import asana\nfrom asana.rest import ApiException\nfrom pprint import pprint\n\nconfiguration = asana.Configuration()\nconfiguration.access_token = '<YOUR_ACCESS_TOKEN>'\napi_client = asana.ApiClient(configuration)\n\n# create an instance of the API class\nportfolios_api_instance = asana.PortfoliosApi(api_client)\nworkspace = \"1331\" # str | The workspace or organization to filter portfolios on.\nopts = {\n 'limit': 50, # int | Results per page. The number of objects to return per page. The value must be between 1 and 100.\n 'offset': \"eyJ0eXAiOJiKV1iQLCJhbGciOiJIUzI1NiJ9\", # str | 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.*\n 'owner': \"14916\", # str | The user who owns the portfolio. Currently, API users can only get a list of portfolios that they themselves own, unless the request is made from a Service Account. In the case of a Service Account, if this parameter is specified, then all portfolios owned by this parameter are returned. Otherwise, all portfolios across the workspace are returned.\n 'custom_type': \"12345\", # str | Filter results by custom type. Provide a custom type GID to return only objects of that custom type (an unknown GID returns `400`). Provide an empty string to return only objects with no custom type assigned. If this parameter is omitted, results are not filtered by custom type.\n 'opt_fields': \"archived,color,created_at,created_by,created_by.name,current_status_update,current_status_update.resource_subtype,current_status_update.title,custom_field_settings,custom_field_settings.custom_field,custom_field_settings.custom_field.asana_created_field,custom_field_settings.custom_field.created_by,custom_field_settings.custom_field.created_by.name,custom_field_settings.custom_field.currency_code,custom_field_settings.custom_field.custom_label,custom_field_settings.custom_field.custom_label_position,custom_field_settings.custom_field.date_value,custom_field_settings.custom_field.date_value.date,custom_field_settings.custom_field.date_value.date_time,custom_field_settings.custom_field.default_access_level,custom_field_settings.custom_field.description,custom_field_settings.custom_field.display_value,custom_field_settings.custom_field.enabled,custom_field_settings.custom_field.enum_options,custom_field_settings.custom_field.enum_options.color,custom_field_settings.custom_field.enum_options.enabled,custom_field_settings.custom_field.enum_options.name,custom_field_settings.custom_field.enum_value,custom_field_settings.custom_field.enum_value.color,custom_field_settings.custom_field.enum_value.enabled,custom_field_settings.custom_field.enum_value.name,custom_field_settings.custom_field.format,custom_field_settings.custom_field.has_notifications_enabled,custom_field_settings.custom_field.html_text_value,custom_field_settings.custom_field.id_prefix,custom_field_settings.custom_field.input_restrictions,custom_field_settings.custom_field.is_formula_field,custom_field_settings.custom_field.is_global_to_workspace,custom_field_settings.custom_field.is_value_read_only,custom_field_settings.custom_field.multi_enum_values,custom_field_settings.custom_field.multi_enum_values.color,custom_field_settings.custom_field.multi_enum_values.enabled,custom_field_settings.custom_field.multi_enum_values.name,custom_field_settings.custom_field.name,custom_field_settings.custom_field.number_value,custom_field_settings.custom_field.people_value,custom_field_settings.custom_field.people_value.name,custom_field_settings.custom_field.precision,custom_field_settings.custom_field.privacy_setting,custom_field_settings.custom_field.reference_value,custom_field_settings.custom_field.reference_value.name,custom_field_settings.custom_field.representation_type,custom_field_settings.custom_field.resource_subtype,custom_field_settings.custom_field.text_value,custom_field_settings.custom_field.type,custom_field_settings.is_important,custom_field_settings.parent,custom_field_settings.parent.name,custom_field_settings.parent.resource_subtype,custom_field_settings.project,custom_field_settings.project.name,custom_field_settings.project.resource_subtype,custom_fields,custom_fields.date_value,custom_fields.date_value.date,custom_fields.date_value.date_time,custom_fields.display_value,custom_fields.enabled,custom_fields.enum_options,custom_fields.enum_options.color,custom_fields.enum_options.enabled,custom_fields.enum_options.name,custom_fields.enum_value,custom_fields.enum_value.color,custom_fields.enum_value.enabled,custom_fields.enum_value.name,custom_fields.id_prefix,custom_fields.input_restrictions,custom_fields.is_formula_field,custom_fields.multi_enum_values,custom_fields.multi_enum_values.color,custom_fields.multi_enum_values.enabled,custom_fields.multi_enum_values.name,custom_fields.name,custom_fields.number_value,custom_fields.representation_type,custom_fields.text_value,custom_fields.type,custom_type,custom_type.asana_created_type_identifier,custom_type.name,default_access_level,due_on,members,members.name,name,offset,owner,owner.name,path,permalink_url,privacy_setting,project_templates,project_templates.name,public,resource_subtype,start_on,uri,workspace,workspace.name\", # list[str] | 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.\n}\n\ntry:\n # Get multiple portfolios\n api_response = portfolios_api_instance.get_portfolios(workspace, opts)\n for data in api_response:\n pprint(data)\nexcept ApiException as e:\n print(\"Exception when calling PortfoliosApi->get_portfolios: %s\\n\" % e)",
"name": "python-sdk-v5"
},
{
"language": "python",
"install": "pip install asana==3.2.3",
"code": "import asana\n\nclient = asana.Client.access_token('PERSONAL_ACCESS_TOKEN')\n\nresult = client.portfolios.get_portfolios({'param': 'value', 'param': 'value'}, opt_pretty=True)",
"name": "python-sdk-v3"
},
{
"language": "php",
"install": "composer require asana/asana",
"code": "<?php\nrequire 'vendor/autoload.php';\n\n$client = Asana\\Client::accessToken('PERSONAL_ACCESS_TOKEN');\n\n$result = $client->portfolios->getPortfolios(array('param' => 'value', 'param' => 'value'), array('opt_pretty' => 'true'))"
},
{
"language": "ruby",
"install": "gem install asana",
"code": "require 'asana'\n\nclient = Asana::Client.new do |c|\n c.authentication :access_token, 'PERSONAL_ACCESS_TOKEN'\nend\n\nresult = client.portfolios.get_portfolios(workspace: ''workspace_example'', owner: ''owner_example'', param: \"value\", param: \"value\", options: {pretty: true})"
}
]
},
"x-purple-suite-runtime": "unavailable"
}
POST /api/1.0/portfolios
Create a portfolio
<b>Required scope: </b><code>portfolios:write</code>
Creates a new portfolio in the given workspace with the supplied name.
Note that portfolios created in the Asana UI may have some state
(like the “Priority” custom field) which is automatically added
to the portfolio when it is created. Portfolios created via our
API will *not* be created with the same initial state to allow
integrations to create their own starting state on a portfolio.
This operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.
Authentication
[
{
"personalAccessToken": []
},
{
"oauth2": [
"portfolios:write"
]
}
]
Path-level parameters and metadata
{
"parameters": [
{
"$ref": "#/components/parameters/pretty"
}
]
}
Request, responses and operation details
{
"summary": "Create a portfolio",
"description": "<b>Required scope: </b><code>portfolios:write</code>\n\nCreates a new portfolio in the given workspace with the supplied name.\n\nNote that portfolios created in the Asana UI may have some state\n(like the “Priority” custom field) which is automatically added\nto the portfolio when it is created. Portfolios created via our\nAPI will *not* be created with the same initial state to allow\nintegrations to create their own starting state on a portfolio.\n\nThis operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.",
"tags": [
"Portfolios"
],
"operationId": "createPortfolio",
"parameters": [
{
"name": "opt_fields",
"in": "query",
"description": "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. Properties can include nested fields. To learn more, see the [input/output options guide](/docs/inputoutput-options#selecting-nested-fields).",
"required": false,
"example": [
"archived",
"color",
"created_at",
"created_by",
"created_by.name",
"current_status_update",
"current_status_update.resource_subtype",
"current_status_update.title",
"custom_field_settings",
"custom_field_settings.custom_field",
"custom_field_settings.custom_field.asana_created_field",
"custom_field_settings.custom_field.created_by",
"custom_field_settings.custom_field.created_by.name",
"custom_field_settings.custom_field.currency_code",
"custom_field_settings.custom_field.custom_label",
"custom_field_settings.custom_field.custom_label_position",
"custom_field_settings.custom_field.date_value",
"custom_field_settings.custom_field.date_value.date",
"custom_field_settings.custom_field.date_value.date_time",
"custom_field_settings.custom_field.default_access_level",
"custom_field_settings.custom_field.description",
"custom_field_settings.custom_field.display_value",
"custom_field_settings.custom_field.enabled",
"custom_field_settings.custom_field.enum_options",
"custom_field_settings.custom_field.enum_options.color",
"custom_field_settings.custom_field.enum_options.enabled",
"custom_field_settings.custom_field.enum_options.name",
"custom_field_settings.custom_field.enum_value",
"custom_field_settings.custom_field.enum_value.color",
"custom_field_settings.custom_field.enum_value.enabled",
"custom_field_settings.custom_field.enum_value.name",
"custom_field_settings.custom_field.format",
"custom_field_settings.custom_field.has_notifications_enabled",
"custom_field_settings.custom_field.html_text_value",
"custom_field_settings.custom_field.id_prefix",
"custom_field_settings.custom_field.input_restrictions",
"custom_field_settings.custom_field.is_formula_field",
"custom_field_settings.custom_field.is_global_to_workspace",
"custom_field_settings.custom_field.is_value_read_only",
"custom_field_settings.custom_field.multi_enum_values",
"custom_field_settings.custom_field.multi_enum_values.color",
"custom_field_settings.custom_field.multi_enum_values.enabled",
"custom_field_settings.custom_field.multi_enum_values.name",
"custom_field_settings.custom_field.name",
"custom_field_settings.custom_field.number_value",
"custom_field_settings.custom_field.people_value",
"custom_field_settings.custom_field.people_value.name",
"custom_field_settings.custom_field.precision",
"custom_field_settings.custom_field.privacy_setting",
"custom_field_settings.custom_field.reference_value",
"custom_field_settings.custom_field.reference_value.name",
"custom_field_settings.custom_field.representation_type",
"custom_field_settings.custom_field.resource_subtype",
"custom_field_settings.custom_field.text_value",
"custom_field_settings.custom_field.type",
"custom_field_settings.is_important",
"custom_field_settings.parent",
"custom_field_settings.parent.name",
"custom_field_settings.parent.resource_subtype",
"custom_field_settings.project",
"custom_field_settings.project.name",
"custom_field_settings.project.resource_subtype",
"custom_fields",
"custom_fields.date_value",
"custom_fields.date_value.date",
"custom_fields.date_value.date_time",
"custom_fields.display_value",
"custom_fields.enabled",
"custom_fields.enum_options",
"custom_fields.enum_options.color",
"custom_fields.enum_options.enabled",
"custom_fields.enum_options.name",
"custom_fields.enum_value",
"custom_fields.enum_value.color",
"custom_fields.enum_value.enabled",
"custom_fields.enum_value.name",
"custom_fields.id_prefix",
"custom_fields.input_restrictions",
"custom_fields.is_formula_field",
"custom_fields.multi_enum_values",
"custom_fields.multi_enum_values.color",
"custom_fields.multi_enum_values.enabled",
"custom_fields.multi_enum_values.name",
"custom_fields.name",
"custom_fields.number_value",
"custom_fields.representation_type",
"custom_fields.text_value",
"custom_fields.type",
"custom_type",
"custom_type.asana_created_type_identifier",
"custom_type.name",
"default_access_level",
"due_on",
"members",
"members.name",
"name",
"owner",
"owner.name",
"permalink_url",
"privacy_setting",
"project_templates",
"project_templates.name",
"public",
"resource_subtype",
"start_on",
"workspace",
"workspace.name"
],
"schema": {
"type": "array",
"items": {
"type": "string",
"enum": [
"archived",
"color",
"created_at",
"created_by",
"created_by.name",
"current_status_update",
"current_status_update.resource_subtype",
"current_status_update.title",
"custom_field_settings",
"custom_field_settings.custom_field",
"custom_field_settings.custom_field.asana_created_field",
"custom_field_settings.custom_field.created_by",
"custom_field_settings.custom_field.created_by.name",
"custom_field_settings.custom_field.currency_code",
"custom_field_settings.custom_field.custom_label",
"custom_field_settings.custom_field.custom_label_position",
"custom_field_settings.custom_field.date_value",
"custom_field_settings.custom_field.date_value.date",
"custom_field_settings.custom_field.date_value.date_time",
"custom_field_settings.custom_field.default_access_level",
"custom_field_settings.custom_field.description",
"custom_field_settings.custom_field.display_value",
"custom_field_settings.custom_field.enabled",
"custom_field_settings.custom_field.enum_options",
"custom_field_settings.custom_field.enum_options.color",
"custom_field_settings.custom_field.enum_options.enabled",
"custom_field_settings.custom_field.enum_options.name",
"custom_field_settings.custom_field.enum_value",
"custom_field_settings.custom_field.enum_value.color",
"custom_field_settings.custom_field.enum_value.enabled",
"custom_field_settings.custom_field.enum_value.name",
"custom_field_settings.custom_field.format",
"custom_field_settings.custom_field.has_notifications_enabled",
"custom_field_settings.custom_field.html_text_value",
"custom_field_settings.custom_field.id_prefix",
"custom_field_settings.custom_field.input_restrictions",
"custom_field_settings.custom_field.is_formula_field",
"custom_field_settings.custom_field.is_global_to_workspace",
"custom_field_settings.custom_field.is_value_read_only",
"custom_field_settings.custom_field.multi_enum_values",
"custom_field_settings.custom_field.multi_enum_values.color",
"custom_field_settings.custom_field.multi_enum_values.enabled",
"custom_field_settings.custom_field.multi_enum_values.name",
"custom_field_settings.custom_field.name",
"custom_field_settings.custom_field.number_value",
"custom_field_settings.custom_field.people_value",
"custom_field_settings.custom_field.people_value.name",
"custom_field_settings.custom_field.precision",
"custom_field_settings.custom_field.privacy_setting",
"custom_field_settings.custom_field.reference_value",
"custom_field_settings.custom_field.reference_value.name",
"custom_field_settings.custom_field.representation_type",
"custom_field_settings.custom_field.resource_subtype",
"custom_field_settings.custom_field.text_value",
"custom_field_settings.custom_field.type",
"custom_field_settings.is_important",
"custom_field_settings.parent",
"custom_field_settings.parent.name",
"custom_field_settings.parent.resource_subtype",
"custom_field_settings.project",
"custom_field_settings.project.name",
"custom_field_settings.project.resource_subtype",
"custom_fields",
"custom_fields.date_value",
"custom_fields.date_value.date",
"custom_fields.date_value.date_time",
"custom_fields.display_value",
"custom_fields.enabled",
"custom_fields.enum_options",
"custom_fields.enum_options.color",
"custom_fields.enum_options.enabled",
"custom_fields.enum_options.name",
"custom_fields.enum_value",
"custom_fields.enum_value.color",
"custom_fields.enum_value.enabled",
"custom_fields.enum_value.name",
"custom_fields.id_prefix",
"custom_fields.input_restrictions",
"custom_fields.is_formula_field",
"custom_fields.multi_enum_values",
"custom_fields.multi_enum_values.color",
"custom_fields.multi_enum_values.enabled",
"custom_fields.multi_enum_values.name",
"custom_fields.name",
"custom_fields.number_value",
"custom_fields.representation_type",
"custom_fields.text_value",
"custom_fields.type",
"custom_type",
"custom_type.asana_created_type_identifier",
"custom_type.name",
"default_access_level",
"due_on",
"members",
"members.name",
"name",
"owner",
"owner.name",
"permalink_url",
"privacy_setting",
"project_templates",
"project_templates.name",
"public",
"resource_subtype",
"start_on",
"workspace",
"workspace.name"
]
}
},
"style": "form",
"explode": false
}
],
"requestBody": {
"description": "The portfolio to create.",
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"$ref": "#/components/schemas/PortfolioRequest"
}
}
}
}
}
},
"responses": {
"201": {
"description": "Successfully created portfolio.",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"$ref": "#/components/schemas/PortfolioResponse"
}
}
}
}
}
},
"400": {
"$ref": "#/components/responses/BadRequest"
},
"401": {
"$ref": "#/components/responses/Unauthorized"
},
"403": {
"$ref": "#/components/responses/Forbidden"
},
"404": {
"$ref": "#/components/responses/NotFound"
},
"500": {
"$ref": "#/components/responses/InternalServerError"
}
},
"security": [
{
"personalAccessToken": []
},
{
"oauth2": [
"portfolios:write"
]
}
],
"x-readme": {
"code-samples": [
{
"language": "java",
"install": "<dependency><groupId>com.asana</groupId><artifactId>asana</artifactId><version>1.0.0</version></dependency>",
"code": "import com.asana.Client;\n\nClient client = Client.accessToken(\"PERSONAL_ACCESS_TOKEN\");\n\nPortfolio result = client.portfolios.createPortfolio()\n .data(\"field\", \"value\")\n .data(\"field\", \"value\")\n .option(\"pretty\", true)\n .execute();"
},
{
"language": "node",
"install": "npm install asana",
"code": "const Asana = require('asana');\n\nlet client = new Asana.ApiClient();\nclient.authentications.token.accessToken = '<YOUR_ACCESS_TOKEN>';\n\nlet portfoliosApiInstance = new Asana.PortfoliosApi(client);\nlet body = {\"data\": {\"<PARAM_1>\": \"<VALUE_1>\", \"<PARAM_2>\": \"<VALUE_2>\",}}; // Object | The portfolio to create.\nlet opts = { \n 'opt_fields': \"archived,color,created_at,created_by,created_by.name,current_status_update,current_status_update.resource_subtype,current_status_update.title,custom_field_settings,custom_field_settings.custom_field,custom_field_settings.custom_field.asana_created_field,custom_field_settings.custom_field.created_by,custom_field_settings.custom_field.created_by.name,custom_field_settings.custom_field.currency_code,custom_field_settings.custom_field.custom_label,custom_field_settings.custom_field.custom_label_position,custom_field_settings.custom_field.date_value,custom_field_settings.custom_field.date_value.date,custom_field_settings.custom_field.date_value.date_time,custom_field_settings.custom_field.default_access_level,custom_field_settings.custom_field.description,custom_field_settings.custom_field.display_value,custom_field_settings.custom_field.enabled,custom_field_settings.custom_field.enum_options,custom_field_settings.custom_field.enum_options.color,custom_field_settings.custom_field.enum_options.enabled,custom_field_settings.custom_field.enum_options.name,custom_field_settings.custom_field.enum_value,custom_field_settings.custom_field.enum_value.color,custom_field_settings.custom_field.enum_value.enabled,custom_field_settings.custom_field.enum_value.name,custom_field_settings.custom_field.format,custom_field_settings.custom_field.has_notifications_enabled,custom_field_settings.custom_field.html_text_value,custom_field_settings.custom_field.id_prefix,custom_field_settings.custom_field.input_restrictions,custom_field_settings.custom_field.is_formula_field,custom_field_settings.custom_field.is_global_to_workspace,custom_field_settings.custom_field.is_value_read_only,custom_field_settings.custom_field.multi_enum_values,custom_field_settings.custom_field.multi_enum_values.color,custom_field_settings.custom_field.multi_enum_values.enabled,custom_field_settings.custom_field.multi_enum_values.name,custom_field_settings.custom_field.name,custom_field_settings.custom_field.number_value,custom_field_settings.custom_field.people_value,custom_field_settings.custom_field.people_value.name,custom_field_settings.custom_field.precision,custom_field_settings.custom_field.privacy_setting,custom_field_settings.custom_field.reference_value,custom_field_settings.custom_field.reference_value.name,custom_field_settings.custom_field.representation_type,custom_field_settings.custom_field.resource_subtype,custom_field_settings.custom_field.text_value,custom_field_settings.custom_field.type,custom_field_settings.is_important,custom_field_settings.parent,custom_field_settings.parent.name,custom_field_settings.parent.resource_subtype,custom_field_settings.project,custom_field_settings.project.name,custom_field_settings.project.resource_subtype,custom_fields,custom_fields.date_value,custom_fields.date_value.date,custom_fields.date_value.date_time,custom_fields.display_value,custom_fields.enabled,custom_fields.enum_options,custom_fields.enum_options.color,custom_fields.enum_options.enabled,custom_fields.enum_options.name,custom_fields.enum_value,custom_fields.enum_value.color,custom_fields.enum_value.enabled,custom_fields.enum_value.name,custom_fields.id_prefix,custom_fields.input_restrictions,custom_fields.is_formula_field,custom_fields.multi_enum_values,custom_fields.multi_enum_values.color,custom_fields.multi_enum_values.enabled,custom_fields.multi_enum_values.name,custom_fields.name,custom_fields.number_value,custom_fields.representation_type,custom_fields.text_value,custom_fields.type,custom_type,custom_type.asana_created_type_identifier,custom_type.name,default_access_level,due_on,members,members.name,name,owner,owner.name,permalink_url,privacy_setting,project_templates,project_templates.name,public,resource_subtype,start_on,workspace,workspace.name\"\n};\nportfoliosApiInstance.createPortfolio(body, opts).then((result) => {\n console.log('API called successfully. Returned data: ' + JSON.stringify(result.data, null, 2));\n}, (error) => {\n console.error(error.response.body);\n});",
"name": "node-sdk-v3"
},
{
"language": "node",
"install": "npm install asana@1.0.5",
"code": "const asana = require('asana');\n\nconst client = asana.Client.create().useAccessToken('PERSONAL_ACCESS_TOKEN');\n\nclient.portfolios.createPortfolio({field: \"value\", field: \"value\", pretty: true})\n .then((result) => {\n console.log(result);\n });",
"name": "node-sdk-v1"
},
{
"language": "python",
"install": "pip install asana",
"code": "import asana\nfrom asana.rest import ApiException\nfrom pprint import pprint\n\nconfiguration = asana.Configuration()\nconfiguration.access_token = '<YOUR_ACCESS_TOKEN>'\napi_client = asana.ApiClient(configuration)\n\n# create an instance of the API class\nportfolios_api_instance = asana.PortfoliosApi(api_client)\nbody = {\"data\": {\"<PARAM_1>\": \"<VALUE_1>\", \"<PARAM_2>\": \"<VALUE_2>\",}} # dict | The portfolio to create.\nopts = {\n 'opt_fields': \"archived,color,created_at,created_by,created_by.name,current_status_update,current_status_update.resource_subtype,current_status_update.title,custom_field_settings,custom_field_settings.custom_field,custom_field_settings.custom_field.asana_created_field,custom_field_settings.custom_field.created_by,custom_field_settings.custom_field.created_by.name,custom_field_settings.custom_field.currency_code,custom_field_settings.custom_field.custom_label,custom_field_settings.custom_field.custom_label_position,custom_field_settings.custom_field.date_value,custom_field_settings.custom_field.date_value.date,custom_field_settings.custom_field.date_value.date_time,custom_field_settings.custom_field.default_access_level,custom_field_settings.custom_field.description,custom_field_settings.custom_field.display_value,custom_field_settings.custom_field.enabled,custom_field_settings.custom_field.enum_options,custom_field_settings.custom_field.enum_options.color,custom_field_settings.custom_field.enum_options.enabled,custom_field_settings.custom_field.enum_options.name,custom_field_settings.custom_field.enum_value,custom_field_settings.custom_field.enum_value.color,custom_field_settings.custom_field.enum_value.enabled,custom_field_settings.custom_field.enum_value.name,custom_field_settings.custom_field.format,custom_field_settings.custom_field.has_notifications_enabled,custom_field_settings.custom_field.html_text_value,custom_field_settings.custom_field.id_prefix,custom_field_settings.custom_field.input_restrictions,custom_field_settings.custom_field.is_formula_field,custom_field_settings.custom_field.is_global_to_workspace,custom_field_settings.custom_field.is_value_read_only,custom_field_settings.custom_field.multi_enum_values,custom_field_settings.custom_field.multi_enum_values.color,custom_field_settings.custom_field.multi_enum_values.enabled,custom_field_settings.custom_field.multi_enum_values.name,custom_field_settings.custom_field.name,custom_field_settings.custom_field.number_value,custom_field_settings.custom_field.people_value,custom_field_settings.custom_field.people_value.name,custom_field_settings.custom_field.precision,custom_field_settings.custom_field.privacy_setting,custom_field_settings.custom_field.reference_value,custom_field_settings.custom_field.reference_value.name,custom_field_settings.custom_field.representation_type,custom_field_settings.custom_field.resource_subtype,custom_field_settings.custom_field.text_value,custom_field_settings.custom_field.type,custom_field_settings.is_important,custom_field_settings.parent,custom_field_settings.parent.name,custom_field_settings.parent.resource_subtype,custom_field_settings.project,custom_field_settings.project.name,custom_field_settings.project.resource_subtype,custom_fields,custom_fields.date_value,custom_fields.date_value.date,custom_fields.date_value.date_time,custom_fields.display_value,custom_fields.enabled,custom_fields.enum_options,custom_fields.enum_options.color,custom_fields.enum_options.enabled,custom_fields.enum_options.name,custom_fields.enum_value,custom_fields.enum_value.color,custom_fields.enum_value.enabled,custom_fields.enum_value.name,custom_fields.id_prefix,custom_fields.input_restrictions,custom_fields.is_formula_field,custom_fields.multi_enum_values,custom_fields.multi_enum_values.color,custom_fields.multi_enum_values.enabled,custom_fields.multi_enum_values.name,custom_fields.name,custom_fields.number_value,custom_fields.representation_type,custom_fields.text_value,custom_fields.type,custom_type,custom_type.asana_created_type_identifier,custom_type.name,default_access_level,due_on,members,members.name,name,owner,owner.name,permalink_url,privacy_setting,project_templates,project_templates.name,public,resource_subtype,start_on,workspace,workspace.name\", # list[str] | 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.\n}\n\ntry:\n # Create a portfolio\n api_response = portfolios_api_instance.create_portfolio(body, opts)\n pprint(api_response)\nexcept ApiException as e:\n print(\"Exception when calling PortfoliosApi->create_portfolio: %s\\n\" % e)",
"name": "python-sdk-v5"
},
{
"language": "python",
"install": "pip install asana==3.2.3",
"code": "import asana\n\nclient = asana.Client.access_token('PERSONAL_ACCESS_TOKEN')\n\nresult = client.portfolios.create_portfolio({'field': 'value', 'field': 'value'}, opt_pretty=True)",
"name": "python-sdk-v3"
},
{
"language": "php",
"install": "composer require asana/asana",
"code": "<?php\nrequire 'vendor/autoload.php';\n\n$client = Asana\\Client::accessToken('PERSONAL_ACCESS_TOKEN');\n\n$result = $client->portfolios->createPortfolio(array('field' => 'value', 'field' => 'value'), array('opt_pretty' => 'true'))"
},
{
"language": "ruby",
"install": "gem install asana",
"code": "require 'asana'\n\nclient = Asana::Client.new do |c|\n c.authentication :access_token, 'PERSONAL_ACCESS_TOKEN'\nend\n\nresult = client.portfolios.create_portfolio(field: \"value\", field: \"value\", options: {pretty: true})"
}
]
},
"x-purple-suite-runtime": "unavailable"
}
GET /api/1.0/portfolios/{portfolio_gid}
Get a portfolio
<b>Required scope: </b><code>portfolios:read</code>
<table>
<tr>
<th>Field</th>
<th>Required Scope</th>
</tr>
<tr>
<td><code>custom_type</code></td>
<td><code>custom_types:read</code></td>
</tr>
</table>
Returns the complete portfolio record for a single portfolio.
This operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.
Authentication
[
{
"personalAccessToken": []
},
{
"oauth2": [
"portfolios:read"
]
}
]
Path-level parameters and metadata
{
"parameters": [
{
"$ref": "#/components/parameters/portfolio_path_gid"
},
{
"$ref": "#/components/parameters/pretty"
}
]
}
Request, responses and operation details
{
"summary": "Get a portfolio",
"description": "<b>Required scope: </b><code>portfolios:read</code>\n\n<table>\n <tr>\n <th>Field</th>\n <th>Required Scope</th>\n </tr>\n <tr>\n <td><code>custom_type</code></td>\n <td><code>custom_types:read</code></td>\n </tr>\n</table>\n\nReturns the complete portfolio record for a single portfolio.\n\nThis operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.",
"tags": [
"Portfolios"
],
"operationId": "getPortfolio",
"parameters": [
{
"name": "opt_fields",
"in": "query",
"description": "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. Properties can include nested fields. To learn more, see the [input/output options guide](/docs/inputoutput-options#selecting-nested-fields).",
"required": false,
"example": [
"archived",
"color",
"created_at",
"created_by",
"created_by.name",
"current_status_update",
"current_status_update.resource_subtype",
"current_status_update.title",
"custom_field_settings",
"custom_field_settings.custom_field",
"custom_field_settings.custom_field.asana_created_field",
"custom_field_settings.custom_field.created_by",
"custom_field_settings.custom_field.created_by.name",
"custom_field_settings.custom_field.currency_code",
"custom_field_settings.custom_field.custom_label",
"custom_field_settings.custom_field.custom_label_position",
"custom_field_settings.custom_field.date_value",
"custom_field_settings.custom_field.date_value.date",
"custom_field_settings.custom_field.date_value.date_time",
"custom_field_settings.custom_field.default_access_level",
"custom_field_settings.custom_field.description",
"custom_field_settings.custom_field.display_value",
"custom_field_settings.custom_field.enabled",
"custom_field_settings.custom_field.enum_options",
"custom_field_settings.custom_field.enum_options.color",
"custom_field_settings.custom_field.enum_options.enabled",
"custom_field_settings.custom_field.enum_options.name",
"custom_field_settings.custom_field.enum_value",
"custom_field_settings.custom_field.enum_value.color",
"custom_field_settings.custom_field.enum_value.enabled",
"custom_field_settings.custom_field.enum_value.name",
"custom_field_settings.custom_field.format",
"custom_field_settings.custom_field.has_notifications_enabled",
"custom_field_settings.custom_field.html_text_value",
"custom_field_settings.custom_field.id_prefix",
"custom_field_settings.custom_field.input_restrictions",
"custom_field_settings.custom_field.is_formula_field",
"custom_field_settings.custom_field.is_global_to_workspace",
"custom_field_settings.custom_field.is_value_read_only",
"custom_field_settings.custom_field.multi_enum_values",
"custom_field_settings.custom_field.multi_enum_values.color",
"custom_field_settings.custom_field.multi_enum_values.enabled",
"custom_field_settings.custom_field.multi_enum_values.name",
"custom_field_settings.custom_field.name",
"custom_field_settings.custom_field.number_value",
"custom_field_settings.custom_field.people_value",
"custom_field_settings.custom_field.people_value.name",
"custom_field_settings.custom_field.precision",
"custom_field_settings.custom_field.privacy_setting",
"custom_field_settings.custom_field.reference_value",
"custom_field_settings.custom_field.reference_value.name",
"custom_field_settings.custom_field.representation_type",
"custom_field_settings.custom_field.resource_subtype",
"custom_field_settings.custom_field.text_value",
"custom_field_settings.custom_field.type",
"custom_field_settings.is_important",
"custom_field_settings.parent",
"custom_field_settings.parent.name",
"custom_field_settings.parent.resource_subtype",
"custom_field_settings.project",
"custom_field_settings.project.name",
"custom_field_settings.project.resource_subtype",
"custom_fields",
"custom_fields.date_value",
"custom_fields.date_value.date",
"custom_fields.date_value.date_time",
"custom_fields.display_value",
"custom_fields.enabled",
"custom_fields.enum_options",
"custom_fields.enum_options.color",
"custom_fields.enum_options.enabled",
"custom_fields.enum_options.name",
"custom_fields.enum_value",
"custom_fields.enum_value.color",
"custom_fields.enum_value.enabled",
"custom_fields.enum_value.name",
"custom_fields.id_prefix",
"custom_fields.input_restrictions",
"custom_fields.is_formula_field",
"custom_fields.multi_enum_values",
"custom_fields.multi_enum_values.color",
"custom_fields.multi_enum_values.enabled",
"custom_fields.multi_enum_values.name",
"custom_fields.name",
"custom_fields.number_value",
"custom_fields.representation_type",
"custom_fields.text_value",
"custom_fields.type",
"custom_type",
"custom_type.asana_created_type_identifier",
"custom_type.name",
"default_access_level",
"due_on",
"members",
"members.name",
"name",
"owner",
"owner.name",
"permalink_url",
"privacy_setting",
"project_templates",
"project_templates.name",
"public",
"resource_subtype",
"start_on",
"workspace",
"workspace.name"
],
"schema": {
"type": "array",
"items": {
"type": "string",
"enum": [
"archived",
"color",
"created_at",
"created_by",
"created_by.name",
"current_status_update",
"current_status_update.resource_subtype",
"current_status_update.title",
"custom_field_settings",
"custom_field_settings.custom_field",
"custom_field_settings.custom_field.asana_created_field",
"custom_field_settings.custom_field.created_by",
"custom_field_settings.custom_field.created_by.name",
"custom_field_settings.custom_field.currency_code",
"custom_field_settings.custom_field.custom_label",
"custom_field_settings.custom_field.custom_label_position",
"custom_field_settings.custom_field.date_value",
"custom_field_settings.custom_field.date_value.date",
"custom_field_settings.custom_field.date_value.date_time",
"custom_field_settings.custom_field.default_access_level",
"custom_field_settings.custom_field.description",
"custom_field_settings.custom_field.display_value",
"custom_field_settings.custom_field.enabled",
"custom_field_settings.custom_field.enum_options",
"custom_field_settings.custom_field.enum_options.color",
"custom_field_settings.custom_field.enum_options.enabled",
"custom_field_settings.custom_field.enum_options.name",
"custom_field_settings.custom_field.enum_value",
"custom_field_settings.custom_field.enum_value.color",
"custom_field_settings.custom_field.enum_value.enabled",
"custom_field_settings.custom_field.enum_value.name",
"custom_field_settings.custom_field.format",
"custom_field_settings.custom_field.has_notifications_enabled",
"custom_field_settings.custom_field.html_text_value",
"custom_field_settings.custom_field.id_prefix",
"custom_field_settings.custom_field.input_restrictions",
"custom_field_settings.custom_field.is_formula_field",
"custom_field_settings.custom_field.is_global_to_workspace",
"custom_field_settings.custom_field.is_value_read_only",
"custom_field_settings.custom_field.multi_enum_values",
"custom_field_settings.custom_field.multi_enum_values.color",
"custom_field_settings.custom_field.multi_enum_values.enabled",
"custom_field_settings.custom_field.multi_enum_values.name",
"custom_field_settings.custom_field.name",
"custom_field_settings.custom_field.number_value",
"custom_field_settings.custom_field.people_value",
"custom_field_settings.custom_field.people_value.name",
"custom_field_settings.custom_field.precision",
"custom_field_settings.custom_field.privacy_setting",
"custom_field_settings.custom_field.reference_value",
"custom_field_settings.custom_field.reference_value.name",
"custom_field_settings.custom_field.representation_type",
"custom_field_settings.custom_field.resource_subtype",
"custom_field_settings.custom_field.text_value",
"custom_field_settings.custom_field.type",
"custom_field_settings.is_important",
"custom_field_settings.parent",
"custom_field_settings.parent.name",
"custom_field_settings.parent.resource_subtype",
"custom_field_settings.project",
"custom_field_settings.project.name",
"custom_field_settings.project.resource_subtype",
"custom_fields",
"custom_fields.date_value",
"custom_fields.date_value.date",
"custom_fields.date_value.date_time",
"custom_fields.display_value",
"custom_fields.enabled",
"custom_fields.enum_options",
"custom_fields.enum_options.color",
"custom_fields.enum_options.enabled",
"custom_fields.enum_options.name",
"custom_fields.enum_value",
"custom_fields.enum_value.color",
"custom_fields.enum_value.enabled",
"custom_fields.enum_value.name",
"custom_fields.id_prefix",
"custom_fields.input_restrictions",
"custom_fields.is_formula_field",
"custom_fields.multi_enum_values",
"custom_fields.multi_enum_values.color",
"custom_fields.multi_enum_values.enabled",
"custom_fields.multi_enum_values.name",
"custom_fields.name",
"custom_fields.number_value",
"custom_fields.representation_type",
"custom_fields.text_value",
"custom_fields.type",
"custom_type",
"custom_type.asana_created_type_identifier",
"custom_type.name",
"default_access_level",
"due_on",
"members",
"members.name",
"name",
"owner",
"owner.name",
"permalink_url",
"privacy_setting",
"project_templates",
"project_templates.name",
"public",
"resource_subtype",
"start_on",
"workspace",
"workspace.name"
]
}
},
"style": "form",
"explode": false
}
],
"responses": {
"200": {
"description": "Successfully retrieved the requested portfolio.",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"$ref": "#/components/schemas/PortfolioResponse"
}
}
}
}
}
},
"400": {
"$ref": "#/components/responses/BadRequest"
},
"401": {
"$ref": "#/components/responses/Unauthorized"
},
"403": {
"$ref": "#/components/responses/Forbidden"
},
"404": {
"$ref": "#/components/responses/NotFound"
},
"500": {
"$ref": "#/components/responses/InternalServerError"
}
},
"security": [
{
"personalAccessToken": []
},
{
"oauth2": [
"portfolios:read"
]
}
],
"x-readme": {
"code-samples": [
{
"language": "java",
"install": "<dependency><groupId>com.asana</groupId><artifactId>asana</artifactId><version>1.0.0</version></dependency>",
"code": "import com.asana.Client;\n\nClient client = Client.accessToken(\"PERSONAL_ACCESS_TOKEN\");\n\nPortfolio result = client.portfolios.getPortfolio(portfolioGid)\n .option(\"pretty\", true)\n .execute();"
},
{
"language": "node",
"install": "npm install asana",
"code": "const Asana = require('asana');\n\nlet client = new Asana.ApiClient();\nclient.authentications.token.accessToken = '<YOUR_ACCESS_TOKEN>';\n\nlet portfoliosApiInstance = new Asana.PortfoliosApi(client);\nlet portfolio_gid = \"12345\"; // String | Globally unique identifier for the portfolio.\nlet opts = { \n 'opt_fields': \"archived,color,created_at,created_by,created_by.name,current_status_update,current_status_update.resource_subtype,current_status_update.title,custom_field_settings,custom_field_settings.custom_field,custom_field_settings.custom_field.asana_created_field,custom_field_settings.custom_field.created_by,custom_field_settings.custom_field.created_by.name,custom_field_settings.custom_field.currency_code,custom_field_settings.custom_field.custom_label,custom_field_settings.custom_field.custom_label_position,custom_field_settings.custom_field.date_value,custom_field_settings.custom_field.date_value.date,custom_field_settings.custom_field.date_value.date_time,custom_field_settings.custom_field.default_access_level,custom_field_settings.custom_field.description,custom_field_settings.custom_field.display_value,custom_field_settings.custom_field.enabled,custom_field_settings.custom_field.enum_options,custom_field_settings.custom_field.enum_options.color,custom_field_settings.custom_field.enum_options.enabled,custom_field_settings.custom_field.enum_options.name,custom_field_settings.custom_field.enum_value,custom_field_settings.custom_field.enum_value.color,custom_field_settings.custom_field.enum_value.enabled,custom_field_settings.custom_field.enum_value.name,custom_field_settings.custom_field.format,custom_field_settings.custom_field.has_notifications_enabled,custom_field_settings.custom_field.html_text_value,custom_field_settings.custom_field.id_prefix,custom_field_settings.custom_field.input_restrictions,custom_field_settings.custom_field.is_formula_field,custom_field_settings.custom_field.is_global_to_workspace,custom_field_settings.custom_field.is_value_read_only,custom_field_settings.custom_field.multi_enum_values,custom_field_settings.custom_field.multi_enum_values.color,custom_field_settings.custom_field.multi_enum_values.enabled,custom_field_settings.custom_field.multi_enum_values.name,custom_field_settings.custom_field.name,custom_field_settings.custom_field.number_value,custom_field_settings.custom_field.people_value,custom_field_settings.custom_field.people_value.name,custom_field_settings.custom_field.precision,custom_field_settings.custom_field.privacy_setting,custom_field_settings.custom_field.reference_value,custom_field_settings.custom_field.reference_value.name,custom_field_settings.custom_field.representation_type,custom_field_settings.custom_field.resource_subtype,custom_field_settings.custom_field.text_value,custom_field_settings.custom_field.type,custom_field_settings.is_important,custom_field_settings.parent,custom_field_settings.parent.name,custom_field_settings.parent.resource_subtype,custom_field_settings.project,custom_field_settings.project.name,custom_field_settings.project.resource_subtype,custom_fields,custom_fields.date_value,custom_fields.date_value.date,custom_fields.date_value.date_time,custom_fields.display_value,custom_fields.enabled,custom_fields.enum_options,custom_fields.enum_options.color,custom_fields.enum_options.enabled,custom_fields.enum_options.name,custom_fields.enum_value,custom_fields.enum_value.color,custom_fields.enum_value.enabled,custom_fields.enum_value.name,custom_fields.id_prefix,custom_fields.input_restrictions,custom_fields.is_formula_field,custom_fields.multi_enum_values,custom_fields.multi_enum_values.color,custom_fields.multi_enum_values.enabled,custom_fields.multi_enum_values.name,custom_fields.name,custom_fields.number_value,custom_fields.representation_type,custom_fields.text_value,custom_fields.type,custom_type,custom_type.asana_created_type_identifier,custom_type.name,default_access_level,due_on,members,members.name,name,owner,owner.name,permalink_url,privacy_setting,project_templates,project_templates.name,public,resource_subtype,start_on,workspace,workspace.name\"\n};\nportfoliosApiInstance.getPortfolio(portfolio_gid, opts).then((result) => {\n console.log('API called successfully. Returned data: ' + JSON.stringify(result.data, null, 2));\n}, (error) => {\n console.error(error.response.body);\n});",
"name": "node-sdk-v3"
},
{
"language": "node",
"install": "npm install asana@1.0.5",
"code": "const asana = require('asana');\n\nconst client = asana.Client.create().useAccessToken('PERSONAL_ACCESS_TOKEN');\n\nclient.portfolios.getPortfolio(portfolioGid, {param: \"value\", param: \"value\", opt_pretty: true})\n .then((result) => {\n console.log(result);\n });",
"name": "node-sdk-v1"
},
{
"language": "python",
"install": "pip install asana",
"code": "import asana\nfrom asana.rest import ApiException\nfrom pprint import pprint\n\nconfiguration = asana.Configuration()\nconfiguration.access_token = '<YOUR_ACCESS_TOKEN>'\napi_client = asana.ApiClient(configuration)\n\n# create an instance of the API class\nportfolios_api_instance = asana.PortfoliosApi(api_client)\nportfolio_gid = \"12345\" # str | Globally unique identifier for the portfolio.\nopts = {\n 'opt_fields': \"archived,color,created_at,created_by,created_by.name,current_status_update,current_status_update.resource_subtype,current_status_update.title,custom_field_settings,custom_field_settings.custom_field,custom_field_settings.custom_field.asana_created_field,custom_field_settings.custom_field.created_by,custom_field_settings.custom_field.created_by.name,custom_field_settings.custom_field.currency_code,custom_field_settings.custom_field.custom_label,custom_field_settings.custom_field.custom_label_position,custom_field_settings.custom_field.date_value,custom_field_settings.custom_field.date_value.date,custom_field_settings.custom_field.date_value.date_time,custom_field_settings.custom_field.default_access_level,custom_field_settings.custom_field.description,custom_field_settings.custom_field.display_value,custom_field_settings.custom_field.enabled,custom_field_settings.custom_field.enum_options,custom_field_settings.custom_field.enum_options.color,custom_field_settings.custom_field.enum_options.enabled,custom_field_settings.custom_field.enum_options.name,custom_field_settings.custom_field.enum_value,custom_field_settings.custom_field.enum_value.color,custom_field_settings.custom_field.enum_value.enabled,custom_field_settings.custom_field.enum_value.name,custom_field_settings.custom_field.format,custom_field_settings.custom_field.has_notifications_enabled,custom_field_settings.custom_field.html_text_value,custom_field_settings.custom_field.id_prefix,custom_field_settings.custom_field.input_restrictions,custom_field_settings.custom_field.is_formula_field,custom_field_settings.custom_field.is_global_to_workspace,custom_field_settings.custom_field.is_value_read_only,custom_field_settings.custom_field.multi_enum_values,custom_field_settings.custom_field.multi_enum_values.color,custom_field_settings.custom_field.multi_enum_values.enabled,custom_field_settings.custom_field.multi_enum_values.name,custom_field_settings.custom_field.name,custom_field_settings.custom_field.number_value,custom_field_settings.custom_field.people_value,custom_field_settings.custom_field.people_value.name,custom_field_settings.custom_field.precision,custom_field_settings.custom_field.privacy_setting,custom_field_settings.custom_field.reference_value,custom_field_settings.custom_field.reference_value.name,custom_field_settings.custom_field.representation_type,custom_field_settings.custom_field.resource_subtype,custom_field_settings.custom_field.text_value,custom_field_settings.custom_field.type,custom_field_settings.is_important,custom_field_settings.parent,custom_field_settings.parent.name,custom_field_settings.parent.resource_subtype,custom_field_settings.project,custom_field_settings.project.name,custom_field_settings.project.resource_subtype,custom_fields,custom_fields.date_value,custom_fields.date_value.date,custom_fields.date_value.date_time,custom_fields.display_value,custom_fields.enabled,custom_fields.enum_options,custom_fields.enum_options.color,custom_fields.enum_options.enabled,custom_fields.enum_options.name,custom_fields.enum_value,custom_fields.enum_value.color,custom_fields.enum_value.enabled,custom_fields.enum_value.name,custom_fields.id_prefix,custom_fields.input_restrictions,custom_fields.is_formula_field,custom_fields.multi_enum_values,custom_fields.multi_enum_values.color,custom_fields.multi_enum_values.enabled,custom_fields.multi_enum_values.name,custom_fields.name,custom_fields.number_value,custom_fields.representation_type,custom_fields.text_value,custom_fields.type,custom_type,custom_type.asana_created_type_identifier,custom_type.name,default_access_level,due_on,members,members.name,name,owner,owner.name,permalink_url,privacy_setting,project_templates,project_templates.name,public,resource_subtype,start_on,workspace,workspace.name\", # list[str] | 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.\n}\n\ntry:\n # Get a portfolio\n api_response = portfolios_api_instance.get_portfolio(portfolio_gid, opts)\n pprint(api_response)\nexcept ApiException as e:\n print(\"Exception when calling PortfoliosApi->get_portfolio: %s\\n\" % e)",
"name": "python-sdk-v5"
},
{
"language": "python",
"install": "pip install asana==3.2.3",
"code": "import asana\n\nclient = asana.Client.access_token('PERSONAL_ACCESS_TOKEN')\n\nresult = client.portfolios.get_portfolio(portfolio_gid, {'param': 'value', 'param': 'value'}, opt_pretty=True)",
"name": "python-sdk-v3"
},
{
"language": "php",
"install": "composer require asana/asana",
"code": "<?php\nrequire 'vendor/autoload.php';\n\n$client = Asana\\Client::accessToken('PERSONAL_ACCESS_TOKEN');\n\n$result = $client->portfolios->getPortfolio($portfolio_gid, array('param' => 'value', 'param' => 'value'), array('opt_pretty' => 'true'))"
},
{
"language": "ruby",
"install": "gem install asana",
"code": "require 'asana'\n\nclient = Asana::Client.new do |c|\n c.authentication :access_token, 'PERSONAL_ACCESS_TOKEN'\nend\n\nresult = client.portfolios.get_portfolio(portfolio_gid: 'portfolio_gid', param: \"value\", param: \"value\", options: {pretty: true})"
}
]
},
"x-purple-suite-runtime": "unavailable"
}
PUT /api/1.0/portfolios/{portfolio_gid}
Update a portfolio
<b>Required scope: </b><code>portfolios:write</code>
An existing portfolio can be updated by making a PUT request on the URL for
that portfolio. Only the fields provided in the `data` block will be updated;
any unspecified fields will remain unchanged.
Returns the complete updated portfolio record.
This operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.
Authentication
[
{
"personalAccessToken": []
},
{
"oauth2": [
"portfolios:write"
]
}
]
Path-level parameters and metadata
{
"parameters": [
{
"$ref": "#/components/parameters/portfolio_path_gid"
},
{
"$ref": "#/components/parameters/pretty"
}
]
}
Request, responses and operation details
{
"summary": "Update a portfolio",
"description": "<b>Required scope: </b><code>portfolios:write</code>\n\nAn existing portfolio can be updated by making a PUT request on the URL for\nthat portfolio. Only the fields provided in the `data` block will be updated;\nany unspecified fields will remain unchanged.\n\nReturns the complete updated portfolio record.\n\nThis operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.",
"tags": [
"Portfolios"
],
"operationId": "updatePortfolio",
"parameters": [
{
"name": "opt_fields",
"in": "query",
"description": "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. Properties can include nested fields. To learn more, see the [input/output options guide](/docs/inputoutput-options#selecting-nested-fields).",
"required": false,
"example": [
"archived",
"color",
"created_at",
"created_by",
"created_by.name",
"current_status_update",
"current_status_update.resource_subtype",
"current_status_update.title",
"custom_field_settings",
"custom_field_settings.custom_field",
"custom_field_settings.custom_field.asana_created_field",
"custom_field_settings.custom_field.created_by",
"custom_field_settings.custom_field.created_by.name",
"custom_field_settings.custom_field.currency_code",
"custom_field_settings.custom_field.custom_label",
"custom_field_settings.custom_field.custom_label_position",
"custom_field_settings.custom_field.date_value",
"custom_field_settings.custom_field.date_value.date",
"custom_field_settings.custom_field.date_value.date_time",
"custom_field_settings.custom_field.default_access_level",
"custom_field_settings.custom_field.description",
"custom_field_settings.custom_field.display_value",
"custom_field_settings.custom_field.enabled",
"custom_field_settings.custom_field.enum_options",
"custom_field_settings.custom_field.enum_options.color",
"custom_field_settings.custom_field.enum_options.enabled",
"custom_field_settings.custom_field.enum_options.name",
"custom_field_settings.custom_field.enum_value",
"custom_field_settings.custom_field.enum_value.color",
"custom_field_settings.custom_field.enum_value.enabled",
"custom_field_settings.custom_field.enum_value.name",
"custom_field_settings.custom_field.format",
"custom_field_settings.custom_field.has_notifications_enabled",
"custom_field_settings.custom_field.html_text_value",
"custom_field_settings.custom_field.id_prefix",
"custom_field_settings.custom_field.input_restrictions",
"custom_field_settings.custom_field.is_formula_field",
"custom_field_settings.custom_field.is_global_to_workspace",
"custom_field_settings.custom_field.is_value_read_only",
"custom_field_settings.custom_field.multi_enum_values",
"custom_field_settings.custom_field.multi_enum_values.color",
"custom_field_settings.custom_field.multi_enum_values.enabled",
"custom_field_settings.custom_field.multi_enum_values.name",
"custom_field_settings.custom_field.name",
"custom_field_settings.custom_field.number_value",
"custom_field_settings.custom_field.people_value",
"custom_field_settings.custom_field.people_value.name",
"custom_field_settings.custom_field.precision",
"custom_field_settings.custom_field.privacy_setting",
"custom_field_settings.custom_field.reference_value",
"custom_field_settings.custom_field.reference_value.name",
"custom_field_settings.custom_field.representation_type",
"custom_field_settings.custom_field.resource_subtype",
"custom_field_settings.custom_field.text_value",
"custom_field_settings.custom_field.type",
"custom_field_settings.is_important",
"custom_field_settings.parent",
"custom_field_settings.parent.name",
"custom_field_settings.parent.resource_subtype",
"custom_field_settings.project",
"custom_field_settings.project.name",
"custom_field_settings.project.resource_subtype",
"custom_fields",
"custom_fields.date_value",
"custom_fields.date_value.date",
"custom_fields.date_value.date_time",
"custom_fields.display_value",
"custom_fields.enabled",
"custom_fields.enum_options",
"custom_fields.enum_options.color",
"custom_fields.enum_options.enabled",
"custom_fields.enum_options.name",
"custom_fields.enum_value",
"custom_fields.enum_value.color",
"custom_fields.enum_value.enabled",
"custom_fields.enum_value.name",
"custom_fields.id_prefix",
"custom_fields.input_restrictions",
"custom_fields.is_formula_field",
"custom_fields.multi_enum_values",
"custom_fields.multi_enum_values.color",
"custom_fields.multi_enum_values.enabled",
"custom_fields.multi_enum_values.name",
"custom_fields.name",
"custom_fields.number_value",
"custom_fields.representation_type",
"custom_fields.text_value",
"custom_fields.type",
"custom_type",
"custom_type.asana_created_type_identifier",
"custom_type.name",
"default_access_level",
"due_on",
"members",
"members.name",
"name",
"owner",
"owner.name",
"permalink_url",
"privacy_setting",
"project_templates",
"project_templates.name",
"public",
"resource_subtype",
"start_on",
"workspace",
"workspace.name"
],
"schema": {
"type": "array",
"items": {
"type": "string",
"enum": [
"archived",
"color",
"created_at",
"created_by",
"created_by.name",
"current_status_update",
"current_status_update.resource_subtype",
"current_status_update.title",
"custom_field_settings",
"custom_field_settings.custom_field",
"custom_field_settings.custom_field.asana_created_field",
"custom_field_settings.custom_field.created_by",
"custom_field_settings.custom_field.created_by.name",
"custom_field_settings.custom_field.currency_code",
"custom_field_settings.custom_field.custom_label",
"custom_field_settings.custom_field.custom_label_position",
"custom_field_settings.custom_field.date_value",
"custom_field_settings.custom_field.date_value.date",
"custom_field_settings.custom_field.date_value.date_time",
"custom_field_settings.custom_field.default_access_level",
"custom_field_settings.custom_field.description",
"custom_field_settings.custom_field.display_value",
"custom_field_settings.custom_field.enabled",
"custom_field_settings.custom_field.enum_options",
"custom_field_settings.custom_field.enum_options.color",
"custom_field_settings.custom_field.enum_options.enabled",
"custom_field_settings.custom_field.enum_options.name",
"custom_field_settings.custom_field.enum_value",
"custom_field_settings.custom_field.enum_value.color",
"custom_field_settings.custom_field.enum_value.enabled",
"custom_field_settings.custom_field.enum_value.name",
"custom_field_settings.custom_field.format",
"custom_field_settings.custom_field.has_notifications_enabled",
"custom_field_settings.custom_field.html_text_value",
"custom_field_settings.custom_field.id_prefix",
"custom_field_settings.custom_field.input_restrictions",
"custom_field_settings.custom_field.is_formula_field",
"custom_field_settings.custom_field.is_global_to_workspace",
"custom_field_settings.custom_field.is_value_read_only",
"custom_field_settings.custom_field.multi_enum_values",
"custom_field_settings.custom_field.multi_enum_values.color",
"custom_field_settings.custom_field.multi_enum_values.enabled",
"custom_field_settings.custom_field.multi_enum_values.name",
"custom_field_settings.custom_field.name",
"custom_field_settings.custom_field.number_value",
"custom_field_settings.custom_field.people_value",
"custom_field_settings.custom_field.people_value.name",
"custom_field_settings.custom_field.precision",
"custom_field_settings.custom_field.privacy_setting",
"custom_field_settings.custom_field.reference_value",
"custom_field_settings.custom_field.reference_value.name",
"custom_field_settings.custom_field.representation_type",
"custom_field_settings.custom_field.resource_subtype",
"custom_field_settings.custom_field.text_value",
"custom_field_settings.custom_field.type",
"custom_field_settings.is_important",
"custom_field_settings.parent",
"custom_field_settings.parent.name",
"custom_field_settings.parent.resource_subtype",
"custom_field_settings.project",
"custom_field_settings.project.name",
"custom_field_settings.project.resource_subtype",
"custom_fields",
"custom_fields.date_value",
"custom_fields.date_value.date",
"custom_fields.date_value.date_time",
"custom_fields.display_value",
"custom_fields.enabled",
"custom_fields.enum_options",
"custom_fields.enum_options.color",
"custom_fields.enum_options.enabled",
"custom_fields.enum_options.name",
"custom_fields.enum_value",
"custom_fields.enum_value.color",
"custom_fields.enum_value.enabled",
"custom_fields.enum_value.name",
"custom_fields.id_prefix",
"custom_fields.input_restrictions",
"custom_fields.is_formula_field",
"custom_fields.multi_enum_values",
"custom_fields.multi_enum_values.color",
"custom_fields.multi_enum_values.enabled",
"custom_fields.multi_enum_values.name",
"custom_fields.name",
"custom_fields.number_value",
"custom_fields.representation_type",
"custom_fields.text_value",
"custom_fields.type",
"custom_type",
"custom_type.asana_created_type_identifier",
"custom_type.name",
"default_access_level",
"due_on",
"members",
"members.name",
"name",
"owner",
"owner.name",
"permalink_url",
"privacy_setting",
"project_templates",
"project_templates.name",
"public",
"resource_subtype",
"start_on",
"workspace",
"workspace.name"
]
}
},
"style": "form",
"explode": false
}
],
"requestBody": {
"description": "The updated fields for the portfolio.",
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"$ref": "#/components/schemas/PortfolioUpdateRequest"
}
}
}
}
}
},
"responses": {
"200": {
"description": "Successfully updated the portfolio.",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"$ref": "#/components/schemas/PortfolioResponse"
}
}
}
}
}
},
"400": {
"$ref": "#/components/responses/BadRequest"
},
"401": {
"$ref": "#/components/responses/Unauthorized"
},
"403": {
"$ref": "#/components/responses/Forbidden"
},
"404": {
"$ref": "#/components/responses/NotFound"
},
"500": {
"$ref": "#/components/responses/InternalServerError"
}
},
"security": [
{
"personalAccessToken": []
},
{
"oauth2": [
"portfolios:write"
]
}
],
"x-readme": {
"code-samples": [
{
"language": "java",
"install": "<dependency><groupId>com.asana</groupId><artifactId>asana</artifactId><version>1.0.0</version></dependency>",
"code": "import com.asana.Client;\n\nClient client = Client.accessToken(\"PERSONAL_ACCESS_TOKEN\");\n\nPortfolio result = client.portfolios.updatePortfolio(portfolioGid)\n .data(\"field\", \"value\")\n .data(\"field\", \"value\")\n .option(\"pretty\", true)\n .execute();"
},
{
"language": "node",
"install": "npm install asana",
"code": "const Asana = require('asana');\n\nlet client = new Asana.ApiClient();\nclient.authentications.token.accessToken = '<YOUR_ACCESS_TOKEN>';\n\nlet portfoliosApiInstance = new Asana.PortfoliosApi(client);\nlet body = {\"data\": {\"<PARAM_1>\": \"<VALUE_1>\", \"<PARAM_2>\": \"<VALUE_2>\",}}; // Object | The updated fields for the portfolio.\nlet portfolio_gid = \"12345\"; // String | Globally unique identifier for the portfolio.\nlet opts = { \n 'opt_fields': \"archived,color,created_at,created_by,created_by.name,current_status_update,current_status_update.resource_subtype,current_status_update.title,custom_field_settings,custom_field_settings.custom_field,custom_field_settings.custom_field.asana_created_field,custom_field_settings.custom_field.created_by,custom_field_settings.custom_field.created_by.name,custom_field_settings.custom_field.currency_code,custom_field_settings.custom_field.custom_label,custom_field_settings.custom_field.custom_label_position,custom_field_settings.custom_field.date_value,custom_field_settings.custom_field.date_value.date,custom_field_settings.custom_field.date_value.date_time,custom_field_settings.custom_field.default_access_level,custom_field_settings.custom_field.description,custom_field_settings.custom_field.display_value,custom_field_settings.custom_field.enabled,custom_field_settings.custom_field.enum_options,custom_field_settings.custom_field.enum_options.color,custom_field_settings.custom_field.enum_options.enabled,custom_field_settings.custom_field.enum_options.name,custom_field_settings.custom_field.enum_value,custom_field_settings.custom_field.enum_value.color,custom_field_settings.custom_field.enum_value.enabled,custom_field_settings.custom_field.enum_value.name,custom_field_settings.custom_field.format,custom_field_settings.custom_field.has_notifications_enabled,custom_field_settings.custom_field.html_text_value,custom_field_settings.custom_field.id_prefix,custom_field_settings.custom_field.input_restrictions,custom_field_settings.custom_field.is_formula_field,custom_field_settings.custom_field.is_global_to_workspace,custom_field_settings.custom_field.is_value_read_only,custom_field_settings.custom_field.multi_enum_values,custom_field_settings.custom_field.multi_enum_values.color,custom_field_settings.custom_field.multi_enum_values.enabled,custom_field_settings.custom_field.multi_enum_values.name,custom_field_settings.custom_field.name,custom_field_settings.custom_field.number_value,custom_field_settings.custom_field.people_value,custom_field_settings.custom_field.people_value.name,custom_field_settings.custom_field.precision,custom_field_settings.custom_field.privacy_setting,custom_field_settings.custom_field.reference_value,custom_field_settings.custom_field.reference_value.name,custom_field_settings.custom_field.representation_type,custom_field_settings.custom_field.resource_subtype,custom_field_settings.custom_field.text_value,custom_field_settings.custom_field.type,custom_field_settings.is_important,custom_field_settings.parent,custom_field_settings.parent.name,custom_field_settings.parent.resource_subtype,custom_field_settings.project,custom_field_settings.project.name,custom_field_settings.project.resource_subtype,custom_fields,custom_fields.date_value,custom_fields.date_value.date,custom_fields.date_value.date_time,custom_fields.display_value,custom_fields.enabled,custom_fields.enum_options,custom_fields.enum_options.color,custom_fields.enum_options.enabled,custom_fields.enum_options.name,custom_fields.enum_value,custom_fields.enum_value.color,custom_fields.enum_value.enabled,custom_fields.enum_value.name,custom_fields.id_prefix,custom_fields.input_restrictions,custom_fields.is_formula_field,custom_fields.multi_enum_values,custom_fields.multi_enum_values.color,custom_fields.multi_enum_values.enabled,custom_fields.multi_enum_values.name,custom_fields.name,custom_fields.number_value,custom_fields.representation_type,custom_fields.text_value,custom_fields.type,custom_type,custom_type.asana_created_type_identifier,custom_type.name,default_access_level,due_on,members,members.name,name,owner,owner.name,permalink_url,privacy_setting,project_templates,project_templates.name,public,resource_subtype,start_on,workspace,workspace.name\"\n};\nportfoliosApiInstance.updatePortfolio(body, portfolio_gid, opts).then((result) => {\n console.log('API called successfully. Returned data: ' + JSON.stringify(result.data, null, 2));\n}, (error) => {\n console.error(error.response.body);\n});",
"name": "node-sdk-v3"
},
{
"language": "node",
"install": "npm install asana@1.0.5",
"code": "const asana = require('asana');\n\nconst client = asana.Client.create().useAccessToken('PERSONAL_ACCESS_TOKEN');\n\nclient.portfolios.updatePortfolio(portfolioGid, {field: \"value\", field: \"value\", pretty: true})\n .then((result) => {\n console.log(result);\n });",
"name": "node-sdk-v1"
},
{
"language": "python",
"install": "pip install asana",
"code": "import asana\nfrom asana.rest import ApiException\nfrom pprint import pprint\n\nconfiguration = asana.Configuration()\nconfiguration.access_token = '<YOUR_ACCESS_TOKEN>'\napi_client = asana.ApiClient(configuration)\n\n# create an instance of the API class\nportfolios_api_instance = asana.PortfoliosApi(api_client)\nbody = {\"data\": {\"<PARAM_1>\": \"<VALUE_1>\", \"<PARAM_2>\": \"<VALUE_2>\",}} # dict | The updated fields for the portfolio.\nportfolio_gid = \"12345\" # str | Globally unique identifier for the portfolio.\nopts = {\n 'opt_fields': \"archived,color,created_at,created_by,created_by.name,current_status_update,current_status_update.resource_subtype,current_status_update.title,custom_field_settings,custom_field_settings.custom_field,custom_field_settings.custom_field.asana_created_field,custom_field_settings.custom_field.created_by,custom_field_settings.custom_field.created_by.name,custom_field_settings.custom_field.currency_code,custom_field_settings.custom_field.custom_label,custom_field_settings.custom_field.custom_label_position,custom_field_settings.custom_field.date_value,custom_field_settings.custom_field.date_value.date,custom_field_settings.custom_field.date_value.date_time,custom_field_settings.custom_field.default_access_level,custom_field_settings.custom_field.description,custom_field_settings.custom_field.display_value,custom_field_settings.custom_field.enabled,custom_field_settings.custom_field.enum_options,custom_field_settings.custom_field.enum_options.color,custom_field_settings.custom_field.enum_options.enabled,custom_field_settings.custom_field.enum_options.name,custom_field_settings.custom_field.enum_value,custom_field_settings.custom_field.enum_value.color,custom_field_settings.custom_field.enum_value.enabled,custom_field_settings.custom_field.enum_value.name,custom_field_settings.custom_field.format,custom_field_settings.custom_field.has_notifications_enabled,custom_field_settings.custom_field.html_text_value,custom_field_settings.custom_field.id_prefix,custom_field_settings.custom_field.input_restrictions,custom_field_settings.custom_field.is_formula_field,custom_field_settings.custom_field.is_global_to_workspace,custom_field_settings.custom_field.is_value_read_only,custom_field_settings.custom_field.multi_enum_values,custom_field_settings.custom_field.multi_enum_values.color,custom_field_settings.custom_field.multi_enum_values.enabled,custom_field_settings.custom_field.multi_enum_values.name,custom_field_settings.custom_field.name,custom_field_settings.custom_field.number_value,custom_field_settings.custom_field.people_value,custom_field_settings.custom_field.people_value.name,custom_field_settings.custom_field.precision,custom_field_settings.custom_field.privacy_setting,custom_field_settings.custom_field.reference_value,custom_field_settings.custom_field.reference_value.name,custom_field_settings.custom_field.representation_type,custom_field_settings.custom_field.resource_subtype,custom_field_settings.custom_field.text_value,custom_field_settings.custom_field.type,custom_field_settings.is_important,custom_field_settings.parent,custom_field_settings.parent.name,custom_field_settings.parent.resource_subtype,custom_field_settings.project,custom_field_settings.project.name,custom_field_settings.project.resource_subtype,custom_fields,custom_fields.date_value,custom_fields.date_value.date,custom_fields.date_value.date_time,custom_fields.display_value,custom_fields.enabled,custom_fields.enum_options,custom_fields.enum_options.color,custom_fields.enum_options.enabled,custom_fields.enum_options.name,custom_fields.enum_value,custom_fields.enum_value.color,custom_fields.enum_value.enabled,custom_fields.enum_value.name,custom_fields.id_prefix,custom_fields.input_restrictions,custom_fields.is_formula_field,custom_fields.multi_enum_values,custom_fields.multi_enum_values.color,custom_fields.multi_enum_values.enabled,custom_fields.multi_enum_values.name,custom_fields.name,custom_fields.number_value,custom_fields.representation_type,custom_fields.text_value,custom_fields.type,custom_type,custom_type.asana_created_type_identifier,custom_type.name,default_access_level,due_on,members,members.name,name,owner,owner.name,permalink_url,privacy_setting,project_templates,project_templates.name,public,resource_subtype,start_on,workspace,workspace.name\", # list[str] | 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.\n}\n\ntry:\n # Update a portfolio\n api_response = portfolios_api_instance.update_portfolio(body, portfolio_gid, opts)\n pprint(api_response)\nexcept ApiException as e:\n print(\"Exception when calling PortfoliosApi->update_portfolio: %s\\n\" % e)",
"name": "python-sdk-v5"
},
{
"language": "python",
"install": "pip install asana==3.2.3",
"code": "import asana\n\nclient = asana.Client.access_token('PERSONAL_ACCESS_TOKEN')\n\nresult = client.portfolios.update_portfolio(portfolio_gid, {'field': 'value', 'field': 'value'}, opt_pretty=True)",
"name": "python-sdk-v3"
},
{
"language": "php",
"install": "composer require asana/asana",
"code": "<?php\nrequire 'vendor/autoload.php';\n\n$client = Asana\\Client::accessToken('PERSONAL_ACCESS_TOKEN');\n\n$result = $client->portfolios->updatePortfolio($portfolio_gid, array('field' => 'value', 'field' => 'value'), array('opt_pretty' => 'true'))"
},
{
"language": "ruby",
"install": "gem install asana",
"code": "require 'asana'\n\nclient = Asana::Client.new do |c|\n c.authentication :access_token, 'PERSONAL_ACCESS_TOKEN'\nend\n\nresult = client.portfolios.update_portfolio(portfolio_gid: 'portfolio_gid', field: \"value\", field: \"value\", options: {pretty: true})"
}
]
},
"x-purple-suite-runtime": "unavailable"
}
DELETE /api/1.0/portfolios/{portfolio_gid}
Delete a portfolio
An existing portfolio can be deleted by making a DELETE request on
the URL for that portfolio.
Returns an empty data record.
This operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.
Authentication
[
{
"personalAccessToken": []
},
{
"oauth2": []
}
]
Path-level parameters and metadata
{
"parameters": [
{
"$ref": "#/components/parameters/portfolio_path_gid"
},
{
"$ref": "#/components/parameters/pretty"
}
]
}
Request, responses and operation details
{
"summary": "Delete a portfolio",
"description": "An existing portfolio can be deleted by making a DELETE request on\nthe URL for that portfolio.\n\nReturns an empty data record.\n\nThis operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.",
"tags": [
"Portfolios"
],
"operationId": "deletePortfolio",
"responses": {
"200": {
"description": "Successfully deleted the specified portfolio.",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"$ref": "#/components/schemas/EmptyResponse"
}
}
}
}
}
},
"400": {
"$ref": "#/components/responses/BadRequest"
},
"401": {
"$ref": "#/components/responses/Unauthorized"
},
"403": {
"$ref": "#/components/responses/Forbidden"
},
"404": {
"$ref": "#/components/responses/NotFound"
},
"500": {
"$ref": "#/components/responses/InternalServerError"
}
},
"security": [
{
"personalAccessToken": []
},
{
"oauth2": []
}
],
"x-readme": {
"code-samples": [
{
"language": "java",
"install": "<dependency><groupId>com.asana</groupId><artifactId>asana</artifactId><version>1.0.0</version></dependency>",
"code": "import com.asana.Client;\n\nClient client = Client.accessToken(\"PERSONAL_ACCESS_TOKEN\");\n\nJsonElement result = client.portfolios.deletePortfolio(portfolioGid)\n .option(\"pretty\", true)\n .execute();"
},
{
"language": "node",
"install": "npm install asana",
"code": "const Asana = require('asana');\n\nlet client = new Asana.ApiClient();\nclient.authentications.token.accessToken = '<YOUR_ACCESS_TOKEN>';\n\nlet portfoliosApiInstance = new Asana.PortfoliosApi(client);\nlet portfolio_gid = \"12345\"; // String | Globally unique identifier for the portfolio.\n\nportfoliosApiInstance.deletePortfolio(portfolio_gid).then((result) => {\n console.log('API called successfully. Returned data: ' + JSON.stringify(result.data, null, 2));\n}, (error) => {\n console.error(error.response.body);\n});",
"name": "node-sdk-v3"
},
{
"language": "node",
"install": "npm install asana@1.0.5",
"code": "const asana = require('asana');\n\nconst client = asana.Client.create().useAccessToken('PERSONAL_ACCESS_TOKEN');\n\nclient.portfolios.deletePortfolio(portfolioGid)\n .then((result) => {\n console.log(result);\n });",
"name": "node-sdk-v1"
},
{
"language": "python",
"install": "pip install asana",
"code": "import asana\nfrom asana.rest import ApiException\nfrom pprint import pprint\n\nconfiguration = asana.Configuration()\nconfiguration.access_token = '<YOUR_ACCESS_TOKEN>'\napi_client = asana.ApiClient(configuration)\n\n# create an instance of the API class\nportfolios_api_instance = asana.PortfoliosApi(api_client)\nportfolio_gid = \"12345\" # str | Globally unique identifier for the portfolio.\n\n\ntry:\n # Delete a portfolio\n api_response = portfolios_api_instance.delete_portfolio(portfolio_gid)\n pprint(api_response)\nexcept ApiException as e:\n print(\"Exception when calling PortfoliosApi->delete_portfolio: %s\\n\" % e)",
"name": "python-sdk-v5"
},
{
"language": "python",
"install": "pip install asana==3.2.3",
"code": "import asana\n\nclient = asana.Client.access_token('PERSONAL_ACCESS_TOKEN')\n\nresult = client.portfolios.delete_portfolio(portfolio_gid, opt_pretty=True)",
"name": "python-sdk-v3"
},
{
"language": "php",
"install": "composer require asana/asana",
"code": "<?php\nrequire 'vendor/autoload.php';\n\n$client = Asana\\Client::accessToken('PERSONAL_ACCESS_TOKEN');\n\n$result = $client->portfolios->deletePortfolio($portfolio_gid, array('opt_pretty' => 'true'))"
},
{
"language": "ruby",
"install": "gem install asana",
"code": "require 'asana'\n\nclient = Asana::Client.new do |c|\n c.authentication :access_token, 'PERSONAL_ACCESS_TOKEN'\nend\n\nresult = client.portfolios.delete_portfolio(portfolio_gid: 'portfolio_gid', options: {pretty: true})"
}
]
},
"x-purple-suite-runtime": "unavailable"
}
GET /api/1.0/portfolios/{portfolio_gid}/items
Get portfolio items
<b>Required scope: </b><code>portfolios:read</code>
Get a list of the items in compact form in a portfolio.
This operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.
Authentication
[
{
"personalAccessToken": []
},
{
"oauth2": [
"portfolios:read"
]
}
]
Path-level parameters and metadata
{
"parameters": [
{
"$ref": "#/components/parameters/portfolio_path_gid"
},
{
"$ref": "#/components/parameters/pretty"
},
{
"$ref": "#/components/parameters/limit"
},
{
"$ref": "#/components/parameters/offset"
}
]
}
Request, responses and operation details
{
"summary": "Get portfolio items",
"description": "<b>Required scope: </b><code>portfolios:read</code>\n\nGet a list of the items in compact form in a portfolio.\n\nThis operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.",
"tags": [
"Portfolios"
],
"operationId": "getItemsForPortfolio",
"parameters": [
{
"name": "opt_fields",
"in": "query",
"description": "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. Properties can include nested fields. To learn more, see the [input/output options guide](/docs/inputoutput-options#selecting-nested-fields).",
"required": false,
"example": [
"offset",
"path",
"uri"
],
"schema": {
"type": "array",
"items": {
"type": "string",
"enum": [
"offset",
"path",
"uri"
]
}
},
"style": "form",
"explode": false
}
],
"responses": {
"200": {
"description": "Successfully retrieved the requested portfolio's items.",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"type": "array",
"items": {
"$ref": "#/components/schemas/PortfolioItemCompact"
}
},
"next_page": {
"$ref": "#/components/schemas/NextPage"
}
}
}
}
}
},
"400": {
"$ref": "#/components/responses/BadRequest"
},
"401": {
"$ref": "#/components/responses/Unauthorized"
},
"403": {
"$ref": "#/components/responses/Forbidden"
},
"404": {
"$ref": "#/components/responses/NotFound"
},
"500": {
"$ref": "#/components/responses/InternalServerError"
}
},
"security": [
{
"personalAccessToken": []
},
{
"oauth2": [
"portfolios:read"
]
}
],
"x-readme": {
"code-samples": [
{
"language": "java",
"install": "<dependency><groupId>com.asana</groupId><artifactId>asana</artifactId><version>1.0.0</version></dependency>",
"code": "import com.asana.Client;\n\nClient client = Client.accessToken(\"PERSONAL_ACCESS_TOKEN\");\n\nList<Project> result = client.portfolios.getItemsForPortfolio(portfolioGid)\n .option(\"pretty\", true)\n .execute();"
},
{
"language": "node",
"install": "npm install asana",
"code": "const Asana = require('asana');\n\nlet client = new Asana.ApiClient();\nclient.authentications.token.accessToken = '<YOUR_ACCESS_TOKEN>';\n\nlet portfoliosApiInstance = new Asana.PortfoliosApi(client);\nlet portfolio_gid = \"12345\"; // String | Globally unique identifier for the portfolio.\nlet opts = { \n 'limit': 50, \n 'offset': \"eyJ0eXAiOJiKV1iQLCJhbGciOiJIUzI1NiJ9\", \n 'opt_fields': \"offset,path,uri\"\n};\nportfoliosApiInstance.getItemsForPortfolio(portfolio_gid, opts).then((result) => {\n console.log('API called successfully. Returned data: ' + JSON.stringify(result.data, null, 2));\n}, (error) => {\n console.error(error.response.body);\n});",
"name": "node-sdk-v3"
},
{
"language": "node",
"install": "npm install asana@1.0.5",
"code": "const asana = require('asana');\n\nconst client = asana.Client.create().useAccessToken('PERSONAL_ACCESS_TOKEN');\n\nclient.portfolios.getItemsForPortfolio(portfolioGid, {param: \"value\", param: \"value\", opt_pretty: true})\n .then((result) => {\n console.log(result);\n });",
"name": "node-sdk-v1"
},
{
"language": "python",
"install": "pip install asana",
"code": "import asana\nfrom asana.rest import ApiException\nfrom pprint import pprint\n\nconfiguration = asana.Configuration()\nconfiguration.access_token = '<YOUR_ACCESS_TOKEN>'\napi_client = asana.ApiClient(configuration)\n\n# create an instance of the API class\nportfolios_api_instance = asana.PortfoliosApi(api_client)\nportfolio_gid = \"12345\" # str | Globally unique identifier for the portfolio.\nopts = {\n 'limit': 50, # int | Results per page. The number of objects to return per page. The value must be between 1 and 100.\n 'offset': \"eyJ0eXAiOJiKV1iQLCJhbGciOiJIUzI1NiJ9\", # str | 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.*\n 'opt_fields': \"offset,path,uri\", # list[str] | 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.\n}\n\ntry:\n # Get portfolio items\n api_response = portfolios_api_instance.get_items_for_portfolio(portfolio_gid, opts)\n for data in api_response:\n pprint(data)\nexcept ApiException as e:\n print(\"Exception when calling PortfoliosApi->get_items_for_portfolio: %s\\n\" % e)",
"name": "python-sdk-v5"
},
{
"language": "python",
"install": "pip install asana==3.2.3",
"code": "import asana\n\nclient = asana.Client.access_token('PERSONAL_ACCESS_TOKEN')\n\nresult = client.portfolios.get_items_for_portfolio(portfolio_gid, {'param': 'value', 'param': 'value'}, opt_pretty=True)",
"name": "python-sdk-v3"
},
{
"language": "php",
"install": "composer require asana/asana",
"code": "<?php\nrequire 'vendor/autoload.php';\n\n$client = Asana\\Client::accessToken('PERSONAL_ACCESS_TOKEN');\n\n$result = $client->portfolios->getItemsForPortfolio($portfolio_gid, array('param' => 'value', 'param' => 'value'), array('opt_pretty' => 'true'))"
},
{
"language": "ruby",
"install": "gem install asana",
"code": "require 'asana'\n\nclient = Asana::Client.new do |c|\n c.authentication :access_token, 'PERSONAL_ACCESS_TOKEN'\nend\n\nresult = client.portfolios.get_items_for_portfolio(portfolio_gid: 'portfolio_gid', param: \"value\", param: \"value\", options: {pretty: true})"
}
]
},
"x-purple-suite-runtime": "unavailable"
}
POST /api/1.0/portfolios/{portfolio_gid}/addItem
Add a portfolio item
<b>Required scope: </b><code>portfolios:write</code>
Add an item to a portfolio.
Returns an empty data block.
This operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.
Authentication
[
{
"personalAccessToken": []
},
{
"oauth2": [
"portfolios:write"
]
}
]
Path-level parameters and metadata
{
"parameters": [
{
"$ref": "#/components/parameters/portfolio_path_gid"
},
{
"$ref": "#/components/parameters/pretty"
}
]
}
Request, responses and operation details
{
"summary": "Add a portfolio item",
"description": "<b>Required scope: </b><code>portfolios:write</code>\n\nAdd an item to a portfolio.\nReturns an empty data block.\n\nThis operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.",
"tags": [
"Portfolios"
],
"operationId": "addItemForPortfolio",
"requestBody": {
"description": "Information about the item being inserted.",
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"$ref": "#/components/schemas/PortfolioAddItemRequest"
}
}
}
}
}
},
"responses": {
"200": {
"description": "Successfully added the item to the portfolio.",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"$ref": "#/components/schemas/EmptyResponse"
}
}
}
}
}
},
"400": {
"$ref": "#/components/responses/BadRequest"
},
"401": {
"$ref": "#/components/responses/Unauthorized"
},
"403": {
"$ref": "#/components/responses/Forbidden"
},
"404": {
"$ref": "#/components/responses/NotFound"
},
"500": {
"$ref": "#/components/responses/InternalServerError"
}
},
"security": [
{
"personalAccessToken": []
},
{
"oauth2": [
"portfolios:write"
]
}
],
"x-readme": {
"code-samples": [
{
"language": "java",
"install": "<dependency><groupId>com.asana</groupId><artifactId>asana</artifactId><version>1.0.0</version></dependency>",
"code": "import com.asana.Client;\n\nClient client = Client.accessToken(\"PERSONAL_ACCESS_TOKEN\");\n\nJsonElement result = client.portfolios.addItemForPortfolio(portfolioGid)\n .data(\"field\", \"value\")\n .data(\"field\", \"value\")\n .option(\"pretty\", true)\n .execute();"
},
{
"language": "node",
"install": "npm install asana",
"code": "const Asana = require('asana');\n\nlet client = new Asana.ApiClient();\nclient.authentications.token.accessToken = '<YOUR_ACCESS_TOKEN>';\n\nlet portfoliosApiInstance = new Asana.PortfoliosApi(client);\nlet body = {\"data\": {\"<PARAM_1>\": \"<VALUE_1>\", \"<PARAM_2>\": \"<VALUE_2>\",}}; // Object | Information about the item being inserted.\nlet portfolio_gid = \"12345\"; // String | Globally unique identifier for the portfolio.\n\nportfoliosApiInstance.addItemForPortfolio(body, portfolio_gid).then((result) => {\n console.log('API called successfully. Returned data: ' + JSON.stringify(result.data, null, 2));\n}, (error) => {\n console.error(error.response.body);\n});",
"name": "node-sdk-v3"
},
{
"language": "node",
"install": "npm install asana@1.0.5",
"code": "const asana = require('asana');\n\nconst client = asana.Client.create().useAccessToken('PERSONAL_ACCESS_TOKEN');\n\nclient.portfolios.addItemForPortfolio(portfolioGid, {field: \"value\", field: \"value\", pretty: true})\n .then((result) => {\n console.log(result);\n });",
"name": "node-sdk-v1"
},
{
"language": "python",
"install": "pip install asana",
"code": "import asana\nfrom asana.rest import ApiException\nfrom pprint import pprint\n\nconfiguration = asana.Configuration()\nconfiguration.access_token = '<YOUR_ACCESS_TOKEN>'\napi_client = asana.ApiClient(configuration)\n\n# create an instance of the API class\nportfolios_api_instance = asana.PortfoliosApi(api_client)\nbody = {\"data\": {\"<PARAM_1>\": \"<VALUE_1>\", \"<PARAM_2>\": \"<VALUE_2>\",}} # dict | Information about the item being inserted.\nportfolio_gid = \"12345\" # str | Globally unique identifier for the portfolio.\n\n\ntry:\n # Add a portfolio item\n api_response = portfolios_api_instance.add_item_for_portfolio(body, portfolio_gid)\n pprint(api_response)\nexcept ApiException as e:\n print(\"Exception when calling PortfoliosApi->add_item_for_portfolio: %s\\n\" % e)",
"name": "python-sdk-v5"
},
{
"language": "python",
"install": "pip install asana==3.2.3",
"code": "import asana\n\nclient = asana.Client.access_token('PERSONAL_ACCESS_TOKEN')\n\nresult = client.portfolios.add_item_for_portfolio(portfolio_gid, {'field': 'value', 'field': 'value'}, opt_pretty=True)",
"name": "python-sdk-v3"
},
{
"language": "php",
"install": "composer require asana/asana",
"code": "<?php\nrequire 'vendor/autoload.php';\n\n$client = Asana\\Client::accessToken('PERSONAL_ACCESS_TOKEN');\n\n$result = $client->portfolios->addItemForPortfolio($portfolio_gid, array('field' => 'value', 'field' => 'value'), array('opt_pretty' => 'true'))"
},
{
"language": "ruby",
"install": "gem install asana",
"code": "require 'asana'\n\nclient = Asana::Client.new do |c|\n c.authentication :access_token, 'PERSONAL_ACCESS_TOKEN'\nend\n\nresult = client.portfolios.add_item_for_portfolio(portfolio_gid: 'portfolio_gid', field: \"value\", field: \"value\", options: {pretty: true})"
}
]
},
"x-purple-suite-runtime": "unavailable"
}
POST /api/1.0/portfolios/{portfolio_gid}/removeItem
Remove a portfolio item
<b>Required scope: </b><code>portfolios:write</code>
Remove an item from a portfolio.
Returns an empty data block.
This operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.
Authentication
[
{
"personalAccessToken": []
},
{
"oauth2": [
"portfolios:write"
]
}
]
Path-level parameters and metadata
{
"parameters": [
{
"$ref": "#/components/parameters/portfolio_path_gid"
},
{
"$ref": "#/components/parameters/pretty"
}
]
}
Request, responses and operation details
{
"summary": "Remove a portfolio item",
"description": "<b>Required scope: </b><code>portfolios:write</code>\n\nRemove an item from a portfolio.\nReturns an empty data block.\n\nThis operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.",
"tags": [
"Portfolios"
],
"operationId": "removeItemForPortfolio",
"requestBody": {
"description": "Information about the item being removed.",
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"$ref": "#/components/schemas/PortfolioRemoveItemRequest"
}
}
}
}
}
},
"responses": {
"200": {
"description": "Successfully removed the item from the portfolio.",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"$ref": "#/components/schemas/EmptyResponse"
}
}
}
}
}
},
"400": {
"$ref": "#/components/responses/BadRequest"
},
"401": {
"$ref": "#/components/responses/Unauthorized"
},
"403": {
"$ref": "#/components/responses/Forbidden"
},
"404": {
"$ref": "#/components/responses/NotFound"
},
"500": {
"$ref": "#/components/responses/InternalServerError"
}
},
"security": [
{
"personalAccessToken": []
},
{
"oauth2": [
"portfolios:write"
]
}
],
"x-readme": {
"code-samples": [
{
"language": "java",
"install": "<dependency><groupId>com.asana</groupId><artifactId>asana</artifactId><version>1.0.0</version></dependency>",
"code": "import com.asana.Client;\n\nClient client = Client.accessToken(\"PERSONAL_ACCESS_TOKEN\");\n\nJsonElement result = client.portfolios.removeItemForPortfolio(portfolioGid)\n .data(\"field\", \"value\")\n .data(\"field\", \"value\")\n .option(\"pretty\", true)\n .execute();"
},
{
"language": "node",
"install": "npm install asana",
"code": "const Asana = require('asana');\n\nlet client = new Asana.ApiClient();\nclient.authentications.token.accessToken = '<YOUR_ACCESS_TOKEN>';\n\nlet portfoliosApiInstance = new Asana.PortfoliosApi(client);\nlet body = {\"data\": {\"<PARAM_1>\": \"<VALUE_1>\", \"<PARAM_2>\": \"<VALUE_2>\",}}; // Object | Information about the item being removed.\nlet portfolio_gid = \"12345\"; // String | Globally unique identifier for the portfolio.\n\nportfoliosApiInstance.removeItemForPortfolio(body, portfolio_gid).then((result) => {\n console.log('API called successfully. Returned data: ' + JSON.stringify(result.data, null, 2));\n}, (error) => {\n console.error(error.response.body);\n});",
"name": "node-sdk-v3"
},
{
"language": "node",
"install": "npm install asana@1.0.5",
"code": "const asana = require('asana');\n\nconst client = asana.Client.create().useAccessToken('PERSONAL_ACCESS_TOKEN');\n\nclient.portfolios.removeItemForPortfolio(portfolioGid, {field: \"value\", field: \"value\", pretty: true})\n .then((result) => {\n console.log(result);\n });",
"name": "node-sdk-v1"
},
{
"language": "python",
"install": "pip install asana",
"code": "import asana\nfrom asana.rest import ApiException\nfrom pprint import pprint\n\nconfiguration = asana.Configuration()\nconfiguration.access_token = '<YOUR_ACCESS_TOKEN>'\napi_client = asana.ApiClient(configuration)\n\n# create an instance of the API class\nportfolios_api_instance = asana.PortfoliosApi(api_client)\nbody = {\"data\": {\"<PARAM_1>\": \"<VALUE_1>\", \"<PARAM_2>\": \"<VALUE_2>\",}} # dict | Information about the item being removed.\nportfolio_gid = \"12345\" # str | Globally unique identifier for the portfolio.\n\n\ntry:\n # Remove a portfolio item\n api_response = portfolios_api_instance.remove_item_for_portfolio(body, portfolio_gid)\n pprint(api_response)\nexcept ApiException as e:\n print(\"Exception when calling PortfoliosApi->remove_item_for_portfolio: %s\\n\" % e)",
"name": "python-sdk-v5"
},
{
"language": "python",
"install": "pip install asana==3.2.3",
"code": "import asana\n\nclient = asana.Client.access_token('PERSONAL_ACCESS_TOKEN')\n\nresult = client.portfolios.remove_item_for_portfolio(portfolio_gid, {'field': 'value', 'field': 'value'}, opt_pretty=True)",
"name": "python-sdk-v3"
},
{
"language": "php",
"install": "composer require asana/asana",
"code": "<?php\nrequire 'vendor/autoload.php';\n\n$client = Asana\\Client::accessToken('PERSONAL_ACCESS_TOKEN');\n\n$result = $client->portfolios->removeItemForPortfolio($portfolio_gid, array('field' => 'value', 'field' => 'value'), array('opt_pretty' => 'true'))"
},
{
"language": "ruby",
"install": "gem install asana",
"code": "require 'asana'\n\nclient = Asana::Client.new do |c|\n c.authentication :access_token, 'PERSONAL_ACCESS_TOKEN'\nend\n\nresult = client.portfolios.remove_item_for_portfolio(portfolio_gid: 'portfolio_gid', field: \"value\", field: \"value\", options: {pretty: true})"
}
]
},
"x-purple-suite-runtime": "unavailable"
}
POST /api/1.0/portfolios/{portfolio_gid}/addCustomFieldSetting
Add a custom field to a portfolio
<b>Required scope: </b><code>portfolios:write</code>
Custom fields are associated with portfolios by way of custom field settings. This method creates a setting for the portfolio.
This operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.
Authentication
[
{
"personalAccessToken": []
},
{
"oauth2": [
"portfolios:write"
]
}
]
Path-level parameters and metadata
{
"parameters": [
{
"$ref": "#/components/parameters/portfolio_path_gid"
},
{
"$ref": "#/components/parameters/pretty"
}
]
}
Request, responses and operation details
{
"summary": "Add a custom field to a portfolio",
"description": "<b>Required scope: </b><code>portfolios:write</code>\n\nCustom fields are associated with portfolios by way of custom field settings. This method creates a setting for the portfolio.\n\nThis operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.",
"tags": [
"Portfolios"
],
"operationId": "addCustomFieldSettingForPortfolio",
"security": [
{
"personalAccessToken": []
},
{
"oauth2": [
"portfolios:write"
]
}
],
"requestBody": {
"description": "Information about the custom field setting.",
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"$ref": "#/components/schemas/AddCustomFieldSettingRequest"
}
}
}
}
}
},
"responses": {
"200": {
"description": "Successfully added the custom field to the portfolio.",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"$ref": "#/components/schemas/CustomFieldSettingResponse"
}
}
}
}
}
},
"400": {
"$ref": "#/components/responses/BadRequest"
},
"401": {
"$ref": "#/components/responses/Unauthorized"
},
"403": {
"$ref": "#/components/responses/Forbidden"
},
"404": {
"$ref": "#/components/responses/NotFound"
},
"500": {
"$ref": "#/components/responses/InternalServerError"
}
},
"x-readme": {
"code-samples": [
{
"language": "java",
"install": "<dependency><groupId>com.asana</groupId><artifactId>asana</artifactId><version>1.0.0</version></dependency>",
"code": "import com.asana.Client;\n\nClient client = Client.accessToken(\"PERSONAL_ACCESS_TOKEN\");\n\nCustomFieldSetting result = client.portfolios.addCustomFieldSettingForPortfolio(portfolioGid)\n .data(\"field\", \"value\")\n .data(\"field\", \"value\")\n .option(\"pretty\", true)\n .execute();"
},
{
"language": "node",
"install": "npm install asana",
"code": "const Asana = require('asana');\n\nlet client = new Asana.ApiClient();\nclient.authentications.token.accessToken = '<YOUR_ACCESS_TOKEN>';\n\nlet portfoliosApiInstance = new Asana.PortfoliosApi(client);\nlet body = {\"data\": {\"<PARAM_1>\": \"<VALUE_1>\", \"<PARAM_2>\": \"<VALUE_2>\",}}; // Object | Information about the custom field setting.\nlet portfolio_gid = \"12345\"; // String | Globally unique identifier for the portfolio.\n\nportfoliosApiInstance.addCustomFieldSettingForPortfolio(body, portfolio_gid).then((result) => {\n console.log('API called successfully. Returned data: ' + JSON.stringify(result.data, null, 2));\n}, (error) => {\n console.error(error.response.body);\n});",
"name": "node-sdk-v3"
},
{
"language": "node",
"install": "npm install asana@1.0.5",
"code": "const asana = require('asana');\n\nconst client = asana.Client.create().useAccessToken('PERSONAL_ACCESS_TOKEN');\n\nclient.portfolios.addCustomFieldSettingForPortfolio(portfolioGid, {field: \"value\", field: \"value\", pretty: true})\n .then((result) => {\n console.log(result);\n });",
"name": "node-sdk-v1"
},
{
"language": "python",
"install": "pip install asana",
"code": "import asana\nfrom asana.rest import ApiException\nfrom pprint import pprint\n\nconfiguration = asana.Configuration()\nconfiguration.access_token = '<YOUR_ACCESS_TOKEN>'\napi_client = asana.ApiClient(configuration)\n\n# create an instance of the API class\nportfolios_api_instance = asana.PortfoliosApi(api_client)\nbody = {\"data\": {\"<PARAM_1>\": \"<VALUE_1>\", \"<PARAM_2>\": \"<VALUE_2>\",}} # dict | Information about the custom field setting.\nportfolio_gid = \"12345\" # str | Globally unique identifier for the portfolio.\n\n\ntry:\n # Add a custom field to a portfolio\n api_response = portfolios_api_instance.add_custom_field_setting_for_portfolio(body, portfolio_gid)\n pprint(api_response)\nexcept ApiException as e:\n print(\"Exception when calling PortfoliosApi->add_custom_field_setting_for_portfolio: %s\\n\" % e)",
"name": "python-sdk-v5"
},
{
"language": "python",
"install": "pip install asana==3.2.3",
"code": "import asana\n\nclient = asana.Client.access_token('PERSONAL_ACCESS_TOKEN')\n\nresult = client.portfolios.add_custom_field_setting_for_portfolio(portfolio_gid, {'field': 'value', 'field': 'value'}, opt_pretty=True)",
"name": "python-sdk-v3"
},
{
"language": "php",
"install": "composer require asana/asana",
"code": "<?php\nrequire 'vendor/autoload.php';\n\n$client = Asana\\Client::accessToken('PERSONAL_ACCESS_TOKEN');\n\n$result = $client->portfolios->addCustomFieldSettingForPortfolio($portfolio_gid, array('field' => 'value', 'field' => 'value'), array('opt_pretty' => 'true'))"
},
{
"language": "ruby",
"install": "gem install asana",
"code": "require 'asana'\n\nclient = Asana::Client.new do |c|\n c.authentication :access_token, 'PERSONAL_ACCESS_TOKEN'\nend\n\nresult = client.portfolios.add_custom_field_setting_for_portfolio(portfolio_gid: 'portfolio_gid', field: \"value\", field: \"value\", options: {pretty: true})"
}
]
},
"x-purple-suite-runtime": "unavailable"
}
POST /api/1.0/portfolios/{portfolio_gid}/removeCustomFieldSetting
Remove a custom field from a portfolio
<b>Required scope: </b><code>portfolios:write</code>
Removes a custom field setting from a portfolio.
This operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.
Authentication
[
{
"personalAccessToken": []
},
{
"oauth2": [
"portfolios:write"
]
}
]
Path-level parameters and metadata
{
"parameters": [
{
"$ref": "#/components/parameters/portfolio_path_gid"
},
{
"$ref": "#/components/parameters/pretty"
}
]
}
Request, responses and operation details
{
"summary": "Remove a custom field from a portfolio",
"description": "<b>Required scope: </b><code>portfolios:write</code>\n\nRemoves a custom field setting from a portfolio.\n\nThis operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.",
"tags": [
"Portfolios"
],
"operationId": "removeCustomFieldSettingForPortfolio",
"security": [
{
"personalAccessToken": []
},
{
"oauth2": [
"portfolios:write"
]
}
],
"requestBody": {
"description": "Information about the custom field setting being removed.",
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"$ref": "#/components/schemas/RemoveCustomFieldSettingRequest"
}
}
}
}
}
},
"responses": {
"200": {
"description": "Successfully removed the custom field from the portfolio.",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"$ref": "#/components/schemas/EmptyResponse"
}
}
}
}
}
},
"400": {
"$ref": "#/components/responses/BadRequest"
},
"401": {
"$ref": "#/components/responses/Unauthorized"
},
"403": {
"$ref": "#/components/responses/Forbidden"
},
"404": {
"$ref": "#/components/responses/NotFound"
},
"500": {
"$ref": "#/components/responses/InternalServerError"
}
},
"x-readme": {
"code-samples": [
{
"language": "java",
"install": "<dependency><groupId>com.asana</groupId><artifactId>asana</artifactId><version>1.0.0</version></dependency>",
"code": "import com.asana.Client;\n\nClient client = Client.accessToken(\"PERSONAL_ACCESS_TOKEN\");\n\nJsonElement result = client.portfolios.removeCustomFieldSettingForPortfolio(portfolioGid)\n .data(\"field\", \"value\")\n .data(\"field\", \"value\")\n .option(\"pretty\", true)\n .execute();"
},
{
"language": "node",
"install": "npm install asana",
"code": "const Asana = require('asana');\n\nlet client = new Asana.ApiClient();\nclient.authentications.token.accessToken = '<YOUR_ACCESS_TOKEN>';\n\nlet portfoliosApiInstance = new Asana.PortfoliosApi(client);\nlet body = {\"data\": {\"<PARAM_1>\": \"<VALUE_1>\", \"<PARAM_2>\": \"<VALUE_2>\",}}; // Object | Information about the custom field setting being removed.\nlet portfolio_gid = \"12345\"; // String | Globally unique identifier for the portfolio.\n\nportfoliosApiInstance.removeCustomFieldSettingForPortfolio(body, portfolio_gid).then((result) => {\n console.log('API called successfully. Returned data: ' + JSON.stringify(result.data, null, 2));\n}, (error) => {\n console.error(error.response.body);\n});",
"name": "node-sdk-v3"
},
{
"language": "node",
"install": "npm install asana@1.0.5",
"code": "const asana = require('asana');\n\nconst client = asana.Client.create().useAccessToken('PERSONAL_ACCESS_TOKEN');\n\nclient.portfolios.removeCustomFieldSettingForPortfolio(portfolioGid, {field: \"value\", field: \"value\", pretty: true})\n .then((result) => {\n console.log(result);\n });",
"name": "node-sdk-v1"
},
{
"language": "python",
"install": "pip install asana",
"code": "import asana\nfrom asana.rest import ApiException\nfrom pprint import pprint\n\nconfiguration = asana.Configuration()\nconfiguration.access_token = '<YOUR_ACCESS_TOKEN>'\napi_client = asana.ApiClient(configuration)\n\n# create an instance of the API class\nportfolios_api_instance = asana.PortfoliosApi(api_client)\nbody = {\"data\": {\"<PARAM_1>\": \"<VALUE_1>\", \"<PARAM_2>\": \"<VALUE_2>\",}} # dict | Information about the custom field setting being removed.\nportfolio_gid = \"12345\" # str | Globally unique identifier for the portfolio.\n\n\ntry:\n # Remove a custom field from a portfolio\n api_response = portfolios_api_instance.remove_custom_field_setting_for_portfolio(body, portfolio_gid)\n pprint(api_response)\nexcept ApiException as e:\n print(\"Exception when calling PortfoliosApi->remove_custom_field_setting_for_portfolio: %s\\n\" % e)",
"name": "python-sdk-v5"
},
{
"language": "python",
"install": "pip install asana==3.2.3",
"code": "import asana\n\nclient = asana.Client.access_token('PERSONAL_ACCESS_TOKEN')\n\nresult = client.portfolios.remove_custom_field_setting_for_portfolio(portfolio_gid, {'field': 'value', 'field': 'value'}, opt_pretty=True)",
"name": "python-sdk-v3"
},
{
"language": "php",
"install": "composer require asana/asana",
"code": "<?php\nrequire 'vendor/autoload.php';\n\n$client = Asana\\Client::accessToken('PERSONAL_ACCESS_TOKEN');\n\n$result = $client->portfolios->removeCustomFieldSettingForPortfolio($portfolio_gid, array('field' => 'value', 'field' => 'value'), array('opt_pretty' => 'true'))"
},
{
"language": "ruby",
"install": "gem install asana",
"code": "require 'asana'\n\nclient = Asana::Client.new do |c|\n c.authentication :access_token, 'PERSONAL_ACCESS_TOKEN'\nend\n\nresult = client.portfolios.remove_custom_field_setting_for_portfolio(portfolio_gid: 'portfolio_gid', field: \"value\", field: \"value\", options: {pretty: true})"
}
]
},
"x-purple-suite-runtime": "unavailable"
}
POST /api/1.0/portfolios/{portfolio_gid}/addMembers
Add users to a portfolio
Adds the specified list of users as members of the portfolio.
Returns the updated portfolio record.
This operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.
Authentication
[
{
"personalAccessToken": []
},
{
"oauth2": []
}
]
Path-level parameters and metadata
{
"parameters": [
{
"$ref": "#/components/parameters/portfolio_path_gid"
},
{
"$ref": "#/components/parameters/pretty"
}
]
}
Request, responses and operation details
{
"summary": "Add users to a portfolio",
"description": "Adds the specified list of users as members of the portfolio.\nReturns the updated portfolio record.\n\nThis operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.",
"tags": [
"Portfolios"
],
"operationId": "addMembersForPortfolio",
"parameters": [
{
"name": "opt_fields",
"in": "query",
"description": "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. Properties can include nested fields. To learn more, see the [input/output options guide](/docs/inputoutput-options#selecting-nested-fields).",
"required": false,
"example": [
"archived",
"color",
"created_at",
"created_by",
"created_by.name",
"current_status_update",
"current_status_update.resource_subtype",
"current_status_update.title",
"custom_field_settings",
"custom_field_settings.custom_field",
"custom_field_settings.custom_field.asana_created_field",
"custom_field_settings.custom_field.created_by",
"custom_field_settings.custom_field.created_by.name",
"custom_field_settings.custom_field.currency_code",
"custom_field_settings.custom_field.custom_label",
"custom_field_settings.custom_field.custom_label_position",
"custom_field_settings.custom_field.date_value",
"custom_field_settings.custom_field.date_value.date",
"custom_field_settings.custom_field.date_value.date_time",
"custom_field_settings.custom_field.default_access_level",
"custom_field_settings.custom_field.description",
"custom_field_settings.custom_field.display_value",
"custom_field_settings.custom_field.enabled",
"custom_field_settings.custom_field.enum_options",
"custom_field_settings.custom_field.enum_options.color",
"custom_field_settings.custom_field.enum_options.enabled",
"custom_field_settings.custom_field.enum_options.name",
"custom_field_settings.custom_field.enum_value",
"custom_field_settings.custom_field.enum_value.color",
"custom_field_settings.custom_field.enum_value.enabled",
"custom_field_settings.custom_field.enum_value.name",
"custom_field_settings.custom_field.format",
"custom_field_settings.custom_field.has_notifications_enabled",
"custom_field_settings.custom_field.html_text_value",
"custom_field_settings.custom_field.id_prefix",
"custom_field_settings.custom_field.input_restrictions",
"custom_field_settings.custom_field.is_formula_field",
"custom_field_settings.custom_field.is_global_to_workspace",
"custom_field_settings.custom_field.is_value_read_only",
"custom_field_settings.custom_field.multi_enum_values",
"custom_field_settings.custom_field.multi_enum_values.color",
"custom_field_settings.custom_field.multi_enum_values.enabled",
"custom_field_settings.custom_field.multi_enum_values.name",
"custom_field_settings.custom_field.name",
"custom_field_settings.custom_field.number_value",
"custom_field_settings.custom_field.people_value",
"custom_field_settings.custom_field.people_value.name",
"custom_field_settings.custom_field.precision",
"custom_field_settings.custom_field.privacy_setting",
"custom_field_settings.custom_field.reference_value",
"custom_field_settings.custom_field.reference_value.name",
"custom_field_settings.custom_field.representation_type",
"custom_field_settings.custom_field.resource_subtype",
"custom_field_settings.custom_field.text_value",
"custom_field_settings.custom_field.type",
"custom_field_settings.is_important",
"custom_field_settings.parent",
"custom_field_settings.parent.name",
"custom_field_settings.parent.resource_subtype",
"custom_field_settings.project",
"custom_field_settings.project.name",
"custom_field_settings.project.resource_subtype",
"custom_fields",
"custom_fields.date_value",
"custom_fields.date_value.date",
"custom_fields.date_value.date_time",
"custom_fields.display_value",
"custom_fields.enabled",
"custom_fields.enum_options",
"custom_fields.enum_options.color",
"custom_fields.enum_options.enabled",
"custom_fields.enum_options.name",
"custom_fields.enum_value",
"custom_fields.enum_value.color",
"custom_fields.enum_value.enabled",
"custom_fields.enum_value.name",
"custom_fields.id_prefix",
"custom_fields.input_restrictions",
"custom_fields.is_formula_field",
"custom_fields.multi_enum_values",
"custom_fields.multi_enum_values.color",
"custom_fields.multi_enum_values.enabled",
"custom_fields.multi_enum_values.name",
"custom_fields.name",
"custom_fields.number_value",
"custom_fields.representation_type",
"custom_fields.text_value",
"custom_fields.type",
"custom_type",
"custom_type.asana_created_type_identifier",
"custom_type.name",
"default_access_level",
"due_on",
"members",
"members.name",
"name",
"owner",
"owner.name",
"permalink_url",
"privacy_setting",
"project_templates",
"project_templates.name",
"public",
"resource_subtype",
"start_on",
"workspace",
"workspace.name"
],
"schema": {
"type": "array",
"items": {
"type": "string",
"enum": [
"archived",
"color",
"created_at",
"created_by",
"created_by.name",
"current_status_update",
"current_status_update.resource_subtype",
"current_status_update.title",
"custom_field_settings",
"custom_field_settings.custom_field",
"custom_field_settings.custom_field.asana_created_field",
"custom_field_settings.custom_field.created_by",
"custom_field_settings.custom_field.created_by.name",
"custom_field_settings.custom_field.currency_code",
"custom_field_settings.custom_field.custom_label",
"custom_field_settings.custom_field.custom_label_position",
"custom_field_settings.custom_field.date_value",
"custom_field_settings.custom_field.date_value.date",
"custom_field_settings.custom_field.date_value.date_time",
"custom_field_settings.custom_field.default_access_level",
"custom_field_settings.custom_field.description",
"custom_field_settings.custom_field.display_value",
"custom_field_settings.custom_field.enabled",
"custom_field_settings.custom_field.enum_options",
"custom_field_settings.custom_field.enum_options.color",
"custom_field_settings.custom_field.enum_options.enabled",
"custom_field_settings.custom_field.enum_options.name",
"custom_field_settings.custom_field.enum_value",
"custom_field_settings.custom_field.enum_value.color",
"custom_field_settings.custom_field.enum_value.enabled",
"custom_field_settings.custom_field.enum_value.name",
"custom_field_settings.custom_field.format",
"custom_field_settings.custom_field.has_notifications_enabled",
"custom_field_settings.custom_field.html_text_value",
"custom_field_settings.custom_field.id_prefix",
"custom_field_settings.custom_field.input_restrictions",
"custom_field_settings.custom_field.is_formula_field",
"custom_field_settings.custom_field.is_global_to_workspace",
"custom_field_settings.custom_field.is_value_read_only",
"custom_field_settings.custom_field.multi_enum_values",
"custom_field_settings.custom_field.multi_enum_values.color",
"custom_field_settings.custom_field.multi_enum_values.enabled",
"custom_field_settings.custom_field.multi_enum_values.name",
"custom_field_settings.custom_field.name",
"custom_field_settings.custom_field.number_value",
"custom_field_settings.custom_field.people_value",
"custom_field_settings.custom_field.people_value.name",
"custom_field_settings.custom_field.precision",
"custom_field_settings.custom_field.privacy_setting",
"custom_field_settings.custom_field.reference_value",
"custom_field_settings.custom_field.reference_value.name",
"custom_field_settings.custom_field.representation_type",
"custom_field_settings.custom_field.resource_subtype",
"custom_field_settings.custom_field.text_value",
"custom_field_settings.custom_field.type",
"custom_field_settings.is_important",
"custom_field_settings.parent",
"custom_field_settings.parent.name",
"custom_field_settings.parent.resource_subtype",
"custom_field_settings.project",
"custom_field_settings.project.name",
"custom_field_settings.project.resource_subtype",
"custom_fields",
"custom_fields.date_value",
"custom_fields.date_value.date",
"custom_fields.date_value.date_time",
"custom_fields.display_value",
"custom_fields.enabled",
"custom_fields.enum_options",
"custom_fields.enum_options.color",
"custom_fields.enum_options.enabled",
"custom_fields.enum_options.name",
"custom_fields.enum_value",
"custom_fields.enum_value.color",
"custom_fields.enum_value.enabled",
"custom_fields.enum_value.name",
"custom_fields.id_prefix",
"custom_fields.input_restrictions",
"custom_fields.is_formula_field",
"custom_fields.multi_enum_values",
"custom_fields.multi_enum_values.color",
"custom_fields.multi_enum_values.enabled",
"custom_fields.multi_enum_values.name",
"custom_fields.name",
"custom_fields.number_value",
"custom_fields.representation_type",
"custom_fields.text_value",
"custom_fields.type",
"custom_type",
"custom_type.asana_created_type_identifier",
"custom_type.name",
"default_access_level",
"due_on",
"members",
"members.name",
"name",
"owner",
"owner.name",
"permalink_url",
"privacy_setting",
"project_templates",
"project_templates.name",
"public",
"resource_subtype",
"start_on",
"workspace",
"workspace.name"
]
}
},
"style": "form",
"explode": false
}
],
"requestBody": {
"description": "Information about the members being added.",
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"$ref": "#/components/schemas/AddMembersRequest"
}
}
}
}
}
},
"responses": {
"200": {
"description": "Successfully added members to the portfolio.",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"$ref": "#/components/schemas/PortfolioResponse"
}
}
}
}
}
},
"400": {
"$ref": "#/components/responses/BadRequest"
},
"401": {
"$ref": "#/components/responses/Unauthorized"
},
"403": {
"$ref": "#/components/responses/Forbidden"
},
"404": {
"$ref": "#/components/responses/NotFound"
},
"500": {
"$ref": "#/components/responses/InternalServerError"
}
},
"security": [
{
"personalAccessToken": []
},
{
"oauth2": []
}
],
"x-readme": {
"code-samples": [
{
"language": "java",
"install": "<dependency><groupId>com.asana</groupId><artifactId>asana</artifactId><version>1.0.0</version></dependency>",
"code": "import com.asana.Client;\n\nClient client = Client.accessToken(\"PERSONAL_ACCESS_TOKEN\");\n\nPortfolio result = client.portfolios.addMembersForPortfolio(portfolioGid)\n .data(\"field\", \"value\")\n .data(\"field\", \"value\")\n .option(\"pretty\", true)\n .execute();"
},
{
"language": "node",
"install": "npm install asana",
"code": "const Asana = require('asana');\n\nlet client = new Asana.ApiClient();\nclient.authentications.token.accessToken = '<YOUR_ACCESS_TOKEN>';\n\nlet portfoliosApiInstance = new Asana.PortfoliosApi(client);\nlet body = {\"data\": {\"<PARAM_1>\": \"<VALUE_1>\", \"<PARAM_2>\": \"<VALUE_2>\",}}; // Object | Information about the members being added.\nlet portfolio_gid = \"12345\"; // String | Globally unique identifier for the portfolio.\nlet opts = { \n 'opt_fields': \"archived,color,created_at,created_by,created_by.name,current_status_update,current_status_update.resource_subtype,current_status_update.title,custom_field_settings,custom_field_settings.custom_field,custom_field_settings.custom_field.asana_created_field,custom_field_settings.custom_field.created_by,custom_field_settings.custom_field.created_by.name,custom_field_settings.custom_field.currency_code,custom_field_settings.custom_field.custom_label,custom_field_settings.custom_field.custom_label_position,custom_field_settings.custom_field.date_value,custom_field_settings.custom_field.date_value.date,custom_field_settings.custom_field.date_value.date_time,custom_field_settings.custom_field.default_access_level,custom_field_settings.custom_field.description,custom_field_settings.custom_field.display_value,custom_field_settings.custom_field.enabled,custom_field_settings.custom_field.enum_options,custom_field_settings.custom_field.enum_options.color,custom_field_settings.custom_field.enum_options.enabled,custom_field_settings.custom_field.enum_options.name,custom_field_settings.custom_field.enum_value,custom_field_settings.custom_field.enum_value.color,custom_field_settings.custom_field.enum_value.enabled,custom_field_settings.custom_field.enum_value.name,custom_field_settings.custom_field.format,custom_field_settings.custom_field.has_notifications_enabled,custom_field_settings.custom_field.html_text_value,custom_field_settings.custom_field.id_prefix,custom_field_settings.custom_field.input_restrictions,custom_field_settings.custom_field.is_formula_field,custom_field_settings.custom_field.is_global_to_workspace,custom_field_settings.custom_field.is_value_read_only,custom_field_settings.custom_field.multi_enum_values,custom_field_settings.custom_field.multi_enum_values.color,custom_field_settings.custom_field.multi_enum_values.enabled,custom_field_settings.custom_field.multi_enum_values.name,custom_field_settings.custom_field.name,custom_field_settings.custom_field.number_value,custom_field_settings.custom_field.people_value,custom_field_settings.custom_field.people_value.name,custom_field_settings.custom_field.precision,custom_field_settings.custom_field.privacy_setting,custom_field_settings.custom_field.reference_value,custom_field_settings.custom_field.reference_value.name,custom_field_settings.custom_field.representation_type,custom_field_settings.custom_field.resource_subtype,custom_field_settings.custom_field.text_value,custom_field_settings.custom_field.type,custom_field_settings.is_important,custom_field_settings.parent,custom_field_settings.parent.name,custom_field_settings.parent.resource_subtype,custom_field_settings.project,custom_field_settings.project.name,custom_field_settings.project.resource_subtype,custom_fields,custom_fields.date_value,custom_fields.date_value.date,custom_fields.date_value.date_time,custom_fields.display_value,custom_fields.enabled,custom_fields.enum_options,custom_fields.enum_options.color,custom_fields.enum_options.enabled,custom_fields.enum_options.name,custom_fields.enum_value,custom_fields.enum_value.color,custom_fields.enum_value.enabled,custom_fields.enum_value.name,custom_fields.id_prefix,custom_fields.input_restrictions,custom_fields.is_formula_field,custom_fields.multi_enum_values,custom_fields.multi_enum_values.color,custom_fields.multi_enum_values.enabled,custom_fields.multi_enum_values.name,custom_fields.name,custom_fields.number_value,custom_fields.representation_type,custom_fields.text_value,custom_fields.type,custom_type,custom_type.asana_created_type_identifier,custom_type.name,default_access_level,due_on,members,members.name,name,owner,owner.name,permalink_url,privacy_setting,project_templates,project_templates.name,public,resource_subtype,start_on,workspace,workspace.name\"\n};\nportfoliosApiInstance.addMembersForPortfolio(body, portfolio_gid, opts).then((result) => {\n console.log('API called successfully. Returned data: ' + JSON.stringify(result.data, null, 2));\n}, (error) => {\n console.error(error.response.body);\n});",
"name": "node-sdk-v3"
},
{
"language": "node",
"install": "npm install asana@1.0.5",
"code": "const asana = require('asana');\n\nconst client = asana.Client.create().useAccessToken('PERSONAL_ACCESS_TOKEN');\n\nclient.portfolios.addMembersForPortfolio(portfolioGid, {field: \"value\", field: \"value\", pretty: true})\n .then((result) => {\n console.log(result);\n });",
"name": "node-sdk-v1"
},
{
"language": "python",
"install": "pip install asana",
"code": "import asana\nfrom asana.rest import ApiException\nfrom pprint import pprint\n\nconfiguration = asana.Configuration()\nconfiguration.access_token = '<YOUR_ACCESS_TOKEN>'\napi_client = asana.ApiClient(configuration)\n\n# create an instance of the API class\nportfolios_api_instance = asana.PortfoliosApi(api_client)\nbody = {\"data\": {\"<PARAM_1>\": \"<VALUE_1>\", \"<PARAM_2>\": \"<VALUE_2>\",}} # dict | Information about the members being added.\nportfolio_gid = \"12345\" # str | Globally unique identifier for the portfolio.\nopts = {\n 'opt_fields': \"archived,color,created_at,created_by,created_by.name,current_status_update,current_status_update.resource_subtype,current_status_update.title,custom_field_settings,custom_field_settings.custom_field,custom_field_settings.custom_field.asana_created_field,custom_field_settings.custom_field.created_by,custom_field_settings.custom_field.created_by.name,custom_field_settings.custom_field.currency_code,custom_field_settings.custom_field.custom_label,custom_field_settings.custom_field.custom_label_position,custom_field_settings.custom_field.date_value,custom_field_settings.custom_field.date_value.date,custom_field_settings.custom_field.date_value.date_time,custom_field_settings.custom_field.default_access_level,custom_field_settings.custom_field.description,custom_field_settings.custom_field.display_value,custom_field_settings.custom_field.enabled,custom_field_settings.custom_field.enum_options,custom_field_settings.custom_field.enum_options.color,custom_field_settings.custom_field.enum_options.enabled,custom_field_settings.custom_field.enum_options.name,custom_field_settings.custom_field.enum_value,custom_field_settings.custom_field.enum_value.color,custom_field_settings.custom_field.enum_value.enabled,custom_field_settings.custom_field.enum_value.name,custom_field_settings.custom_field.format,custom_field_settings.custom_field.has_notifications_enabled,custom_field_settings.custom_field.html_text_value,custom_field_settings.custom_field.id_prefix,custom_field_settings.custom_field.input_restrictions,custom_field_settings.custom_field.is_formula_field,custom_field_settings.custom_field.is_global_to_workspace,custom_field_settings.custom_field.is_value_read_only,custom_field_settings.custom_field.multi_enum_values,custom_field_settings.custom_field.multi_enum_values.color,custom_field_settings.custom_field.multi_enum_values.enabled,custom_field_settings.custom_field.multi_enum_values.name,custom_field_settings.custom_field.name,custom_field_settings.custom_field.number_value,custom_field_settings.custom_field.people_value,custom_field_settings.custom_field.people_value.name,custom_field_settings.custom_field.precision,custom_field_settings.custom_field.privacy_setting,custom_field_settings.custom_field.reference_value,custom_field_settings.custom_field.reference_value.name,custom_field_settings.custom_field.representation_type,custom_field_settings.custom_field.resource_subtype,custom_field_settings.custom_field.text_value,custom_field_settings.custom_field.type,custom_field_settings.is_important,custom_field_settings.parent,custom_field_settings.parent.name,custom_field_settings.parent.resource_subtype,custom_field_settings.project,custom_field_settings.project.name,custom_field_settings.project.resource_subtype,custom_fields,custom_fields.date_value,custom_fields.date_value.date,custom_fields.date_value.date_time,custom_fields.display_value,custom_fields.enabled,custom_fields.enum_options,custom_fields.enum_options.color,custom_fields.enum_options.enabled,custom_fields.enum_options.name,custom_fields.enum_value,custom_fields.enum_value.color,custom_fields.enum_value.enabled,custom_fields.enum_value.name,custom_fields.id_prefix,custom_fields.input_restrictions,custom_fields.is_formula_field,custom_fields.multi_enum_values,custom_fields.multi_enum_values.color,custom_fields.multi_enum_values.enabled,custom_fields.multi_enum_values.name,custom_fields.name,custom_fields.number_value,custom_fields.representation_type,custom_fields.text_value,custom_fields.type,custom_type,custom_type.asana_created_type_identifier,custom_type.name,default_access_level,due_on,members,members.name,name,owner,owner.name,permalink_url,privacy_setting,project_templates,project_templates.name,public,resource_subtype,start_on,workspace,workspace.name\", # list[str] | 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.\n}\n\ntry:\n # Add users to a portfolio\n api_response = portfolios_api_instance.add_members_for_portfolio(body, portfolio_gid, opts)\n pprint(api_response)\nexcept ApiException as e:\n print(\"Exception when calling PortfoliosApi->add_members_for_portfolio: %s\\n\" % e)",
"name": "python-sdk-v5"
},
{
"language": "python",
"install": "pip install asana==3.2.3",
"code": "import asana\n\nclient = asana.Client.access_token('PERSONAL_ACCESS_TOKEN')\n\nresult = client.portfolios.add_members_for_portfolio(portfolio_gid, {'field': 'value', 'field': 'value'}, opt_pretty=True)",
"name": "python-sdk-v3"
},
{
"language": "php",
"install": "composer require asana/asana",
"code": "<?php\nrequire 'vendor/autoload.php';\n\n$client = Asana\\Client::accessToken('PERSONAL_ACCESS_TOKEN');\n\n$result = $client->portfolios->addMembersForPortfolio($portfolio_gid, array('field' => 'value', 'field' => 'value'), array('opt_pretty' => 'true'))"
},
{
"language": "ruby",
"install": "gem install asana",
"code": "require 'asana'\n\nclient = Asana::Client.new do |c|\n c.authentication :access_token, 'PERSONAL_ACCESS_TOKEN'\nend\n\nresult = client.portfolios.add_members_for_portfolio(portfolio_gid: 'portfolio_gid', field: \"value\", field: \"value\", options: {pretty: true})"
}
]
},
"x-purple-suite-runtime": "unavailable"
}
POST /api/1.0/portfolios/{portfolio_gid}/removeMembers
Remove users from a portfolio
Removes the specified list of users from members of the portfolio.
Returns the updated portfolio record.
This operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.
Authentication
[
{
"personalAccessToken": []
},
{
"oauth2": []
}
]
Path-level parameters and metadata
{
"parameters": [
{
"$ref": "#/components/parameters/portfolio_path_gid"
},
{
"$ref": "#/components/parameters/pretty"
}
]
}
Request, responses and operation details
{
"summary": "Remove users from a portfolio",
"description": "Removes the specified list of users from members of the portfolio.\nReturns the updated portfolio record.\n\nThis operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.",
"tags": [
"Portfolios"
],
"operationId": "removeMembersForPortfolio",
"parameters": [
{
"name": "opt_fields",
"in": "query",
"description": "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. Properties can include nested fields. To learn more, see the [input/output options guide](/docs/inputoutput-options#selecting-nested-fields).",
"required": false,
"example": [
"archived",
"color",
"created_at",
"created_by",
"created_by.name",
"current_status_update",
"current_status_update.resource_subtype",
"current_status_update.title",
"custom_field_settings",
"custom_field_settings.custom_field",
"custom_field_settings.custom_field.asana_created_field",
"custom_field_settings.custom_field.created_by",
"custom_field_settings.custom_field.created_by.name",
"custom_field_settings.custom_field.currency_code",
"custom_field_settings.custom_field.custom_label",
"custom_field_settings.custom_field.custom_label_position",
"custom_field_settings.custom_field.date_value",
"custom_field_settings.custom_field.date_value.date",
"custom_field_settings.custom_field.date_value.date_time",
"custom_field_settings.custom_field.default_access_level",
"custom_field_settings.custom_field.description",
"custom_field_settings.custom_field.display_value",
"custom_field_settings.custom_field.enabled",
"custom_field_settings.custom_field.enum_options",
"custom_field_settings.custom_field.enum_options.color",
"custom_field_settings.custom_field.enum_options.enabled",
"custom_field_settings.custom_field.enum_options.name",
"custom_field_settings.custom_field.enum_value",
"custom_field_settings.custom_field.enum_value.color",
"custom_field_settings.custom_field.enum_value.enabled",
"custom_field_settings.custom_field.enum_value.name",
"custom_field_settings.custom_field.format",
"custom_field_settings.custom_field.has_notifications_enabled",
"custom_field_settings.custom_field.html_text_value",
"custom_field_settings.custom_field.id_prefix",
"custom_field_settings.custom_field.input_restrictions",
"custom_field_settings.custom_field.is_formula_field",
"custom_field_settings.custom_field.is_global_to_workspace",
"custom_field_settings.custom_field.is_value_read_only",
"custom_field_settings.custom_field.multi_enum_values",
"custom_field_settings.custom_field.multi_enum_values.color",
"custom_field_settings.custom_field.multi_enum_values.enabled",
"custom_field_settings.custom_field.multi_enum_values.name",
"custom_field_settings.custom_field.name",
"custom_field_settings.custom_field.number_value",
"custom_field_settings.custom_field.people_value",
"custom_field_settings.custom_field.people_value.name",
"custom_field_settings.custom_field.precision",
"custom_field_settings.custom_field.privacy_setting",
"custom_field_settings.custom_field.reference_value",
"custom_field_settings.custom_field.reference_value.name",
"custom_field_settings.custom_field.representation_type",
"custom_field_settings.custom_field.resource_subtype",
"custom_field_settings.custom_field.text_value",
"custom_field_settings.custom_field.type",
"custom_field_settings.is_important",
"custom_field_settings.parent",
"custom_field_settings.parent.name",
"custom_field_settings.parent.resource_subtype",
"custom_field_settings.project",
"custom_field_settings.project.name",
"custom_field_settings.project.resource_subtype",
"custom_fields",
"custom_fields.date_value",
"custom_fields.date_value.date",
"custom_fields.date_value.date_time",
"custom_fields.display_value",
"custom_fields.enabled",
"custom_fields.enum_options",
"custom_fields.enum_options.color",
"custom_fields.enum_options.enabled",
"custom_fields.enum_options.name",
"custom_fields.enum_value",
"custom_fields.enum_value.color",
"custom_fields.enum_value.enabled",
"custom_fields.enum_value.name",
"custom_fields.id_prefix",
"custom_fields.input_restrictions",
"custom_fields.is_formula_field",
"custom_fields.multi_enum_values",
"custom_fields.multi_enum_values.color",
"custom_fields.multi_enum_values.enabled",
"custom_fields.multi_enum_values.name",
"custom_fields.name",
"custom_fields.number_value",
"custom_fields.representation_type",
"custom_fields.text_value",
"custom_fields.type",
"custom_type",
"custom_type.asana_created_type_identifier",
"custom_type.name",
"default_access_level",
"due_on",
"members",
"members.name",
"name",
"owner",
"owner.name",
"permalink_url",
"privacy_setting",
"project_templates",
"project_templates.name",
"public",
"resource_subtype",
"start_on",
"workspace",
"workspace.name"
],
"schema": {
"type": "array",
"items": {
"type": "string",
"enum": [
"archived",
"color",
"created_at",
"created_by",
"created_by.name",
"current_status_update",
"current_status_update.resource_subtype",
"current_status_update.title",
"custom_field_settings",
"custom_field_settings.custom_field",
"custom_field_settings.custom_field.asana_created_field",
"custom_field_settings.custom_field.created_by",
"custom_field_settings.custom_field.created_by.name",
"custom_field_settings.custom_field.currency_code",
"custom_field_settings.custom_field.custom_label",
"custom_field_settings.custom_field.custom_label_position",
"custom_field_settings.custom_field.date_value",
"custom_field_settings.custom_field.date_value.date",
"custom_field_settings.custom_field.date_value.date_time",
"custom_field_settings.custom_field.default_access_level",
"custom_field_settings.custom_field.description",
"custom_field_settings.custom_field.display_value",
"custom_field_settings.custom_field.enabled",
"custom_field_settings.custom_field.enum_options",
"custom_field_settings.custom_field.enum_options.color",
"custom_field_settings.custom_field.enum_options.enabled",
"custom_field_settings.custom_field.enum_options.name",
"custom_field_settings.custom_field.enum_value",
"custom_field_settings.custom_field.enum_value.color",
"custom_field_settings.custom_field.enum_value.enabled",
"custom_field_settings.custom_field.enum_value.name",
"custom_field_settings.custom_field.format",
"custom_field_settings.custom_field.has_notifications_enabled",
"custom_field_settings.custom_field.html_text_value",
"custom_field_settings.custom_field.id_prefix",
"custom_field_settings.custom_field.input_restrictions",
"custom_field_settings.custom_field.is_formula_field",
"custom_field_settings.custom_field.is_global_to_workspace",
"custom_field_settings.custom_field.is_value_read_only",
"custom_field_settings.custom_field.multi_enum_values",
"custom_field_settings.custom_field.multi_enum_values.color",
"custom_field_settings.custom_field.multi_enum_values.enabled",
"custom_field_settings.custom_field.multi_enum_values.name",
"custom_field_settings.custom_field.name",
"custom_field_settings.custom_field.number_value",
"custom_field_settings.custom_field.people_value",
"custom_field_settings.custom_field.people_value.name",
"custom_field_settings.custom_field.precision",
"custom_field_settings.custom_field.privacy_setting",
"custom_field_settings.custom_field.reference_value",
"custom_field_settings.custom_field.reference_value.name",
"custom_field_settings.custom_field.representation_type",
"custom_field_settings.custom_field.resource_subtype",
"custom_field_settings.custom_field.text_value",
"custom_field_settings.custom_field.type",
"custom_field_settings.is_important",
"custom_field_settings.parent",
"custom_field_settings.parent.name",
"custom_field_settings.parent.resource_subtype",
"custom_field_settings.project",
"custom_field_settings.project.name",
"custom_field_settings.project.resource_subtype",
"custom_fields",
"custom_fields.date_value",
"custom_fields.date_value.date",
"custom_fields.date_value.date_time",
"custom_fields.display_value",
"custom_fields.enabled",
"custom_fields.enum_options",
"custom_fields.enum_options.color",
"custom_fields.enum_options.enabled",
"custom_fields.enum_options.name",
"custom_fields.enum_value",
"custom_fields.enum_value.color",
"custom_fields.enum_value.enabled",
"custom_fields.enum_value.name",
"custom_fields.id_prefix",
"custom_fields.input_restrictions",
"custom_fields.is_formula_field",
"custom_fields.multi_enum_values",
"custom_fields.multi_enum_values.color",
"custom_fields.multi_enum_values.enabled",
"custom_fields.multi_enum_values.name",
"custom_fields.name",
"custom_fields.number_value",
"custom_fields.representation_type",
"custom_fields.text_value",
"custom_fields.type",
"custom_type",
"custom_type.asana_created_type_identifier",
"custom_type.name",
"default_access_level",
"due_on",
"members",
"members.name",
"name",
"owner",
"owner.name",
"permalink_url",
"privacy_setting",
"project_templates",
"project_templates.name",
"public",
"resource_subtype",
"start_on",
"workspace",
"workspace.name"
]
}
},
"style": "form",
"explode": false
}
],
"requestBody": {
"description": "Information about the members being removed.",
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"$ref": "#/components/schemas/RemoveMembersRequest"
}
}
}
}
}
},
"responses": {
"200": {
"description": "Successfully removed the members from the portfolio.",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"$ref": "#/components/schemas/PortfolioResponse"
}
}
}
}
}
},
"400": {
"$ref": "#/components/responses/BadRequest"
},
"401": {
"$ref": "#/components/responses/Unauthorized"
},
"403": {
"$ref": "#/components/responses/Forbidden"
},
"404": {
"$ref": "#/components/responses/NotFound"
},
"500": {
"$ref": "#/components/responses/InternalServerError"
}
},
"security": [
{
"personalAccessToken": []
},
{
"oauth2": []
}
],
"x-readme": {
"code-samples": [
{
"language": "java",
"install": "<dependency><groupId>com.asana</groupId><artifactId>asana</artifactId><version>1.0.0</version></dependency>",
"code": "import com.asana.Client;\n\nClient client = Client.accessToken(\"PERSONAL_ACCESS_TOKEN\");\n\nPortfolio result = client.portfolios.removeMembersForPortfolio(portfolioGid)\n .data(\"field\", \"value\")\n .data(\"field\", \"value\")\n .option(\"pretty\", true)\n .execute();"
},
{
"language": "node",
"install": "npm install asana",
"code": "const Asana = require('asana');\n\nlet client = new Asana.ApiClient();\nclient.authentications.token.accessToken = '<YOUR_ACCESS_TOKEN>';\n\nlet portfoliosApiInstance = new Asana.PortfoliosApi(client);\nlet body = {\"data\": {\"<PARAM_1>\": \"<VALUE_1>\", \"<PARAM_2>\": \"<VALUE_2>\",}}; // Object | Information about the members being removed.\nlet portfolio_gid = \"12345\"; // String | Globally unique identifier for the portfolio.\nlet opts = { \n 'opt_fields': \"archived,color,created_at,created_by,created_by.name,current_status_update,current_status_update.resource_subtype,current_status_update.title,custom_field_settings,custom_field_settings.custom_field,custom_field_settings.custom_field.asana_created_field,custom_field_settings.custom_field.created_by,custom_field_settings.custom_field.created_by.name,custom_field_settings.custom_field.currency_code,custom_field_settings.custom_field.custom_label,custom_field_settings.custom_field.custom_label_position,custom_field_settings.custom_field.date_value,custom_field_settings.custom_field.date_value.date,custom_field_settings.custom_field.date_value.date_time,custom_field_settings.custom_field.default_access_level,custom_field_settings.custom_field.description,custom_field_settings.custom_field.display_value,custom_field_settings.custom_field.enabled,custom_field_settings.custom_field.enum_options,custom_field_settings.custom_field.enum_options.color,custom_field_settings.custom_field.enum_options.enabled,custom_field_settings.custom_field.enum_options.name,custom_field_settings.custom_field.enum_value,custom_field_settings.custom_field.enum_value.color,custom_field_settings.custom_field.enum_value.enabled,custom_field_settings.custom_field.enum_value.name,custom_field_settings.custom_field.format,custom_field_settings.custom_field.has_notifications_enabled,custom_field_settings.custom_field.html_text_value,custom_field_settings.custom_field.id_prefix,custom_field_settings.custom_field.input_restrictions,custom_field_settings.custom_field.is_formula_field,custom_field_settings.custom_field.is_global_to_workspace,custom_field_settings.custom_field.is_value_read_only,custom_field_settings.custom_field.multi_enum_values,custom_field_settings.custom_field.multi_enum_values.color,custom_field_settings.custom_field.multi_enum_values.enabled,custom_field_settings.custom_field.multi_enum_values.name,custom_field_settings.custom_field.name,custom_field_settings.custom_field.number_value,custom_field_settings.custom_field.people_value,custom_field_settings.custom_field.people_value.name,custom_field_settings.custom_field.precision,custom_field_settings.custom_field.privacy_setting,custom_field_settings.custom_field.reference_value,custom_field_settings.custom_field.reference_value.name,custom_field_settings.custom_field.representation_type,custom_field_settings.custom_field.resource_subtype,custom_field_settings.custom_field.text_value,custom_field_settings.custom_field.type,custom_field_settings.is_important,custom_field_settings.parent,custom_field_settings.parent.name,custom_field_settings.parent.resource_subtype,custom_field_settings.project,custom_field_settings.project.name,custom_field_settings.project.resource_subtype,custom_fields,custom_fields.date_value,custom_fields.date_value.date,custom_fields.date_value.date_time,custom_fields.display_value,custom_fields.enabled,custom_fields.enum_options,custom_fields.enum_options.color,custom_fields.enum_options.enabled,custom_fields.enum_options.name,custom_fields.enum_value,custom_fields.enum_value.color,custom_fields.enum_value.enabled,custom_fields.enum_value.name,custom_fields.id_prefix,custom_fields.input_restrictions,custom_fields.is_formula_field,custom_fields.multi_enum_values,custom_fields.multi_enum_values.color,custom_fields.multi_enum_values.enabled,custom_fields.multi_enum_values.name,custom_fields.name,custom_fields.number_value,custom_fields.representation_type,custom_fields.text_value,custom_fields.type,custom_type,custom_type.asana_created_type_identifier,custom_type.name,default_access_level,due_on,members,members.name,name,owner,owner.name,permalink_url,privacy_setting,project_templates,project_templates.name,public,resource_subtype,start_on,workspace,workspace.name\"\n};\nportfoliosApiInstance.removeMembersForPortfolio(body, portfolio_gid, opts).then((result) => {\n console.log('API called successfully. Returned data: ' + JSON.stringify(result.data, null, 2));\n}, (error) => {\n console.error(error.response.body);\n});",
"name": "node-sdk-v3"
},
{
"language": "node",
"install": "npm install asana@1.0.5",
"code": "const asana = require('asana');\n\nconst client = asana.Client.create().useAccessToken('PERSONAL_ACCESS_TOKEN');\n\nclient.portfolios.removeMembersForPortfolio(portfolioGid, {field: \"value\", field: \"value\", pretty: true})\n .then((result) => {\n console.log(result);\n });",
"name": "node-sdk-v1"
},
{
"language": "python",
"install": "pip install asana",
"code": "import asana\nfrom asana.rest import ApiException\nfrom pprint import pprint\n\nconfiguration = asana.Configuration()\nconfiguration.access_token = '<YOUR_ACCESS_TOKEN>'\napi_client = asana.ApiClient(configuration)\n\n# create an instance of the API class\nportfolios_api_instance = asana.PortfoliosApi(api_client)\nbody = {\"data\": {\"<PARAM_1>\": \"<VALUE_1>\", \"<PARAM_2>\": \"<VALUE_2>\",}} # dict | Information about the members being removed.\nportfolio_gid = \"12345\" # str | Globally unique identifier for the portfolio.\nopts = {\n 'opt_fields': \"archived,color,created_at,created_by,created_by.name,current_status_update,current_status_update.resource_subtype,current_status_update.title,custom_field_settings,custom_field_settings.custom_field,custom_field_settings.custom_field.asana_created_field,custom_field_settings.custom_field.created_by,custom_field_settings.custom_field.created_by.name,custom_field_settings.custom_field.currency_code,custom_field_settings.custom_field.custom_label,custom_field_settings.custom_field.custom_label_position,custom_field_settings.custom_field.date_value,custom_field_settings.custom_field.date_value.date,custom_field_settings.custom_field.date_value.date_time,custom_field_settings.custom_field.default_access_level,custom_field_settings.custom_field.description,custom_field_settings.custom_field.display_value,custom_field_settings.custom_field.enabled,custom_field_settings.custom_field.enum_options,custom_field_settings.custom_field.enum_options.color,custom_field_settings.custom_field.enum_options.enabled,custom_field_settings.custom_field.enum_options.name,custom_field_settings.custom_field.enum_value,custom_field_settings.custom_field.enum_value.color,custom_field_settings.custom_field.enum_value.enabled,custom_field_settings.custom_field.enum_value.name,custom_field_settings.custom_field.format,custom_field_settings.custom_field.has_notifications_enabled,custom_field_settings.custom_field.html_text_value,custom_field_settings.custom_field.id_prefix,custom_field_settings.custom_field.input_restrictions,custom_field_settings.custom_field.is_formula_field,custom_field_settings.custom_field.is_global_to_workspace,custom_field_settings.custom_field.is_value_read_only,custom_field_settings.custom_field.multi_enum_values,custom_field_settings.custom_field.multi_enum_values.color,custom_field_settings.custom_field.multi_enum_values.enabled,custom_field_settings.custom_field.multi_enum_values.name,custom_field_settings.custom_field.name,custom_field_settings.custom_field.number_value,custom_field_settings.custom_field.people_value,custom_field_settings.custom_field.people_value.name,custom_field_settings.custom_field.precision,custom_field_settings.custom_field.privacy_setting,custom_field_settings.custom_field.reference_value,custom_field_settings.custom_field.reference_value.name,custom_field_settings.custom_field.representation_type,custom_field_settings.custom_field.resource_subtype,custom_field_settings.custom_field.text_value,custom_field_settings.custom_field.type,custom_field_settings.is_important,custom_field_settings.parent,custom_field_settings.parent.name,custom_field_settings.parent.resource_subtype,custom_field_settings.project,custom_field_settings.project.name,custom_field_settings.project.resource_subtype,custom_fields,custom_fields.date_value,custom_fields.date_value.date,custom_fields.date_value.date_time,custom_fields.display_value,custom_fields.enabled,custom_fields.enum_options,custom_fields.enum_options.color,custom_fields.enum_options.enabled,custom_fields.enum_options.name,custom_fields.enum_value,custom_fields.enum_value.color,custom_fields.enum_value.enabled,custom_fields.enum_value.name,custom_fields.id_prefix,custom_fields.input_restrictions,custom_fields.is_formula_field,custom_fields.multi_enum_values,custom_fields.multi_enum_values.color,custom_fields.multi_enum_values.enabled,custom_fields.multi_enum_values.name,custom_fields.name,custom_fields.number_value,custom_fields.representation_type,custom_fields.text_value,custom_fields.type,custom_type,custom_type.asana_created_type_identifier,custom_type.name,default_access_level,due_on,members,members.name,name,owner,owner.name,permalink_url,privacy_setting,project_templates,project_templates.name,public,resource_subtype,start_on,workspace,workspace.name\", # list[str] | 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.\n}\n\ntry:\n # Remove users from a portfolio\n api_response = portfolios_api_instance.remove_members_for_portfolio(body, portfolio_gid, opts)\n pprint(api_response)\nexcept ApiException as e:\n print(\"Exception when calling PortfoliosApi->remove_members_for_portfolio: %s\\n\" % e)",
"name": "python-sdk-v5"
},
{
"language": "python",
"install": "pip install asana==3.2.3",
"code": "import asana\n\nclient = asana.Client.access_token('PERSONAL_ACCESS_TOKEN')\n\nresult = client.portfolios.remove_members_for_portfolio(portfolio_gid, {'field': 'value', 'field': 'value'}, opt_pretty=True)",
"name": "python-sdk-v3"
},
{
"language": "php",
"install": "composer require asana/asana",
"code": "<?php\nrequire 'vendor/autoload.php';\n\n$client = Asana\\Client::accessToken('PERSONAL_ACCESS_TOKEN');\n\n$result = $client->portfolios->removeMembersForPortfolio($portfolio_gid, array('field' => 'value', 'field' => 'value'), array('opt_pretty' => 'true'))"
},
{
"language": "ruby",
"install": "gem install asana",
"code": "require 'asana'\n\nclient = Asana::Client.new do |c|\n c.authentication :access_token, 'PERSONAL_ACCESS_TOKEN'\nend\n\nresult = client.portfolios.remove_members_for_portfolio(portfolio_gid: 'portfolio_gid', field: \"value\", field: \"value\", options: {pretty: true})"
}
]
},
"x-purple-suite-runtime": "unavailable"
}
POST /api/1.0/portfolios/{portfolio_gid}/duplicate
Duplicate a portfolio
<b>Required scope: </b><code>portfolios:write</code>
Creates and returns a job that will asynchronously handle the duplication.
This operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.
Authentication
[
{
"personalAccessToken": []
},
{
"oauth2": [
"portfolios:write"
]
}
]
Path-level parameters and metadata
{
"parameters": [
{
"$ref": "#/components/parameters/portfolio_path_gid"
},
{
"$ref": "#/components/parameters/pretty"
}
]
}
Request, responses and operation details
{
"summary": "Duplicate a portfolio",
"description": "<b>Required scope: </b><code>portfolios:write</code>\n\nCreates and returns a job that will asynchronously handle the duplication.\n\nThis operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.",
"tags": [
"Portfolios"
],
"operationId": "duplicatePortfolio",
"parameters": [
{
"name": "opt_fields",
"in": "query",
"description": "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. Properties can include nested fields. To learn more, see the [input/output options guide](/docs/inputoutput-options#selecting-nested-fields).",
"required": false,
"example": [
"new_graph_export",
"new_graph_export.completed_at",
"new_graph_export.created_at",
"new_graph_export.download_url",
"new_portfolio",
"new_portfolio.name",
"new_portfolio.resource_subtype",
"new_project",
"new_project.name",
"new_project.resource_subtype",
"new_project_template",
"new_project_template.name",
"new_resource_export",
"new_resource_export.completed_at",
"new_resource_export.created_at",
"new_resource_export.download_url",
"new_task",
"new_task.created_by",
"new_task.name",
"new_task.resource_subtype",
"resource_subtype",
"status"
],
"schema": {
"type": "array",
"items": {
"type": "string",
"enum": [
"new_graph_export",
"new_graph_export.completed_at",
"new_graph_export.created_at",
"new_graph_export.download_url",
"new_portfolio",
"new_portfolio.name",
"new_portfolio.resource_subtype",
"new_project",
"new_project.name",
"new_project.resource_subtype",
"new_project_template",
"new_project_template.name",
"new_resource_export",
"new_resource_export.completed_at",
"new_resource_export.created_at",
"new_resource_export.download_url",
"new_task",
"new_task.created_by",
"new_task.name",
"new_task.resource_subtype",
"resource_subtype",
"status"
]
}
},
"style": "form",
"explode": false
}
],
"requestBody": {
"description": "Describes the duplicate's name and the elements that will be duplicated.",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"$ref": "#/components/schemas/PortfolioDuplicateRequest"
}
}
}
}
}
},
"responses": {
"201": {
"description": "Successfully created the job to handle duplication.",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"$ref": "#/components/schemas/JobResponse"
}
}
}
}
}
},
"400": {
"$ref": "#/components/responses/BadRequest"
},
"401": {
"$ref": "#/components/responses/Unauthorized"
},
"403": {
"$ref": "#/components/responses/Forbidden"
},
"404": {
"$ref": "#/components/responses/NotFound"
},
"500": {
"$ref": "#/components/responses/InternalServerError"
}
},
"security": [
{
"personalAccessToken": []
},
{
"oauth2": [
"portfolios:write"
]
}
],
"x-readme": {
"code-samples": [
{
"language": "node",
"install": "npm install asana",
"code": "const Asana = require('asana');\n\nlet client = new Asana.ApiClient();\nclient.authentications.token.accessToken = '<YOUR_ACCESS_TOKEN>';\n\nlet portfoliosApiInstance = new Asana.PortfoliosApi(client);\nlet portfolio_gid = \"12345\"; // String | Globally unique identifier for the portfolio.\nlet opts = { \n 'body': {\"data\": {\"<PARAM_1>\": \"<VALUE_1>\", \"<PARAM_2>\": \"<VALUE_2>\",}}, \n 'opt_fields': \"new_graph_export,new_graph_export.completed_at,new_graph_export.created_at,new_graph_export.download_url,new_portfolio,new_portfolio.name,new_portfolio.resource_subtype,new_project,new_project.name,new_project.resource_subtype,new_project_template,new_project_template.name,new_resource_export,new_resource_export.completed_at,new_resource_export.created_at,new_resource_export.download_url,new_task,new_task.created_by,new_task.name,new_task.resource_subtype,resource_subtype,status\"\n};\nportfoliosApiInstance.duplicatePortfolio(portfolio_gid, opts).then((result) => {\n console.log('API called successfully. Returned data: ' + JSON.stringify(result.data, null, 2));\n}, (error) => {\n console.error(error.response.body);\n});",
"name": "node-sdk-v3"
},
{
"language": "python",
"install": "pip install asana",
"code": "import asana\nfrom asana.rest import ApiException\nfrom pprint import pprint\n\nconfiguration = asana.Configuration()\nconfiguration.access_token = '<YOUR_ACCESS_TOKEN>'\napi_client = asana.ApiClient(configuration)\n\n# create an instance of the API class\nportfolios_api_instance = asana.PortfoliosApi(api_client)\nportfolio_gid = \"12345\" # str | Globally unique identifier for the portfolio.\nopts = {\n 'body': {\"data\": {\"<PARAM_1>\": \"<VALUE_1>\", \"<PARAM_2>\": \"<VALUE_2>\",}}, # dict | Describes the duplicate's name and the elements that will be duplicated.\n 'opt_fields': \"new_graph_export,new_graph_export.completed_at,new_graph_export.created_at,new_graph_export.download_url,new_portfolio,new_portfolio.name,new_portfolio.resource_subtype,new_project,new_project.name,new_project.resource_subtype,new_project_template,new_project_template.name,new_resource_export,new_resource_export.completed_at,new_resource_export.created_at,new_resource_export.download_url,new_task,new_task.created_by,new_task.name,new_task.resource_subtype,resource_subtype,status\", # list[str] | 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.\n}\n\ntry:\n # Duplicate a portfolio\n api_response = portfolios_api_instance.duplicate_portfolio(portfolio_gid, opts)\n pprint(api_response)\nexcept ApiException as e:\n print(\"Exception when calling PortfoliosApi->duplicate_portfolio: %s\\n\" % e)",
"name": "python-sdk-v5"
}
]
},
"x-purple-suite-runtime": "unavailable"
}
GET /api/1.0/project_briefs/{project_brief_gid}
Get a project brief
Get the full record for a project brief.
This operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.
Authentication
[
{
"personalAccessToken": []
},
{
"oauth2": []
}
]
Path-level parameters and metadata
{
"parameters": [
{
"$ref": "#/components/parameters/project_brief_path_gid"
},
{
"$ref": "#/components/parameters/pretty"
}
]
}
Request, responses and operation details
{
"summary": "Get a project brief",
"description": "Get the full record for a project brief.\n\nThis operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.",
"tags": [
"Project briefs"
],
"operationId": "getProjectBrief",
"parameters": [
{
"name": "opt_fields",
"in": "query",
"description": "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. Properties can include nested fields. To learn more, see the [input/output options guide](/docs/inputoutput-options#selecting-nested-fields).",
"required": false,
"example": [
"html_text",
"permalink_url",
"project",
"project.name",
"project.resource_subtype",
"text",
"title"
],
"schema": {
"type": "array",
"items": {
"type": "string",
"enum": [
"html_text",
"permalink_url",
"project",
"project.name",
"project.resource_subtype",
"text",
"title"
]
}
},
"style": "form",
"explode": false
}
],
"responses": {
"200": {
"description": "Successfully retrieved the record for a project brief.",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"$ref": "#/components/schemas/ProjectBriefResponse"
}
}
}
}
}
},
"400": {
"$ref": "#/components/responses/BadRequest"
},
"401": {
"$ref": "#/components/responses/Unauthorized"
},
"402": {
"$ref": "#/components/responses/PaymentRequired"
},
"403": {
"$ref": "#/components/responses/Forbidden"
},
"404": {
"$ref": "#/components/responses/NotFound"
},
"424": {
"$ref": "#/components/responses/TooManyRequests"
},
"500": {
"$ref": "#/components/responses/InternalServerError"
},
"501": {
"$ref": "#/components/responses/BadGateway"
},
"503": {
"$ref": "#/components/responses/ServiceUnavailable"
},
"504": {
"$ref": "#/components/responses/GatewayTimeout"
}
},
"security": [
{
"personalAccessToken": []
},
{
"oauth2": []
}
],
"x-readme": {
"code-samples": [
{
"language": "java",
"install": "<dependency><groupId>com.asana</groupId><artifactId>asana</artifactId><version>1.0.0</version></dependency>",
"code": "import com.asana.Client;\n\nClient client = Client.accessToken(\"PERSONAL_ACCESS_TOKEN\");\n\nJsonElement result = client.projectbriefs.getProjectBrief(projectBriefGid)\n .option(\"pretty\", true)\n .execute();"
},
{
"language": "node",
"install": "npm install asana",
"code": "const Asana = require('asana');\n\nlet client = new Asana.ApiClient();\nclient.authentications.token.accessToken = '<YOUR_ACCESS_TOKEN>';\n\nlet projectBriefsApiInstance = new Asana.ProjectBriefsApi(client);\nlet project_brief_gid = \"12345\"; // String | Globally unique identifier for the project brief.\nlet opts = { \n 'opt_fields': \"html_text,permalink_url,project,project.name,project.resource_subtype,text,title\"\n};\nprojectBriefsApiInstance.getProjectBrief(project_brief_gid, opts).then((result) => {\n console.log('API called successfully. Returned data: ' + JSON.stringify(result.data, null, 2));\n}, (error) => {\n console.error(error.response.body);\n});",
"name": "node-sdk-v3"
},
{
"language": "node",
"install": "npm install asana@1.0.5",
"code": "const asana = require('asana');\n\nconst client = asana.Client.create().useAccessToken('PERSONAL_ACCESS_TOKEN');\n\nclient.projectbriefs.getProjectBrief(projectBriefGid, {param: \"value\", param: \"value\", opt_pretty: true})\n .then((result) => {\n console.log(result);\n });",
"name": "node-sdk-v1"
},
{
"language": "python",
"install": "pip install asana",
"code": "import asana\nfrom asana.rest import ApiException\nfrom pprint import pprint\n\nconfiguration = asana.Configuration()\nconfiguration.access_token = '<YOUR_ACCESS_TOKEN>'\napi_client = asana.ApiClient(configuration)\n\n# create an instance of the API class\nproject_briefs_api_instance = asana.ProjectBriefsApi(api_client)\nproject_brief_gid = \"12345\" # str | Globally unique identifier for the project brief.\nopts = {\n 'opt_fields': \"html_text,permalink_url,project,project.name,project.resource_subtype,text,title\", # list[str] | 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.\n}\n\ntry:\n # Get a project brief\n api_response = project_briefs_api_instance.get_project_brief(project_brief_gid, opts)\n pprint(api_response)\nexcept ApiException as e:\n print(\"Exception when calling ProjectBriefsApi->get_project_brief: %s\\n\" % e)",
"name": "python-sdk-v5"
},
{
"language": "python",
"install": "pip install asana==3.2.3",
"code": "import asana\n\nclient = asana.Client.access_token('PERSONAL_ACCESS_TOKEN')\n\nresult = client.project_briefs.get_project_brief(project_brief_gid, {'param': 'value', 'param': 'value'}, opt_pretty=True)",
"name": "python-sdk-v3"
},
{
"language": "php",
"install": "composer require asana/asana",
"code": "<?php\nrequire 'vendor/autoload.php';\n\n$client = Asana\\Client::accessToken('PERSONAL_ACCESS_TOKEN');\n\n$result = $client->projectbriefs->getProjectBrief($project_brief_gid, array('param' => 'value', 'param' => 'value'), array('opt_pretty' => 'true'))"
},
{
"language": "ruby",
"install": "gem install asana",
"code": "require 'asana'\n\nclient = Asana::Client.new do |c|\n c.authentication :access_token, 'PERSONAL_ACCESS_TOKEN'\nend\n\nresult = client.project_briefs.get_project_brief(project_brief_gid: 'project_brief_gid', param: \"value\", param: \"value\", options: {pretty: true})"
}
]
},
"x-purple-suite-runtime": "unavailable"
}
PUT /api/1.0/project_briefs/{project_brief_gid}
Update a project brief
An existing project brief can be updated by making a PUT request on the URL for
that project brief. Only the fields provided in the `data` block will be updated;
any unspecified fields will remain unchanged.
Returns the complete updated project brief record.
This operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.
Authentication
[
{
"personalAccessToken": []
},
{
"oauth2": []
}
]
Path-level parameters and metadata
{
"parameters": [
{
"$ref": "#/components/parameters/project_brief_path_gid"
},
{
"$ref": "#/components/parameters/pretty"
}
]
}
Request, responses and operation details
{
"summary": "Update a project brief",
"description": "An existing project brief can be updated by making a PUT request on the URL for\nthat project brief. Only the fields provided in the `data` block will be updated;\nany unspecified fields will remain unchanged.\n\nReturns the complete updated project brief record.\n\nThis operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.",
"tags": [
"Project briefs"
],
"operationId": "updateProjectBrief",
"parameters": [
{
"name": "opt_fields",
"in": "query",
"description": "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. Properties can include nested fields. To learn more, see the [input/output options guide](/docs/inputoutput-options#selecting-nested-fields).",
"required": false,
"example": [
"html_text",
"permalink_url",
"project",
"project.name",
"project.resource_subtype",
"text",
"title"
],
"schema": {
"type": "array",
"items": {
"type": "string",
"enum": [
"html_text",
"permalink_url",
"project",
"project.name",
"project.resource_subtype",
"text",
"title"
]
}
},
"style": "form",
"explode": false
}
],
"requestBody": {
"description": "The updated fields for the project brief.",
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"$ref": "#/components/schemas/ProjectBriefRequest"
}
}
}
}
}
},
"responses": {
"200": {
"description": "Successfully updated the project brief.",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"$ref": "#/components/schemas/ProjectBriefResponse"
}
}
}
}
}
},
"400": {
"$ref": "#/components/responses/BadRequest"
},
"401": {
"$ref": "#/components/responses/Unauthorized"
},
"403": {
"$ref": "#/components/responses/Forbidden"
},
"404": {
"$ref": "#/components/responses/NotFound"
},
"500": {
"$ref": "#/components/responses/InternalServerError"
}
},
"security": [
{
"personalAccessToken": []
},
{
"oauth2": []
}
],
"x-readme": {
"code-samples": [
{
"language": "java",
"install": "<dependency><groupId>com.asana</groupId><artifactId>asana</artifactId><version>1.0.0</version></dependency>",
"code": "import com.asana.Client;\n\nClient client = Client.accessToken(\"PERSONAL_ACCESS_TOKEN\");\n\nJsonElement result = client.projectbriefs.updateProjectBrief(projectBriefGid)\n .data(\"field\", \"value\")\n .data(\"field\", \"value\")\n .option(\"pretty\", true)\n .execute();"
},
{
"language": "node",
"install": "npm install asana",
"code": "const Asana = require('asana');\n\nlet client = new Asana.ApiClient();\nclient.authentications.token.accessToken = '<YOUR_ACCESS_TOKEN>';\n\nlet projectBriefsApiInstance = new Asana.ProjectBriefsApi(client);\nlet body = {\"data\": {\"<PARAM_1>\": \"<VALUE_1>\", \"<PARAM_2>\": \"<VALUE_2>\",}}; // Object | The updated fields for the project brief.\nlet project_brief_gid = \"12345\"; // String | Globally unique identifier for the project brief.\nlet opts = { \n 'opt_fields': \"html_text,permalink_url,project,project.name,project.resource_subtype,text,title\"\n};\nprojectBriefsApiInstance.updateProjectBrief(body, project_brief_gid, opts).then((result) => {\n console.log('API called successfully. Returned data: ' + JSON.stringify(result.data, null, 2));\n}, (error) => {\n console.error(error.response.body);\n});",
"name": "node-sdk-v3"
},
{
"language": "node",
"install": "npm install asana@1.0.5",
"code": "const asana = require('asana');\n\nconst client = asana.Client.create().useAccessToken('PERSONAL_ACCESS_TOKEN');\n\nclient.projectbriefs.updateProjectBrief(projectBriefGid, {field: \"value\", field: \"value\", pretty: true})\n .then((result) => {\n console.log(result);\n });",
"name": "node-sdk-v1"
},
{
"language": "python",
"install": "pip install asana",
"code": "import asana\nfrom asana.rest import ApiException\nfrom pprint import pprint\n\nconfiguration = asana.Configuration()\nconfiguration.access_token = '<YOUR_ACCESS_TOKEN>'\napi_client = asana.ApiClient(configuration)\n\n# create an instance of the API class\nproject_briefs_api_instance = asana.ProjectBriefsApi(api_client)\nbody = {\"data\": {\"<PARAM_1>\": \"<VALUE_1>\", \"<PARAM_2>\": \"<VALUE_2>\",}} # dict | The updated fields for the project brief.\nproject_brief_gid = \"12345\" # str | Globally unique identifier for the project brief.\nopts = {\n 'opt_fields': \"html_text,permalink_url,project,project.name,project.resource_subtype,text,title\", # list[str] | 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.\n}\n\ntry:\n # Update a project brief\n api_response = project_briefs_api_instance.update_project_brief(body, project_brief_gid, opts)\n pprint(api_response)\nexcept ApiException as e:\n print(\"Exception when calling ProjectBriefsApi->update_project_brief: %s\\n\" % e)",
"name": "python-sdk-v5"
},
{
"language": "python",
"install": "pip install asana==3.2.3",
"code": "import asana\n\nclient = asana.Client.access_token('PERSONAL_ACCESS_TOKEN')\n\nresult = client.project_briefs.update_project_brief(project_brief_gid, {'field': 'value', 'field': 'value'}, opt_pretty=True)",
"name": "python-sdk-v3"
},
{
"language": "php",
"install": "composer require asana/asana",
"code": "<?php\nrequire 'vendor/autoload.php';\n\n$client = Asana\\Client::accessToken('PERSONAL_ACCESS_TOKEN');\n\n$result = $client->projectbriefs->updateProjectBrief($project_brief_gid, array('field' => 'value', 'field' => 'value'), array('opt_pretty' => 'true'))"
},
{
"language": "ruby",
"install": "gem install asana",
"code": "require 'asana'\n\nclient = Asana::Client.new do |c|\n c.authentication :access_token, 'PERSONAL_ACCESS_TOKEN'\nend\n\nresult = client.project_briefs.update_project_brief(project_brief_gid: 'project_brief_gid', field: \"value\", field: \"value\", options: {pretty: true})"
}
]
},
"x-purple-suite-runtime": "unavailable"
}
DELETE /api/1.0/project_briefs/{project_brief_gid}
Delete a project brief
Deletes a specific, existing project brief.
Returns an empty data record.
This operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.
Authentication
[
{
"personalAccessToken": []
},
{
"oauth2": []
}
]
Path-level parameters and metadata
{
"parameters": [
{
"$ref": "#/components/parameters/project_brief_path_gid"
},
{
"$ref": "#/components/parameters/pretty"
}
]
}
Request, responses and operation details
{
"summary": "Delete a project brief",
"description": "Deletes a specific, existing project brief.\n\nReturns an empty data record.\n\nThis operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.",
"tags": [
"Project briefs"
],
"operationId": "deleteProjectBrief",
"responses": {
"200": {
"description": "Successfully deleted the specified project brief.",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"$ref": "#/components/schemas/EmptyResponse"
}
}
}
}
}
},
"400": {
"$ref": "#/components/responses/BadRequest"
},
"401": {
"$ref": "#/components/responses/Unauthorized"
},
"403": {
"$ref": "#/components/responses/Forbidden"
},
"404": {
"$ref": "#/components/responses/NotFound"
},
"500": {
"$ref": "#/components/responses/InternalServerError"
}
},
"security": [
{
"personalAccessToken": []
},
{
"oauth2": []
}
],
"x-readme": {
"code-samples": [
{
"language": "java",
"install": "<dependency><groupId>com.asana</groupId><artifactId>asana</artifactId><version>1.0.0</version></dependency>",
"code": "import com.asana.Client;\n\nClient client = Client.accessToken(\"PERSONAL_ACCESS_TOKEN\");\n\nJsonElement result = client.projectbriefs.deleteProjectBrief(projectBriefGid)\n .option(\"pretty\", true)\n .execute();"
},
{
"language": "node",
"install": "npm install asana",
"code": "const Asana = require('asana');\n\nlet client = new Asana.ApiClient();\nclient.authentications.token.accessToken = '<YOUR_ACCESS_TOKEN>';\n\nlet projectBriefsApiInstance = new Asana.ProjectBriefsApi(client);\nlet project_brief_gid = \"12345\"; // String | Globally unique identifier for the project brief.\n\nprojectBriefsApiInstance.deleteProjectBrief(project_brief_gid).then((result) => {\n console.log('API called successfully. Returned data: ' + JSON.stringify(result.data, null, 2));\n}, (error) => {\n console.error(error.response.body);\n});",
"name": "node-sdk-v3"
},
{
"language": "node",
"install": "npm install asana@1.0.5",
"code": "const asana = require('asana');\n\nconst client = asana.Client.create().useAccessToken('PERSONAL_ACCESS_TOKEN');\n\nclient.projectbriefs.deleteProjectBrief(projectBriefGid)\n .then((result) => {\n console.log(result);\n });",
"name": "node-sdk-v1"
},
{
"language": "python",
"install": "pip install asana",
"code": "import asana\nfrom asana.rest import ApiException\nfrom pprint import pprint\n\nconfiguration = asana.Configuration()\nconfiguration.access_token = '<YOUR_ACCESS_TOKEN>'\napi_client = asana.ApiClient(configuration)\n\n# create an instance of the API class\nproject_briefs_api_instance = asana.ProjectBriefsApi(api_client)\nproject_brief_gid = \"12345\" # str | Globally unique identifier for the project brief.\n\n\ntry:\n # Delete a project brief\n api_response = project_briefs_api_instance.delete_project_brief(project_brief_gid)\n pprint(api_response)\nexcept ApiException as e:\n print(\"Exception when calling ProjectBriefsApi->delete_project_brief: %s\\n\" % e)",
"name": "python-sdk-v5"
},
{
"language": "python",
"install": "pip install asana==3.2.3",
"code": "import asana\n\nclient = asana.Client.access_token('PERSONAL_ACCESS_TOKEN')\n\nresult = client.project_briefs.delete_project_brief(project_brief_gid, opt_pretty=True)",
"name": "python-sdk-v3"
},
{
"language": "php",
"install": "composer require asana/asana",
"code": "<?php\nrequire 'vendor/autoload.php';\n\n$client = Asana\\Client::accessToken('PERSONAL_ACCESS_TOKEN');\n\n$result = $client->projectbriefs->deleteProjectBrief($project_brief_gid, array('opt_pretty' => 'true'))"
},
{
"language": "ruby",
"install": "gem install asana",
"code": "require 'asana'\n\nclient = Asana::Client.new do |c|\n c.authentication :access_token, 'PERSONAL_ACCESS_TOKEN'\nend\n\nresult = client.project_briefs.delete_project_brief(project_brief_gid: 'project_brief_gid', options: {pretty: true})"
}
]
},
"x-purple-suite-runtime": "unavailable"
}
POST /api/1.0/projects/{project_gid}/project_briefs
Create a project brief
Creates a new project brief.
Returns the full record of the newly created project brief.
This operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.
Authentication
[
{
"personalAccessToken": []
},
{
"oauth2": []
}
]
Path-level parameters and metadata
{
"parameters": [
{
"$ref": "#/components/parameters/project_path_gid"
},
{
"$ref": "#/components/parameters/pretty"
}
]
}
Request, responses and operation details
{
"summary": "Create a project brief",
"description": "Creates a new project brief.\n\nReturns the full record of the newly created project brief.\n\nThis operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.",
"tags": [
"Project briefs"
],
"operationId": "createProjectBrief",
"parameters": [
{
"name": "opt_fields",
"in": "query",
"description": "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. Properties can include nested fields. To learn more, see the [input/output options guide](/docs/inputoutput-options#selecting-nested-fields).",
"required": false,
"example": [
"html_text",
"permalink_url",
"project",
"project.name",
"project.resource_subtype",
"text",
"title"
],
"schema": {
"type": "array",
"items": {
"type": "string",
"enum": [
"html_text",
"permalink_url",
"project",
"project.name",
"project.resource_subtype",
"text",
"title"
]
}
},
"style": "form",
"explode": false
}
],
"requestBody": {
"description": "The project brief to create.",
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"$ref": "#/components/schemas/ProjectBriefRequest"
}
}
}
}
}
},
"responses": {
"201": {
"description": "Successfully created a new project brief.",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"$ref": "#/components/schemas/ProjectBriefResponse"
}
}
}
}
}
},
"400": {
"$ref": "#/components/responses/BadRequest"
},
"401": {
"$ref": "#/components/responses/Unauthorized"
},
"402": {
"$ref": "#/components/responses/PaymentRequired"
},
"403": {
"$ref": "#/components/responses/Forbidden"
},
"404": {
"$ref": "#/components/responses/NotFound"
},
"500": {
"$ref": "#/components/responses/InternalServerError"
}
},
"security": [
{
"personalAccessToken": []
},
{
"oauth2": []
}
],
"x-readme": {
"code-samples": [
{
"language": "java",
"install": "<dependency><groupId>com.asana</groupId><artifactId>asana</artifactId><version>1.0.0</version></dependency>",
"code": "import com.asana.Client;\n\nClient client = Client.accessToken(\"PERSONAL_ACCESS_TOKEN\");\n\nJsonElement result = client.projectbriefs.createProjectBrief(projectGid)\n .data(\"field\", \"value\")\n .data(\"field\", \"value\")\n .option(\"pretty\", true)\n .execute();"
},
{
"language": "node",
"install": "npm install asana",
"code": "const Asana = require('asana');\n\nlet client = new Asana.ApiClient();\nclient.authentications.token.accessToken = '<YOUR_ACCESS_TOKEN>';\n\nlet projectBriefsApiInstance = new Asana.ProjectBriefsApi(client);\nlet body = {\"data\": {\"<PARAM_1>\": \"<VALUE_1>\", \"<PARAM_2>\": \"<VALUE_2>\",}}; // Object | The project brief to create.\nlet project_gid = \"1331\"; // String | Globally unique identifier for the project.\nlet opts = { \n 'opt_fields': \"html_text,permalink_url,project,project.name,project.resource_subtype,text,title\"\n};\nprojectBriefsApiInstance.createProjectBrief(body, project_gid, opts).then((result) => {\n console.log('API called successfully. Returned data: ' + JSON.stringify(result.data, null, 2));\n}, (error) => {\n console.error(error.response.body);\n});",
"name": "node-sdk-v3"
},
{
"language": "node",
"install": "npm install asana@1.0.5",
"code": "const asana = require('asana');\n\nconst client = asana.Client.create().useAccessToken('PERSONAL_ACCESS_TOKEN');\n\nclient.projectbriefs.createProjectBrief(projectGid, {field: \"value\", field: \"value\", pretty: true})\n .then((result) => {\n console.log(result);\n });",
"name": "node-sdk-v1"
},
{
"language": "python",
"install": "pip install asana",
"code": "import asana\nfrom asana.rest import ApiException\nfrom pprint import pprint\n\nconfiguration = asana.Configuration()\nconfiguration.access_token = '<YOUR_ACCESS_TOKEN>'\napi_client = asana.ApiClient(configuration)\n\n# create an instance of the API class\nproject_briefs_api_instance = asana.ProjectBriefsApi(api_client)\nbody = {\"data\": {\"<PARAM_1>\": \"<VALUE_1>\", \"<PARAM_2>\": \"<VALUE_2>\",}} # dict | The project brief to create.\nproject_gid = \"1331\" # str | Globally unique identifier for the project.\nopts = {\n 'opt_fields': \"html_text,permalink_url,project,project.name,project.resource_subtype,text,title\", # list[str] | 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.\n}\n\ntry:\n # Create a project brief\n api_response = project_briefs_api_instance.create_project_brief(body, project_gid, opts)\n pprint(api_response)\nexcept ApiException as e:\n print(\"Exception when calling ProjectBriefsApi->create_project_brief: %s\\n\" % e)",
"name": "python-sdk-v5"
},
{
"language": "python",
"install": "pip install asana==3.2.3",
"code": "import asana\n\nclient = asana.Client.access_token('PERSONAL_ACCESS_TOKEN')\n\nresult = client.project_briefs.create_project_brief(project_gid, {'field': 'value', 'field': 'value'}, opt_pretty=True)",
"name": "python-sdk-v3"
},
{
"language": "php",
"install": "composer require asana/asana",
"code": "<?php\nrequire 'vendor/autoload.php';\n\n$client = Asana\\Client::accessToken('PERSONAL_ACCESS_TOKEN');\n\n$result = $client->projectbriefs->createProjectBrief($project_gid, array('field' => 'value', 'field' => 'value'), array('opt_pretty' => 'true'))"
},
{
"language": "ruby",
"install": "gem install asana",
"code": "require 'asana'\n\nclient = Asana::Client.new do |c|\n c.authentication :access_token, 'PERSONAL_ACCESS_TOKEN'\nend\n\nresult = client.project_briefs.create_project_brief(project_gid: 'project_gid', field: \"value\", field: \"value\", options: {pretty: true})"
}
]
},
"x-purple-suite-runtime": "unavailable"
}
GET /api/1.0/project_memberships/{project_membership_gid}
Get a project membership
Returns the complete project record for a single project membership.
This operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.
Authentication
[
{
"personalAccessToken": []
},
{
"oauth2": []
}
]
Path-level parameters and metadata
{
"parameters": [
{
"$ref": "#/components/parameters/project_membership_path_gid"
},
{
"$ref": "#/components/parameters/pretty"
}
]
}
Request, responses and operation details
{
"summary": "Get a project membership",
"description": "Returns the complete project record for a single project membership.\n\nThis operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.",
"tags": [
"Project memberships"
],
"operationId": "getProjectMembership",
"parameters": [
{
"name": "opt_fields",
"in": "query",
"description": "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. Properties can include nested fields. To learn more, see the [input/output options guide](/docs/inputoutput-options#selecting-nested-fields).",
"required": false,
"example": [
"access_level",
"member",
"member.name",
"parent",
"parent.name",
"parent.resource_subtype",
"project",
"project.name",
"project.resource_subtype",
"user",
"user.name",
"write_access"
],
"schema": {
"type": "array",
"items": {
"type": "string",
"enum": [
"access_level",
"member",
"member.name",
"parent",
"parent.name",
"parent.resource_subtype",
"project",
"project.name",
"project.resource_subtype",
"user",
"user.name",
"write_access"
]
}
},
"style": "form",
"explode": false
}
],
"responses": {
"200": {
"description": "Successfully retrieved the requested project membership.",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"$ref": "#/components/schemas/ProjectMembershipNormalResponse"
}
}
}
}
}
},
"400": {
"$ref": "#/components/responses/BadRequest"
},
"401": {
"$ref": "#/components/responses/Unauthorized"
},
"403": {
"$ref": "#/components/responses/Forbidden"
},
"404": {
"$ref": "#/components/responses/NotFound"
},
"500": {
"$ref": "#/components/responses/InternalServerError"
}
},
"security": [
{
"personalAccessToken": []
},
{
"oauth2": []
}
],
"x-readme": {
"code-samples": [
{
"language": "java",
"install": "<dependency><groupId>com.asana</groupId><artifactId>asana</artifactId><version>1.0.0</version></dependency>",
"code": "import com.asana.Client;\n\nClient client = Client.accessToken(\"PERSONAL_ACCESS_TOKEN\");\n\nProjectMembership result = client.projectmemberships.getProjectMembership(projectMembershipGid)\n .option(\"pretty\", true)\n .execute();"
},
{
"language": "node",
"install": "npm install asana",
"code": "const Asana = require('asana');\n\nlet client = new Asana.ApiClient();\nclient.authentications.token.accessToken = '<YOUR_ACCESS_TOKEN>';\n\nlet projectMembershipsApiInstance = new Asana.ProjectMembershipsApi(client);\nlet project_membership_gid = \"1331\"; // String | \nlet opts = { \n 'opt_fields': \"access_level,member,member.name,parent,parent.name,parent.resource_subtype,project,project.name,project.resource_subtype,user,user.name,write_access\"\n};\nprojectMembershipsApiInstance.getProjectMembership(project_membership_gid, opts).then((result) => {\n console.log('API called successfully. Returned data: ' + JSON.stringify(result.data, null, 2));\n}, (error) => {\n console.error(error.response.body);\n});",
"name": "node-sdk-v3"
},
{
"language": "node",
"install": "npm install asana@1.0.5",
"code": "const asana = require('asana');\n\nconst client = asana.Client.create().useAccessToken('PERSONAL_ACCESS_TOKEN');\n\nclient.projectmemberships.getProjectMembership(projectMembershipGid, {param: \"value\", param: \"value\", opt_pretty: true})\n .then((result) => {\n console.log(result);\n });",
"name": "node-sdk-v1"
},
{
"language": "python",
"install": "pip install asana",
"code": "import asana\nfrom asana.rest import ApiException\nfrom pprint import pprint\n\nconfiguration = asana.Configuration()\nconfiguration.access_token = '<YOUR_ACCESS_TOKEN>'\napi_client = asana.ApiClient(configuration)\n\n# create an instance of the API class\nproject_memberships_api_instance = asana.ProjectMembershipsApi(api_client)\nproject_membership_gid = \"1331\" # str | \nopts = {\n 'opt_fields': \"access_level,member,member.name,parent,parent.name,parent.resource_subtype,project,project.name,project.resource_subtype,user,user.name,write_access\", # list[str] | 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.\n}\n\ntry:\n # Get a project membership\n api_response = project_memberships_api_instance.get_project_membership(project_membership_gid, opts)\n pprint(api_response)\nexcept ApiException as e:\n print(\"Exception when calling ProjectMembershipsApi->get_project_membership: %s\\n\" % e)",
"name": "python-sdk-v5"
},
{
"language": "python",
"install": "pip install asana==3.2.3",
"code": "import asana\n\nclient = asana.Client.access_token('PERSONAL_ACCESS_TOKEN')\n\nresult = client.project_memberships.get_project_membership(project_membership_gid, {'param': 'value', 'param': 'value'}, opt_pretty=True)",
"name": "python-sdk-v3"
},
{
"language": "php",
"install": "composer require asana/asana",
"code": "<?php\nrequire 'vendor/autoload.php';\n\n$client = Asana\\Client::accessToken('PERSONAL_ACCESS_TOKEN');\n\n$result = $client->projectmemberships->getProjectMembership($project_membership_gid, array('param' => 'value', 'param' => 'value'), array('opt_pretty' => 'true'))"
},
{
"language": "ruby",
"install": "gem install asana",
"code": "require 'asana'\n\nclient = Asana::Client.new do |c|\n c.authentication :access_token, 'PERSONAL_ACCESS_TOKEN'\nend\n\nresult = client.project_memberships.get_project_membership(project_membership_gid: 'project_membership_gid', param: \"value\", param: \"value\", options: {pretty: true})"
}
]
},
"x-purple-suite-runtime": "unavailable"
}
GET /api/1.0/projects/{project_gid}/project_memberships
Get memberships from a project
Returns the compact project membership records for the project.
This operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.
Authentication
[
{
"personalAccessToken": []
},
{
"oauth2": []
}
]
Path-level parameters and metadata
{
"parameters": [
{
"$ref": "#/components/parameters/project_path_gid"
},
{
"$ref": "#/components/parameters/user_query_param"
},
{
"$ref": "#/components/parameters/pretty"
},
{
"$ref": "#/components/parameters/limit"
},
{
"$ref": "#/components/parameters/offset"
}
]
}
Request, responses and operation details
{
"summary": "Get memberships from a project",
"description": "Returns the compact project membership records for the project.\n\nThis operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.",
"tags": [
"Project memberships"
],
"operationId": "getProjectMembershipsForProject",
"parameters": [
{
"name": "opt_fields",
"in": "query",
"description": "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. Properties can include nested fields. To learn more, see the [input/output options guide](/docs/inputoutput-options#selecting-nested-fields).",
"required": false,
"example": [
"access_level",
"member",
"member.name",
"offset",
"parent",
"parent.name",
"parent.resource_subtype",
"path",
"uri"
],
"schema": {
"type": "array",
"items": {
"type": "string",
"enum": [
"access_level",
"member",
"member.name",
"offset",
"parent",
"parent.name",
"parent.resource_subtype",
"path",
"uri"
]
}
},
"style": "form",
"explode": false
}
],
"responses": {
"200": {
"description": "Successfully retrieved the requested project's memberships.",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"type": "array",
"items": {
"$ref": "#/components/schemas/ProjectMembershipCompact"
}
},
"next_page": {
"$ref": "#/components/schemas/NextPage"
}
}
}
}
}
},
"400": {
"$ref": "#/components/responses/BadRequest"
},
"401": {
"$ref": "#/components/responses/Unauthorized"
},
"403": {
"$ref": "#/components/responses/Forbidden"
},
"404": {
"$ref": "#/components/responses/NotFound"
},
"500": {
"$ref": "#/components/responses/InternalServerError"
}
},
"security": [
{
"personalAccessToken": []
},
{
"oauth2": []
}
],
"x-readme": {
"code-samples": [
{
"language": "java",
"install": "<dependency><groupId>com.asana</groupId><artifactId>asana</artifactId><version>1.0.0</version></dependency>",
"code": "import com.asana.Client;\n\nClient client = Client.accessToken(\"PERSONAL_ACCESS_TOKEN\");\n\nList<ProjectMembership> result = client.projectmemberships.getProjectMembershipsForProject(projectGid, user)\n .option(\"pretty\", true)\n .execute();"
},
{
"language": "node",
"install": "npm install asana",
"code": "const Asana = require('asana');\n\nlet client = new Asana.ApiClient();\nclient.authentications.token.accessToken = '<YOUR_ACCESS_TOKEN>';\n\nlet projectMembershipsApiInstance = new Asana.ProjectMembershipsApi(client);\nlet project_gid = \"1331\"; // String | Globally unique identifier for the project.\nlet opts = { \n 'user': \"me\", \n 'limit': 50, \n 'offset': \"eyJ0eXAiOJiKV1iQLCJhbGciOiJIUzI1NiJ9\", \n 'opt_fields': \"access_level,member,member.name,offset,parent,parent.name,parent.resource_subtype,path,uri\"\n};\nprojectMembershipsApiInstance.getProjectMembershipsForProject(project_gid, opts).then((result) => {\n console.log('API called successfully. Returned data: ' + JSON.stringify(result.data, null, 2));\n}, (error) => {\n console.error(error.response.body);\n});",
"name": "node-sdk-v3"
},
{
"language": "node",
"install": "npm install asana@1.0.5",
"code": "const asana = require('asana');\n\nconst client = asana.Client.create().useAccessToken('PERSONAL_ACCESS_TOKEN');\n\nclient.projectmemberships.getProjectMembershipsForProject(projectGid, {param: \"value\", param: \"value\", opt_pretty: true})\n .then((result) => {\n console.log(result);\n });",
"name": "node-sdk-v1"
},
{
"language": "python",
"install": "pip install asana",
"code": "import asana\nfrom asana.rest import ApiException\nfrom pprint import pprint\n\nconfiguration = asana.Configuration()\nconfiguration.access_token = '<YOUR_ACCESS_TOKEN>'\napi_client = asana.ApiClient(configuration)\n\n# create an instance of the API class\nproject_memberships_api_instance = asana.ProjectMembershipsApi(api_client)\nproject_gid = \"1331\" # str | Globally unique identifier for the project.\nopts = {\n 'user': \"me\", # str | A string identifying a user. This can either be the string \\\"me\\\", an email, or the gid of a user.\n 'limit': 50, # int | Results per page. The number of objects to return per page. The value must be between 1 and 100.\n 'offset': \"eyJ0eXAiOJiKV1iQLCJhbGciOiJIUzI1NiJ9\", # str | 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.*\n 'opt_fields': \"access_level,member,member.name,offset,parent,parent.name,parent.resource_subtype,path,uri\", # list[str] | 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.\n}\n\ntry:\n # Get memberships from a project\n api_response = project_memberships_api_instance.get_project_memberships_for_project(project_gid, opts)\n for data in api_response:\n pprint(data)\nexcept ApiException as e:\n print(\"Exception when calling ProjectMembershipsApi->get_project_memberships_for_project: %s\\n\" % e)",
"name": "python-sdk-v5"
},
{
"language": "python",
"install": "pip install asana==3.2.3",
"code": "import asana\n\nclient = asana.Client.access_token('PERSONAL_ACCESS_TOKEN')\n\nresult = client.project_memberships.get_project_memberships_for_project(project_gid, {'param': 'value', 'param': 'value'}, opt_pretty=True)",
"name": "python-sdk-v3"
},
{
"language": "php",
"install": "composer require asana/asana",
"code": "<?php\nrequire 'vendor/autoload.php';\n\n$client = Asana\\Client::accessToken('PERSONAL_ACCESS_TOKEN');\n\n$result = $client->projectmemberships->getProjectMembershipsForProject($project_gid, array('param' => 'value', 'param' => 'value'), array('opt_pretty' => 'true'))"
},
{
"language": "ruby",
"install": "gem install asana",
"code": "require 'asana'\n\nclient = Asana::Client.new do |c|\n c.authentication :access_token, 'PERSONAL_ACCESS_TOKEN'\nend\n\nresult = client.project_memberships.get_project_memberships_for_project(project_gid: 'project_gid', param: \"value\", param: \"value\", options: {pretty: true})"
}
]
},
"x-purple-suite-runtime": "unavailable"
}
GET /api/1.0/project_portfolio_settings/{project_portfolio_setting_gid}
Get a project portfolio setting
<b>Required scope: </b><code>project_portfolio_settings:read</code>
Returns the complete project portfolio setting record for a single project portfolio setting.
This operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.
Authentication
[
{
"personalAccessToken": []
},
{
"oauth2": [
"project_portfolio_settings:read"
]
}
]
Path-level parameters and metadata
{
"parameters": [
{
"$ref": "#/components/parameters/project_portfolio_setting_path_gid"
},
{
"$ref": "#/components/parameters/pretty"
}
]
}
Request, responses and operation details
{
"summary": "Get a project portfolio setting",
"description": "<b>Required scope: </b><code>project_portfolio_settings:read</code>\n\nReturns the complete project portfolio setting record for a single project portfolio setting.\n\nThis operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.",
"tags": [
"Project portfolio settings"
],
"operationId": "getProjectPortfolioSetting",
"parameters": [
{
"name": "opt_fields",
"in": "query",
"description": "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. Properties can include nested fields. To learn more, see the [input/output options guide](/docs/inputoutput-options#selecting-nested-fields).",
"required": false,
"example": [
"created_at",
"is_access_control_inherited",
"portfolio",
"project"
],
"schema": {
"type": "array",
"items": {
"type": "string",
"enum": [
"created_at",
"is_access_control_inherited",
"portfolio",
"project"
]
}
},
"style": "form",
"explode": false
}
],
"responses": {
"200": {
"description": "Successfully retrieved the requested project portfolio setting.",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"$ref": "#/components/schemas/ProjectPortfolioSettingResponse"
}
}
}
}
}
},
"400": {
"$ref": "#/components/responses/BadRequest"
},
"401": {
"$ref": "#/components/responses/Unauthorized"
},
"403": {
"$ref": "#/components/responses/Forbidden"
},
"404": {
"$ref": "#/components/responses/NotFound"
},
"500": {
"$ref": "#/components/responses/InternalServerError"
}
},
"security": [
{
"personalAccessToken": []
},
{
"oauth2": [
"project_portfolio_settings:read"
]
}
],
"x-readme": {
"code-samples": [
{
"language": "node",
"install": "npm install asana",
"code": "const Asana = require('asana');\n\nlet client = new Asana.ApiClient();\nclient.authentications.token.accessToken = '<YOUR_ACCESS_TOKEN>';\n\nlet projectPortfolioSettingsApiInstance = new Asana.ProjectPortfolioSettingsApi(client);\nlet project_portfolio_setting_gid = \"1331\"; // String | Globally unique identifier for the project portfolio setting.\nlet opts = { \n 'opt_fields': \"created_at,is_access_control_inherited,portfolio,project\"\n};\nprojectPortfolioSettingsApiInstance.getProjectPortfolioSetting(project_portfolio_setting_gid, opts).then((result) => {\n console.log('API called successfully. Returned data: ' + JSON.stringify(result.data, null, 2));\n}, (error) => {\n console.error(error.response.body);\n});",
"name": "node-sdk-v3"
},
{
"language": "python",
"install": "pip install asana",
"code": "import asana\nfrom asana.rest import ApiException\nfrom pprint import pprint\n\nconfiguration = asana.Configuration()\nconfiguration.access_token = '<YOUR_ACCESS_TOKEN>'\napi_client = asana.ApiClient(configuration)\n\n# create an instance of the API class\nproject_portfolio_settings_api_instance = asana.ProjectPortfolioSettingsApi(api_client)\nproject_portfolio_setting_gid = \"1331\" # str | Globally unique identifier for the project portfolio setting.\nopts = {\n 'opt_fields': \"created_at,is_access_control_inherited,portfolio,project\", # list[str] | 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.\n}\n\ntry:\n # Get a project portfolio setting\n api_response = project_portfolio_settings_api_instance.get_project_portfolio_setting(project_portfolio_setting_gid, opts)\n pprint(api_response)\nexcept ApiException as e:\n print(\"Exception when calling ProjectPortfolioSettingsApi->get_project_portfolio_setting: %s\\n\" % e)",
"name": "python-sdk-v5"
}
]
},
"x-purple-suite-runtime": "unavailable"
}
PUT /api/1.0/project_portfolio_settings/{project_portfolio_setting_gid}
Update a project portfolio setting
<b>Required scope: </b><code>project_portfolio_settings:write</code>
An existing project portfolio setting can be updated by making a PUT
request on the URL for that setting. Only the fields provided in the
`data` block will be updated; any unspecified fields will remain
unchanged.
Returns the complete updated project portfolio setting record.
This operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.
Authentication
[
{
"personalAccessToken": []
},
{
"oauth2": [
"project_portfolio_settings:write"
]
}
]
Path-level parameters and metadata
{
"parameters": [
{
"$ref": "#/components/parameters/project_portfolio_setting_path_gid"
},
{
"$ref": "#/components/parameters/pretty"
}
]
}
Request, responses and operation details
{
"summary": "Update a project portfolio setting",
"description": "<b>Required scope: </b><code>project_portfolio_settings:write</code>\n\nAn existing project portfolio setting can be updated by making a PUT\nrequest on the URL for that setting. Only the fields provided in the\n`data` block will be updated; any unspecified fields will remain\nunchanged.\n\nReturns the complete updated project portfolio setting record.\n\nThis operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.",
"tags": [
"Project portfolio settings"
],
"operationId": "updateProjectPortfolioSetting",
"parameters": [
{
"name": "opt_fields",
"in": "query",
"description": "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. Properties can include nested fields. To learn more, see the [input/output options guide](/docs/inputoutput-options#selecting-nested-fields).",
"required": false,
"example": [
"created_at",
"is_access_control_inherited",
"portfolio",
"project"
],
"schema": {
"type": "array",
"items": {
"type": "string",
"enum": [
"created_at",
"is_access_control_inherited",
"portfolio",
"project"
]
}
},
"style": "form",
"explode": false
}
],
"requestBody": {
"description": "The updated fields for the project portfolio setting.",
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"$ref": "#/components/schemas/ProjectPortfolioSettingUpdateRequest"
}
}
}
}
}
},
"responses": {
"200": {
"description": "Successfully updated the project portfolio setting.",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"$ref": "#/components/schemas/ProjectPortfolioSettingResponse"
}
}
}
}
}
},
"400": {
"$ref": "#/components/responses/BadRequest"
},
"401": {
"$ref": "#/components/responses/Unauthorized"
},
"403": {
"$ref": "#/components/responses/Forbidden"
},
"404": {
"$ref": "#/components/responses/NotFound"
},
"500": {
"$ref": "#/components/responses/InternalServerError"
}
},
"security": [
{
"personalAccessToken": []
},
{
"oauth2": [
"project_portfolio_settings:write"
]
}
],
"x-readme": {
"code-samples": [
{
"language": "node",
"install": "npm install asana",
"code": "const Asana = require('asana');\n\nlet client = new Asana.ApiClient();\nclient.authentications.token.accessToken = '<YOUR_ACCESS_TOKEN>';\n\nlet projectPortfolioSettingsApiInstance = new Asana.ProjectPortfolioSettingsApi(client);\nlet body = {\"data\": {\"<PARAM_1>\": \"<VALUE_1>\", \"<PARAM_2>\": \"<VALUE_2>\",}}; // Object | The updated fields for the project portfolio setting.\nlet project_portfolio_setting_gid = \"1331\"; // String | Globally unique identifier for the project portfolio setting.\nlet opts = { \n 'opt_fields': \"created_at,is_access_control_inherited,portfolio,project\"\n};\nprojectPortfolioSettingsApiInstance.updateProjectPortfolioSetting(body, project_portfolio_setting_gid, opts).then((result) => {\n console.log('API called successfully. Returned data: ' + JSON.stringify(result.data, null, 2));\n}, (error) => {\n console.error(error.response.body);\n});",
"name": "node-sdk-v3"
},
{
"language": "python",
"install": "pip install asana",
"code": "import asana\nfrom asana.rest import ApiException\nfrom pprint import pprint\n\nconfiguration = asana.Configuration()\nconfiguration.access_token = '<YOUR_ACCESS_TOKEN>'\napi_client = asana.ApiClient(configuration)\n\n# create an instance of the API class\nproject_portfolio_settings_api_instance = asana.ProjectPortfolioSettingsApi(api_client)\nbody = {\"data\": {\"<PARAM_1>\": \"<VALUE_1>\", \"<PARAM_2>\": \"<VALUE_2>\",}} # dict | The updated fields for the project portfolio setting.\nproject_portfolio_setting_gid = \"1331\" # str | Globally unique identifier for the project portfolio setting.\nopts = {\n 'opt_fields': \"created_at,is_access_control_inherited,portfolio,project\", # list[str] | 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.\n}\n\ntry:\n # Update a project portfolio setting\n api_response = project_portfolio_settings_api_instance.update_project_portfolio_setting(body, project_portfolio_setting_gid, opts)\n pprint(api_response)\nexcept ApiException as e:\n print(\"Exception when calling ProjectPortfolioSettingsApi->update_project_portfolio_setting: %s\\n\" % e)",
"name": "python-sdk-v5"
}
]
},
"x-purple-suite-runtime": "unavailable"
}
GET /api/1.0/projects/{project_gid}/project_portfolio_settings
Get project portfolio settings for a project
<b>Required scope: </b><code>project_portfolio_settings:read</code>
Returns a compact representation of all of the project portfolio settings for the given project.
This operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.
Authentication
[
{
"personalAccessToken": []
},
{
"oauth2": [
"project_portfolio_settings:read"
]
}
]
Path-level parameters and metadata
{
"parameters": [
{
"$ref": "#/components/parameters/project_path_gid"
},
{
"$ref": "#/components/parameters/pretty"
},
{
"$ref": "#/components/parameters/limit"
},
{
"$ref": "#/components/parameters/offset"
}
]
}
Request, responses and operation details
{
"summary": "Get project portfolio settings for a project",
"description": "<b>Required scope: </b><code>project_portfolio_settings:read</code>\n\nReturns a compact representation of all of the project portfolio settings for the given project.\n\nThis operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.",
"tags": [
"Project portfolio settings"
],
"operationId": "getProjectPortfolioSettingsForProject",
"parameters": [
{
"name": "opt_fields",
"in": "query",
"description": "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. Properties can include nested fields. To learn more, see the [input/output options guide](/docs/inputoutput-options#selecting-nested-fields).",
"required": false,
"example": [
"created_at",
"is_access_control_inherited",
"offset",
"path",
"portfolio",
"project",
"uri"
],
"schema": {
"type": "array",
"items": {
"type": "string",
"enum": [
"created_at",
"is_access_control_inherited",
"offset",
"path",
"portfolio",
"project",
"uri"
]
}
},
"style": "form",
"explode": false
}
],
"responses": {
"200": {
"description": "Successfully retrieved the requested project's project portfolio settings.",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"type": "array",
"items": {
"$ref": "#/components/schemas/ProjectPortfolioSettingCompact"
}
},
"next_page": {
"$ref": "#/components/schemas/NextPage"
}
}
}
}
}
},
"400": {
"$ref": "#/components/responses/BadRequest"
},
"401": {
"$ref": "#/components/responses/Unauthorized"
},
"403": {
"$ref": "#/components/responses/Forbidden"
},
"404": {
"$ref": "#/components/responses/NotFound"
},
"500": {
"$ref": "#/components/responses/InternalServerError"
}
},
"security": [
{
"personalAccessToken": []
},
{
"oauth2": [
"project_portfolio_settings:read"
]
}
],
"x-readme": {
"code-samples": [
{
"language": "node",
"install": "npm install asana",
"code": "const Asana = require('asana');\n\nlet client = new Asana.ApiClient();\nclient.authentications.token.accessToken = '<YOUR_ACCESS_TOKEN>';\n\nlet projectPortfolioSettingsApiInstance = new Asana.ProjectPortfolioSettingsApi(client);\nlet project_gid = \"1331\"; // String | Globally unique identifier for the project.\nlet opts = { \n 'limit': 50, \n 'offset': \"eyJ0eXAiOJiKV1iQLCJhbGciOiJIUzI1NiJ9\", \n 'opt_fields': \"created_at,is_access_control_inherited,offset,path,portfolio,project,uri\"\n};\nprojectPortfolioSettingsApiInstance.getProjectPortfolioSettingsForProject(project_gid, opts).then((result) => {\n console.log('API called successfully. Returned data: ' + JSON.stringify(result.data, null, 2));\n}, (error) => {\n console.error(error.response.body);\n});",
"name": "node-sdk-v3"
},
{
"language": "python",
"install": "pip install asana",
"code": "import asana\nfrom asana.rest import ApiException\nfrom pprint import pprint\n\nconfiguration = asana.Configuration()\nconfiguration.access_token = '<YOUR_ACCESS_TOKEN>'\napi_client = asana.ApiClient(configuration)\n\n# create an instance of the API class\nproject_portfolio_settings_api_instance = asana.ProjectPortfolioSettingsApi(api_client)\nproject_gid = \"1331\" # str | Globally unique identifier for the project.\nopts = {\n 'limit': 50, # int | Results per page. The number of objects to return per page. The value must be between 1 and 100.\n 'offset': \"eyJ0eXAiOJiKV1iQLCJhbGciOiJIUzI1NiJ9\", # str | 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.*\n 'opt_fields': \"created_at,is_access_control_inherited,offset,path,portfolio,project,uri\", # list[str] | 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.\n}\n\ntry:\n # Get project portfolio settings for a project\n api_response = project_portfolio_settings_api_instance.get_project_portfolio_settings_for_project(project_gid, opts)\n for data in api_response:\n pprint(data)\nexcept ApiException as e:\n print(\"Exception when calling ProjectPortfolioSettingsApi->get_project_portfolio_settings_for_project: %s\\n\" % e)",
"name": "python-sdk-v5"
}
]
},
"x-purple-suite-runtime": "unavailable"
}
GET /api/1.0/portfolios/{portfolio_gid}/project_portfolio_settings
Get project portfolio settings for a portfolio
<b>Required scope: </b><code>project_portfolio_settings:read</code>
Returns a compact representation of all of the project portfolio settings for the given portfolio.
This operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.
Authentication
[
{
"personalAccessToken": []
},
{
"oauth2": [
"project_portfolio_settings:read"
]
}
]
Path-level parameters and metadata
{
"parameters": [
{
"$ref": "#/components/parameters/portfolio_path_gid"
},
{
"$ref": "#/components/parameters/pretty"
},
{
"$ref": "#/components/parameters/limit"
},
{
"$ref": "#/components/parameters/offset"
}
]
}
Request, responses and operation details
{
"summary": "Get project portfolio settings for a portfolio",
"description": "<b>Required scope: </b><code>project_portfolio_settings:read</code>\n\nReturns a compact representation of all of the project portfolio settings for the given portfolio.\n\nThis operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.",
"tags": [
"Project portfolio settings"
],
"operationId": "getProjectPortfolioSettingsForPortfolio",
"parameters": [
{
"name": "opt_fields",
"in": "query",
"description": "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. Properties can include nested fields. To learn more, see the [input/output options guide](/docs/inputoutput-options#selecting-nested-fields).",
"required": false,
"example": [
"created_at",
"is_access_control_inherited",
"offset",
"path",
"portfolio",
"project",
"uri"
],
"schema": {
"type": "array",
"items": {
"type": "string",
"enum": [
"created_at",
"is_access_control_inherited",
"offset",
"path",
"portfolio",
"project",
"uri"
]
}
},
"style": "form",
"explode": false
}
],
"responses": {
"200": {
"description": "Successfully retrieved the requested portfolio's project portfolio settings.",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"type": "array",
"items": {
"$ref": "#/components/schemas/ProjectPortfolioSettingCompact"
}
},
"next_page": {
"$ref": "#/components/schemas/NextPage"
}
}
}
}
}
},
"400": {
"$ref": "#/components/responses/BadRequest"
},
"401": {
"$ref": "#/components/responses/Unauthorized"
},
"403": {
"$ref": "#/components/responses/Forbidden"
},
"404": {
"$ref": "#/components/responses/NotFound"
},
"500": {
"$ref": "#/components/responses/InternalServerError"
}
},
"security": [
{
"personalAccessToken": []
},
{
"oauth2": [
"project_portfolio_settings:read"
]
}
],
"x-readme": {
"code-samples": [
{
"language": "node",
"install": "npm install asana",
"code": "const Asana = require('asana');\n\nlet client = new Asana.ApiClient();\nclient.authentications.token.accessToken = '<YOUR_ACCESS_TOKEN>';\n\nlet projectPortfolioSettingsApiInstance = new Asana.ProjectPortfolioSettingsApi(client);\nlet portfolio_gid = \"12345\"; // String | Globally unique identifier for the portfolio.\nlet opts = { \n 'limit': 50, \n 'offset': \"eyJ0eXAiOJiKV1iQLCJhbGciOiJIUzI1NiJ9\", \n 'opt_fields': \"created_at,is_access_control_inherited,offset,path,portfolio,project,uri\"\n};\nprojectPortfolioSettingsApiInstance.getProjectPortfolioSettingsForPortfolio(portfolio_gid, opts).then((result) => {\n console.log('API called successfully. Returned data: ' + JSON.stringify(result.data, null, 2));\n}, (error) => {\n console.error(error.response.body);\n});",
"name": "node-sdk-v3"
},
{
"language": "python",
"install": "pip install asana",
"code": "import asana\nfrom asana.rest import ApiException\nfrom pprint import pprint\n\nconfiguration = asana.Configuration()\nconfiguration.access_token = '<YOUR_ACCESS_TOKEN>'\napi_client = asana.ApiClient(configuration)\n\n# create an instance of the API class\nproject_portfolio_settings_api_instance = asana.ProjectPortfolioSettingsApi(api_client)\nportfolio_gid = \"12345\" # str | Globally unique identifier for the portfolio.\nopts = {\n 'limit': 50, # int | Results per page. The number of objects to return per page. The value must be between 1 and 100.\n 'offset': \"eyJ0eXAiOJiKV1iQLCJhbGciOiJIUzI1NiJ9\", # str | 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.*\n 'opt_fields': \"created_at,is_access_control_inherited,offset,path,portfolio,project,uri\", # list[str] | 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.\n}\n\ntry:\n # Get project portfolio settings for a portfolio\n api_response = project_portfolio_settings_api_instance.get_project_portfolio_settings_for_portfolio(portfolio_gid, opts)\n for data in api_response:\n pprint(data)\nexcept ApiException as e:\n print(\"Exception when calling ProjectPortfolioSettingsApi->get_project_portfolio_settings_for_portfolio: %s\\n\" % e)",
"name": "python-sdk-v5"
}
]
},
"x-purple-suite-runtime": "unavailable"
}
GET /api/1.0/project_statuses/{project_status_gid}
Get a project status
*Deprecated: new integrations should prefer the `/status_updates/{status_gid}` route.*
Returns the complete record for a single status update.
This operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.
Authentication
[
{
"personalAccessToken": []
},
{
"oauth2": []
}
]
Path-level parameters and metadata
{
"parameters": [
{
"$ref": "#/components/parameters/project_status_path_gid"
},
{
"$ref": "#/components/parameters/pretty"
}
]
}
Request, responses and operation details
{
"summary": "Get a project status",
"description": "*Deprecated: new integrations should prefer the `/status_updates/{status_gid}` route.*\n\nReturns the complete record for a single status update.\n\nThis operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.",
"tags": [
"Project statuses"
],
"operationId": "getProjectStatus",
"parameters": [
{
"name": "opt_fields",
"in": "query",
"description": "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. Properties can include nested fields. To learn more, see the [input/output options guide](/docs/inputoutput-options#selecting-nested-fields).",
"required": false,
"example": [
"author",
"author.name",
"color",
"created_at",
"created_by",
"created_by.name",
"html_text",
"modified_at",
"text",
"title"
],
"schema": {
"type": "array",
"items": {
"type": "string",
"enum": [
"author",
"author.name",
"color",
"created_at",
"created_by",
"created_by.name",
"html_text",
"modified_at",
"text",
"title"
]
}
},
"style": "form",
"explode": false
}
],
"responses": {
"200": {
"description": "Successfully retrieved the specified project's status updates.",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"$ref": "#/components/schemas/ProjectStatusResponse"
}
}
}
}
}
},
"400": {
"$ref": "#/components/responses/BadRequest"
},
"401": {
"$ref": "#/components/responses/Unauthorized"
},
"403": {
"$ref": "#/components/responses/Forbidden"
},
"404": {
"$ref": "#/components/responses/NotFound"
},
"500": {
"$ref": "#/components/responses/InternalServerError"
}
},
"security": [
{
"personalAccessToken": []
},
{
"oauth2": []
}
],
"x-readme": {
"code-samples": [
{
"language": "java",
"install": "<dependency><groupId>com.asana</groupId><artifactId>asana</artifactId><version>1.0.0</version></dependency>",
"code": "import com.asana.Client;\n\nClient client = Client.accessToken(\"PERSONAL_ACCESS_TOKEN\");\n\nProjectStatus result = client.projectstatuses.getProjectStatus(projectStatusGid)\n .option(\"pretty\", true)\n .execute();"
},
{
"language": "node",
"install": "npm install asana",
"code": "const Asana = require('asana');\n\nlet client = new Asana.ApiClient();\nclient.authentications.token.accessToken = '<YOUR_ACCESS_TOKEN>';\n\nlet projectStatusesApiInstance = new Asana.ProjectStatusesApi(client);\nlet project_status_gid = \"321654\"; // String | The project status update to get.\nlet opts = { \n 'opt_fields': \"author,author.name,color,created_at,created_by,created_by.name,html_text,modified_at,text,title\"\n};\nprojectStatusesApiInstance.getProjectStatus(project_status_gid, opts).then((result) => {\n console.log('API called successfully. Returned data: ' + JSON.stringify(result.data, null, 2));\n}, (error) => {\n console.error(error.response.body);\n});",
"name": "node-sdk-v3"
},
{
"language": "node",
"install": "npm install asana@1.0.5",
"code": "const asana = require('asana');\n\nconst client = asana.Client.create().useAccessToken('PERSONAL_ACCESS_TOKEN');\n\nclient.projectstatuses.getProjectStatus(projectStatusGid, {param: \"value\", param: \"value\", opt_pretty: true})\n .then((result) => {\n console.log(result);\n });",
"name": "node-sdk-v1"
},
{
"language": "python",
"install": "pip install asana",
"code": "import asana\nfrom asana.rest import ApiException\nfrom pprint import pprint\n\nconfiguration = asana.Configuration()\nconfiguration.access_token = '<YOUR_ACCESS_TOKEN>'\napi_client = asana.ApiClient(configuration)\n\n# create an instance of the API class\nproject_statuses_api_instance = asana.ProjectStatusesApi(api_client)\nproject_status_gid = \"321654\" # str | The project status update to get.\nopts = {\n 'opt_fields': \"author,author.name,color,created_at,created_by,created_by.name,html_text,modified_at,text,title\", # list[str] | 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.\n}\n\ntry:\n # Get a project status\n api_response = project_statuses_api_instance.get_project_status(project_status_gid, opts)\n pprint(api_response)\nexcept ApiException as e:\n print(\"Exception when calling ProjectStatusesApi->get_project_status: %s\\n\" % e)",
"name": "python-sdk-v5"
},
{
"language": "python",
"install": "pip install asana==3.2.3",
"code": "import asana\n\nclient = asana.Client.access_token('PERSONAL_ACCESS_TOKEN')\n\nresult = client.project_statuses.get_project_status(project_status_gid, {'param': 'value', 'param': 'value'}, opt_pretty=True)",
"name": "python-sdk-v3"
},
{
"language": "php",
"install": "composer require asana/asana",
"code": "<?php\nrequire 'vendor/autoload.php';\n\n$client = Asana\\Client::accessToken('PERSONAL_ACCESS_TOKEN');\n\n$result = $client->projectstatuses->getProjectStatus($project_status_gid, array('param' => 'value', 'param' => 'value'), array('opt_pretty' => 'true'))"
},
{
"language": "ruby",
"install": "gem install asana",
"code": "require 'asana'\n\nclient = Asana::Client.new do |c|\n c.authentication :access_token, 'PERSONAL_ACCESS_TOKEN'\nend\n\nresult = client.project_statuses.get_project_status(project_status_gid: 'project_status_gid', param: \"value\", param: \"value\", options: {pretty: true})"
}
]
},
"x-purple-suite-runtime": "unavailable"
}
DELETE /api/1.0/project_statuses/{project_status_gid}
Delete a project status
*Deprecated: new integrations should prefer the `/status_updates/{status_gid}` route.*
Deletes a specific, existing project status update.
Returns an empty data record.
This operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.
Authentication
[
{
"personalAccessToken": []
},
{
"oauth2": []
}
]
Path-level parameters and metadata
{
"parameters": [
{
"$ref": "#/components/parameters/project_status_path_gid"
},
{
"$ref": "#/components/parameters/pretty"
}
]
}
Request, responses and operation details
{
"summary": "Delete a project status",
"description": "*Deprecated: new integrations should prefer the `/status_updates/{status_gid}` route.*\n\nDeletes a specific, existing project status update.\n\nReturns an empty data record.\n\nThis operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.",
"tags": [
"Project statuses"
],
"operationId": "deleteProjectStatus",
"responses": {
"200": {
"description": "Successfully deleted the specified project status.",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"$ref": "#/components/schemas/EmptyResponse"
}
}
}
}
}
},
"400": {
"$ref": "#/components/responses/BadRequest"
},
"401": {
"$ref": "#/components/responses/Unauthorized"
},
"403": {
"$ref": "#/components/responses/Forbidden"
},
"404": {
"$ref": "#/components/responses/NotFound"
},
"500": {
"$ref": "#/components/responses/InternalServerError"
}
},
"security": [
{
"personalAccessToken": []
},
{
"oauth2": []
}
],
"x-readme": {
"code-samples": [
{
"language": "java",
"install": "<dependency><groupId>com.asana</groupId><artifactId>asana</artifactId><version>1.0.0</version></dependency>",
"code": "import com.asana.Client;\n\nClient client = Client.accessToken(\"PERSONAL_ACCESS_TOKEN\");\n\nJsonElement result = client.projectstatuses.deleteProjectStatus(projectStatusGid)\n .option(\"pretty\", true)\n .execute();"
},
{
"language": "node",
"install": "npm install asana",
"code": "const Asana = require('asana');\n\nlet client = new Asana.ApiClient();\nclient.authentications.token.accessToken = '<YOUR_ACCESS_TOKEN>';\n\nlet projectStatusesApiInstance = new Asana.ProjectStatusesApi(client);\nlet project_status_gid = \"321654\"; // String | The project status update to get.\n\nprojectStatusesApiInstance.deleteProjectStatus(project_status_gid).then((result) => {\n console.log('API called successfully. Returned data: ' + JSON.stringify(result.data, null, 2));\n}, (error) => {\n console.error(error.response.body);\n});",
"name": "node-sdk-v3"
},
{
"language": "node",
"install": "npm install asana@1.0.5",
"code": "const asana = require('asana');\n\nconst client = asana.Client.create().useAccessToken('PERSONAL_ACCESS_TOKEN');\n\nclient.projectstatuses.deleteProjectStatus(projectStatusGid)\n .then((result) => {\n console.log(result);\n });",
"name": "node-sdk-v1"
},
{
"language": "python",
"install": "pip install asana",
"code": "import asana\nfrom asana.rest import ApiException\nfrom pprint import pprint\n\nconfiguration = asana.Configuration()\nconfiguration.access_token = '<YOUR_ACCESS_TOKEN>'\napi_client = asana.ApiClient(configuration)\n\n# create an instance of the API class\nproject_statuses_api_instance = asana.ProjectStatusesApi(api_client)\nproject_status_gid = \"321654\" # str | The project status update to get.\n\n\ntry:\n # Delete a project status\n api_response = project_statuses_api_instance.delete_project_status(project_status_gid)\n pprint(api_response)\nexcept ApiException as e:\n print(\"Exception when calling ProjectStatusesApi->delete_project_status: %s\\n\" % e)",
"name": "python-sdk-v5"
},
{
"language": "python",
"install": "pip install asana==3.2.3",
"code": "import asana\n\nclient = asana.Client.access_token('PERSONAL_ACCESS_TOKEN')\n\nresult = client.project_statuses.delete_project_status(project_status_gid, opt_pretty=True)",
"name": "python-sdk-v3"
},
{
"language": "php",
"install": "composer require asana/asana",
"code": "<?php\nrequire 'vendor/autoload.php';\n\n$client = Asana\\Client::accessToken('PERSONAL_ACCESS_TOKEN');\n\n$result = $client->projectstatuses->deleteProjectStatus($project_status_gid, array('opt_pretty' => 'true'))"
},
{
"language": "ruby",
"install": "gem install asana",
"code": "require 'asana'\n\nclient = Asana::Client.new do |c|\n c.authentication :access_token, 'PERSONAL_ACCESS_TOKEN'\nend\n\nresult = client.project_statuses.delete_project_status(project_status_gid: 'project_status_gid', options: {pretty: true})"
}
]
},
"x-purple-suite-runtime": "unavailable"
}
GET /api/1.0/projects/{project_gid}/project_statuses
Get statuses from a project
*Deprecated: new integrations should prefer the `/status_updates` route.*
Returns the compact project status update records for all updates on the project.
This operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.
Authentication
[
{
"personalAccessToken": []
},
{
"oauth2": []
}
]
Path-level parameters and metadata
{
"parameters": [
{
"$ref": "#/components/parameters/project_path_gid"
},
{
"$ref": "#/components/parameters/pretty"
}
]
}
Request, responses and operation details
{
"summary": "Get statuses from a project",
"description": "*Deprecated: new integrations should prefer the `/status_updates` route.*\n\nReturns the compact project status update records for all updates on the project.\n\nThis operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.",
"tags": [
"Project statuses"
],
"operationId": "getProjectStatusesForProject",
"parameters": [
{
"$ref": "#/components/parameters/project_path_gid"
},
{
"$ref": "#/components/parameters/pretty"
},
{
"$ref": "#/components/parameters/limit"
},
{
"$ref": "#/components/parameters/offset"
},
{
"name": "opt_fields",
"in": "query",
"description": "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. Properties can include nested fields. To learn more, see the [input/output options guide](/docs/inputoutput-options#selecting-nested-fields).",
"required": false,
"example": [
"author",
"author.name",
"color",
"created_at",
"created_by",
"created_by.name",
"html_text",
"modified_at",
"offset",
"path",
"text",
"title",
"uri"
],
"schema": {
"type": "array",
"items": {
"type": "string",
"enum": [
"author",
"author.name",
"color",
"created_at",
"created_by",
"created_by.name",
"html_text",
"modified_at",
"offset",
"path",
"text",
"title",
"uri"
]
}
},
"style": "form",
"explode": false
}
],
"responses": {
"200": {
"description": "Successfully retrieved the specified project's status updates.",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"type": "array",
"items": {
"$ref": "#/components/schemas/ProjectStatusCompact"
}
},
"next_page": {
"$ref": "#/components/schemas/NextPage"
}
}
}
}
}
},
"400": {
"$ref": "#/components/responses/BadRequest"
},
"401": {
"$ref": "#/components/responses/Unauthorized"
},
"403": {
"$ref": "#/components/responses/Forbidden"
},
"404": {
"$ref": "#/components/responses/NotFound"
},
"500": {
"$ref": "#/components/responses/InternalServerError"
}
},
"security": [
{
"personalAccessToken": []
},
{
"oauth2": []
}
],
"x-readme": {
"code-samples": [
{
"language": "java",
"install": "<dependency><groupId>com.asana</groupId><artifactId>asana</artifactId><version>1.0.0</version></dependency>",
"code": "import com.asana.Client;\n\nClient client = Client.accessToken(\"PERSONAL_ACCESS_TOKEN\");\n\nList<ProjectStatus> result = client.projectstatuses.getProjectStatusesForProject(projectGid)\n .option(\"pretty\", true)\n .execute();"
},
{
"language": "node",
"install": "npm install asana",
"code": "const Asana = require('asana');\n\nlet client = new Asana.ApiClient();\nclient.authentications.token.accessToken = '<YOUR_ACCESS_TOKEN>';\n\nlet projectStatusesApiInstance = new Asana.ProjectStatusesApi(client);\nlet project_gid = \"1331\"; // String | Globally unique identifier for the project.\nlet opts = { \n 'limit': 50, \n 'offset': \"eyJ0eXAiOJiKV1iQLCJhbGciOiJIUzI1NiJ9\", \n 'opt_fields': \"author,author.name,color,created_at,created_by,created_by.name,html_text,modified_at,offset,path,text,title,uri\"\n};\nprojectStatusesApiInstance.getProjectStatusesForProject(project_gid, opts).then((result) => {\n console.log('API called successfully. Returned data: ' + JSON.stringify(result.data, null, 2));\n}, (error) => {\n console.error(error.response.body);\n});",
"name": "node-sdk-v3"
},
{
"language": "node",
"install": "npm install asana@1.0.5",
"code": "const asana = require('asana');\n\nconst client = asana.Client.create().useAccessToken('PERSONAL_ACCESS_TOKEN');\n\nclient.projectstatuses.getProjectStatusesForProject(projectGid, {param: \"value\", param: \"value\", opt_pretty: true})\n .then((result) => {\n console.log(result);\n });",
"name": "node-sdk-v1"
},
{
"language": "python",
"install": "pip install asana",
"code": "import asana\nfrom asana.rest import ApiException\nfrom pprint import pprint\n\nconfiguration = asana.Configuration()\nconfiguration.access_token = '<YOUR_ACCESS_TOKEN>'\napi_client = asana.ApiClient(configuration)\n\n# create an instance of the API class\nproject_statuses_api_instance = asana.ProjectStatusesApi(api_client)\nproject_gid = \"1331\" # str | Globally unique identifier for the project.\nopts = {\n 'limit': 50, # int | Results per page. The number of objects to return per page. The value must be between 1 and 100.\n 'offset': \"eyJ0eXAiOJiKV1iQLCJhbGciOiJIUzI1NiJ9\", # str | 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.*\n 'opt_fields': \"author,author.name,color,created_at,created_by,created_by.name,html_text,modified_at,offset,path,text,title,uri\", # list[str] | 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.\n}\n\ntry:\n # Get statuses from a project\n api_response = project_statuses_api_instance.get_project_statuses_for_project(project_gid, opts)\n for data in api_response:\n pprint(data)\nexcept ApiException as e:\n print(\"Exception when calling ProjectStatusesApi->get_project_statuses_for_project: %s\\n\" % e)",
"name": "python-sdk-v5"
},
{
"language": "python",
"install": "pip install asana==3.2.3",
"code": "import asana\n\nclient = asana.Client.access_token('PERSONAL_ACCESS_TOKEN')\n\nresult = client.project_statuses.get_project_statuses_for_project(project_gid, {'param': 'value', 'param': 'value'}, opt_pretty=True)",
"name": "python-sdk-v3"
},
{
"language": "php",
"install": "composer require asana/asana",
"code": "<?php\nrequire 'vendor/autoload.php';\n\n$client = Asana\\Client::accessToken('PERSONAL_ACCESS_TOKEN');\n\n$result = $client->projectstatuses->getProjectStatusesForProject($project_gid, array('param' => 'value', 'param' => 'value'), array('opt_pretty' => 'true'))"
},
{
"language": "ruby",
"install": "gem install asana",
"code": "require 'asana'\n\nclient = Asana::Client.new do |c|\n c.authentication :access_token, 'PERSONAL_ACCESS_TOKEN'\nend\n\nresult = client.project_statuses.get_project_statuses_for_project(project_gid: 'project_gid', param: \"value\", param: \"value\", options: {pretty: true})"
}
]
},
"x-purple-suite-runtime": "unavailable"
}
POST /api/1.0/projects/{project_gid}/project_statuses
Create a project status
*Deprecated: new integrations should prefer the `/status_updates` route.*
Creates a new status update on the project.
Returns the full record of the newly created project status update.
This operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.
Authentication
[
{
"personalAccessToken": []
},
{
"oauth2": []
}
]
Path-level parameters and metadata
{
"parameters": [
{
"$ref": "#/components/parameters/project_path_gid"
},
{
"$ref": "#/components/parameters/pretty"
}
]
}
Request, responses and operation details
{
"summary": "Create a project status",
"description": "*Deprecated: new integrations should prefer the `/status_updates` route.*\n\nCreates a new status update on the project.\n\nReturns the full record of the newly created project status update.\n\nThis operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.",
"tags": [
"Project statuses"
],
"operationId": "createProjectStatusForProject",
"parameters": [
{
"name": "opt_fields",
"in": "query",
"description": "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. Properties can include nested fields. To learn more, see the [input/output options guide](/docs/inputoutput-options#selecting-nested-fields).",
"required": false,
"example": [
"author",
"author.name",
"color",
"created_at",
"created_by",
"created_by.name",
"html_text",
"modified_at",
"text",
"title"
],
"schema": {
"type": "array",
"items": {
"type": "string",
"enum": [
"author",
"author.name",
"color",
"created_at",
"created_by",
"created_by.name",
"html_text",
"modified_at",
"text",
"title"
]
}
},
"style": "form",
"explode": false
}
],
"requestBody": {
"description": "The project status to create.",
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"$ref": "#/components/schemas/ProjectStatusRequest"
}
}
}
}
}
},
"responses": {
"201": {
"description": "Successfully created a new story.",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"$ref": "#/components/schemas/ProjectStatusResponse"
}
}
}
}
}
},
"400": {
"$ref": "#/components/responses/BadRequest"
},
"401": {
"$ref": "#/components/responses/Unauthorized"
},
"403": {
"$ref": "#/components/responses/Forbidden"
},
"404": {
"$ref": "#/components/responses/NotFound"
},
"500": {
"$ref": "#/components/responses/InternalServerError"
}
},
"security": [
{
"personalAccessToken": []
},
{
"oauth2": []
}
],
"x-readme": {
"code-samples": [
{
"language": "java",
"install": "<dependency><groupId>com.asana</groupId><artifactId>asana</artifactId><version>1.0.0</version></dependency>",
"code": "import com.asana.Client;\n\nClient client = Client.accessToken(\"PERSONAL_ACCESS_TOKEN\");\n\nProjectStatus result = client.projectstatuses.createProjectStatusForProject(projectGid)\n .data(\"field\", \"value\")\n .data(\"field\", \"value\")\n .option(\"pretty\", true)\n .execute();"
},
{
"language": "node",
"install": "npm install asana",
"code": "const Asana = require('asana');\n\nlet client = new Asana.ApiClient();\nclient.authentications.token.accessToken = '<YOUR_ACCESS_TOKEN>';\n\nlet projectStatusesApiInstance = new Asana.ProjectStatusesApi(client);\nlet body = {\"data\": {\"<PARAM_1>\": \"<VALUE_1>\", \"<PARAM_2>\": \"<VALUE_2>\",}}; // Object | The project status to create.\nlet project_gid = \"1331\"; // String | Globally unique identifier for the project.\nlet opts = { \n 'opt_fields': \"author,author.name,color,created_at,created_by,created_by.name,html_text,modified_at,text,title\"\n};\nprojectStatusesApiInstance.createProjectStatusForProject(body, project_gid, opts).then((result) => {\n console.log('API called successfully. Returned data: ' + JSON.stringify(result.data, null, 2));\n}, (error) => {\n console.error(error.response.body);\n});",
"name": "node-sdk-v3"
},
{
"language": "node",
"install": "npm install asana@1.0.5",
"code": "const asana = require('asana');\n\nconst client = asana.Client.create().useAccessToken('PERSONAL_ACCESS_TOKEN');\n\nclient.projectstatuses.createProjectStatusForProject(projectGid, {field: \"value\", field: \"value\", pretty: true})\n .then((result) => {\n console.log(result);\n });",
"name": "node-sdk-v1"
},
{
"language": "python",
"install": "pip install asana",
"code": "import asana\nfrom asana.rest import ApiException\nfrom pprint import pprint\n\nconfiguration = asana.Configuration()\nconfiguration.access_token = '<YOUR_ACCESS_TOKEN>'\napi_client = asana.ApiClient(configuration)\n\n# create an instance of the API class\nproject_statuses_api_instance = asana.ProjectStatusesApi(api_client)\nbody = {\"data\": {\"<PARAM_1>\": \"<VALUE_1>\", \"<PARAM_2>\": \"<VALUE_2>\",}} # dict | The project status to create.\nproject_gid = \"1331\" # str | Globally unique identifier for the project.\nopts = {\n 'opt_fields': \"author,author.name,color,created_at,created_by,created_by.name,html_text,modified_at,text,title\", # list[str] | 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.\n}\n\ntry:\n # Create a project status\n api_response = project_statuses_api_instance.create_project_status_for_project(body, project_gid, opts)\n pprint(api_response)\nexcept ApiException as e:\n print(\"Exception when calling ProjectStatusesApi->create_project_status_for_project: %s\\n\" % e)",
"name": "python-sdk-v5"
},
{
"language": "python",
"install": "pip install asana==3.2.3",
"code": "import asana\n\nclient = asana.Client.access_token('PERSONAL_ACCESS_TOKEN')\n\nresult = client.project_statuses.create_project_status_for_project(project_gid, {'field': 'value', 'field': 'value'}, opt_pretty=True)",
"name": "python-sdk-v3"
},
{
"language": "php",
"install": "composer require asana/asana",
"code": "<?php\nrequire 'vendor/autoload.php';\n\n$client = Asana\\Client::accessToken('PERSONAL_ACCESS_TOKEN');\n\n$result = $client->projectstatuses->createProjectStatusForProject($project_gid, array('field' => 'value', 'field' => 'value'), array('opt_pretty' => 'true'))"
},
{
"language": "ruby",
"install": "gem install asana",
"code": "require 'asana'\n\nclient = Asana::Client.new do |c|\n c.authentication :access_token, 'PERSONAL_ACCESS_TOKEN'\nend\n\nresult = client.project_statuses.create_project_status_for_project(project_gid: 'project_gid', field: \"value\", field: \"value\", options: {pretty: true})"
}
]
},
"x-purple-suite-runtime": "unavailable"
}
GET /api/1.0/project_templates/{project_template_gid}
Get a project template
<b>Required scope: </b><code>project_templates:read</code>
Returns the complete project template record for a single project template.
This operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.
Authentication
[
{
"personalAccessToken": []
},
{
"oauth2": [
"project_templates:read"
]
}
]
Path-level parameters and metadata
{
"parameters": [
{
"$ref": "#/components/parameters/project_template_path_gid"
},
{
"$ref": "#/components/parameters/pretty"
}
]
}
Request, responses and operation details
{
"summary": "Get a project template",
"description": "<b>Required scope: </b><code>project_templates:read</code>\n\nReturns the complete project template record for a single project template.\n\nThis operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.",
"tags": [
"Project templates"
],
"operationId": "getProjectTemplate",
"parameters": [
{
"name": "opt_fields",
"in": "query",
"description": "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. Properties can include nested fields. To learn more, see the [input/output options guide](/docs/inputoutput-options#selecting-nested-fields).",
"required": false,
"example": [
"color",
"description",
"html_description",
"name",
"owner",
"public",
"requested_dates",
"requested_dates.description",
"requested_dates.name",
"requested_roles",
"requested_roles.name",
"team",
"team.name"
],
"schema": {
"type": "array",
"items": {
"type": "string",
"enum": [
"color",
"description",
"html_description",
"name",
"owner",
"public",
"requested_dates",
"requested_dates.description",
"requested_dates.name",
"requested_roles",
"requested_roles.name",
"team",
"team.name"
]
}
},
"style": "form",
"explode": false
}
],
"responses": {
"200": {
"description": "Successfully retrieved the requested project template.",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"$ref": "#/components/schemas/ProjectTemplateResponse"
}
}
}
}
}
},
"400": {
"$ref": "#/components/responses/BadRequest"
},
"401": {
"$ref": "#/components/responses/Unauthorized"
},
"403": {
"$ref": "#/components/responses/Forbidden"
},
"404": {
"$ref": "#/components/responses/NotFound"
},
"500": {
"$ref": "#/components/responses/InternalServerError"
}
},
"security": [
{
"personalAccessToken": []
},
{
"oauth2": [
"project_templates:read"
]
}
],
"x-readme": {
"code-samples": [
{
"language": "java",
"install": "<dependency><groupId>com.asana</groupId><artifactId>asana</artifactId><version>1.0.0</version></dependency>",
"code": "import com.asana.Client;\n\nClient client = Client.accessToken(\"PERSONAL_ACCESS_TOKEN\");\n\nJsonElement result = client.projecttemplates.getProjectTemplate(projectTemplateGid)\n .option(\"pretty\", true)\n .execute();"
},
{
"language": "node",
"install": "npm install asana",
"code": "const Asana = require('asana');\n\nlet client = new Asana.ApiClient();\nclient.authentications.token.accessToken = '<YOUR_ACCESS_TOKEN>';\n\nlet projectTemplatesApiInstance = new Asana.ProjectTemplatesApi(client);\nlet project_template_gid = \"1331\"; // String | Globally unique identifier for the project template.\nlet opts = { \n 'opt_fields': \"color,description,html_description,name,owner,public,requested_dates,requested_dates.description,requested_dates.name,requested_roles,requested_roles.name,team,team.name\"\n};\nprojectTemplatesApiInstance.getProjectTemplate(project_template_gid, opts).then((result) => {\n console.log('API called successfully. Returned data: ' + JSON.stringify(result.data, null, 2));\n}, (error) => {\n console.error(error.response.body);\n});",
"name": "node-sdk-v3"
},
{
"language": "node",
"install": "npm install asana@1.0.5",
"code": "const asana = require('asana');\n\nconst client = asana.Client.create().useAccessToken('PERSONAL_ACCESS_TOKEN');\n\nclient.projecttemplates.getProjectTemplate(projectTemplateGid, {param: \"value\", param: \"value\", opt_pretty: true})\n .then((result) => {\n console.log(result);\n });",
"name": "node-sdk-v1"
},
{
"language": "python",
"install": "pip install asana",
"code": "import asana\nfrom asana.rest import ApiException\nfrom pprint import pprint\n\nconfiguration = asana.Configuration()\nconfiguration.access_token = '<YOUR_ACCESS_TOKEN>'\napi_client = asana.ApiClient(configuration)\n\n# create an instance of the API class\nproject_templates_api_instance = asana.ProjectTemplatesApi(api_client)\nproject_template_gid = \"1331\" # str | Globally unique identifier for the project template.\nopts = {\n 'opt_fields': \"color,description,html_description,name,owner,public,requested_dates,requested_dates.description,requested_dates.name,requested_roles,requested_roles.name,team,team.name\", # list[str] | 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.\n}\n\ntry:\n # Get a project template\n api_response = project_templates_api_instance.get_project_template(project_template_gid, opts)\n pprint(api_response)\nexcept ApiException as e:\n print(\"Exception when calling ProjectTemplatesApi->get_project_template: %s\\n\" % e)",
"name": "python-sdk-v5"
},
{
"language": "python",
"install": "pip install asana==3.2.3",
"code": "import asana\n\nclient = asana.Client.access_token('PERSONAL_ACCESS_TOKEN')\n\nresult = client.project_templates.get_project_template(project_template_gid, {'param': 'value', 'param': 'value'}, opt_pretty=True)",
"name": "python-sdk-v3"
},
{
"language": "php",
"install": "composer require asana/asana",
"code": "<?php\nrequire 'vendor/autoload.php';\n\n$client = Asana\\Client::accessToken('PERSONAL_ACCESS_TOKEN');\n\n$result = $client->projecttemplates->getProjectTemplate($project_template_gid, array('param' => 'value', 'param' => 'value'), array('opt_pretty' => 'true'))"
},
{
"language": "ruby",
"install": "gem install asana",
"code": "require 'asana'\n\nclient = Asana::Client.new do |c|\n c.authentication :access_token, 'PERSONAL_ACCESS_TOKEN'\nend\n\nresult = client.project_templates.get_project_template(project_template_gid: 'project_template_gid', param: \"value\", param: \"value\", options: {pretty: true})"
}
]
},
"x-purple-suite-runtime": "unavailable"
}
DELETE /api/1.0/project_templates/{project_template_gid}
Delete a project template
A specific, existing project template can be deleted by making a DELETE request on the URL for that project template.
Returns an empty data record.
This operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.
Authentication
[
{
"personalAccessToken": []
},
{
"oauth2": []
}
]
Path-level parameters and metadata
{
"parameters": [
{
"$ref": "#/components/parameters/project_template_path_gid"
},
{
"$ref": "#/components/parameters/pretty"
}
]
}
Request, responses and operation details
{
"summary": "Delete a project template",
"description": "A specific, existing project template can be deleted by making a DELETE request on the URL for that project template.\n\nReturns an empty data record.\n\nThis operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.",
"tags": [
"Project templates"
],
"operationId": "deleteProjectTemplate",
"responses": {
"200": {
"description": "Successfully deleted the specified project template.",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"$ref": "#/components/schemas/EmptyResponse"
}
}
}
}
}
},
"400": {
"$ref": "#/components/responses/BadRequest"
},
"401": {
"$ref": "#/components/responses/Unauthorized"
},
"402": {
"$ref": "#/components/responses/PaymentRequired"
},
"403": {
"$ref": "#/components/responses/Forbidden"
},
"404": {
"$ref": "#/components/responses/NotFound"
},
"500": {
"$ref": "#/components/responses/InternalServerError"
}
},
"security": [
{
"personalAccessToken": []
},
{
"oauth2": []
}
],
"x-readme": {
"code-samples": [
{
"language": "node",
"install": "npm install asana",
"code": "const Asana = require('asana');\n\nlet client = new Asana.ApiClient();\nclient.authentications.token.accessToken = '<YOUR_ACCESS_TOKEN>';\n\nlet projectTemplatesApiInstance = new Asana.ProjectTemplatesApi(client);\nlet project_template_gid = \"1331\"; // String | Globally unique identifier for the project template.\n\nprojectTemplatesApiInstance.deleteProjectTemplate(project_template_gid).then((result) => {\n console.log('API called successfully. Returned data: ' + JSON.stringify(result.data, null, 2));\n}, (error) => {\n console.error(error.response.body);\n});",
"name": "node-sdk-v3"
},
{
"language": "node",
"install": "npm install asana@1.0.5",
"code": "const asana = require('asana');\n\nconst client = asana.Client.create().useAccessToken('PERSONAL_ACCESS_TOKEN');\n\nclient.projecttemplates.deleteProjectTemplate(projectTemplateGid)\n .then((result) => {\n console.log(result);\n });",
"name": "node-sdk-v1"
},
{
"language": "python",
"install": "pip install asana",
"code": "import asana\nfrom asana.rest import ApiException\nfrom pprint import pprint\n\nconfiguration = asana.Configuration()\nconfiguration.access_token = '<YOUR_ACCESS_TOKEN>'\napi_client = asana.ApiClient(configuration)\n\n# create an instance of the API class\nproject_templates_api_instance = asana.ProjectTemplatesApi(api_client)\nproject_template_gid = \"1331\" # str | Globally unique identifier for the project template.\n\n\ntry:\n # Delete a project template\n api_response = project_templates_api_instance.delete_project_template(project_template_gid)\n pprint(api_response)\nexcept ApiException as e:\n print(\"Exception when calling ProjectTemplatesApi->delete_project_template: %s\\n\" % e)",
"name": "python-sdk-v5"
},
{
"language": "python",
"install": "pip install asana==3.2.3",
"code": "import asana\n\nclient = asana.Client.access_token('PERSONAL_ACCESS_TOKEN')\n\nresult = client.project_templates.delete_project_template(project_template_gid, opt_pretty=True)",
"name": "python-sdk-v3"
}
]
},
"x-purple-suite-runtime": "unavailable"
}
GET /api/1.0/project_templates
Get multiple project templates
<b>Required scope: </b><code>project_templates:read</code>
Returns the compact project template records for all project templates in the given team or workspace.
This operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.
Authentication
[
{
"personalAccessToken": []
},
{
"oauth2": [
"project_templates:read"
]
}
]
Path-level parameters and metadata
{
"parameters": [
{
"$ref": "#/components/parameters/pretty"
}
]
}
Request, responses and operation details
{
"summary": "Get multiple project templates",
"description": "<b>Required scope: </b><code>project_templates:read</code>\n\nReturns the compact project template records for all project templates in the given team or workspace.\n\nThis operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.",
"tags": [
"Project templates"
],
"operationId": "getProjectTemplates",
"parameters": [
{
"$ref": "#/components/parameters/workspace_query_param"
},
{
"$ref": "#/components/parameters/team_query_param"
},
{
"$ref": "#/components/parameters/limit"
},
{
"$ref": "#/components/parameters/offset"
},
{
"name": "opt_fields",
"in": "query",
"description": "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. Properties can include nested fields. To learn more, see the [input/output options guide](/docs/inputoutput-options#selecting-nested-fields).",
"required": false,
"example": [
"color",
"description",
"html_description",
"name",
"offset",
"owner",
"path",
"public",
"requested_dates",
"requested_dates.description",
"requested_dates.name",
"requested_roles",
"requested_roles.name",
"team",
"team.name",
"uri"
],
"schema": {
"type": "array",
"items": {
"type": "string",
"enum": [
"color",
"description",
"html_description",
"name",
"offset",
"owner",
"path",
"public",
"requested_dates",
"requested_dates.description",
"requested_dates.name",
"requested_roles",
"requested_roles.name",
"team",
"team.name",
"uri"
]
}
},
"style": "form",
"explode": false
}
],
"responses": {
"200": {
"description": "Successfully retrieved the requested team's or workspace's project templates.",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"type": "array",
"items": {
"$ref": "#/components/schemas/ProjectTemplateCompact"
}
},
"next_page": {
"$ref": "#/components/schemas/NextPage"
}
}
}
}
}
},
"400": {
"$ref": "#/components/responses/BadRequest"
},
"401": {
"$ref": "#/components/responses/Unauthorized"
},
"403": {
"$ref": "#/components/responses/Forbidden"
},
"404": {
"$ref": "#/components/responses/NotFound"
},
"500": {
"$ref": "#/components/responses/InternalServerError"
}
},
"security": [
{
"personalAccessToken": []
},
{
"oauth2": [
"project_templates:read"
]
}
],
"x-readme": {
"code-samples": [
{
"language": "java",
"install": "<dependency><groupId>com.asana</groupId><artifactId>asana</artifactId><version>1.0.0</version></dependency>",
"code": "import com.asana.Client;\n\nClient client = Client.accessToken(\"PERSONAL_ACCESS_TOKEN\");\n\nList<JsonElement> result = client.projecttemplates.getProjectTemplates(team, workspace)\n .option(\"pretty\", true)\n .execute();"
},
{
"language": "node",
"install": "npm install asana",
"code": "const Asana = require('asana');\n\nlet client = new Asana.ApiClient();\nclient.authentications.token.accessToken = '<YOUR_ACCESS_TOKEN>';\n\nlet projectTemplatesApiInstance = new Asana.ProjectTemplatesApi(client);\nlet opts = { \n 'workspace': \"12345\", \n 'team': \"14916\", \n 'limit': 50, \n 'offset': \"eyJ0eXAiOJiKV1iQLCJhbGciOiJIUzI1NiJ9\", \n 'opt_fields': \"color,description,html_description,name,offset,owner,path,public,requested_dates,requested_dates.description,requested_dates.name,requested_roles,requested_roles.name,team,team.name,uri\"\n};\nprojectTemplatesApiInstance.getProjectTemplates(opts).then((result) => {\n console.log('API called successfully. Returned data: ' + JSON.stringify(result.data, null, 2));\n}, (error) => {\n console.error(error.response.body);\n});",
"name": "node-sdk-v3"
},
{
"language": "node",
"install": "npm install asana@1.0.5",
"code": "const asana = require('asana');\n\nconst client = asana.Client.create().useAccessToken('PERSONAL_ACCESS_TOKEN');\n\nclient.projecttemplates.getProjectTemplates({param: \"value\", param: \"value\", opt_pretty: true})\n .then((result) => {\n console.log(result);\n });",
"name": "node-sdk-v1"
},
{
"language": "python",
"install": "pip install asana",
"code": "import asana\nfrom asana.rest import ApiException\nfrom pprint import pprint\n\nconfiguration = asana.Configuration()\nconfiguration.access_token = '<YOUR_ACCESS_TOKEN>'\napi_client = asana.ApiClient(configuration)\n\n# create an instance of the API class\nproject_templates_api_instance = asana.ProjectTemplatesApi(api_client)\nopts = {\n 'workspace': \"12345\", # str | The workspace to filter results on.\n 'team': \"14916\", # str | The team to filter projects on.\n 'limit': 50, # int | Results per page. The number of objects to return per page. The value must be between 1 and 100.\n 'offset': \"eyJ0eXAiOJiKV1iQLCJhbGciOiJIUzI1NiJ9\", # str | 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.*\n 'opt_fields': \"color,description,html_description,name,offset,owner,path,public,requested_dates,requested_dates.description,requested_dates.name,requested_roles,requested_roles.name,team,team.name,uri\", # list[str] | 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.\n}\n\ntry:\n # Get multiple project templates\n api_response = project_templates_api_instance.get_project_templates(opts)\n for data in api_response:\n pprint(data)\nexcept ApiException as e:\n print(\"Exception when calling ProjectTemplatesApi->get_project_templates: %s\\n\" % e)",
"name": "python-sdk-v5"
},
{
"language": "python",
"install": "pip install asana==3.2.3",
"code": "import asana\n\nclient = asana.Client.access_token('PERSONAL_ACCESS_TOKEN')\n\nresult = client.project_templates.get_project_templates({'param': 'value', 'param': 'value'}, opt_pretty=True)",
"name": "python-sdk-v3"
},
{
"language": "php",
"install": "composer require asana/asana",
"code": "<?php\nrequire 'vendor/autoload.php';\n\n$client = Asana\\Client::accessToken('PERSONAL_ACCESS_TOKEN');\n\n$result = $client->projecttemplates->getProjectTemplates(array('param' => 'value', 'param' => 'value'), array('opt_pretty' => 'true'))"
},
{
"language": "ruby",
"install": "gem install asana",
"code": "require 'asana'\n\nclient = Asana::Client.new do |c|\n c.authentication :access_token, 'PERSONAL_ACCESS_TOKEN'\nend\n\nresult = client.project_templates.get_project_templates(param: \"value\", param: \"value\", options: {pretty: true})"
}
]
},
"x-purple-suite-runtime": "unavailable"
}
GET /api/1.0/teams/{team_gid}/project_templates
Get a team's project templates
<b>Required scope: </b><code>project_templates:read</code>
Returns the compact project template records for all project templates in the team.
This operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.
Authentication
[
{
"personalAccessToken": []
},
{
"oauth2": [
"project_templates:read"
]
}
]
Path-level parameters and metadata
{
"parameters": [
{
"$ref": "#/components/parameters/team_path_gid"
},
{
"$ref": "#/components/parameters/pretty"
}
]
}
Request, responses and operation details
{
"summary": "Get a team's project templates",
"description": "<b>Required scope: </b><code>project_templates:read</code>\n\nReturns the compact project template records for all project templates in the team.\n\nThis operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.",
"tags": [
"Project templates"
],
"operationId": "getProjectTemplatesForTeam",
"parameters": [
{
"$ref": "#/components/parameters/limit"
},
{
"$ref": "#/components/parameters/offset"
},
{
"name": "opt_fields",
"in": "query",
"description": "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. Properties can include nested fields. To learn more, see the [input/output options guide](/docs/inputoutput-options#selecting-nested-fields).",
"required": false,
"example": [
"color",
"description",
"html_description",
"name",
"offset",
"owner",
"path",
"public",
"requested_dates",
"requested_dates.description",
"requested_dates.name",
"requested_roles",
"requested_roles.name",
"team",
"team.name",
"uri"
],
"schema": {
"type": "array",
"items": {
"type": "string",
"enum": [
"color",
"description",
"html_description",
"name",
"offset",
"owner",
"path",
"public",
"requested_dates",
"requested_dates.description",
"requested_dates.name",
"requested_roles",
"requested_roles.name",
"team",
"team.name",
"uri"
]
}
},
"style": "form",
"explode": false
}
],
"responses": {
"200": {
"description": "Successfully retrieved the requested team's project templates.",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"type": "array",
"items": {
"$ref": "#/components/schemas/ProjectTemplateCompact"
}
},
"next_page": {
"$ref": "#/components/schemas/NextPage"
}
}
}
}
}
},
"400": {
"$ref": "#/components/responses/BadRequest"
},
"401": {
"$ref": "#/components/responses/Unauthorized"
},
"403": {
"$ref": "#/components/responses/Forbidden"
},
"404": {
"$ref": "#/components/responses/NotFound"
},
"500": {
"$ref": "#/components/responses/InternalServerError"
}
},
"security": [
{
"personalAccessToken": []
},
{
"oauth2": [
"project_templates:read"
]
}
],
"x-readme": {
"code-samples": [
{
"language": "java",
"install": "<dependency><groupId>com.asana</groupId><artifactId>asana</artifactId><version>1.0.0</version></dependency>",
"code": "import com.asana.Client;\n\nClient client = Client.accessToken(\"PERSONAL_ACCESS_TOKEN\");\n\nList<JsonElement> result = client.projecttemplates.getProjectTemplatesForTeam(teamGid)\n .option(\"pretty\", true)\n .execute();"
},
{
"language": "node",
"install": "npm install asana",
"code": "const Asana = require('asana');\n\nlet client = new Asana.ApiClient();\nclient.authentications.token.accessToken = '<YOUR_ACCESS_TOKEN>';\n\nlet projectTemplatesApiInstance = new Asana.ProjectTemplatesApi(client);\nlet team_gid = \"159874\"; // String | Globally unique identifier for the team.\nlet opts = { \n 'limit': 50, \n 'offset': \"eyJ0eXAiOJiKV1iQLCJhbGciOiJIUzI1NiJ9\", \n 'opt_fields': \"color,description,html_description,name,offset,owner,path,public,requested_dates,requested_dates.description,requested_dates.name,requested_roles,requested_roles.name,team,team.name,uri\"\n};\nprojectTemplatesApiInstance.getProjectTemplatesForTeam(team_gid, opts).then((result) => {\n console.log('API called successfully. Returned data: ' + JSON.stringify(result.data, null, 2));\n}, (error) => {\n console.error(error.response.body);\n});",
"name": "node-sdk-v3"
},
{
"language": "node",
"install": "npm install asana@1.0.5",
"code": "const asana = require('asana');\n\nconst client = asana.Client.create().useAccessToken('PERSONAL_ACCESS_TOKEN');\n\nclient.projecttemplates.getProjectTemplatesForTeam(teamGid, {param: \"value\", param: \"value\", opt_pretty: true})\n .then((result) => {\n console.log(result);\n });",
"name": "node-sdk-v1"
},
{
"language": "python",
"install": "pip install asana",
"code": "import asana\nfrom asana.rest import ApiException\nfrom pprint import pprint\n\nconfiguration = asana.Configuration()\nconfiguration.access_token = '<YOUR_ACCESS_TOKEN>'\napi_client = asana.ApiClient(configuration)\n\n# create an instance of the API class\nproject_templates_api_instance = asana.ProjectTemplatesApi(api_client)\nteam_gid = \"159874\" # str | Globally unique identifier for the team.\nopts = {\n 'limit': 50, # int | Results per page. The number of objects to return per page. The value must be between 1 and 100.\n 'offset': \"eyJ0eXAiOJiKV1iQLCJhbGciOiJIUzI1NiJ9\", # str | 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.*\n 'opt_fields': \"color,description,html_description,name,offset,owner,path,public,requested_dates,requested_dates.description,requested_dates.name,requested_roles,requested_roles.name,team,team.name,uri\", # list[str] | 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.\n}\n\ntry:\n # Get a team's project templates\n api_response = project_templates_api_instance.get_project_templates_for_team(team_gid, opts)\n for data in api_response:\n pprint(data)\nexcept ApiException as e:\n print(\"Exception when calling ProjectTemplatesApi->get_project_templates_for_team: %s\\n\" % e)",
"name": "python-sdk-v5"
},
{
"language": "python",
"install": "pip install asana==3.2.3",
"code": "import asana\n\nclient = asana.Client.access_token('PERSONAL_ACCESS_TOKEN')\n\nresult = client.project_templates.get_project_templates_for_team(team_gid, {'param': 'value', 'param': 'value'}, opt_pretty=True)",
"name": "python-sdk-v3"
},
{
"language": "php",
"install": "composer require asana/asana",
"code": "<?php\nrequire 'vendor/autoload.php';\n\n$client = Asana\\Client::accessToken('PERSONAL_ACCESS_TOKEN');\n\n$result = $client->projecttemplates->getProjectTemplatesForTeam($team_gid, array('param' => 'value', 'param' => 'value'), array('opt_pretty' => 'true'))"
},
{
"language": "ruby",
"install": "gem install asana",
"code": "require 'asana'\n\nclient = Asana::Client.new do |c|\n c.authentication :access_token, 'PERSONAL_ACCESS_TOKEN'\nend\n\nresult = client.project_templates.get_project_templates_for_team(team_gid: 'team_gid', param: \"value\", param: \"value\", options: {pretty: true})"
}
]
},
"x-purple-suite-runtime": "unavailable"
}
POST /api/1.0/project_templates/{project_template_gid}/instantiateProject
Instantiate a project from a project template
<b>Required scope: </b><code>projects:write</code>
Creates and returns a job that will asynchronously handle the project instantiation.
To form this request, it is recommended to first make a request to [get a project template](/reference/getprojecttemplate). Then, from the response, copy the `gid` from the object in the `requested_dates` array. This `gid` should be used in `requested_dates` to instantiate a project.
_Note: The body of this request will differ if your workspace is an organization. To determine if your workspace is an organization, use the [is_organization](/reference/workspaces) parameter._
This operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.
Authentication
[
{
"personalAccessToken": []
},
{
"oauth2": [
"projects:write"
]
}
]
Path-level parameters and metadata
{
"parameters": [
{
"$ref": "#/components/parameters/project_template_path_gid"
},
{
"$ref": "#/components/parameters/pretty"
}
]
}
Request, responses and operation details
{
"summary": "Instantiate a project from a project template",
"description": "<b>Required scope: </b><code>projects:write</code>\n\nCreates and returns a job that will asynchronously handle the project instantiation.\n\nTo form this request, it is recommended to first make a request to [get a project template](/reference/getprojecttemplate). Then, from the response, copy the `gid` from the object in the `requested_dates` array. This `gid` should be used in `requested_dates` to instantiate a project.\n\n_Note: The body of this request will differ if your workspace is an organization. To determine if your workspace is an organization, use the [is_organization](/reference/workspaces) parameter._\n\nThis operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.",
"tags": [
"Project templates"
],
"operationId": "instantiateProject",
"parameters": [
{
"name": "opt_fields",
"in": "query",
"description": "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. Properties can include nested fields. To learn more, see the [input/output options guide](/docs/inputoutput-options#selecting-nested-fields).",
"required": false,
"example": [
"new_graph_export",
"new_graph_export.completed_at",
"new_graph_export.created_at",
"new_graph_export.download_url",
"new_portfolio",
"new_portfolio.name",
"new_portfolio.resource_subtype",
"new_project",
"new_project.name",
"new_project.resource_subtype",
"new_project_template",
"new_project_template.name",
"new_resource_export",
"new_resource_export.completed_at",
"new_resource_export.created_at",
"new_resource_export.download_url",
"new_task",
"new_task.created_by",
"new_task.name",
"new_task.resource_subtype",
"resource_subtype",
"status"
],
"schema": {
"type": "array",
"items": {
"type": "string",
"enum": [
"new_graph_export",
"new_graph_export.completed_at",
"new_graph_export.created_at",
"new_graph_export.download_url",
"new_portfolio",
"new_portfolio.name",
"new_portfolio.resource_subtype",
"new_project",
"new_project.name",
"new_project.resource_subtype",
"new_project_template",
"new_project_template.name",
"new_resource_export",
"new_resource_export.completed_at",
"new_resource_export.created_at",
"new_resource_export.download_url",
"new_task",
"new_task.created_by",
"new_task.name",
"new_task.resource_subtype",
"resource_subtype",
"status"
]
}
},
"style": "form",
"explode": false
}
],
"requestBody": {
"description": "Describes the inputs used for instantiating a project, such as the resulting project's name, which team it should be created in, and values for date variables.",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"$ref": "#/components/schemas/ProjectTemplateInstantiateProjectRequest"
}
}
}
}
}
},
"responses": {
"201": {
"description": "Successfully created the job to handle project instantiation.",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"$ref": "#/components/schemas/JobResponse"
}
}
}
}
}
},
"400": {
"$ref": "#/components/responses/BadRequest"
},
"401": {
"$ref": "#/components/responses/Unauthorized"
},
"403": {
"$ref": "#/components/responses/Forbidden"
},
"404": {
"$ref": "#/components/responses/NotFound"
},
"500": {
"$ref": "#/components/responses/InternalServerError"
}
},
"security": [
{
"personalAccessToken": []
},
{
"oauth2": [
"projects:write"
]
}
],
"x-readme": {
"code-samples": [
{
"language": "java",
"install": "<dependency><groupId>com.asana</groupId><artifactId>asana</artifactId><version>1.0.0</version></dependency>",
"code": "import com.asana.Client;\n\nClient client = Client.accessToken(\"PERSONAL_ACCESS_TOKEN\");\n\nJob result = client.projecttemplates.instantiateProject(projectTemplateGid)\n .data(\"field\", \"value\")\n .data(\"field\", \"value\")\n .option(\"pretty\", true)\n .execute();"
},
{
"language": "node",
"install": "npm install asana",
"code": "const Asana = require('asana');\n\nlet client = new Asana.ApiClient();\nclient.authentications.token.accessToken = '<YOUR_ACCESS_TOKEN>';\n\nlet projectTemplatesApiInstance = new Asana.ProjectTemplatesApi(client);\nlet project_template_gid = \"1331\"; // String | Globally unique identifier for the project template.\nlet opts = { \n 'body': {\"data\": {\"<PARAM_1>\": \"<VALUE_1>\", \"<PARAM_2>\": \"<VALUE_2>\",}}, \n 'opt_fields': \"new_graph_export,new_graph_export.completed_at,new_graph_export.created_at,new_graph_export.download_url,new_portfolio,new_portfolio.name,new_portfolio.resource_subtype,new_project,new_project.name,new_project.resource_subtype,new_project_template,new_project_template.name,new_resource_export,new_resource_export.completed_at,new_resource_export.created_at,new_resource_export.download_url,new_task,new_task.created_by,new_task.name,new_task.resource_subtype,resource_subtype,status\"\n};\nprojectTemplatesApiInstance.instantiateProject(project_template_gid, opts).then((result) => {\n console.log('API called successfully. Returned data: ' + JSON.stringify(result.data, null, 2));\n}, (error) => {\n console.error(error.response.body);\n});",
"name": "node-sdk-v3"
},
{
"language": "node",
"install": "npm install asana@1.0.5",
"code": "const asana = require('asana');\n\nconst client = asana.Client.create().useAccessToken('PERSONAL_ACCESS_TOKEN');\n\nclient.projecttemplates.instantiateProject(projectTemplateGid, {field: \"value\", field: \"value\", pretty: true})\n .then((result) => {\n console.log(result);\n });",
"name": "node-sdk-v1"
},
{
"language": "python",
"install": "pip install asana",
"code": "import asana\nfrom asana.rest import ApiException\nfrom pprint import pprint\n\nconfiguration = asana.Configuration()\nconfiguration.access_token = '<YOUR_ACCESS_TOKEN>'\napi_client = asana.ApiClient(configuration)\n\n# create an instance of the API class\nproject_templates_api_instance = asana.ProjectTemplatesApi(api_client)\nproject_template_gid = \"1331\" # str | Globally unique identifier for the project template.\nopts = {\n 'body': {\"data\": {\"<PARAM_1>\": \"<VALUE_1>\", \"<PARAM_2>\": \"<VALUE_2>\",}}, # dict | Describes the inputs used for instantiating a project, such as the resulting project's name, which team it should be created in, and values for date variables.\n 'opt_fields': \"new_graph_export,new_graph_export.completed_at,new_graph_export.created_at,new_graph_export.download_url,new_portfolio,new_portfolio.name,new_portfolio.resource_subtype,new_project,new_project.name,new_project.resource_subtype,new_project_template,new_project_template.name,new_resource_export,new_resource_export.completed_at,new_resource_export.created_at,new_resource_export.download_url,new_task,new_task.created_by,new_task.name,new_task.resource_subtype,resource_subtype,status\", # list[str] | 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.\n}\n\ntry:\n # Instantiate a project from a project template\n api_response = project_templates_api_instance.instantiate_project(project_template_gid, opts)\n pprint(api_response)\nexcept ApiException as e:\n print(\"Exception when calling ProjectTemplatesApi->instantiate_project: %s\\n\" % e)",
"name": "python-sdk-v5"
},
{
"language": "python",
"install": "pip install asana==3.2.3",
"code": "import asana\n\nclient = asana.Client.access_token('PERSONAL_ACCESS_TOKEN')\n\nresult = client.project_templates.instantiate_project(project_template_gid, {'field': 'value', 'field': 'value'}, opt_pretty=True)",
"name": "python-sdk-v3"
},
{
"language": "php",
"install": "composer require asana/asana",
"code": "<?php\nrequire 'vendor/autoload.php';\n\n$client = Asana\\Client::accessToken('PERSONAL_ACCESS_TOKEN');\n\n$result = $client->projecttemplates->instantiateProject($project_template_gid, array('field' => 'value', 'field' => 'value'), array('opt_pretty' => 'true'))"
},
{
"language": "ruby",
"install": "gem install asana",
"code": "require 'asana'\n\nclient = Asana::Client.new do |c|\n c.authentication :access_token, 'PERSONAL_ACCESS_TOKEN'\nend\n\nresult = client.project_templates.instantiate_project(project_template_gid: 'project_template_gid', field: \"value\", field: \"value\", options: {pretty: true})"
}
]
},
"x-purple-suite-runtime": "unavailable"
}
GET /api/1.0/projects
Get multiple projects
<b>Required scope: </b><code>projects:read</code>
Returns the compact project records for some filtered set of projects. Use one or more of the parameters provided to filter the projects returned.
*Note: This endpoint may timeout for large domains. Try filtering by team!*
**The `team` filter is deprecated.** Please use `GET /memberships` with `{ member: team, resource_subtype: project_membership }` to find projects shared with a team.
The persistent core model supports the response and query fields named in x-purple-suite-supported-response-fields and x-purple-suite-supported-query. Other fields/options return an explicit 400 errors envelope.
Authentication
[
{
"personalAccessToken": []
},
{
"oauth2": [
"projects:read"
]
}
]
Path-level parameters and metadata
{
"parameters": [
{
"$ref": "#/components/parameters/pretty"
}
]
}
Request, responses and operation details
{
"summary": "Get multiple projects",
"description": "<b>Required scope: </b><code>projects:read</code>\n\nReturns the compact project records for some filtered set of projects. Use one or more of the parameters provided to filter the projects returned.\n*Note: This endpoint may timeout for large domains. Try filtering by team!*\n**The `team` filter is deprecated.** Please use `GET /memberships` with `{ member: team, resource_subtype: project_membership }` to find projects shared with a team.\n\nThe persistent core model supports the response and query fields named in x-purple-suite-supported-response-fields and x-purple-suite-supported-query. Other fields/options return an explicit 400 errors envelope.",
"tags": [
"Projects"
],
"operationId": "getProjects",
"parameters": [
{
"$ref": "#/components/parameters/limit"
},
{
"$ref": "#/components/parameters/offset"
},
{
"name": "workspace",
"in": "query",
"description": "The workspace or organization to filter projects on.",
"schema": {
"type": "string"
},
"example": "1331"
},
{
"name": "team",
"in": "query",
"description": "**Deprecated.** The team to filter projects on. Please use `GET /memberships` with `{ member: team, resource_subtype: project_membership }` instead.",
"schema": {
"type": "string"
},
"example": "14916",
"deprecated": true
},
{
"$ref": "#/components/parameters/archived_query_param"
},
{
"$ref": "#/components/parameters/custom_type_query_param"
},
{
"name": "opt_fields",
"in": "query",
"description": "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. Properties can include nested fields. To learn more, see the [input/output options guide](/docs/inputoutput-options#selecting-nested-fields).",
"required": false,
"example": [
"archived",
"color",
"completed",
"completed_at",
"completed_by",
"completed_by.name",
"created_at",
"created_from_template",
"created_from_template.name",
"current_status",
"current_status.author",
"current_status.author.name",
"current_status.color",
"current_status.created_at",
"current_status.created_by",
"current_status.created_by.name",
"current_status.html_text",
"current_status.modified_at",
"current_status.text",
"current_status.title",
"current_status_update",
"current_status_update.resource_subtype",
"current_status_update.title",
"custom_field_settings",
"custom_field_settings.custom_field",
"custom_field_settings.custom_field.asana_created_field",
"custom_field_settings.custom_field.created_by",
"custom_field_settings.custom_field.created_by.name",
"custom_field_settings.custom_field.currency_code",
"custom_field_settings.custom_field.custom_label",
"custom_field_settings.custom_field.custom_label_position",
"custom_field_settings.custom_field.date_value",
"custom_field_settings.custom_field.date_value.date",
"custom_field_settings.custom_field.date_value.date_time",
"custom_field_settings.custom_field.default_access_level",
"custom_field_settings.custom_field.description",
"custom_field_settings.custom_field.display_value",
"custom_field_settings.custom_field.enabled",
"custom_field_settings.custom_field.enum_options",
"custom_field_settings.custom_field.enum_options.color",
"custom_field_settings.custom_field.enum_options.enabled",
"custom_field_settings.custom_field.enum_options.name",
"custom_field_settings.custom_field.enum_value",
"custom_field_settings.custom_field.enum_value.color",
"custom_field_settings.custom_field.enum_value.enabled",
"custom_field_settings.custom_field.enum_value.name",
"custom_field_settings.custom_field.format",
"custom_field_settings.custom_field.has_notifications_enabled",
"custom_field_settings.custom_field.html_text_value",
"custom_field_settings.custom_field.id_prefix",
"custom_field_settings.custom_field.input_restrictions",
"custom_field_settings.custom_field.is_formula_field",
"custom_field_settings.custom_field.is_global_to_workspace",
"custom_field_settings.custom_field.is_value_read_only",
"custom_field_settings.custom_field.multi_enum_values",
"custom_field_settings.custom_field.multi_enum_values.color",
"custom_field_settings.custom_field.multi_enum_values.enabled",
"custom_field_settings.custom_field.multi_enum_values.name",
"custom_field_settings.custom_field.name",
"custom_field_settings.custom_field.number_value",
"custom_field_settings.custom_field.people_value",
"custom_field_settings.custom_field.people_value.name",
"custom_field_settings.custom_field.precision",
"custom_field_settings.custom_field.privacy_setting",
"custom_field_settings.custom_field.reference_value",
"custom_field_settings.custom_field.reference_value.name",
"custom_field_settings.custom_field.representation_type",
"custom_field_settings.custom_field.resource_subtype",
"custom_field_settings.custom_field.text_value",
"custom_field_settings.custom_field.type",
"custom_field_settings.is_important",
"custom_field_settings.parent",
"custom_field_settings.parent.name",
"custom_field_settings.parent.resource_subtype",
"custom_field_settings.project",
"custom_field_settings.project.name",
"custom_field_settings.project.resource_subtype",
"custom_fields",
"custom_fields.date_value",
"custom_fields.date_value.date",
"custom_fields.date_value.date_time",
"custom_fields.display_value",
"custom_fields.enabled",
"custom_fields.enum_options",
"custom_fields.enum_options.color",
"custom_fields.enum_options.enabled",
"custom_fields.enum_options.name",
"custom_fields.enum_value",
"custom_fields.enum_value.color",
"custom_fields.enum_value.enabled",
"custom_fields.enum_value.name",
"custom_fields.id_prefix",
"custom_fields.input_restrictions",
"custom_fields.is_formula_field",
"custom_fields.multi_enum_values",
"custom_fields.multi_enum_values.color",
"custom_fields.multi_enum_values.enabled",
"custom_fields.multi_enum_values.name",
"custom_fields.name",
"custom_fields.number_value",
"custom_fields.representation_type",
"custom_fields.text_value",
"custom_fields.type",
"custom_type",
"custom_type.asana_created_type_identifier",
"custom_type.name",
"default_access_level",
"default_view",
"due_date",
"due_on",
"followers",
"followers.name",
"html_notes",
"icon",
"members",
"members.name",
"minimum_access_level_for_customization",
"minimum_access_level_for_sharing",
"modified_at",
"name",
"notes",
"offset",
"owner",
"path",
"permalink_url",
"privacy_setting",
"project_brief",
"public",
"resource_subtype",
"start_on",
"team",
"team.name",
"uri",
"workspace",
"workspace.name"
],
"schema": {
"type": "array",
"items": {
"type": "string",
"enum": [
"archived",
"color",
"completed",
"completed_at",
"completed_by",
"completed_by.name",
"created_at",
"created_from_template",
"created_from_template.name",
"current_status",
"current_status.author",
"current_status.author.name",
"current_status.color",
"current_status.created_at",
"current_status.created_by",
"current_status.created_by.name",
"current_status.html_text",
"current_status.modified_at",
"current_status.text",
"current_status.title",
"current_status_update",
"current_status_update.resource_subtype",
"current_status_update.title",
"custom_field_settings",
"custom_field_settings.custom_field",
"custom_field_settings.custom_field.asana_created_field",
"custom_field_settings.custom_field.created_by",
"custom_field_settings.custom_field.created_by.name",
"custom_field_settings.custom_field.currency_code",
"custom_field_settings.custom_field.custom_label",
"custom_field_settings.custom_field.custom_label_position",
"custom_field_settings.custom_field.date_value",
"custom_field_settings.custom_field.date_value.date",
"custom_field_settings.custom_field.date_value.date_time",
"custom_field_settings.custom_field.default_access_level",
"custom_field_settings.custom_field.description",
"custom_field_settings.custom_field.display_value",
"custom_field_settings.custom_field.enabled",
"custom_field_settings.custom_field.enum_options",
"custom_field_settings.custom_field.enum_options.color",
"custom_field_settings.custom_field.enum_options.enabled",
"custom_field_settings.custom_field.enum_options.name",
"custom_field_settings.custom_field.enum_value",
"custom_field_settings.custom_field.enum_value.color",
"custom_field_settings.custom_field.enum_value.enabled",
"custom_field_settings.custom_field.enum_value.name",
"custom_field_settings.custom_field.format",
"custom_field_settings.custom_field.has_notifications_enabled",
"custom_field_settings.custom_field.html_text_value",
"custom_field_settings.custom_field.id_prefix",
"custom_field_settings.custom_field.input_restrictions",
"custom_field_settings.custom_field.is_formula_field",
"custom_field_settings.custom_field.is_global_to_workspace",
"custom_field_settings.custom_field.is_value_read_only",
"custom_field_settings.custom_field.multi_enum_values",
"custom_field_settings.custom_field.multi_enum_values.color",
"custom_field_settings.custom_field.multi_enum_values.enabled",
"custom_field_settings.custom_field.multi_enum_values.name",
"custom_field_settings.custom_field.name",
"custom_field_settings.custom_field.number_value",
"custom_field_settings.custom_field.people_value",
"custom_field_settings.custom_field.people_value.name",
"custom_field_settings.custom_field.precision",
"custom_field_settings.custom_field.privacy_setting",
"custom_field_settings.custom_field.reference_value",
"custom_field_settings.custom_field.reference_value.name",
"custom_field_settings.custom_field.representation_type",
"custom_field_settings.custom_field.resource_subtype",
"custom_field_settings.custom_field.text_value",
"custom_field_settings.custom_field.type",
"custom_field_settings.is_important",
"custom_field_settings.parent",
"custom_field_settings.parent.name",
"custom_field_settings.parent.resource_subtype",
"custom_field_settings.project",
"custom_field_settings.project.name",
"custom_field_settings.project.resource_subtype",
"custom_fields",
"custom_fields.date_value",
"custom_fields.date_value.date",
"custom_fields.date_value.date_time",
"custom_fields.display_value",
"custom_fields.enabled",
"custom_fields.enum_options",
"custom_fields.enum_options.color",
"custom_fields.enum_options.enabled",
"custom_fields.enum_options.name",
"custom_fields.enum_value",
"custom_fields.enum_value.color",
"custom_fields.enum_value.enabled",
"custom_fields.enum_value.name",
"custom_fields.id_prefix",
"custom_fields.input_restrictions",
"custom_fields.is_formula_field",
"custom_fields.multi_enum_values",
"custom_fields.multi_enum_values.color",
"custom_fields.multi_enum_values.enabled",
"custom_fields.multi_enum_values.name",
"custom_fields.name",
"custom_fields.number_value",
"custom_fields.representation_type",
"custom_fields.text_value",
"custom_fields.type",
"custom_type",
"custom_type.asana_created_type_identifier",
"custom_type.name",
"default_access_level",
"default_view",
"due_date",
"due_on",
"followers",
"followers.name",
"html_notes",
"icon",
"members",
"members.name",
"minimum_access_level_for_customization",
"minimum_access_level_for_sharing",
"modified_at",
"name",
"notes",
"offset",
"owner",
"path",
"permalink_url",
"privacy_setting",
"project_brief",
"public",
"resource_subtype",
"start_on",
"team",
"team.name",
"uri",
"workspace",
"workspace.name"
]
}
},
"style": "form",
"explode": false
}
],
"responses": {
"200": {
"description": "Successfully retrieved projects.",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"type": "array",
"items": {
"$ref": "#/components/schemas/ProjectCompact"
}
},
"next_page": {
"$ref": "#/components/schemas/NextPage"
}
}
}
}
}
},
"400": {
"$ref": "#/components/responses/BadRequest"
},
"401": {
"$ref": "#/components/responses/Unauthorized"
},
"403": {
"$ref": "#/components/responses/Forbidden"
},
"404": {
"$ref": "#/components/responses/NotFound"
},
"500": {
"$ref": "#/components/responses/InternalServerError"
}
},
"security": [
{
"personalAccessToken": []
},
{
"oauth2": [
"projects:read"
]
}
],
"x-readme": {
"code-samples": [
{
"language": "java",
"install": "<dependency><groupId>com.asana</groupId><artifactId>asana</artifactId><version>1.0.0</version></dependency>",
"code": "import com.asana.Client;\n\nClient client = Client.accessToken(\"PERSONAL_ACCESS_TOKEN\");\n\nList<Project> result = client.projects.getProjects(archived, team, workspace)\n .option(\"pretty\", true)\n .execute();"
},
{
"language": "node",
"install": "npm install asana",
"code": "const Asana = require('asana');\n\nlet client = new Asana.ApiClient();\nclient.authentications.token.accessToken = '<YOUR_ACCESS_TOKEN>';\n\nlet projectsApiInstance = new Asana.ProjectsApi(client);\nlet opts = { \n 'limit': 50, \n 'offset': \"eyJ0eXAiOJiKV1iQLCJhbGciOiJIUzI1NiJ9\", \n 'workspace': \"1331\", \n 'team': \"14916\", \n 'archived': false, \n 'custom_type': \"12345\", \n 'opt_fields': \"archived,color,completed,completed_at,completed_by,completed_by.name,created_at,created_from_template,created_from_template.name,current_status,current_status.author,current_status.author.name,current_status.color,current_status.created_at,current_status.created_by,current_status.created_by.name,current_status.html_text,current_status.modified_at,current_status.text,current_status.title,current_status_update,current_status_update.resource_subtype,current_status_update.title,custom_field_settings,custom_field_settings.custom_field,custom_field_settings.custom_field.asana_created_field,custom_field_settings.custom_field.created_by,custom_field_settings.custom_field.created_by.name,custom_field_settings.custom_field.currency_code,custom_field_settings.custom_field.custom_label,custom_field_settings.custom_field.custom_label_position,custom_field_settings.custom_field.date_value,custom_field_settings.custom_field.date_value.date,custom_field_settings.custom_field.date_value.date_time,custom_field_settings.custom_field.default_access_level,custom_field_settings.custom_field.description,custom_field_settings.custom_field.display_value,custom_field_settings.custom_field.enabled,custom_field_settings.custom_field.enum_options,custom_field_settings.custom_field.enum_options.color,custom_field_settings.custom_field.enum_options.enabled,custom_field_settings.custom_field.enum_options.name,custom_field_settings.custom_field.enum_value,custom_field_settings.custom_field.enum_value.color,custom_field_settings.custom_field.enum_value.enabled,custom_field_settings.custom_field.enum_value.name,custom_field_settings.custom_field.format,custom_field_settings.custom_field.has_notifications_enabled,custom_field_settings.custom_field.html_text_value,custom_field_settings.custom_field.id_prefix,custom_field_settings.custom_field.input_restrictions,custom_field_settings.custom_field.is_formula_field,custom_field_settings.custom_field.is_global_to_workspace,custom_field_settings.custom_field.is_value_read_only,custom_field_settings.custom_field.multi_enum_values,custom_field_settings.custom_field.multi_enum_values.color,custom_field_settings.custom_field.multi_enum_values.enabled,custom_field_settings.custom_field.multi_enum_values.name,custom_field_settings.custom_field.name,custom_field_settings.custom_field.number_value,custom_field_settings.custom_field.people_value,custom_field_settings.custom_field.people_value.name,custom_field_settings.custom_field.precision,custom_field_settings.custom_field.privacy_setting,custom_field_settings.custom_field.reference_value,custom_field_settings.custom_field.reference_value.name,custom_field_settings.custom_field.representation_type,custom_field_settings.custom_field.resource_subtype,custom_field_settings.custom_field.text_value,custom_field_settings.custom_field.type,custom_field_settings.is_important,custom_field_settings.parent,custom_field_settings.parent.name,custom_field_settings.parent.resource_subtype,custom_field_settings.project,custom_field_settings.project.name,custom_field_settings.project.resource_subtype,custom_fields,custom_fields.date_value,custom_fields.date_value.date,custom_fields.date_value.date_time,custom_fields.display_value,custom_fields.enabled,custom_fields.enum_options,custom_fields.enum_options.color,custom_fields.enum_options.enabled,custom_fields.enum_options.name,custom_fields.enum_value,custom_fields.enum_value.color,custom_fields.enum_value.enabled,custom_fields.enum_value.name,custom_fields.id_prefix,custom_fields.input_restrictions,custom_fields.is_formula_field,custom_fields.multi_enum_values,custom_fields.multi_enum_values.color,custom_fields.multi_enum_values.enabled,custom_fields.multi_enum_values.name,custom_fields.name,custom_fields.number_value,custom_fields.representation_type,custom_fields.text_value,custom_fields.type,custom_type,custom_type.asana_created_type_identifier,custom_type.name,default_access_level,default_view,due_date,due_on,followers,followers.name,html_notes,icon,members,members.name,minimum_access_level_for_customization,minimum_access_level_for_sharing,modified_at,name,notes,offset,owner,path,permalink_url,privacy_setting,project_brief,public,resource_subtype,start_on,team,team.name,uri,workspace,workspace.name\"\n};\nprojectsApiInstance.getProjects(opts).then((result) => {\n console.log('API called successfully. Returned data: ' + JSON.stringify(result.data, null, 2));\n}, (error) => {\n console.error(error.response.body);\n});",
"name": "node-sdk-v3"
},
{
"language": "node",
"install": "npm install asana@1.0.5",
"code": "const asana = require('asana');\n\nconst client = asana.Client.create().useAccessToken('PERSONAL_ACCESS_TOKEN');\n\nclient.projects.getProjects({param: \"value\", param: \"value\", opt_pretty: true})\n .then((result) => {\n console.log(result);\n });",
"name": "node-sdk-v1"
},
{
"language": "python",
"install": "pip install asana",
"code": "import asana\nfrom asana.rest import ApiException\nfrom pprint import pprint\n\nconfiguration = asana.Configuration()\nconfiguration.access_token = '<YOUR_ACCESS_TOKEN>'\napi_client = asana.ApiClient(configuration)\n\n# create an instance of the API class\nprojects_api_instance = asana.ProjectsApi(api_client)\nopts = {\n 'limit': 50, # int | Results per page. The number of objects to return per page. The value must be between 1 and 100.\n 'offset': \"eyJ0eXAiOJiKV1iQLCJhbGciOiJIUzI1NiJ9\", # str | 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.*\n 'workspace': \"1331\", # str | The workspace or organization to filter projects on.\n 'team': \"14916\", # str | **Deprecated.** The team to filter projects on. Please use `GET /memberships` with `{ member: team, resource_subtype: project_membership }` instead.\n 'archived': False, # bool | Only return projects whose `archived` field takes on the value of this parameter.\n 'custom_type': \"12345\", # str | Filter results by custom type. Provide a custom type GID to return only objects of that custom type (an unknown GID returns `400`). Provide an empty string to return only objects with no custom type assigned. If this parameter is omitted, results are not filtered by custom type.\n 'opt_fields': \"archived,color,completed,completed_at,completed_by,completed_by.name,created_at,created_from_template,created_from_template.name,current_status,current_status.author,current_status.author.name,current_status.color,current_status.created_at,current_status.created_by,current_status.created_by.name,current_status.html_text,current_status.modified_at,current_status.text,current_status.title,current_status_update,current_status_update.resource_subtype,current_status_update.title,custom_field_settings,custom_field_settings.custom_field,custom_field_settings.custom_field.asana_created_field,custom_field_settings.custom_field.created_by,custom_field_settings.custom_field.created_by.name,custom_field_settings.custom_field.currency_code,custom_field_settings.custom_field.custom_label,custom_field_settings.custom_field.custom_label_position,custom_field_settings.custom_field.date_value,custom_field_settings.custom_field.date_value.date,custom_field_settings.custom_field.date_value.date_time,custom_field_settings.custom_field.default_access_level,custom_field_settings.custom_field.description,custom_field_settings.custom_field.display_value,custom_field_settings.custom_field.enabled,custom_field_settings.custom_field.enum_options,custom_field_settings.custom_field.enum_options.color,custom_field_settings.custom_field.enum_options.enabled,custom_field_settings.custom_field.enum_options.name,custom_field_settings.custom_field.enum_value,custom_field_settings.custom_field.enum_value.color,custom_field_settings.custom_field.enum_value.enabled,custom_field_settings.custom_field.enum_value.name,custom_field_settings.custom_field.format,custom_field_settings.custom_field.has_notifications_enabled,custom_field_settings.custom_field.html_text_value,custom_field_settings.custom_field.id_prefix,custom_field_settings.custom_field.input_restrictions,custom_field_settings.custom_field.is_formula_field,custom_field_settings.custom_field.is_global_to_workspace,custom_field_settings.custom_field.is_value_read_only,custom_field_settings.custom_field.multi_enum_values,custom_field_settings.custom_field.multi_enum_values.color,custom_field_settings.custom_field.multi_enum_values.enabled,custom_field_settings.custom_field.multi_enum_values.name,custom_field_settings.custom_field.name,custom_field_settings.custom_field.number_value,custom_field_settings.custom_field.people_value,custom_field_settings.custom_field.people_value.name,custom_field_settings.custom_field.precision,custom_field_settings.custom_field.privacy_setting,custom_field_settings.custom_field.reference_value,custom_field_settings.custom_field.reference_value.name,custom_field_settings.custom_field.representation_type,custom_field_settings.custom_field.resource_subtype,custom_field_settings.custom_field.text_value,custom_field_settings.custom_field.type,custom_field_settings.is_important,custom_field_settings.parent,custom_field_settings.parent.name,custom_field_settings.parent.resource_subtype,custom_field_settings.project,custom_field_settings.project.name,custom_field_settings.project.resource_subtype,custom_fields,custom_fields.date_value,custom_fields.date_value.date,custom_fields.date_value.date_time,custom_fields.display_value,custom_fields.enabled,custom_fields.enum_options,custom_fields.enum_options.color,custom_fields.enum_options.enabled,custom_fields.enum_options.name,custom_fields.enum_value,custom_fields.enum_value.color,custom_fields.enum_value.enabled,custom_fields.enum_value.name,custom_fields.id_prefix,custom_fields.input_restrictions,custom_fields.is_formula_field,custom_fields.multi_enum_values,custom_fields.multi_enum_values.color,custom_fields.multi_enum_values.enabled,custom_fields.multi_enum_values.name,custom_fields.name,custom_fields.number_value,custom_fields.representation_type,custom_fields.text_value,custom_fields.type,custom_type,custom_type.asana_created_type_identifier,custom_type.name,default_access_level,default_view,due_date,due_on,followers,followers.name,html_notes,icon,members,members.name,minimum_access_level_for_customization,minimum_access_level_for_sharing,modified_at,name,notes,offset,owner,path,permalink_url,privacy_setting,project_brief,public,resource_subtype,start_on,team,team.name,uri,workspace,workspace.name\", # list[str] | 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.\n}\n\ntry:\n # Get multiple projects\n api_response = projects_api_instance.get_projects(opts)\n for data in api_response:\n pprint(data)\nexcept ApiException as e:\n print(\"Exception when calling ProjectsApi->get_projects: %s\\n\" % e)",
"name": "python-sdk-v5"
},
{
"language": "python",
"install": "pip install asana==3.2.3",
"code": "import asana\n\nclient = asana.Client.access_token('PERSONAL_ACCESS_TOKEN')\n\nresult = client.projects.get_projects({'param': 'value', 'param': 'value'}, opt_pretty=True)",
"name": "python-sdk-v3"
},
{
"language": "php",
"install": "composer require asana/asana",
"code": "<?php\nrequire 'vendor/autoload.php';\n\n$client = Asana\\Client::accessToken('PERSONAL_ACCESS_TOKEN');\n\n$result = $client->projects->getProjects(array('param' => 'value', 'param' => 'value'), array('opt_pretty' => 'true'))"
},
{
"language": "ruby",
"install": "gem install asana",
"code": "require 'asana'\n\nclient = Asana::Client.new do |c|\n c.authentication :access_token, 'PERSONAL_ACCESS_TOKEN'\nend\n\nresult = client.projects.get_projects(param: \"value\", param: \"value\", options: {pretty: true})"
}
]
},
"x-purple-suite-runtime": "modeled-core",
"x-purple-suite-supported-query": [
"opt_pretty",
"limit",
"offset",
"workspace",
"archived",
"opt_fields"
],
"x-purple-suite-supported-response-fields": [
"gid",
"resource_type",
"resource_subtype",
"name",
"notes",
"completed",
"completed_at",
"created_at",
"modified_at",
"assignee",
"assignee_status",
"workspace",
"projects",
"memberships",
"parent",
"due_on",
"start_on",
"tags",
"dependencies",
"num_subtasks",
"archived",
"public",
"color",
"default_view",
"team",
"project",
"section",
"text",
"created_by",
"target",
"type",
"email",
"photo",
"is_organization"
]
}
POST /api/1.0/projects
Create a project
<b>Required scope: </b><code>projects:write</code>
Create a new project in a workspace or team.
Every project is required to be created in a specific workspace or
organization, and this cannot be changed once set. Note that you can use
the `workspace` parameter regardless of whether or not it is an
organization.
If the workspace for your project is an organization, you must also
supply a `team` to share the project with.
Returns the full record of the newly created project.
**Deprecation notice:** The `team` parameter and the `private_to_team`
value for `privacy_setting` are deprecated. When either is included in
the request, the `Asana-Change` response header will indicate an affected
deprecation. Clients should switch to using `POST /memberships` with
`{ parent: project, member: team }` to share a project with a team after
creation.
The persistent core model supports the response and query fields named in x-purple-suite-supported-response-fields and x-purple-suite-supported-query. Other fields/options return an explicit 400 errors envelope.
Authentication
[
{
"personalAccessToken": []
},
{
"oauth2": [
"projects:write"
]
}
]
Path-level parameters and metadata
{
"parameters": [
{
"$ref": "#/components/parameters/pretty"
}
]
}
Request, responses and operation details
{
"summary": "Create a project",
"description": "<b>Required scope: </b><code>projects:write</code>\n\nCreate a new project in a workspace or team.\n\nEvery project is required to be created in a specific workspace or\norganization, and this cannot be changed once set. Note that you can use\nthe `workspace` parameter regardless of whether or not it is an\norganization.\n\nIf the workspace for your project is an organization, you must also\nsupply a `team` to share the project with.\n\nReturns the full record of the newly created project.\n\n**Deprecation notice:** The `team` parameter and the `private_to_team`\nvalue for `privacy_setting` are deprecated. When either is included in\nthe request, the `Asana-Change` response header will indicate an affected\ndeprecation. Clients should switch to using `POST /memberships` with\n`{ parent: project, member: team }` to share a project with a team after\ncreation.\n\nThe persistent core model supports the response and query fields named in x-purple-suite-supported-response-fields and x-purple-suite-supported-query. Other fields/options return an explicit 400 errors envelope.",
"tags": [
"Projects"
],
"operationId": "createProject",
"parameters": [
{
"name": "opt_fields",
"in": "query",
"description": "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. Properties can include nested fields. To learn more, see the [input/output options guide](/docs/inputoutput-options#selecting-nested-fields).",
"required": false,
"example": [
"archived",
"color",
"completed",
"completed_at",
"completed_by",
"completed_by.name",
"created_at",
"created_from_template",
"created_from_template.name",
"current_status",
"current_status.author",
"current_status.author.name",
"current_status.color",
"current_status.created_at",
"current_status.created_by",
"current_status.created_by.name",
"current_status.html_text",
"current_status.modified_at",
"current_status.text",
"current_status.title",
"current_status_update",
"current_status_update.resource_subtype",
"current_status_update.title",
"custom_field_settings",
"custom_field_settings.custom_field",
"custom_field_settings.custom_field.asana_created_field",
"custom_field_settings.custom_field.created_by",
"custom_field_settings.custom_field.created_by.name",
"custom_field_settings.custom_field.currency_code",
"custom_field_settings.custom_field.custom_label",
"custom_field_settings.custom_field.custom_label_position",
"custom_field_settings.custom_field.date_value",
"custom_field_settings.custom_field.date_value.date",
"custom_field_settings.custom_field.date_value.date_time",
"custom_field_settings.custom_field.default_access_level",
"custom_field_settings.custom_field.description",
"custom_field_settings.custom_field.display_value",
"custom_field_settings.custom_field.enabled",
"custom_field_settings.custom_field.enum_options",
"custom_field_settings.custom_field.enum_options.color",
"custom_field_settings.custom_field.enum_options.enabled",
"custom_field_settings.custom_field.enum_options.name",
"custom_field_settings.custom_field.enum_value",
"custom_field_settings.custom_field.enum_value.color",
"custom_field_settings.custom_field.enum_value.enabled",
"custom_field_settings.custom_field.enum_value.name",
"custom_field_settings.custom_field.format",
"custom_field_settings.custom_field.has_notifications_enabled",
"custom_field_settings.custom_field.html_text_value",
"custom_field_settings.custom_field.id_prefix",
"custom_field_settings.custom_field.input_restrictions",
"custom_field_settings.custom_field.is_formula_field",
"custom_field_settings.custom_field.is_global_to_workspace",
"custom_field_settings.custom_field.is_value_read_only",
"custom_field_settings.custom_field.multi_enum_values",
"custom_field_settings.custom_field.multi_enum_values.color",
"custom_field_settings.custom_field.multi_enum_values.enabled",
"custom_field_settings.custom_field.multi_enum_values.name",
"custom_field_settings.custom_field.name",
"custom_field_settings.custom_field.number_value",
"custom_field_settings.custom_field.people_value",
"custom_field_settings.custom_field.people_value.name",
"custom_field_settings.custom_field.precision",
"custom_field_settings.custom_field.privacy_setting",
"custom_field_settings.custom_field.reference_value",
"custom_field_settings.custom_field.reference_value.name",
"custom_field_settings.custom_field.representation_type",
"custom_field_settings.custom_field.resource_subtype",
"custom_field_settings.custom_field.text_value",
"custom_field_settings.custom_field.type",
"custom_field_settings.is_important",
"custom_field_settings.parent",
"custom_field_settings.parent.name",
"custom_field_settings.parent.resource_subtype",
"custom_field_settings.project",
"custom_field_settings.project.name",
"custom_field_settings.project.resource_subtype",
"custom_fields",
"custom_fields.date_value",
"custom_fields.date_value.date",
"custom_fields.date_value.date_time",
"custom_fields.display_value",
"custom_fields.enabled",
"custom_fields.enum_options",
"custom_fields.enum_options.color",
"custom_fields.enum_options.enabled",
"custom_fields.enum_options.name",
"custom_fields.enum_value",
"custom_fields.enum_value.color",
"custom_fields.enum_value.enabled",
"custom_fields.enum_value.name",
"custom_fields.id_prefix",
"custom_fields.input_restrictions",
"custom_fields.is_formula_field",
"custom_fields.multi_enum_values",
"custom_fields.multi_enum_values.color",
"custom_fields.multi_enum_values.enabled",
"custom_fields.multi_enum_values.name",
"custom_fields.name",
"custom_fields.number_value",
"custom_fields.representation_type",
"custom_fields.text_value",
"custom_fields.type",
"custom_type",
"custom_type.asana_created_type_identifier",
"custom_type.name",
"default_access_level",
"default_view",
"due_date",
"due_on",
"followers",
"followers.name",
"html_notes",
"icon",
"members",
"members.name",
"minimum_access_level_for_customization",
"minimum_access_level_for_sharing",
"modified_at",
"name",
"notes",
"owner",
"permalink_url",
"privacy_setting",
"project_brief",
"public",
"resource_subtype",
"start_on",
"team",
"team.name",
"workspace",
"workspace.name"
],
"schema": {
"type": "array",
"items": {
"type": "string",
"enum": [
"archived",
"color",
"completed",
"completed_at",
"completed_by",
"completed_by.name",
"created_at",
"created_from_template",
"created_from_template.name",
"current_status",
"current_status.author",
"current_status.author.name",
"current_status.color",
"current_status.created_at",
"current_status.created_by",
"current_status.created_by.name",
"current_status.html_text",
"current_status.modified_at",
"current_status.text",
"current_status.title",
"current_status_update",
"current_status_update.resource_subtype",
"current_status_update.title",
"custom_field_settings",
"custom_field_settings.custom_field",
"custom_field_settings.custom_field.asana_created_field",
"custom_field_settings.custom_field.created_by",
"custom_field_settings.custom_field.created_by.name",
"custom_field_settings.custom_field.currency_code",
"custom_field_settings.custom_field.custom_label",
"custom_field_settings.custom_field.custom_label_position",
"custom_field_settings.custom_field.date_value",
"custom_field_settings.custom_field.date_value.date",
"custom_field_settings.custom_field.date_value.date_time",
"custom_field_settings.custom_field.default_access_level",
"custom_field_settings.custom_field.description",
"custom_field_settings.custom_field.display_value",
"custom_field_settings.custom_field.enabled",
"custom_field_settings.custom_field.enum_options",
"custom_field_settings.custom_field.enum_options.color",
"custom_field_settings.custom_field.enum_options.enabled",
"custom_field_settings.custom_field.enum_options.name",
"custom_field_settings.custom_field.enum_value",
"custom_field_settings.custom_field.enum_value.color",
"custom_field_settings.custom_field.enum_value.enabled",
"custom_field_settings.custom_field.enum_value.name",
"custom_field_settings.custom_field.format",
"custom_field_settings.custom_field.has_notifications_enabled",
"custom_field_settings.custom_field.html_text_value",
"custom_field_settings.custom_field.id_prefix",
"custom_field_settings.custom_field.input_restrictions",
"custom_field_settings.custom_field.is_formula_field",
"custom_field_settings.custom_field.is_global_to_workspace",
"custom_field_settings.custom_field.is_value_read_only",
"custom_field_settings.custom_field.multi_enum_values",
"custom_field_settings.custom_field.multi_enum_values.color",
"custom_field_settings.custom_field.multi_enum_values.enabled",
"custom_field_settings.custom_field.multi_enum_values.name",
"custom_field_settings.custom_field.name",
"custom_field_settings.custom_field.number_value",
"custom_field_settings.custom_field.people_value",
"custom_field_settings.custom_field.people_value.name",
"custom_field_settings.custom_field.precision",
"custom_field_settings.custom_field.privacy_setting",
"custom_field_settings.custom_field.reference_value",
"custom_field_settings.custom_field.reference_value.name",
"custom_field_settings.custom_field.representation_type",
"custom_field_settings.custom_field.resource_subtype",
"custom_field_settings.custom_field.text_value",
"custom_field_settings.custom_field.type",
"custom_field_settings.is_important",
"custom_field_settings.parent",
"custom_field_settings.parent.name",
"custom_field_settings.parent.resource_subtype",
"custom_field_settings.project",
"custom_field_settings.project.name",
"custom_field_settings.project.resource_subtype",
"custom_fields",
"custom_fields.date_value",
"custom_fields.date_value.date",
"custom_fields.date_value.date_time",
"custom_fields.display_value",
"custom_fields.enabled",
"custom_fields.enum_options",
"custom_fields.enum_options.color",
"custom_fields.enum_options.enabled",
"custom_fields.enum_options.name",
"custom_fields.enum_value",
"custom_fields.enum_value.color",
"custom_fields.enum_value.enabled",
"custom_fields.enum_value.name",
"custom_fields.id_prefix",
"custom_fields.input_restrictions",
"custom_fields.is_formula_field",
"custom_fields.multi_enum_values",
"custom_fields.multi_enum_values.color",
"custom_fields.multi_enum_values.enabled",
"custom_fields.multi_enum_values.name",
"custom_fields.name",
"custom_fields.number_value",
"custom_fields.representation_type",
"custom_fields.text_value",
"custom_fields.type",
"custom_type",
"custom_type.asana_created_type_identifier",
"custom_type.name",
"default_access_level",
"default_view",
"due_date",
"due_on",
"followers",
"followers.name",
"html_notes",
"icon",
"members",
"members.name",
"minimum_access_level_for_customization",
"minimum_access_level_for_sharing",
"modified_at",
"name",
"notes",
"owner",
"permalink_url",
"privacy_setting",
"project_brief",
"public",
"resource_subtype",
"start_on",
"team",
"team.name",
"workspace",
"workspace.name"
]
}
},
"style": "form",
"explode": false
}
],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
"data"
],
"additionalProperties": false,
"properties": {
"data": {
"type": "object",
"additionalProperties": false,
"required": [
"name"
],
"properties": {
"name": {
"type": "string"
},
"notes": {
"type": "string"
},
"workspace": {
"type": "string"
},
"team": {
"type": "string"
},
"archived": {
"type": "boolean"
},
"public": {
"type": "boolean"
},
"color": {
"type": "string",
"nullable": true
},
"due_on": {
"type": "string",
"nullable": true,
"format": "date"
},
"start_on": {
"type": "string",
"nullable": true,
"format": "date"
},
"default_view": {
"enum": [
"list",
"board",
"calendar",
"timeline"
]
}
}
}
}
}
},
"application/x-www-form-urlencoded": {
"schema": {
"type": "object",
"additionalProperties": false,
"required": [
"name"
],
"properties": {
"name": {
"type": "string"
},
"notes": {
"type": "string"
},
"workspace": {
"type": "string"
},
"team": {
"type": "string"
},
"archived": {
"type": "boolean"
},
"public": {
"type": "boolean"
},
"color": {
"type": "string",
"nullable": true
},
"due_on": {
"type": "string",
"nullable": true,
"format": "date"
},
"start_on": {
"type": "string",
"nullable": true,
"format": "date"
},
"default_view": {
"enum": [
"list",
"board",
"calendar",
"timeline"
]
}
}
}
}
}
},
"responses": {
"201": {
"description": "Successfully retrieved projects.",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"$ref": "#/components/schemas/ProjectResponse"
}
}
}
}
}
},
"400": {
"$ref": "#/components/responses/BadRequest"
},
"401": {
"$ref": "#/components/responses/Unauthorized"
},
"403": {
"$ref": "#/components/responses/Forbidden"
},
"404": {
"$ref": "#/components/responses/NotFound"
},
"500": {
"$ref": "#/components/responses/InternalServerError"
}
},
"security": [
{
"personalAccessToken": []
},
{
"oauth2": [
"projects:write"
]
}
],
"x-readme": {
"code-samples": [
{
"language": "java",
"install": "<dependency><groupId>com.asana</groupId><artifactId>asana</artifactId><version>1.0.0</version></dependency>",
"code": "import com.asana.Client;\n\nClient client = Client.accessToken(\"PERSONAL_ACCESS_TOKEN\");\n\nProject result = client.projects.createProject()\n .data(\"field\", \"value\")\n .data(\"field\", \"value\")\n .option(\"pretty\", true)\n .execute();"
},
{
"language": "node",
"install": "npm install asana",
"code": "const Asana = require('asana');\n\nlet client = new Asana.ApiClient();\nclient.authentications.token.accessToken = '<YOUR_ACCESS_TOKEN>';\n\nlet projectsApiInstance = new Asana.ProjectsApi(client);\nlet body = {\"data\": {\"<PARAM_1>\": \"<VALUE_1>\", \"<PARAM_2>\": \"<VALUE_2>\",}}; // Object | The project to create.\nlet opts = { \n 'opt_fields': \"archived,color,completed,completed_at,completed_by,completed_by.name,created_at,created_from_template,created_from_template.name,current_status,current_status.author,current_status.author.name,current_status.color,current_status.created_at,current_status.created_by,current_status.created_by.name,current_status.html_text,current_status.modified_at,current_status.text,current_status.title,current_status_update,current_status_update.resource_subtype,current_status_update.title,custom_field_settings,custom_field_settings.custom_field,custom_field_settings.custom_field.asana_created_field,custom_field_settings.custom_field.created_by,custom_field_settings.custom_field.created_by.name,custom_field_settings.custom_field.currency_code,custom_field_settings.custom_field.custom_label,custom_field_settings.custom_field.custom_label_position,custom_field_settings.custom_field.date_value,custom_field_settings.custom_field.date_value.date,custom_field_settings.custom_field.date_value.date_time,custom_field_settings.custom_field.default_access_level,custom_field_settings.custom_field.description,custom_field_settings.custom_field.display_value,custom_field_settings.custom_field.enabled,custom_field_settings.custom_field.enum_options,custom_field_settings.custom_field.enum_options.color,custom_field_settings.custom_field.enum_options.enabled,custom_field_settings.custom_field.enum_options.name,custom_field_settings.custom_field.enum_value,custom_field_settings.custom_field.enum_value.color,custom_field_settings.custom_field.enum_value.enabled,custom_field_settings.custom_field.enum_value.name,custom_field_settings.custom_field.format,custom_field_settings.custom_field.has_notifications_enabled,custom_field_settings.custom_field.html_text_value,custom_field_settings.custom_field.id_prefix,custom_field_settings.custom_field.input_restrictions,custom_field_settings.custom_field.is_formula_field,custom_field_settings.custom_field.is_global_to_workspace,custom_field_settings.custom_field.is_value_read_only,custom_field_settings.custom_field.multi_enum_values,custom_field_settings.custom_field.multi_enum_values.color,custom_field_settings.custom_field.multi_enum_values.enabled,custom_field_settings.custom_field.multi_enum_values.name,custom_field_settings.custom_field.name,custom_field_settings.custom_field.number_value,custom_field_settings.custom_field.people_value,custom_field_settings.custom_field.people_value.name,custom_field_settings.custom_field.precision,custom_field_settings.custom_field.privacy_setting,custom_field_settings.custom_field.reference_value,custom_field_settings.custom_field.reference_value.name,custom_field_settings.custom_field.representation_type,custom_field_settings.custom_field.resource_subtype,custom_field_settings.custom_field.text_value,custom_field_settings.custom_field.type,custom_field_settings.is_important,custom_field_settings.parent,custom_field_settings.parent.name,custom_field_settings.parent.resource_subtype,custom_field_settings.project,custom_field_settings.project.name,custom_field_settings.project.resource_subtype,custom_fields,custom_fields.date_value,custom_fields.date_value.date,custom_fields.date_value.date_time,custom_fields.display_value,custom_fields.enabled,custom_fields.enum_options,custom_fields.enum_options.color,custom_fields.enum_options.enabled,custom_fields.enum_options.name,custom_fields.enum_value,custom_fields.enum_value.color,custom_fields.enum_value.enabled,custom_fields.enum_value.name,custom_fields.id_prefix,custom_fields.input_restrictions,custom_fields.is_formula_field,custom_fields.multi_enum_values,custom_fields.multi_enum_values.color,custom_fields.multi_enum_values.enabled,custom_fields.multi_enum_values.name,custom_fields.name,custom_fields.number_value,custom_fields.representation_type,custom_fields.text_value,custom_fields.type,custom_type,custom_type.asana_created_type_identifier,custom_type.name,default_access_level,default_view,due_date,due_on,followers,followers.name,html_notes,icon,members,members.name,minimum_access_level_for_customization,minimum_access_level_for_sharing,modified_at,name,notes,owner,permalink_url,privacy_setting,project_brief,public,resource_subtype,start_on,team,team.name,workspace,workspace.name\"\n};\nprojectsApiInstance.createProject(body, opts).then((result) => {\n console.log('API called successfully. Returned data: ' + JSON.stringify(result.data, null, 2));\n}, (error) => {\n console.error(error.response.body);\n});",
"name": "node-sdk-v3"
},
{
"language": "node",
"install": "npm install asana@1.0.5",
"code": "const asana = require('asana');\n\nconst client = asana.Client.create().useAccessToken('PERSONAL_ACCESS_TOKEN');\n\nclient.projects.createProject({field: \"value\", field: \"value\", pretty: true})\n .then((result) => {\n console.log(result);\n });",
"name": "node-sdk-v1"
},
{
"language": "python",
"install": "pip install asana",
"code": "import asana\nfrom asana.rest import ApiException\nfrom pprint import pprint\n\nconfiguration = asana.Configuration()\nconfiguration.access_token = '<YOUR_ACCESS_TOKEN>'\napi_client = asana.ApiClient(configuration)\n\n# create an instance of the API class\nprojects_api_instance = asana.ProjectsApi(api_client)\nbody = {\"data\": {\"<PARAM_1>\": \"<VALUE_1>\", \"<PARAM_2>\": \"<VALUE_2>\",}} # dict | The project to create.\nopts = {\n 'opt_fields': \"archived,color,completed,completed_at,completed_by,completed_by.name,created_at,created_from_template,created_from_template.name,current_status,current_status.author,current_status.author.name,current_status.color,current_status.created_at,current_status.created_by,current_status.created_by.name,current_status.html_text,current_status.modified_at,current_status.text,current_status.title,current_status_update,current_status_update.resource_subtype,current_status_update.title,custom_field_settings,custom_field_settings.custom_field,custom_field_settings.custom_field.asana_created_field,custom_field_settings.custom_field.created_by,custom_field_settings.custom_field.created_by.name,custom_field_settings.custom_field.currency_code,custom_field_settings.custom_field.custom_label,custom_field_settings.custom_field.custom_label_position,custom_field_settings.custom_field.date_value,custom_field_settings.custom_field.date_value.date,custom_field_settings.custom_field.date_value.date_time,custom_field_settings.custom_field.default_access_level,custom_field_settings.custom_field.description,custom_field_settings.custom_field.display_value,custom_field_settings.custom_field.enabled,custom_field_settings.custom_field.enum_options,custom_field_settings.custom_field.enum_options.color,custom_field_settings.custom_field.enum_options.enabled,custom_field_settings.custom_field.enum_options.name,custom_field_settings.custom_field.enum_value,custom_field_settings.custom_field.enum_value.color,custom_field_settings.custom_field.enum_value.enabled,custom_field_settings.custom_field.enum_value.name,custom_field_settings.custom_field.format,custom_field_settings.custom_field.has_notifications_enabled,custom_field_settings.custom_field.html_text_value,custom_field_settings.custom_field.id_prefix,custom_field_settings.custom_field.input_restrictions,custom_field_settings.custom_field.is_formula_field,custom_field_settings.custom_field.is_global_to_workspace,custom_field_settings.custom_field.is_value_read_only,custom_field_settings.custom_field.multi_enum_values,custom_field_settings.custom_field.multi_enum_values.color,custom_field_settings.custom_field.multi_enum_values.enabled,custom_field_settings.custom_field.multi_enum_values.name,custom_field_settings.custom_field.name,custom_field_settings.custom_field.number_value,custom_field_settings.custom_field.people_value,custom_field_settings.custom_field.people_value.name,custom_field_settings.custom_field.precision,custom_field_settings.custom_field.privacy_setting,custom_field_settings.custom_field.reference_value,custom_field_settings.custom_field.reference_value.name,custom_field_settings.custom_field.representation_type,custom_field_settings.custom_field.resource_subtype,custom_field_settings.custom_field.text_value,custom_field_settings.custom_field.type,custom_field_settings.is_important,custom_field_settings.parent,custom_field_settings.parent.name,custom_field_settings.parent.resource_subtype,custom_field_settings.project,custom_field_settings.project.name,custom_field_settings.project.resource_subtype,custom_fields,custom_fields.date_value,custom_fields.date_value.date,custom_fields.date_value.date_time,custom_fields.display_value,custom_fields.enabled,custom_fields.enum_options,custom_fields.enum_options.color,custom_fields.enum_options.enabled,custom_fields.enum_options.name,custom_fields.enum_value,custom_fields.enum_value.color,custom_fields.enum_value.enabled,custom_fields.enum_value.name,custom_fields.id_prefix,custom_fields.input_restrictions,custom_fields.is_formula_field,custom_fields.multi_enum_values,custom_fields.multi_enum_values.color,custom_fields.multi_enum_values.enabled,custom_fields.multi_enum_values.name,custom_fields.name,custom_fields.number_value,custom_fields.representation_type,custom_fields.text_value,custom_fields.type,custom_type,custom_type.asana_created_type_identifier,custom_type.name,default_access_level,default_view,due_date,due_on,followers,followers.name,html_notes,icon,members,members.name,minimum_access_level_for_customization,minimum_access_level_for_sharing,modified_at,name,notes,owner,permalink_url,privacy_setting,project_brief,public,resource_subtype,start_on,team,team.name,workspace,workspace.name\", # list[str] | 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.\n}\n\ntry:\n # Create a project\n api_response = projects_api_instance.create_project(body, opts)\n pprint(api_response)\nexcept ApiException as e:\n print(\"Exception when calling ProjectsApi->create_project: %s\\n\" % e)",
"name": "python-sdk-v5"
},
{
"language": "python",
"install": "pip install asana==3.2.3",
"code": "import asana\n\nclient = asana.Client.access_token('PERSONAL_ACCESS_TOKEN')\n\nresult = client.projects.create_project({'field': 'value', 'field': 'value'}, opt_pretty=True)",
"name": "python-sdk-v3"
},
{
"language": "php",
"install": "composer require asana/asana",
"code": "<?php\nrequire 'vendor/autoload.php';\n\n$client = Asana\\Client::accessToken('PERSONAL_ACCESS_TOKEN');\n\n$result = $client->projects->createProject(array('field' => 'value', 'field' => 'value'), array('opt_pretty' => 'true'))"
},
{
"language": "ruby",
"install": "gem install asana",
"code": "require 'asana'\n\nclient = Asana::Client.new do |c|\n c.authentication :access_token, 'PERSONAL_ACCESS_TOKEN'\nend\n\nresult = client.projects.create_project(field: \"value\", field: \"value\", options: {pretty: true})"
}
]
},
"x-purple-suite-runtime": "modeled-core",
"x-purple-suite-supported-query": [
"opt_pretty",
"opt_fields"
],
"x-purple-suite-supported-response-fields": [
"gid",
"resource_type",
"resource_subtype",
"name",
"notes",
"completed",
"completed_at",
"created_at",
"modified_at",
"assignee",
"assignee_status",
"workspace",
"projects",
"memberships",
"parent",
"due_on",
"start_on",
"tags",
"dependencies",
"num_subtasks",
"archived",
"public",
"color",
"default_view",
"team",
"project",
"section",
"text",
"created_by",
"target",
"type",
"email",
"photo",
"is_organization"
]
}
GET /api/1.0/projects/{project_gid}
Get a project
<b>Required scope: </b><code>projects:read</code>
<table>
<tr>
<th>Field</th>
<th>Required Scope</th>
</tr>
<tr>
<td><code>team</code></td>
<td><code>teams:read</code></td>
</tr>
<tr>
<td><code>custom_type</code></td>
<td><code>custom_types:read</code></td>
</tr>
</table>
Returns the complete project record for a single project.
The persistent core model supports the response and query fields named in x-purple-suite-supported-response-fields and x-purple-suite-supported-query. Other fields/options return an explicit 400 errors envelope.
Authentication
[
{
"personalAccessToken": []
},
{
"oauth2": [
"projects:read"
]
}
]
Path-level parameters and metadata
{
"parameters": [
{
"$ref": "#/components/parameters/project_path_gid"
},
{
"$ref": "#/components/parameters/pretty"
}
]
}
Request, responses and operation details
{
"summary": "Get a project",
"description": "<b>Required scope: </b><code>projects:read</code>\n\n<table>\n <tr>\n <th>Field</th>\n <th>Required Scope</th>\n </tr>\n <tr>\n <td><code>team</code></td>\n <td><code>teams:read</code></td>\n </tr>\n <tr>\n <td><code>custom_type</code></td>\n <td><code>custom_types:read</code></td>\n </tr>\n</table>\n\nReturns the complete project record for a single project.\n\nThe persistent core model supports the response and query fields named in x-purple-suite-supported-response-fields and x-purple-suite-supported-query. Other fields/options return an explicit 400 errors envelope.",
"tags": [
"Projects"
],
"operationId": "getProject",
"parameters": [
{
"name": "opt_fields",
"in": "query",
"description": "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. Properties can include nested fields. To learn more, see the [input/output options guide](/docs/inputoutput-options#selecting-nested-fields).",
"required": false,
"example": [
"archived",
"color",
"completed",
"completed_at",
"completed_by",
"completed_by.name",
"created_at",
"created_from_template",
"created_from_template.name",
"current_status",
"current_status.author",
"current_status.author.name",
"current_status.color",
"current_status.created_at",
"current_status.created_by",
"current_status.created_by.name",
"current_status.html_text",
"current_status.modified_at",
"current_status.text",
"current_status.title",
"current_status_update",
"current_status_update.resource_subtype",
"current_status_update.title",
"custom_field_settings",
"custom_field_settings.custom_field",
"custom_field_settings.custom_field.asana_created_field",
"custom_field_settings.custom_field.created_by",
"custom_field_settings.custom_field.created_by.name",
"custom_field_settings.custom_field.currency_code",
"custom_field_settings.custom_field.custom_label",
"custom_field_settings.custom_field.custom_label_position",
"custom_field_settings.custom_field.date_value",
"custom_field_settings.custom_field.date_value.date",
"custom_field_settings.custom_field.date_value.date_time",
"custom_field_settings.custom_field.default_access_level",
"custom_field_settings.custom_field.description",
"custom_field_settings.custom_field.display_value",
"custom_field_settings.custom_field.enabled",
"custom_field_settings.custom_field.enum_options",
"custom_field_settings.custom_field.enum_options.color",
"custom_field_settings.custom_field.enum_options.enabled",
"custom_field_settings.custom_field.enum_options.name",
"custom_field_settings.custom_field.enum_value",
"custom_field_settings.custom_field.enum_value.color",
"custom_field_settings.custom_field.enum_value.enabled",
"custom_field_settings.custom_field.enum_value.name",
"custom_field_settings.custom_field.format",
"custom_field_settings.custom_field.has_notifications_enabled",
"custom_field_settings.custom_field.html_text_value",
"custom_field_settings.custom_field.id_prefix",
"custom_field_settings.custom_field.input_restrictions",
"custom_field_settings.custom_field.is_formula_field",
"custom_field_settings.custom_field.is_global_to_workspace",
"custom_field_settings.custom_field.is_value_read_only",
"custom_field_settings.custom_field.multi_enum_values",
"custom_field_settings.custom_field.multi_enum_values.color",
"custom_field_settings.custom_field.multi_enum_values.enabled",
"custom_field_settings.custom_field.multi_enum_values.name",
"custom_field_settings.custom_field.name",
"custom_field_settings.custom_field.number_value",
"custom_field_settings.custom_field.people_value",
"custom_field_settings.custom_field.people_value.name",
"custom_field_settings.custom_field.precision",
"custom_field_settings.custom_field.privacy_setting",
"custom_field_settings.custom_field.reference_value",
"custom_field_settings.custom_field.reference_value.name",
"custom_field_settings.custom_field.representation_type",
"custom_field_settings.custom_field.resource_subtype",
"custom_field_settings.custom_field.text_value",
"custom_field_settings.custom_field.type",
"custom_field_settings.is_important",
"custom_field_settings.parent",
"custom_field_settings.parent.name",
"custom_field_settings.parent.resource_subtype",
"custom_field_settings.project",
"custom_field_settings.project.name",
"custom_field_settings.project.resource_subtype",
"custom_fields",
"custom_fields.date_value",
"custom_fields.date_value.date",
"custom_fields.date_value.date_time",
"custom_fields.display_value",
"custom_fields.enabled",
"custom_fields.enum_options",
"custom_fields.enum_options.color",
"custom_fields.enum_options.enabled",
"custom_fields.enum_options.name",
"custom_fields.enum_value",
"custom_fields.enum_value.color",
"custom_fields.enum_value.enabled",
"custom_fields.enum_value.name",
"custom_fields.id_prefix",
"custom_fields.input_restrictions",
"custom_fields.is_formula_field",
"custom_fields.multi_enum_values",
"custom_fields.multi_enum_values.color",
"custom_fields.multi_enum_values.enabled",
"custom_fields.multi_enum_values.name",
"custom_fields.name",
"custom_fields.number_value",
"custom_fields.representation_type",
"custom_fields.text_value",
"custom_fields.type",
"custom_type",
"custom_type.asana_created_type_identifier",
"custom_type.name",
"default_access_level",
"default_view",
"due_date",
"due_on",
"followers",
"followers.name",
"html_notes",
"icon",
"members",
"members.name",
"minimum_access_level_for_customization",
"minimum_access_level_for_sharing",
"modified_at",
"name",
"notes",
"owner",
"permalink_url",
"privacy_setting",
"project_brief",
"public",
"resource_subtype",
"start_on",
"team",
"team.name",
"workspace",
"workspace.name"
],
"schema": {
"type": "array",
"items": {
"type": "string",
"enum": [
"archived",
"color",
"completed",
"completed_at",
"completed_by",
"completed_by.name",
"created_at",
"created_from_template",
"created_from_template.name",
"current_status",
"current_status.author",
"current_status.author.name",
"current_status.color",
"current_status.created_at",
"current_status.created_by",
"current_status.created_by.name",
"current_status.html_text",
"current_status.modified_at",
"current_status.text",
"current_status.title",
"current_status_update",
"current_status_update.resource_subtype",
"current_status_update.title",
"custom_field_settings",
"custom_field_settings.custom_field",
"custom_field_settings.custom_field.asana_created_field",
"custom_field_settings.custom_field.created_by",
"custom_field_settings.custom_field.created_by.name",
"custom_field_settings.custom_field.currency_code",
"custom_field_settings.custom_field.custom_label",
"custom_field_settings.custom_field.custom_label_position",
"custom_field_settings.custom_field.date_value",
"custom_field_settings.custom_field.date_value.date",
"custom_field_settings.custom_field.date_value.date_time",
"custom_field_settings.custom_field.default_access_level",
"custom_field_settings.custom_field.description",
"custom_field_settings.custom_field.display_value",
"custom_field_settings.custom_field.enabled",
"custom_field_settings.custom_field.enum_options",
"custom_field_settings.custom_field.enum_options.color",
"custom_field_settings.custom_field.enum_options.enabled",
"custom_field_settings.custom_field.enum_options.name",
"custom_field_settings.custom_field.enum_value",
"custom_field_settings.custom_field.enum_value.color",
"custom_field_settings.custom_field.enum_value.enabled",
"custom_field_settings.custom_field.enum_value.name",
"custom_field_settings.custom_field.format",
"custom_field_settings.custom_field.has_notifications_enabled",
"custom_field_settings.custom_field.html_text_value",
"custom_field_settings.custom_field.id_prefix",
"custom_field_settings.custom_field.input_restrictions",
"custom_field_settings.custom_field.is_formula_field",
"custom_field_settings.custom_field.is_global_to_workspace",
"custom_field_settings.custom_field.is_value_read_only",
"custom_field_settings.custom_field.multi_enum_values",
"custom_field_settings.custom_field.multi_enum_values.color",
"custom_field_settings.custom_field.multi_enum_values.enabled",
"custom_field_settings.custom_field.multi_enum_values.name",
"custom_field_settings.custom_field.name",
"custom_field_settings.custom_field.number_value",
"custom_field_settings.custom_field.people_value",
"custom_field_settings.custom_field.people_value.name",
"custom_field_settings.custom_field.precision",
"custom_field_settings.custom_field.privacy_setting",
"custom_field_settings.custom_field.reference_value",
"custom_field_settings.custom_field.reference_value.name",
"custom_field_settings.custom_field.representation_type",
"custom_field_settings.custom_field.resource_subtype",
"custom_field_settings.custom_field.text_value",
"custom_field_settings.custom_field.type",
"custom_field_settings.is_important",
"custom_field_settings.parent",
"custom_field_settings.parent.name",
"custom_field_settings.parent.resource_subtype",
"custom_field_settings.project",
"custom_field_settings.project.name",
"custom_field_settings.project.resource_subtype",
"custom_fields",
"custom_fields.date_value",
"custom_fields.date_value.date",
"custom_fields.date_value.date_time",
"custom_fields.display_value",
"custom_fields.enabled",
"custom_fields.enum_options",
"custom_fields.enum_options.color",
"custom_fields.enum_options.enabled",
"custom_fields.enum_options.name",
"custom_fields.enum_value",
"custom_fields.enum_value.color",
"custom_fields.enum_value.enabled",
"custom_fields.enum_value.name",
"custom_fields.id_prefix",
"custom_fields.input_restrictions",
"custom_fields.is_formula_field",
"custom_fields.multi_enum_values",
"custom_fields.multi_enum_values.color",
"custom_fields.multi_enum_values.enabled",
"custom_fields.multi_enum_values.name",
"custom_fields.name",
"custom_fields.number_value",
"custom_fields.representation_type",
"custom_fields.text_value",
"custom_fields.type",
"custom_type",
"custom_type.asana_created_type_identifier",
"custom_type.name",
"default_access_level",
"default_view",
"due_date",
"due_on",
"followers",
"followers.name",
"html_notes",
"icon",
"members",
"members.name",
"minimum_access_level_for_customization",
"minimum_access_level_for_sharing",
"modified_at",
"name",
"notes",
"owner",
"permalink_url",
"privacy_setting",
"project_brief",
"public",
"resource_subtype",
"start_on",
"team",
"team.name",
"workspace",
"workspace.name"
]
}
},
"style": "form",
"explode": false
}
],
"responses": {
"200": {
"description": "Successfully retrieved the requested project.",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"$ref": "#/components/schemas/ProjectResponse"
}
}
}
}
}
},
"400": {
"$ref": "#/components/responses/BadRequest"
},
"401": {
"$ref": "#/components/responses/Unauthorized"
},
"403": {
"$ref": "#/components/responses/Forbidden"
},
"404": {
"$ref": "#/components/responses/NotFound"
},
"500": {
"$ref": "#/components/responses/InternalServerError"
}
},
"security": [
{
"personalAccessToken": []
},
{
"oauth2": [
"projects:read"
]
}
],
"x-readme": {
"code-samples": [
{
"language": "java",
"install": "<dependency><groupId>com.asana</groupId><artifactId>asana</artifactId><version>1.0.0</version></dependency>",
"code": "import com.asana.Client;\n\nClient client = Client.accessToken(\"PERSONAL_ACCESS_TOKEN\");\n\nProject result = client.projects.getProject(projectGid)\n .option(\"pretty\", true)\n .execute();"
},
{
"language": "node",
"install": "npm install asana",
"code": "const Asana = require('asana');\n\nlet client = new Asana.ApiClient();\nclient.authentications.token.accessToken = '<YOUR_ACCESS_TOKEN>';\n\nlet projectsApiInstance = new Asana.ProjectsApi(client);\nlet project_gid = \"1331\"; // String | Globally unique identifier for the project.\nlet opts = { \n 'opt_fields': \"archived,color,completed,completed_at,completed_by,completed_by.name,created_at,created_from_template,created_from_template.name,current_status,current_status.author,current_status.author.name,current_status.color,current_status.created_at,current_status.created_by,current_status.created_by.name,current_status.html_text,current_status.modified_at,current_status.text,current_status.title,current_status_update,current_status_update.resource_subtype,current_status_update.title,custom_field_settings,custom_field_settings.custom_field,custom_field_settings.custom_field.asana_created_field,custom_field_settings.custom_field.created_by,custom_field_settings.custom_field.created_by.name,custom_field_settings.custom_field.currency_code,custom_field_settings.custom_field.custom_label,custom_field_settings.custom_field.custom_label_position,custom_field_settings.custom_field.date_value,custom_field_settings.custom_field.date_value.date,custom_field_settings.custom_field.date_value.date_time,custom_field_settings.custom_field.default_access_level,custom_field_settings.custom_field.description,custom_field_settings.custom_field.display_value,custom_field_settings.custom_field.enabled,custom_field_settings.custom_field.enum_options,custom_field_settings.custom_field.enum_options.color,custom_field_settings.custom_field.enum_options.enabled,custom_field_settings.custom_field.enum_options.name,custom_field_settings.custom_field.enum_value,custom_field_settings.custom_field.enum_value.color,custom_field_settings.custom_field.enum_value.enabled,custom_field_settings.custom_field.enum_value.name,custom_field_settings.custom_field.format,custom_field_settings.custom_field.has_notifications_enabled,custom_field_settings.custom_field.html_text_value,custom_field_settings.custom_field.id_prefix,custom_field_settings.custom_field.input_restrictions,custom_field_settings.custom_field.is_formula_field,custom_field_settings.custom_field.is_global_to_workspace,custom_field_settings.custom_field.is_value_read_only,custom_field_settings.custom_field.multi_enum_values,custom_field_settings.custom_field.multi_enum_values.color,custom_field_settings.custom_field.multi_enum_values.enabled,custom_field_settings.custom_field.multi_enum_values.name,custom_field_settings.custom_field.name,custom_field_settings.custom_field.number_value,custom_field_settings.custom_field.people_value,custom_field_settings.custom_field.people_value.name,custom_field_settings.custom_field.precision,custom_field_settings.custom_field.privacy_setting,custom_field_settings.custom_field.reference_value,custom_field_settings.custom_field.reference_value.name,custom_field_settings.custom_field.representation_type,custom_field_settings.custom_field.resource_subtype,custom_field_settings.custom_field.text_value,custom_field_settings.custom_field.type,custom_field_settings.is_important,custom_field_settings.parent,custom_field_settings.parent.name,custom_field_settings.parent.resource_subtype,custom_field_settings.project,custom_field_settings.project.name,custom_field_settings.project.resource_subtype,custom_fields,custom_fields.date_value,custom_fields.date_value.date,custom_fields.date_value.date_time,custom_fields.display_value,custom_fields.enabled,custom_fields.enum_options,custom_fields.enum_options.color,custom_fields.enum_options.enabled,custom_fields.enum_options.name,custom_fields.enum_value,custom_fields.enum_value.color,custom_fields.enum_value.enabled,custom_fields.enum_value.name,custom_fields.id_prefix,custom_fields.input_restrictions,custom_fields.is_formula_field,custom_fields.multi_enum_values,custom_fields.multi_enum_values.color,custom_fields.multi_enum_values.enabled,custom_fields.multi_enum_values.name,custom_fields.name,custom_fields.number_value,custom_fields.representation_type,custom_fields.text_value,custom_fields.type,custom_type,custom_type.asana_created_type_identifier,custom_type.name,default_access_level,default_view,due_date,due_on,followers,followers.name,html_notes,icon,members,members.name,minimum_access_level_for_customization,minimum_access_level_for_sharing,modified_at,name,notes,owner,permalink_url,privacy_setting,project_brief,public,resource_subtype,start_on,team,team.name,workspace,workspace.name\"\n};\nprojectsApiInstance.getProject(project_gid, opts).then((result) => {\n console.log('API called successfully. Returned data: ' + JSON.stringify(result.data, null, 2));\n}, (error) => {\n console.error(error.response.body);\n});",
"name": "node-sdk-v3"
},
{
"language": "node",
"install": "npm install asana@1.0.5",
"code": "const asana = require('asana');\n\nconst client = asana.Client.create().useAccessToken('PERSONAL_ACCESS_TOKEN');\n\nclient.projects.getProject(projectGid, {param: \"value\", param: \"value\", opt_pretty: true})\n .then((result) => {\n console.log(result);\n });",
"name": "node-sdk-v1"
},
{
"language": "python",
"install": "pip install asana",
"code": "import asana\nfrom asana.rest import ApiException\nfrom pprint import pprint\n\nconfiguration = asana.Configuration()\nconfiguration.access_token = '<YOUR_ACCESS_TOKEN>'\napi_client = asana.ApiClient(configuration)\n\n# create an instance of the API class\nprojects_api_instance = asana.ProjectsApi(api_client)\nproject_gid = \"1331\" # str | Globally unique identifier for the project.\nopts = {\n 'opt_fields': \"archived,color,completed,completed_at,completed_by,completed_by.name,created_at,created_from_template,created_from_template.name,current_status,current_status.author,current_status.author.name,current_status.color,current_status.created_at,current_status.created_by,current_status.created_by.name,current_status.html_text,current_status.modified_at,current_status.text,current_status.title,current_status_update,current_status_update.resource_subtype,current_status_update.title,custom_field_settings,custom_field_settings.custom_field,custom_field_settings.custom_field.asana_created_field,custom_field_settings.custom_field.created_by,custom_field_settings.custom_field.created_by.name,custom_field_settings.custom_field.currency_code,custom_field_settings.custom_field.custom_label,custom_field_settings.custom_field.custom_label_position,custom_field_settings.custom_field.date_value,custom_field_settings.custom_field.date_value.date,custom_field_settings.custom_field.date_value.date_time,custom_field_settings.custom_field.default_access_level,custom_field_settings.custom_field.description,custom_field_settings.custom_field.display_value,custom_field_settings.custom_field.enabled,custom_field_settings.custom_field.enum_options,custom_field_settings.custom_field.enum_options.color,custom_field_settings.custom_field.enum_options.enabled,custom_field_settings.custom_field.enum_options.name,custom_field_settings.custom_field.enum_value,custom_field_settings.custom_field.enum_value.color,custom_field_settings.custom_field.enum_value.enabled,custom_field_settings.custom_field.enum_value.name,custom_field_settings.custom_field.format,custom_field_settings.custom_field.has_notifications_enabled,custom_field_settings.custom_field.html_text_value,custom_field_settings.custom_field.id_prefix,custom_field_settings.custom_field.input_restrictions,custom_field_settings.custom_field.is_formula_field,custom_field_settings.custom_field.is_global_to_workspace,custom_field_settings.custom_field.is_value_read_only,custom_field_settings.custom_field.multi_enum_values,custom_field_settings.custom_field.multi_enum_values.color,custom_field_settings.custom_field.multi_enum_values.enabled,custom_field_settings.custom_field.multi_enum_values.name,custom_field_settings.custom_field.name,custom_field_settings.custom_field.number_value,custom_field_settings.custom_field.people_value,custom_field_settings.custom_field.people_value.name,custom_field_settings.custom_field.precision,custom_field_settings.custom_field.privacy_setting,custom_field_settings.custom_field.reference_value,custom_field_settings.custom_field.reference_value.name,custom_field_settings.custom_field.representation_type,custom_field_settings.custom_field.resource_subtype,custom_field_settings.custom_field.text_value,custom_field_settings.custom_field.type,custom_field_settings.is_important,custom_field_settings.parent,custom_field_settings.parent.name,custom_field_settings.parent.resource_subtype,custom_field_settings.project,custom_field_settings.project.name,custom_field_settings.project.resource_subtype,custom_fields,custom_fields.date_value,custom_fields.date_value.date,custom_fields.date_value.date_time,custom_fields.display_value,custom_fields.enabled,custom_fields.enum_options,custom_fields.enum_options.color,custom_fields.enum_options.enabled,custom_fields.enum_options.name,custom_fields.enum_value,custom_fields.enum_value.color,custom_fields.enum_value.enabled,custom_fields.enum_value.name,custom_fields.id_prefix,custom_fields.input_restrictions,custom_fields.is_formula_field,custom_fields.multi_enum_values,custom_fields.multi_enum_values.color,custom_fields.multi_enum_values.enabled,custom_fields.multi_enum_values.name,custom_fields.name,custom_fields.number_value,custom_fields.representation_type,custom_fields.text_value,custom_fields.type,custom_type,custom_type.asana_created_type_identifier,custom_type.name,default_access_level,default_view,due_date,due_on,followers,followers.name,html_notes,icon,members,members.name,minimum_access_level_for_customization,minimum_access_level_for_sharing,modified_at,name,notes,owner,permalink_url,privacy_setting,project_brief,public,resource_subtype,start_on,team,team.name,workspace,workspace.name\", # list[str] | 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.\n}\n\ntry:\n # Get a project\n api_response = projects_api_instance.get_project(project_gid, opts)\n pprint(api_response)\nexcept ApiException as e:\n print(\"Exception when calling ProjectsApi->get_project: %s\\n\" % e)",
"name": "python-sdk-v5"
},
{
"language": "python",
"install": "pip install asana==3.2.3",
"code": "import asana\n\nclient = asana.Client.access_token('PERSONAL_ACCESS_TOKEN')\n\nresult = client.projects.get_project(project_gid, {'param': 'value', 'param': 'value'}, opt_pretty=True)",
"name": "python-sdk-v3"
},
{
"language": "php",
"install": "composer require asana/asana",
"code": "<?php\nrequire 'vendor/autoload.php';\n\n$client = Asana\\Client::accessToken('PERSONAL_ACCESS_TOKEN');\n\n$result = $client->projects->getProject($project_gid, array('param' => 'value', 'param' => 'value'), array('opt_pretty' => 'true'))"
},
{
"language": "ruby",
"install": "gem install asana",
"code": "require 'asana'\n\nclient = Asana::Client.new do |c|\n c.authentication :access_token, 'PERSONAL_ACCESS_TOKEN'\nend\n\nresult = client.projects.get_project(project_gid: 'project_gid', param: \"value\", param: \"value\", options: {pretty: true})"
}
]
},
"x-purple-suite-runtime": "modeled-core",
"x-purple-suite-supported-query": [
"opt_pretty",
"opt_fields"
],
"x-purple-suite-supported-response-fields": [
"gid",
"resource_type",
"resource_subtype",
"name",
"notes",
"completed",
"completed_at",
"created_at",
"modified_at",
"assignee",
"assignee_status",
"workspace",
"projects",
"memberships",
"parent",
"due_on",
"start_on",
"tags",
"dependencies",
"num_subtasks",
"archived",
"public",
"color",
"default_view",
"team",
"project",
"section",
"text",
"created_by",
"target",
"type",
"email",
"photo",
"is_organization"
]
}
PUT /api/1.0/projects/{project_gid}
Update a project
<b>Required scope: </b><code>projects:write</code>
A specific, existing project can be updated by making a PUT request on
the URL for that project. Only the fields provided in the `data` block
will be updated; any unspecified fields will remain unchanged.
When using this method, it is best to specify only those fields you wish
to change, or else you may overwrite changes made by another user since
you last retrieved the task.
Returns the complete updated project record.
**Deprecation notice:** Updating the `team` field is deprecated. When this
field is included in the request, the `Asana-Change` response header will
indicate an affected deprecation. Clients should switch to using
`POST /memberships` with `{ parent: project, member: team }` to share a
project with a team.
The persistent core model supports the response and query fields named in x-purple-suite-supported-response-fields and x-purple-suite-supported-query. Other fields/options return an explicit 400 errors envelope.
Authentication
[
{
"personalAccessToken": []
},
{
"oauth2": [
"projects:write"
]
}
]
Path-level parameters and metadata
{
"parameters": [
{
"$ref": "#/components/parameters/project_path_gid"
},
{
"$ref": "#/components/parameters/pretty"
}
]
}
Request, responses and operation details
{
"summary": "Update a project",
"description": "<b>Required scope: </b><code>projects:write</code>\n\nA specific, existing project can be updated by making a PUT request on\nthe URL for that project. Only the fields provided in the `data` block\nwill be updated; any unspecified fields will remain unchanged.\n\nWhen using this method, it is best to specify only those fields you wish\nto change, or else you may overwrite changes made by another user since\nyou last retrieved the task.\n\nReturns the complete updated project record.\n\n**Deprecation notice:** Updating the `team` field is deprecated. When this\nfield is included in the request, the `Asana-Change` response header will\nindicate an affected deprecation. Clients should switch to using\n`POST /memberships` with `{ parent: project, member: team }` to share a\nproject with a team.\n\nThe persistent core model supports the response and query fields named in x-purple-suite-supported-response-fields and x-purple-suite-supported-query. Other fields/options return an explicit 400 errors envelope.",
"tags": [
"Projects"
],
"operationId": "updateProject",
"parameters": [
{
"name": "opt_fields",
"in": "query",
"description": "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. Properties can include nested fields. To learn more, see the [input/output options guide](/docs/inputoutput-options#selecting-nested-fields).",
"required": false,
"example": [
"archived",
"color",
"completed",
"completed_at",
"completed_by",
"completed_by.name",
"created_at",
"created_from_template",
"created_from_template.name",
"current_status",
"current_status.author",
"current_status.author.name",
"current_status.color",
"current_status.created_at",
"current_status.created_by",
"current_status.created_by.name",
"current_status.html_text",
"current_status.modified_at",
"current_status.text",
"current_status.title",
"current_status_update",
"current_status_update.resource_subtype",
"current_status_update.title",
"custom_field_settings",
"custom_field_settings.custom_field",
"custom_field_settings.custom_field.asana_created_field",
"custom_field_settings.custom_field.created_by",
"custom_field_settings.custom_field.created_by.name",
"custom_field_settings.custom_field.currency_code",
"custom_field_settings.custom_field.custom_label",
"custom_field_settings.custom_field.custom_label_position",
"custom_field_settings.custom_field.date_value",
"custom_field_settings.custom_field.date_value.date",
"custom_field_settings.custom_field.date_value.date_time",
"custom_field_settings.custom_field.default_access_level",
"custom_field_settings.custom_field.description",
"custom_field_settings.custom_field.display_value",
"custom_field_settings.custom_field.enabled",
"custom_field_settings.custom_field.enum_options",
"custom_field_settings.custom_field.enum_options.color",
"custom_field_settings.custom_field.enum_options.enabled",
"custom_field_settings.custom_field.enum_options.name",
"custom_field_settings.custom_field.enum_value",
"custom_field_settings.custom_field.enum_value.color",
"custom_field_settings.custom_field.enum_value.enabled",
"custom_field_settings.custom_field.enum_value.name",
"custom_field_settings.custom_field.format",
"custom_field_settings.custom_field.has_notifications_enabled",
"custom_field_settings.custom_field.html_text_value",
"custom_field_settings.custom_field.id_prefix",
"custom_field_settings.custom_field.input_restrictions",
"custom_field_settings.custom_field.is_formula_field",
"custom_field_settings.custom_field.is_global_to_workspace",
"custom_field_settings.custom_field.is_value_read_only",
"custom_field_settings.custom_field.multi_enum_values",
"custom_field_settings.custom_field.multi_enum_values.color",
"custom_field_settings.custom_field.multi_enum_values.enabled",
"custom_field_settings.custom_field.multi_enum_values.name",
"custom_field_settings.custom_field.name",
"custom_field_settings.custom_field.number_value",
"custom_field_settings.custom_field.people_value",
"custom_field_settings.custom_field.people_value.name",
"custom_field_settings.custom_field.precision",
"custom_field_settings.custom_field.privacy_setting",
"custom_field_settings.custom_field.reference_value",
"custom_field_settings.custom_field.reference_value.name",
"custom_field_settings.custom_field.representation_type",
"custom_field_settings.custom_field.resource_subtype",
"custom_field_settings.custom_field.text_value",
"custom_field_settings.custom_field.type",
"custom_field_settings.is_important",
"custom_field_settings.parent",
"custom_field_settings.parent.name",
"custom_field_settings.parent.resource_subtype",
"custom_field_settings.project",
"custom_field_settings.project.name",
"custom_field_settings.project.resource_subtype",
"custom_fields",
"custom_fields.date_value",
"custom_fields.date_value.date",
"custom_fields.date_value.date_time",
"custom_fields.display_value",
"custom_fields.enabled",
"custom_fields.enum_options",
"custom_fields.enum_options.color",
"custom_fields.enum_options.enabled",
"custom_fields.enum_options.name",
"custom_fields.enum_value",
"custom_fields.enum_value.color",
"custom_fields.enum_value.enabled",
"custom_fields.enum_value.name",
"custom_fields.id_prefix",
"custom_fields.input_restrictions",
"custom_fields.is_formula_field",
"custom_fields.multi_enum_values",
"custom_fields.multi_enum_values.color",
"custom_fields.multi_enum_values.enabled",
"custom_fields.multi_enum_values.name",
"custom_fields.name",
"custom_fields.number_value",
"custom_fields.representation_type",
"custom_fields.text_value",
"custom_fields.type",
"custom_type",
"custom_type.asana_created_type_identifier",
"custom_type.name",
"default_access_level",
"default_view",
"due_date",
"due_on",
"followers",
"followers.name",
"html_notes",
"icon",
"members",
"members.name",
"minimum_access_level_for_customization",
"minimum_access_level_for_sharing",
"modified_at",
"name",
"notes",
"owner",
"permalink_url",
"privacy_setting",
"project_brief",
"public",
"resource_subtype",
"start_on",
"team",
"team.name",
"workspace",
"workspace.name"
],
"schema": {
"type": "array",
"items": {
"type": "string",
"enum": [
"archived",
"color",
"completed",
"completed_at",
"completed_by",
"completed_by.name",
"created_at",
"created_from_template",
"created_from_template.name",
"current_status",
"current_status.author",
"current_status.author.name",
"current_status.color",
"current_status.created_at",
"current_status.created_by",
"current_status.created_by.name",
"current_status.html_text",
"current_status.modified_at",
"current_status.text",
"current_status.title",
"current_status_update",
"current_status_update.resource_subtype",
"current_status_update.title",
"custom_field_settings",
"custom_field_settings.custom_field",
"custom_field_settings.custom_field.asana_created_field",
"custom_field_settings.custom_field.created_by",
"custom_field_settings.custom_field.created_by.name",
"custom_field_settings.custom_field.currency_code",
"custom_field_settings.custom_field.custom_label",
"custom_field_settings.custom_field.custom_label_position",
"custom_field_settings.custom_field.date_value",
"custom_field_settings.custom_field.date_value.date",
"custom_field_settings.custom_field.date_value.date_time",
"custom_field_settings.custom_field.default_access_level",
"custom_field_settings.custom_field.description",
"custom_field_settings.custom_field.display_value",
"custom_field_settings.custom_field.enabled",
"custom_field_settings.custom_field.enum_options",
"custom_field_settings.custom_field.enum_options.color",
"custom_field_settings.custom_field.enum_options.enabled",
"custom_field_settings.custom_field.enum_options.name",
"custom_field_settings.custom_field.enum_value",
"custom_field_settings.custom_field.enum_value.color",
"custom_field_settings.custom_field.enum_value.enabled",
"custom_field_settings.custom_field.enum_value.name",
"custom_field_settings.custom_field.format",
"custom_field_settings.custom_field.has_notifications_enabled",
"custom_field_settings.custom_field.html_text_value",
"custom_field_settings.custom_field.id_prefix",
"custom_field_settings.custom_field.input_restrictions",
"custom_field_settings.custom_field.is_formula_field",
"custom_field_settings.custom_field.is_global_to_workspace",
"custom_field_settings.custom_field.is_value_read_only",
"custom_field_settings.custom_field.multi_enum_values",
"custom_field_settings.custom_field.multi_enum_values.color",
"custom_field_settings.custom_field.multi_enum_values.enabled",
"custom_field_settings.custom_field.multi_enum_values.name",
"custom_field_settings.custom_field.name",
"custom_field_settings.custom_field.number_value",
"custom_field_settings.custom_field.people_value",
"custom_field_settings.custom_field.people_value.name",
"custom_field_settings.custom_field.precision",
"custom_field_settings.custom_field.privacy_setting",
"custom_field_settings.custom_field.reference_value",
"custom_field_settings.custom_field.reference_value.name",
"custom_field_settings.custom_field.representation_type",
"custom_field_settings.custom_field.resource_subtype",
"custom_field_settings.custom_field.text_value",
"custom_field_settings.custom_field.type",
"custom_field_settings.is_important",
"custom_field_settings.parent",
"custom_field_settings.parent.name",
"custom_field_settings.parent.resource_subtype",
"custom_field_settings.project",
"custom_field_settings.project.name",
"custom_field_settings.project.resource_subtype",
"custom_fields",
"custom_fields.date_value",
"custom_fields.date_value.date",
"custom_fields.date_value.date_time",
"custom_fields.display_value",
"custom_fields.enabled",
"custom_fields.enum_options",
"custom_fields.enum_options.color",
"custom_fields.enum_options.enabled",
"custom_fields.enum_options.name",
"custom_fields.enum_value",
"custom_fields.enum_value.color",
"custom_fields.enum_value.enabled",
"custom_fields.enum_value.name",
"custom_fields.id_prefix",
"custom_fields.input_restrictions",
"custom_fields.is_formula_field",
"custom_fields.multi_enum_values",
"custom_fields.multi_enum_values.color",
"custom_fields.multi_enum_values.enabled",
"custom_fields.multi_enum_values.name",
"custom_fields.name",
"custom_fields.number_value",
"custom_fields.representation_type",
"custom_fields.text_value",
"custom_fields.type",
"custom_type",
"custom_type.asana_created_type_identifier",
"custom_type.name",
"default_access_level",
"default_view",
"due_date",
"due_on",
"followers",
"followers.name",
"html_notes",
"icon",
"members",
"members.name",
"minimum_access_level_for_customization",
"minimum_access_level_for_sharing",
"modified_at",
"name",
"notes",
"owner",
"permalink_url",
"privacy_setting",
"project_brief",
"public",
"resource_subtype",
"start_on",
"team",
"team.name",
"workspace",
"workspace.name"
]
}
},
"style": "form",
"explode": false
}
],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
"data"
],
"additionalProperties": false,
"properties": {
"data": {
"type": "object",
"additionalProperties": false,
"required": [],
"properties": {
"name": {
"type": "string"
},
"notes": {
"type": "string"
},
"team": {
"type": "string"
},
"archived": {
"type": "boolean"
},
"public": {
"type": "boolean"
},
"color": {
"type": "string",
"nullable": true
},
"due_on": {
"type": "string",
"nullable": true,
"format": "date"
},
"start_on": {
"type": "string",
"nullable": true,
"format": "date"
},
"default_view": {
"enum": [
"list",
"board",
"calendar",
"timeline"
]
}
}
}
}
}
},
"application/x-www-form-urlencoded": {
"schema": {
"type": "object",
"additionalProperties": false,
"required": [],
"properties": {
"name": {
"type": "string"
},
"notes": {
"type": "string"
},
"team": {
"type": "string"
},
"archived": {
"type": "boolean"
},
"public": {
"type": "boolean"
},
"color": {
"type": "string",
"nullable": true
},
"due_on": {
"type": "string",
"nullable": true,
"format": "date"
},
"start_on": {
"type": "string",
"nullable": true,
"format": "date"
},
"default_view": {
"enum": [
"list",
"board",
"calendar",
"timeline"
]
}
}
}
}
}
},
"responses": {
"200": {
"description": "Successfully updated the project.",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"$ref": "#/components/schemas/ProjectResponse"
}
}
}
}
}
},
"400": {
"$ref": "#/components/responses/BadRequest"
},
"401": {
"$ref": "#/components/responses/Unauthorized"
},
"403": {
"$ref": "#/components/responses/Forbidden"
},
"404": {
"$ref": "#/components/responses/NotFound"
},
"500": {
"$ref": "#/components/responses/InternalServerError"
}
},
"security": [
{
"personalAccessToken": []
},
{
"oauth2": [
"projects:write"
]
}
],
"x-readme": {
"code-samples": [
{
"language": "java",
"install": "<dependency><groupId>com.asana</groupId><artifactId>asana</artifactId><version>1.0.0</version></dependency>",
"code": "import com.asana.Client;\n\nClient client = Client.accessToken(\"PERSONAL_ACCESS_TOKEN\");\n\nProject result = client.projects.updateProject(projectGid)\n .data(\"field\", \"value\")\n .data(\"field\", \"value\")\n .option(\"pretty\", true)\n .execute();"
},
{
"language": "node",
"install": "npm install asana",
"code": "const Asana = require('asana');\n\nlet client = new Asana.ApiClient();\nclient.authentications.token.accessToken = '<YOUR_ACCESS_TOKEN>';\n\nlet projectsApiInstance = new Asana.ProjectsApi(client);\nlet body = {\"data\": {\"<PARAM_1>\": \"<VALUE_1>\", \"<PARAM_2>\": \"<VALUE_2>\",}}; // Object | The updated fields for the project.\nlet project_gid = \"1331\"; // String | Globally unique identifier for the project.\nlet opts = { \n 'opt_fields': \"archived,color,completed,completed_at,completed_by,completed_by.name,created_at,created_from_template,created_from_template.name,current_status,current_status.author,current_status.author.name,current_status.color,current_status.created_at,current_status.created_by,current_status.created_by.name,current_status.html_text,current_status.modified_at,current_status.text,current_status.title,current_status_update,current_status_update.resource_subtype,current_status_update.title,custom_field_settings,custom_field_settings.custom_field,custom_field_settings.custom_field.asana_created_field,custom_field_settings.custom_field.created_by,custom_field_settings.custom_field.created_by.name,custom_field_settings.custom_field.currency_code,custom_field_settings.custom_field.custom_label,custom_field_settings.custom_field.custom_label_position,custom_field_settings.custom_field.date_value,custom_field_settings.custom_field.date_value.date,custom_field_settings.custom_field.date_value.date_time,custom_field_settings.custom_field.default_access_level,custom_field_settings.custom_field.description,custom_field_settings.custom_field.display_value,custom_field_settings.custom_field.enabled,custom_field_settings.custom_field.enum_options,custom_field_settings.custom_field.enum_options.color,custom_field_settings.custom_field.enum_options.enabled,custom_field_settings.custom_field.enum_options.name,custom_field_settings.custom_field.enum_value,custom_field_settings.custom_field.enum_value.color,custom_field_settings.custom_field.enum_value.enabled,custom_field_settings.custom_field.enum_value.name,custom_field_settings.custom_field.format,custom_field_settings.custom_field.has_notifications_enabled,custom_field_settings.custom_field.html_text_value,custom_field_settings.custom_field.id_prefix,custom_field_settings.custom_field.input_restrictions,custom_field_settings.custom_field.is_formula_field,custom_field_settings.custom_field.is_global_to_workspace,custom_field_settings.custom_field.is_value_read_only,custom_field_settings.custom_field.multi_enum_values,custom_field_settings.custom_field.multi_enum_values.color,custom_field_settings.custom_field.multi_enum_values.enabled,custom_field_settings.custom_field.multi_enum_values.name,custom_field_settings.custom_field.name,custom_field_settings.custom_field.number_value,custom_field_settings.custom_field.people_value,custom_field_settings.custom_field.people_value.name,custom_field_settings.custom_field.precision,custom_field_settings.custom_field.privacy_setting,custom_field_settings.custom_field.reference_value,custom_field_settings.custom_field.reference_value.name,custom_field_settings.custom_field.representation_type,custom_field_settings.custom_field.resource_subtype,custom_field_settings.custom_field.text_value,custom_field_settings.custom_field.type,custom_field_settings.is_important,custom_field_settings.parent,custom_field_settings.parent.name,custom_field_settings.parent.resource_subtype,custom_field_settings.project,custom_field_settings.project.name,custom_field_settings.project.resource_subtype,custom_fields,custom_fields.date_value,custom_fields.date_value.date,custom_fields.date_value.date_time,custom_fields.display_value,custom_fields.enabled,custom_fields.enum_options,custom_fields.enum_options.color,custom_fields.enum_options.enabled,custom_fields.enum_options.name,custom_fields.enum_value,custom_fields.enum_value.color,custom_fields.enum_value.enabled,custom_fields.enum_value.name,custom_fields.id_prefix,custom_fields.input_restrictions,custom_fields.is_formula_field,custom_fields.multi_enum_values,custom_fields.multi_enum_values.color,custom_fields.multi_enum_values.enabled,custom_fields.multi_enum_values.name,custom_fields.name,custom_fields.number_value,custom_fields.representation_type,custom_fields.text_value,custom_fields.type,custom_type,custom_type.asana_created_type_identifier,custom_type.name,default_access_level,default_view,due_date,due_on,followers,followers.name,html_notes,icon,members,members.name,minimum_access_level_for_customization,minimum_access_level_for_sharing,modified_at,name,notes,owner,permalink_url,privacy_setting,project_brief,public,resource_subtype,start_on,team,team.name,workspace,workspace.name\"\n};\nprojectsApiInstance.updateProject(body, project_gid, opts).then((result) => {\n console.log('API called successfully. Returned data: ' + JSON.stringify(result.data, null, 2));\n}, (error) => {\n console.error(error.response.body);\n});",
"name": "node-sdk-v3"
},
{
"language": "node",
"install": "npm install asana@1.0.5",
"code": "const asana = require('asana');\n\nconst client = asana.Client.create().useAccessToken('PERSONAL_ACCESS_TOKEN');\n\nclient.projects.updateProject(projectGid, {field: \"value\", field: \"value\", pretty: true})\n .then((result) => {\n console.log(result);\n });",
"name": "node-sdk-v1"
},
{
"language": "python",
"install": "pip install asana",
"code": "import asana\nfrom asana.rest import ApiException\nfrom pprint import pprint\n\nconfiguration = asana.Configuration()\nconfiguration.access_token = '<YOUR_ACCESS_TOKEN>'\napi_client = asana.ApiClient(configuration)\n\n# create an instance of the API class\nprojects_api_instance = asana.ProjectsApi(api_client)\nbody = {\"data\": {\"<PARAM_1>\": \"<VALUE_1>\", \"<PARAM_2>\": \"<VALUE_2>\",}} # dict | The updated fields for the project.\nproject_gid = \"1331\" # str | Globally unique identifier for the project.\nopts = {\n 'opt_fields': \"archived,color,completed,completed_at,completed_by,completed_by.name,created_at,created_from_template,created_from_template.name,current_status,current_status.author,current_status.author.name,current_status.color,current_status.created_at,current_status.created_by,current_status.created_by.name,current_status.html_text,current_status.modified_at,current_status.text,current_status.title,current_status_update,current_status_update.resource_subtype,current_status_update.title,custom_field_settings,custom_field_settings.custom_field,custom_field_settings.custom_field.asana_created_field,custom_field_settings.custom_field.created_by,custom_field_settings.custom_field.created_by.name,custom_field_settings.custom_field.currency_code,custom_field_settings.custom_field.custom_label,custom_field_settings.custom_field.custom_label_position,custom_field_settings.custom_field.date_value,custom_field_settings.custom_field.date_value.date,custom_field_settings.custom_field.date_value.date_time,custom_field_settings.custom_field.default_access_level,custom_field_settings.custom_field.description,custom_field_settings.custom_field.display_value,custom_field_settings.custom_field.enabled,custom_field_settings.custom_field.enum_options,custom_field_settings.custom_field.enum_options.color,custom_field_settings.custom_field.enum_options.enabled,custom_field_settings.custom_field.enum_options.name,custom_field_settings.custom_field.enum_value,custom_field_settings.custom_field.enum_value.color,custom_field_settings.custom_field.enum_value.enabled,custom_field_settings.custom_field.enum_value.name,custom_field_settings.custom_field.format,custom_field_settings.custom_field.has_notifications_enabled,custom_field_settings.custom_field.html_text_value,custom_field_settings.custom_field.id_prefix,custom_field_settings.custom_field.input_restrictions,custom_field_settings.custom_field.is_formula_field,custom_field_settings.custom_field.is_global_to_workspace,custom_field_settings.custom_field.is_value_read_only,custom_field_settings.custom_field.multi_enum_values,custom_field_settings.custom_field.multi_enum_values.color,custom_field_settings.custom_field.multi_enum_values.enabled,custom_field_settings.custom_field.multi_enum_values.name,custom_field_settings.custom_field.name,custom_field_settings.custom_field.number_value,custom_field_settings.custom_field.people_value,custom_field_settings.custom_field.people_value.name,custom_field_settings.custom_field.precision,custom_field_settings.custom_field.privacy_setting,custom_field_settings.custom_field.reference_value,custom_field_settings.custom_field.reference_value.name,custom_field_settings.custom_field.representation_type,custom_field_settings.custom_field.resource_subtype,custom_field_settings.custom_field.text_value,custom_field_settings.custom_field.type,custom_field_settings.is_important,custom_field_settings.parent,custom_field_settings.parent.name,custom_field_settings.parent.resource_subtype,custom_field_settings.project,custom_field_settings.project.name,custom_field_settings.project.resource_subtype,custom_fields,custom_fields.date_value,custom_fields.date_value.date,custom_fields.date_value.date_time,custom_fields.display_value,custom_fields.enabled,custom_fields.enum_options,custom_fields.enum_options.color,custom_fields.enum_options.enabled,custom_fields.enum_options.name,custom_fields.enum_value,custom_fields.enum_value.color,custom_fields.enum_value.enabled,custom_fields.enum_value.name,custom_fields.id_prefix,custom_fields.input_restrictions,custom_fields.is_formula_field,custom_fields.multi_enum_values,custom_fields.multi_enum_values.color,custom_fields.multi_enum_values.enabled,custom_fields.multi_enum_values.name,custom_fields.name,custom_fields.number_value,custom_fields.representation_type,custom_fields.text_value,custom_fields.type,custom_type,custom_type.asana_created_type_identifier,custom_type.name,default_access_level,default_view,due_date,due_on,followers,followers.name,html_notes,icon,members,members.name,minimum_access_level_for_customization,minimum_access_level_for_sharing,modified_at,name,notes,owner,permalink_url,privacy_setting,project_brief,public,resource_subtype,start_on,team,team.name,workspace,workspace.name\", # list[str] | 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.\n}\n\ntry:\n # Update a project\n api_response = projects_api_instance.update_project(body, project_gid, opts)\n pprint(api_response)\nexcept ApiException as e:\n print(\"Exception when calling ProjectsApi->update_project: %s\\n\" % e)",
"name": "python-sdk-v5"
},
{
"language": "python",
"install": "pip install asana==3.2.3",
"code": "import asana\n\nclient = asana.Client.access_token('PERSONAL_ACCESS_TOKEN')\n\nresult = client.projects.update_project(project_gid, {'field': 'value', 'field': 'value'}, opt_pretty=True)",
"name": "python-sdk-v3"
},
{
"language": "php",
"install": "composer require asana/asana",
"code": "<?php\nrequire 'vendor/autoload.php';\n\n$client = Asana\\Client::accessToken('PERSONAL_ACCESS_TOKEN');\n\n$result = $client->projects->updateProject($project_gid, array('field' => 'value', 'field' => 'value'), array('opt_pretty' => 'true'))"
},
{
"language": "ruby",
"install": "gem install asana",
"code": "require 'asana'\n\nclient = Asana::Client.new do |c|\n c.authentication :access_token, 'PERSONAL_ACCESS_TOKEN'\nend\n\nresult = client.projects.update_project(project_gid: 'project_gid', field: \"value\", field: \"value\", options: {pretty: true})"
}
]
},
"x-purple-suite-runtime": "modeled-core",
"x-purple-suite-supported-query": [
"opt_pretty",
"opt_fields"
],
"x-purple-suite-supported-response-fields": [
"gid",
"resource_type",
"resource_subtype",
"name",
"notes",
"completed",
"completed_at",
"created_at",
"modified_at",
"assignee",
"assignee_status",
"workspace",
"projects",
"memberships",
"parent",
"due_on",
"start_on",
"tags",
"dependencies",
"num_subtasks",
"archived",
"public",
"color",
"default_view",
"team",
"project",
"section",
"text",
"created_by",
"target",
"type",
"email",
"photo",
"is_organization"
]
}
DELETE /api/1.0/projects/{project_gid}
Delete a project
<b>Required scope: </b><code>projects:delete</code>
A specific, existing project can be deleted by making a DELETE request on
the URL for that project.
Returns an empty data record.
The persistent core model supports the response and query fields named in x-purple-suite-supported-response-fields and x-purple-suite-supported-query. Other fields/options return an explicit 400 errors envelope.
Authentication
[
{
"personalAccessToken": []
},
{
"oauth2": [
"projects:delete"
]
}
]
Path-level parameters and metadata
{
"parameters": [
{
"$ref": "#/components/parameters/project_path_gid"
},
{
"$ref": "#/components/parameters/pretty"
}
]
}
Request, responses and operation details
{
"summary": "Delete a project",
"description": "<b>Required scope: </b><code>projects:delete</code>\n\nA specific, existing project can be deleted by making a DELETE request on\nthe URL for that project.\n\nReturns an empty data record.\n\nThe persistent core model supports the response and query fields named in x-purple-suite-supported-response-fields and x-purple-suite-supported-query. Other fields/options return an explicit 400 errors envelope.",
"tags": [
"Projects"
],
"operationId": "deleteProject",
"responses": {
"200": {
"description": "Successfully deleted the specified project.",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"$ref": "#/components/schemas/EmptyResponse"
}
}
}
}
}
},
"400": {
"$ref": "#/components/responses/BadRequest"
},
"401": {
"$ref": "#/components/responses/Unauthorized"
},
"403": {
"$ref": "#/components/responses/Forbidden"
},
"404": {
"$ref": "#/components/responses/NotFound"
},
"500": {
"$ref": "#/components/responses/InternalServerError"
}
},
"security": [
{
"personalAccessToken": []
},
{
"oauth2": [
"projects:delete"
]
}
],
"x-readme": {
"code-samples": [
{
"language": "java",
"install": "<dependency><groupId>com.asana</groupId><artifactId>asana</artifactId><version>1.0.0</version></dependency>",
"code": "import com.asana.Client;\n\nClient client = Client.accessToken(\"PERSONAL_ACCESS_TOKEN\");\n\nJsonElement result = client.projects.deleteProject(projectGid)\n .option(\"pretty\", true)\n .execute();"
},
{
"language": "node",
"install": "npm install asana",
"code": "const Asana = require('asana');\n\nlet client = new Asana.ApiClient();\nclient.authentications.token.accessToken = '<YOUR_ACCESS_TOKEN>';\n\nlet projectsApiInstance = new Asana.ProjectsApi(client);\nlet project_gid = \"1331\"; // String | Globally unique identifier for the project.\n\nprojectsApiInstance.deleteProject(project_gid).then((result) => {\n console.log('API called successfully. Returned data: ' + JSON.stringify(result.data, null, 2));\n}, (error) => {\n console.error(error.response.body);\n});",
"name": "node-sdk-v3"
},
{
"language": "node",
"install": "npm install asana@1.0.5",
"code": "const asana = require('asana');\n\nconst client = asana.Client.create().useAccessToken('PERSONAL_ACCESS_TOKEN');\n\nclient.projects.deleteProject(projectGid)\n .then((result) => {\n console.log(result);\n });",
"name": "node-sdk-v1"
},
{
"language": "python",
"install": "pip install asana",
"code": "import asana\nfrom asana.rest import ApiException\nfrom pprint import pprint\n\nconfiguration = asana.Configuration()\nconfiguration.access_token = '<YOUR_ACCESS_TOKEN>'\napi_client = asana.ApiClient(configuration)\n\n# create an instance of the API class\nprojects_api_instance = asana.ProjectsApi(api_client)\nproject_gid = \"1331\" # str | Globally unique identifier for the project.\n\n\ntry:\n # Delete a project\n api_response = projects_api_instance.delete_project(project_gid)\n pprint(api_response)\nexcept ApiException as e:\n print(\"Exception when calling ProjectsApi->delete_project: %s\\n\" % e)",
"name": "python-sdk-v5"
},
{
"language": "python",
"install": "pip install asana==3.2.3",
"code": "import asana\n\nclient = asana.Client.access_token('PERSONAL_ACCESS_TOKEN')\n\nresult = client.projects.delete_project(project_gid, opt_pretty=True)",
"name": "python-sdk-v3"
},
{
"language": "php",
"install": "composer require asana/asana",
"code": "<?php\nrequire 'vendor/autoload.php';\n\n$client = Asana\\Client::accessToken('PERSONAL_ACCESS_TOKEN');\n\n$result = $client->projects->deleteProject($project_gid, array('opt_pretty' => 'true'))"
},
{
"language": "ruby",
"install": "gem install asana",
"code": "require 'asana'\n\nclient = Asana::Client.new do |c|\n c.authentication :access_token, 'PERSONAL_ACCESS_TOKEN'\nend\n\nresult = client.projects.delete_project(project_gid: 'project_gid', options: {pretty: true})"
}
]
},
"x-purple-suite-runtime": "modeled-core",
"x-purple-suite-supported-query": [
"opt_pretty"
],
"x-purple-suite-supported-response-fields": [
"gid",
"resource_type",
"resource_subtype",
"name",
"notes",
"completed",
"completed_at",
"created_at",
"modified_at",
"assignee",
"assignee_status",
"workspace",
"projects",
"memberships",
"parent",
"due_on",
"start_on",
"tags",
"dependencies",
"num_subtasks",
"archived",
"public",
"color",
"default_view",
"team",
"project",
"section",
"text",
"created_by",
"target",
"type",
"email",
"photo",
"is_organization"
]
}
POST /api/1.0/projects/{project_gid}/duplicate
Duplicate a project
<b>Required scope: </b><code>projects:write</code>
Creates and returns a job that will asynchronously handle the duplication.
This operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.
Authentication
[
{
"personalAccessToken": []
},
{
"oauth2": [
"projects:write"
]
}
]
Path-level parameters and metadata
{
"parameters": [
{
"$ref": "#/components/parameters/project_path_gid"
},
{
"$ref": "#/components/parameters/pretty"
}
]
}
Request, responses and operation details
{
"summary": "Duplicate a project",
"description": "<b>Required scope: </b><code>projects:write</code>\n\nCreates and returns a job that will asynchronously handle the duplication.\n\nThis operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.",
"tags": [
"Projects"
],
"operationId": "duplicateProject",
"parameters": [
{
"name": "opt_fields",
"in": "query",
"description": "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. Properties can include nested fields. To learn more, see the [input/output options guide](/docs/inputoutput-options#selecting-nested-fields).",
"required": false,
"example": [
"new_graph_export",
"new_graph_export.completed_at",
"new_graph_export.created_at",
"new_graph_export.download_url",
"new_portfolio",
"new_portfolio.name",
"new_portfolio.resource_subtype",
"new_project",
"new_project.name",
"new_project.resource_subtype",
"new_project_template",
"new_project_template.name",
"new_resource_export",
"new_resource_export.completed_at",
"new_resource_export.created_at",
"new_resource_export.download_url",
"new_task",
"new_task.created_by",
"new_task.name",
"new_task.resource_subtype",
"resource_subtype",
"status"
],
"schema": {
"type": "array",
"items": {
"type": "string",
"enum": [
"new_graph_export",
"new_graph_export.completed_at",
"new_graph_export.created_at",
"new_graph_export.download_url",
"new_portfolio",
"new_portfolio.name",
"new_portfolio.resource_subtype",
"new_project",
"new_project.name",
"new_project.resource_subtype",
"new_project_template",
"new_project_template.name",
"new_resource_export",
"new_resource_export.completed_at",
"new_resource_export.created_at",
"new_resource_export.download_url",
"new_task",
"new_task.created_by",
"new_task.name",
"new_task.resource_subtype",
"resource_subtype",
"status"
]
}
},
"style": "form",
"explode": false
}
],
"requestBody": {
"description": "Describes the duplicate's name and the elements that will be duplicated.",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"$ref": "#/components/schemas/ProjectDuplicateRequest"
}
}
}
}
}
},
"responses": {
"201": {
"description": "Successfully created the job to handle duplication.",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"$ref": "#/components/schemas/JobResponse"
}
}
}
}
}
},
"400": {
"$ref": "#/components/responses/BadRequest"
},
"401": {
"$ref": "#/components/responses/Unauthorized"
},
"403": {
"$ref": "#/components/responses/Forbidden"
},
"404": {
"$ref": "#/components/responses/NotFound"
},
"500": {
"$ref": "#/components/responses/InternalServerError"
}
},
"security": [
{
"personalAccessToken": []
},
{
"oauth2": [
"projects:write"
]
}
],
"x-readme": {
"code-samples": [
{
"language": "java",
"install": "<dependency><groupId>com.asana</groupId><artifactId>asana</artifactId><version>1.0.0</version></dependency>",
"code": "import com.asana.Client;\n\nClient client = Client.accessToken(\"PERSONAL_ACCESS_TOKEN\");\n\nJob result = client.projects.duplicateProject(projectGid)\n .data(\"field\", \"value\")\n .data(\"field\", \"value\")\n .option(\"pretty\", true)\n .execute();"
},
{
"language": "node",
"install": "npm install asana",
"code": "const Asana = require('asana');\n\nlet client = new Asana.ApiClient();\nclient.authentications.token.accessToken = '<YOUR_ACCESS_TOKEN>';\n\nlet projectsApiInstance = new Asana.ProjectsApi(client);\nlet project_gid = \"1331\"; // String | Globally unique identifier for the project.\nlet opts = { \n 'body': {\"data\": {\"<PARAM_1>\": \"<VALUE_1>\", \"<PARAM_2>\": \"<VALUE_2>\",}}, \n 'opt_fields': \"new_graph_export,new_graph_export.completed_at,new_graph_export.created_at,new_graph_export.download_url,new_portfolio,new_portfolio.name,new_portfolio.resource_subtype,new_project,new_project.name,new_project.resource_subtype,new_project_template,new_project_template.name,new_resource_export,new_resource_export.completed_at,new_resource_export.created_at,new_resource_export.download_url,new_task,new_task.created_by,new_task.name,new_task.resource_subtype,resource_subtype,status\"\n};\nprojectsApiInstance.duplicateProject(project_gid, opts).then((result) => {\n console.log('API called successfully. Returned data: ' + JSON.stringify(result.data, null, 2));\n}, (error) => {\n console.error(error.response.body);\n});",
"name": "node-sdk-v3"
},
{
"language": "node",
"install": "npm install asana@1.0.5",
"code": "const asana = require('asana');\n\nconst client = asana.Client.create().useAccessToken('PERSONAL_ACCESS_TOKEN');\n\nclient.projects.duplicateProject(projectGid, {field: \"value\", field: \"value\", pretty: true})\n .then((result) => {\n console.log(result);\n });",
"name": "node-sdk-v1"
},
{
"language": "python",
"install": "pip install asana",
"code": "import asana\nfrom asana.rest import ApiException\nfrom pprint import pprint\n\nconfiguration = asana.Configuration()\nconfiguration.access_token = '<YOUR_ACCESS_TOKEN>'\napi_client = asana.ApiClient(configuration)\n\n# create an instance of the API class\nprojects_api_instance = asana.ProjectsApi(api_client)\nproject_gid = \"1331\" # str | Globally unique identifier for the project.\nopts = {\n 'body': {\"data\": {\"<PARAM_1>\": \"<VALUE_1>\", \"<PARAM_2>\": \"<VALUE_2>\",}}, # dict | Describes the duplicate's name and the elements that will be duplicated.\n 'opt_fields': \"new_graph_export,new_graph_export.completed_at,new_graph_export.created_at,new_graph_export.download_url,new_portfolio,new_portfolio.name,new_portfolio.resource_subtype,new_project,new_project.name,new_project.resource_subtype,new_project_template,new_project_template.name,new_resource_export,new_resource_export.completed_at,new_resource_export.created_at,new_resource_export.download_url,new_task,new_task.created_by,new_task.name,new_task.resource_subtype,resource_subtype,status\", # list[str] | 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.\n}\n\ntry:\n # Duplicate a project\n api_response = projects_api_instance.duplicate_project(project_gid, opts)\n pprint(api_response)\nexcept ApiException as e:\n print(\"Exception when calling ProjectsApi->duplicate_project: %s\\n\" % e)",
"name": "python-sdk-v5"
},
{
"language": "python",
"install": "pip install asana==3.2.3",
"code": "import asana\n\nclient = asana.Client.access_token('PERSONAL_ACCESS_TOKEN')\n\nresult = client.projects.duplicate_project(project_gid, {'field': 'value', 'field': 'value'}, opt_pretty=True)",
"name": "python-sdk-v3"
},
{
"language": "php",
"install": "composer require asana/asana",
"code": "<?php\nrequire 'vendor/autoload.php';\n\n$client = Asana\\Client::accessToken('PERSONAL_ACCESS_TOKEN');\n\n$result = $client->projects->duplicateProject($project_gid, array('field' => 'value', 'field' => 'value'), array('opt_pretty' => 'true'))"
},
{
"language": "ruby",
"install": "gem install asana",
"code": "require 'asana'\n\nclient = Asana::Client.new do |c|\n c.authentication :access_token, 'PERSONAL_ACCESS_TOKEN'\nend\n\nresult = client.projects.duplicate_project(project_gid: 'project_gid', field: \"value\", field: \"value\", options: {pretty: true})"
}
]
},
"x-purple-suite-runtime": "unavailable"
}
GET /api/1.0/tasks/{task_gid}/projects
Get projects a task is in
<b>Required scope: </b><code>projects:read</code>
Returns a compact representation of all of the projects the task is in.
The persistent core model supports the response and query fields named in x-purple-suite-supported-response-fields and x-purple-suite-supported-query. Other fields/options return an explicit 400 errors envelope.
Authentication
[
{
"personalAccessToken": []
},
{
"oauth2": [
"projects:read"
]
}
]
Path-level parameters and metadata
{
"parameters": [
{
"$ref": "#/components/parameters/task_path_gid"
},
{
"$ref": "#/components/parameters/pretty"
},
{
"$ref": "#/components/parameters/limit"
},
{
"$ref": "#/components/parameters/offset"
},
{
"name": "include_inherited_projects",
"in": "query",
"description": "Opt-in, read-only. When `true`, the response also includes projects the task inherits from its ancestor tasks (in addition to its direct projects). Defaults to `false`, in which case only direct projects are returned.",
"schema": {
"type": "boolean",
"default": false
},
"example": false
}
]
}
Request, responses and operation details
{
"summary": "Get projects a task is in",
"description": "<b>Required scope: </b><code>projects:read</code>\n\nReturns a compact representation of all of the projects the task is in.\n\nThe persistent core model supports the response and query fields named in x-purple-suite-supported-response-fields and x-purple-suite-supported-query. Other fields/options return an explicit 400 errors envelope.",
"tags": [
"Projects"
],
"operationId": "getProjectsForTask",
"parameters": [
{
"name": "opt_fields",
"in": "query",
"description": "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. Properties can include nested fields. To learn more, see the [input/output options guide](/docs/inputoutput-options#selecting-nested-fields).",
"required": false,
"example": [
"archived",
"color",
"completed",
"completed_at",
"completed_by",
"completed_by.name",
"created_at",
"created_from_template",
"created_from_template.name",
"current_status",
"current_status.author",
"current_status.author.name",
"current_status.color",
"current_status.created_at",
"current_status.created_by",
"current_status.created_by.name",
"current_status.html_text",
"current_status.modified_at",
"current_status.text",
"current_status.title",
"current_status_update",
"current_status_update.resource_subtype",
"current_status_update.title",
"custom_field_settings",
"custom_field_settings.custom_field",
"custom_field_settings.custom_field.asana_created_field",
"custom_field_settings.custom_field.created_by",
"custom_field_settings.custom_field.created_by.name",
"custom_field_settings.custom_field.currency_code",
"custom_field_settings.custom_field.custom_label",
"custom_field_settings.custom_field.custom_label_position",
"custom_field_settings.custom_field.date_value",
"custom_field_settings.custom_field.date_value.date",
"custom_field_settings.custom_field.date_value.date_time",
"custom_field_settings.custom_field.default_access_level",
"custom_field_settings.custom_field.description",
"custom_field_settings.custom_field.display_value",
"custom_field_settings.custom_field.enabled",
"custom_field_settings.custom_field.enum_options",
"custom_field_settings.custom_field.enum_options.color",
"custom_field_settings.custom_field.enum_options.enabled",
"custom_field_settings.custom_field.enum_options.name",
"custom_field_settings.custom_field.enum_value",
"custom_field_settings.custom_field.enum_value.color",
"custom_field_settings.custom_field.enum_value.enabled",
"custom_field_settings.custom_field.enum_value.name",
"custom_field_settings.custom_field.format",
"custom_field_settings.custom_field.has_notifications_enabled",
"custom_field_settings.custom_field.html_text_value",
"custom_field_settings.custom_field.id_prefix",
"custom_field_settings.custom_field.input_restrictions",
"custom_field_settings.custom_field.is_formula_field",
"custom_field_settings.custom_field.is_global_to_workspace",
"custom_field_settings.custom_field.is_value_read_only",
"custom_field_settings.custom_field.multi_enum_values",
"custom_field_settings.custom_field.multi_enum_values.color",
"custom_field_settings.custom_field.multi_enum_values.enabled",
"custom_field_settings.custom_field.multi_enum_values.name",
"custom_field_settings.custom_field.name",
"custom_field_settings.custom_field.number_value",
"custom_field_settings.custom_field.people_value",
"custom_field_settings.custom_field.people_value.name",
"custom_field_settings.custom_field.precision",
"custom_field_settings.custom_field.privacy_setting",
"custom_field_settings.custom_field.reference_value",
"custom_field_settings.custom_field.reference_value.name",
"custom_field_settings.custom_field.representation_type",
"custom_field_settings.custom_field.resource_subtype",
"custom_field_settings.custom_field.text_value",
"custom_field_settings.custom_field.type",
"custom_field_settings.is_important",
"custom_field_settings.parent",
"custom_field_settings.parent.name",
"custom_field_settings.parent.resource_subtype",
"custom_field_settings.project",
"custom_field_settings.project.name",
"custom_field_settings.project.resource_subtype",
"custom_fields",
"custom_fields.date_value",
"custom_fields.date_value.date",
"custom_fields.date_value.date_time",
"custom_fields.display_value",
"custom_fields.enabled",
"custom_fields.enum_options",
"custom_fields.enum_options.color",
"custom_fields.enum_options.enabled",
"custom_fields.enum_options.name",
"custom_fields.enum_value",
"custom_fields.enum_value.color",
"custom_fields.enum_value.enabled",
"custom_fields.enum_value.name",
"custom_fields.id_prefix",
"custom_fields.input_restrictions",
"custom_fields.is_formula_field",
"custom_fields.multi_enum_values",
"custom_fields.multi_enum_values.color",
"custom_fields.multi_enum_values.enabled",
"custom_fields.multi_enum_values.name",
"custom_fields.name",
"custom_fields.number_value",
"custom_fields.representation_type",
"custom_fields.text_value",
"custom_fields.type",
"custom_type",
"custom_type.asana_created_type_identifier",
"custom_type.name",
"default_access_level",
"default_view",
"due_date",
"due_on",
"followers",
"followers.name",
"html_notes",
"icon",
"members",
"members.name",
"minimum_access_level_for_customization",
"minimum_access_level_for_sharing",
"modified_at",
"name",
"notes",
"offset",
"owner",
"path",
"permalink_url",
"privacy_setting",
"project_brief",
"public",
"resource_subtype",
"start_on",
"team",
"team.name",
"uri",
"workspace",
"workspace.name"
],
"schema": {
"type": "array",
"items": {
"type": "string",
"enum": [
"archived",
"color",
"completed",
"completed_at",
"completed_by",
"completed_by.name",
"created_at",
"created_from_template",
"created_from_template.name",
"current_status",
"current_status.author",
"current_status.author.name",
"current_status.color",
"current_status.created_at",
"current_status.created_by",
"current_status.created_by.name",
"current_status.html_text",
"current_status.modified_at",
"current_status.text",
"current_status.title",
"current_status_update",
"current_status_update.resource_subtype",
"current_status_update.title",
"custom_field_settings",
"custom_field_settings.custom_field",
"custom_field_settings.custom_field.asana_created_field",
"custom_field_settings.custom_field.created_by",
"custom_field_settings.custom_field.created_by.name",
"custom_field_settings.custom_field.currency_code",
"custom_field_settings.custom_field.custom_label",
"custom_field_settings.custom_field.custom_label_position",
"custom_field_settings.custom_field.date_value",
"custom_field_settings.custom_field.date_value.date",
"custom_field_settings.custom_field.date_value.date_time",
"custom_field_settings.custom_field.default_access_level",
"custom_field_settings.custom_field.description",
"custom_field_settings.custom_field.display_value",
"custom_field_settings.custom_field.enabled",
"custom_field_settings.custom_field.enum_options",
"custom_field_settings.custom_field.enum_options.color",
"custom_field_settings.custom_field.enum_options.enabled",
"custom_field_settings.custom_field.enum_options.name",
"custom_field_settings.custom_field.enum_value",
"custom_field_settings.custom_field.enum_value.color",
"custom_field_settings.custom_field.enum_value.enabled",
"custom_field_settings.custom_field.enum_value.name",
"custom_field_settings.custom_field.format",
"custom_field_settings.custom_field.has_notifications_enabled",
"custom_field_settings.custom_field.html_text_value",
"custom_field_settings.custom_field.id_prefix",
"custom_field_settings.custom_field.input_restrictions",
"custom_field_settings.custom_field.is_formula_field",
"custom_field_settings.custom_field.is_global_to_workspace",
"custom_field_settings.custom_field.is_value_read_only",
"custom_field_settings.custom_field.multi_enum_values",
"custom_field_settings.custom_field.multi_enum_values.color",
"custom_field_settings.custom_field.multi_enum_values.enabled",
"custom_field_settings.custom_field.multi_enum_values.name",
"custom_field_settings.custom_field.name",
"custom_field_settings.custom_field.number_value",
"custom_field_settings.custom_field.people_value",
"custom_field_settings.custom_field.people_value.name",
"custom_field_settings.custom_field.precision",
"custom_field_settings.custom_field.privacy_setting",
"custom_field_settings.custom_field.reference_value",
"custom_field_settings.custom_field.reference_value.name",
"custom_field_settings.custom_field.representation_type",
"custom_field_settings.custom_field.resource_subtype",
"custom_field_settings.custom_field.text_value",
"custom_field_settings.custom_field.type",
"custom_field_settings.is_important",
"custom_field_settings.parent",
"custom_field_settings.parent.name",
"custom_field_settings.parent.resource_subtype",
"custom_field_settings.project",
"custom_field_settings.project.name",
"custom_field_settings.project.resource_subtype",
"custom_fields",
"custom_fields.date_value",
"custom_fields.date_value.date",
"custom_fields.date_value.date_time",
"custom_fields.display_value",
"custom_fields.enabled",
"custom_fields.enum_options",
"custom_fields.enum_options.color",
"custom_fields.enum_options.enabled",
"custom_fields.enum_options.name",
"custom_fields.enum_value",
"custom_fields.enum_value.color",
"custom_fields.enum_value.enabled",
"custom_fields.enum_value.name",
"custom_fields.id_prefix",
"custom_fields.input_restrictions",
"custom_fields.is_formula_field",
"custom_fields.multi_enum_values",
"custom_fields.multi_enum_values.color",
"custom_fields.multi_enum_values.enabled",
"custom_fields.multi_enum_values.name",
"custom_fields.name",
"custom_fields.number_value",
"custom_fields.representation_type",
"custom_fields.text_value",
"custom_fields.type",
"custom_type",
"custom_type.asana_created_type_identifier",
"custom_type.name",
"default_access_level",
"default_view",
"due_date",
"due_on",
"followers",
"followers.name",
"html_notes",
"icon",
"members",
"members.name",
"minimum_access_level_for_customization",
"minimum_access_level_for_sharing",
"modified_at",
"name",
"notes",
"offset",
"owner",
"path",
"permalink_url",
"privacy_setting",
"project_brief",
"public",
"resource_subtype",
"start_on",
"team",
"team.name",
"uri",
"workspace",
"workspace.name"
]
}
},
"style": "form",
"explode": false
}
],
"responses": {
"200": {
"description": "Successfully retrieved the projects for the given task.",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"type": "array",
"items": {
"$ref": "#/components/schemas/ProjectCompact"
}
},
"next_page": {
"$ref": "#/components/schemas/NextPage"
}
}
}
}
}
},
"400": {
"$ref": "#/components/responses/BadRequest"
},
"401": {
"$ref": "#/components/responses/Unauthorized"
},
"403": {
"$ref": "#/components/responses/Forbidden"
},
"404": {
"$ref": "#/components/responses/NotFound"
},
"500": {
"$ref": "#/components/responses/InternalServerError"
}
},
"security": [
{
"personalAccessToken": []
},
{
"oauth2": [
"projects:read"
]
}
],
"x-readme": {
"code-samples": [
{
"language": "java",
"install": "<dependency><groupId>com.asana</groupId><artifactId>asana</artifactId><version>1.0.0</version></dependency>",
"code": "import com.asana.Client;\n\nClient client = Client.accessToken(\"PERSONAL_ACCESS_TOKEN\");\n\nList<Project> result = client.projects.getProjectsForTask(taskGid)\n .option(\"pretty\", true)\n .execute();"
},
{
"language": "node",
"install": "npm install asana",
"code": "const Asana = require('asana');\n\nlet client = new Asana.ApiClient();\nclient.authentications.token.accessToken = '<YOUR_ACCESS_TOKEN>';\n\nlet projectsApiInstance = new Asana.ProjectsApi(client);\nlet task_gid = \"321654\"; // String | The task to operate on.\nlet opts = { \n 'limit': 50, \n 'offset': \"eyJ0eXAiOJiKV1iQLCJhbGciOiJIUzI1NiJ9\", \n 'include_inherited_projects': false, \n 'opt_fields': \"archived,color,completed,completed_at,completed_by,completed_by.name,created_at,created_from_template,created_from_template.name,current_status,current_status.author,current_status.author.name,current_status.color,current_status.created_at,current_status.created_by,current_status.created_by.name,current_status.html_text,current_status.modified_at,current_status.text,current_status.title,current_status_update,current_status_update.resource_subtype,current_status_update.title,custom_field_settings,custom_field_settings.custom_field,custom_field_settings.custom_field.asana_created_field,custom_field_settings.custom_field.created_by,custom_field_settings.custom_field.created_by.name,custom_field_settings.custom_field.currency_code,custom_field_settings.custom_field.custom_label,custom_field_settings.custom_field.custom_label_position,custom_field_settings.custom_field.date_value,custom_field_settings.custom_field.date_value.date,custom_field_settings.custom_field.date_value.date_time,custom_field_settings.custom_field.default_access_level,custom_field_settings.custom_field.description,custom_field_settings.custom_field.display_value,custom_field_settings.custom_field.enabled,custom_field_settings.custom_field.enum_options,custom_field_settings.custom_field.enum_options.color,custom_field_settings.custom_field.enum_options.enabled,custom_field_settings.custom_field.enum_options.name,custom_field_settings.custom_field.enum_value,custom_field_settings.custom_field.enum_value.color,custom_field_settings.custom_field.enum_value.enabled,custom_field_settings.custom_field.enum_value.name,custom_field_settings.custom_field.format,custom_field_settings.custom_field.has_notifications_enabled,custom_field_settings.custom_field.html_text_value,custom_field_settings.custom_field.id_prefix,custom_field_settings.custom_field.input_restrictions,custom_field_settings.custom_field.is_formula_field,custom_field_settings.custom_field.is_global_to_workspace,custom_field_settings.custom_field.is_value_read_only,custom_field_settings.custom_field.multi_enum_values,custom_field_settings.custom_field.multi_enum_values.color,custom_field_settings.custom_field.multi_enum_values.enabled,custom_field_settings.custom_field.multi_enum_values.name,custom_field_settings.custom_field.name,custom_field_settings.custom_field.number_value,custom_field_settings.custom_field.people_value,custom_field_settings.custom_field.people_value.name,custom_field_settings.custom_field.precision,custom_field_settings.custom_field.privacy_setting,custom_field_settings.custom_field.reference_value,custom_field_settings.custom_field.reference_value.name,custom_field_settings.custom_field.representation_type,custom_field_settings.custom_field.resource_subtype,custom_field_settings.custom_field.text_value,custom_field_settings.custom_field.type,custom_field_settings.is_important,custom_field_settings.parent,custom_field_settings.parent.name,custom_field_settings.parent.resource_subtype,custom_field_settings.project,custom_field_settings.project.name,custom_field_settings.project.resource_subtype,custom_fields,custom_fields.date_value,custom_fields.date_value.date,custom_fields.date_value.date_time,custom_fields.display_value,custom_fields.enabled,custom_fields.enum_options,custom_fields.enum_options.color,custom_fields.enum_options.enabled,custom_fields.enum_options.name,custom_fields.enum_value,custom_fields.enum_value.color,custom_fields.enum_value.enabled,custom_fields.enum_value.name,custom_fields.id_prefix,custom_fields.input_restrictions,custom_fields.is_formula_field,custom_fields.multi_enum_values,custom_fields.multi_enum_values.color,custom_fields.multi_enum_values.enabled,custom_fields.multi_enum_values.name,custom_fields.name,custom_fields.number_value,custom_fields.representation_type,custom_fields.text_value,custom_fields.type,custom_type,custom_type.asana_created_type_identifier,custom_type.name,default_access_level,default_view,due_date,due_on,followers,followers.name,html_notes,icon,members,members.name,minimum_access_level_for_customization,minimum_access_level_for_sharing,modified_at,name,notes,offset,owner,path,permalink_url,privacy_setting,project_brief,public,resource_subtype,start_on,team,team.name,uri,workspace,workspace.name\"\n};\nprojectsApiInstance.getProjectsForTask(task_gid, opts).then((result) => {\n console.log('API called successfully. Returned data: ' + JSON.stringify(result.data, null, 2));\n}, (error) => {\n console.error(error.response.body);\n});",
"name": "node-sdk-v3"
},
{
"language": "node",
"install": "npm install asana@1.0.5",
"code": "const asana = require('asana');\n\nconst client = asana.Client.create().useAccessToken('PERSONAL_ACCESS_TOKEN');\n\nclient.projects.getProjectsForTask(taskGid, {param: \"value\", param: \"value\", opt_pretty: true})\n .then((result) => {\n console.log(result);\n });",
"name": "node-sdk-v1"
},
{
"language": "python",
"install": "pip install asana",
"code": "import asana\nfrom asana.rest import ApiException\nfrom pprint import pprint\n\nconfiguration = asana.Configuration()\nconfiguration.access_token = '<YOUR_ACCESS_TOKEN>'\napi_client = asana.ApiClient(configuration)\n\n# create an instance of the API class\nprojects_api_instance = asana.ProjectsApi(api_client)\ntask_gid = \"321654\" # str | The task to operate on.\nopts = {\n 'limit': 50, # int | Results per page. The number of objects to return per page. The value must be between 1 and 100.\n 'offset': \"eyJ0eXAiOJiKV1iQLCJhbGciOiJIUzI1NiJ9\", # str | 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.*\n 'include_inherited_projects': False, # bool | Opt-in, read-only. When `true`, the response also includes projects the task inherits from its ancestor tasks (in addition to its direct projects). Defaults to `false`, in which case only direct projects are returned.\n 'opt_fields': \"archived,color,completed,completed_at,completed_by,completed_by.name,created_at,created_from_template,created_from_template.name,current_status,current_status.author,current_status.author.name,current_status.color,current_status.created_at,current_status.created_by,current_status.created_by.name,current_status.html_text,current_status.modified_at,current_status.text,current_status.title,current_status_update,current_status_update.resource_subtype,current_status_update.title,custom_field_settings,custom_field_settings.custom_field,custom_field_settings.custom_field.asana_created_field,custom_field_settings.custom_field.created_by,custom_field_settings.custom_field.created_by.name,custom_field_settings.custom_field.currency_code,custom_field_settings.custom_field.custom_label,custom_field_settings.custom_field.custom_label_position,custom_field_settings.custom_field.date_value,custom_field_settings.custom_field.date_value.date,custom_field_settings.custom_field.date_value.date_time,custom_field_settings.custom_field.default_access_level,custom_field_settings.custom_field.description,custom_field_settings.custom_field.display_value,custom_field_settings.custom_field.enabled,custom_field_settings.custom_field.enum_options,custom_field_settings.custom_field.enum_options.color,custom_field_settings.custom_field.enum_options.enabled,custom_field_settings.custom_field.enum_options.name,custom_field_settings.custom_field.enum_value,custom_field_settings.custom_field.enum_value.color,custom_field_settings.custom_field.enum_value.enabled,custom_field_settings.custom_field.enum_value.name,custom_field_settings.custom_field.format,custom_field_settings.custom_field.has_notifications_enabled,custom_field_settings.custom_field.html_text_value,custom_field_settings.custom_field.id_prefix,custom_field_settings.custom_field.input_restrictions,custom_field_settings.custom_field.is_formula_field,custom_field_settings.custom_field.is_global_to_workspace,custom_field_settings.custom_field.is_value_read_only,custom_field_settings.custom_field.multi_enum_values,custom_field_settings.custom_field.multi_enum_values.color,custom_field_settings.custom_field.multi_enum_values.enabled,custom_field_settings.custom_field.multi_enum_values.name,custom_field_settings.custom_field.name,custom_field_settings.custom_field.number_value,custom_field_settings.custom_field.people_value,custom_field_settings.custom_field.people_value.name,custom_field_settings.custom_field.precision,custom_field_settings.custom_field.privacy_setting,custom_field_settings.custom_field.reference_value,custom_field_settings.custom_field.reference_value.name,custom_field_settings.custom_field.representation_type,custom_field_settings.custom_field.resource_subtype,custom_field_settings.custom_field.text_value,custom_field_settings.custom_field.type,custom_field_settings.is_important,custom_field_settings.parent,custom_field_settings.parent.name,custom_field_settings.parent.resource_subtype,custom_field_settings.project,custom_field_settings.project.name,custom_field_settings.project.resource_subtype,custom_fields,custom_fields.date_value,custom_fields.date_value.date,custom_fields.date_value.date_time,custom_fields.display_value,custom_fields.enabled,custom_fields.enum_options,custom_fields.enum_options.color,custom_fields.enum_options.enabled,custom_fields.enum_options.name,custom_fields.enum_value,custom_fields.enum_value.color,custom_fields.enum_value.enabled,custom_fields.enum_value.name,custom_fields.id_prefix,custom_fields.input_restrictions,custom_fields.is_formula_field,custom_fields.multi_enum_values,custom_fields.multi_enum_values.color,custom_fields.multi_enum_values.enabled,custom_fields.multi_enum_values.name,custom_fields.name,custom_fields.number_value,custom_fields.representation_type,custom_fields.text_value,custom_fields.type,custom_type,custom_type.asana_created_type_identifier,custom_type.name,default_access_level,default_view,due_date,due_on,followers,followers.name,html_notes,icon,members,members.name,minimum_access_level_for_customization,minimum_access_level_for_sharing,modified_at,name,notes,offset,owner,path,permalink_url,privacy_setting,project_brief,public,resource_subtype,start_on,team,team.name,uri,workspace,workspace.name\", # list[str] | 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.\n}\n\ntry:\n # Get projects a task is in\n api_response = projects_api_instance.get_projects_for_task(task_gid, opts)\n for data in api_response:\n pprint(data)\nexcept ApiException as e:\n print(\"Exception when calling ProjectsApi->get_projects_for_task: %s\\n\" % e)",
"name": "python-sdk-v5"
},
{
"language": "python",
"install": "pip install asana==3.2.3",
"code": "import asana\n\nclient = asana.Client.access_token('PERSONAL_ACCESS_TOKEN')\n\nresult = client.projects.get_projects_for_task(task_gid, {'param': 'value', 'param': 'value'}, opt_pretty=True)",
"name": "python-sdk-v3"
},
{
"language": "php",
"install": "composer require asana/asana",
"code": "<?php\nrequire 'vendor/autoload.php';\n\n$client = Asana\\Client::accessToken('PERSONAL_ACCESS_TOKEN');\n\n$result = $client->projects->getProjectsForTask($task_gid, array('param' => 'value', 'param' => 'value'), array('opt_pretty' => 'true'))"
},
{
"language": "ruby",
"install": "gem install asana",
"code": "require 'asana'\n\nclient = Asana::Client.new do |c|\n c.authentication :access_token, 'PERSONAL_ACCESS_TOKEN'\nend\n\nresult = client.projects.get_projects_for_task(task_gid: 'task_gid', param: \"value\", param: \"value\", options: {pretty: true})"
}
]
},
"x-purple-suite-runtime": "modeled-core",
"x-purple-suite-supported-query": [
"opt_pretty",
"limit",
"offset",
"opt_fields"
],
"x-purple-suite-supported-response-fields": [
"gid",
"resource_type",
"resource_subtype",
"name",
"notes",
"completed",
"completed_at",
"created_at",
"modified_at",
"assignee",
"assignee_status",
"workspace",
"projects",
"memberships",
"parent",
"due_on",
"start_on",
"tags",
"dependencies",
"num_subtasks",
"archived",
"public",
"color",
"default_view",
"team",
"project",
"section",
"text",
"created_by",
"target",
"type",
"email",
"photo",
"is_organization"
]
}
GET /api/1.0/teams/{team_gid}/projects
Get a team's projects
<b>Required scope: </b><code>projects:read</code>
Returns the compact project records for all projects in the team.
The persistent core model supports the response and query fields named in x-purple-suite-supported-response-fields and x-purple-suite-supported-query. Other fields/options return an explicit 400 errors envelope.
Authentication
[
{
"personalAccessToken": []
},
{
"oauth2": [
"projects:read"
]
}
]
Path-level parameters and metadata
{
"parameters": [
{
"$ref": "#/components/parameters/team_path_gid"
},
{
"$ref": "#/components/parameters/pretty"
}
]
}
Request, responses and operation details
{
"summary": "Get a team's projects",
"description": "<b>Required scope: </b><code>projects:read</code>\n\nReturns the compact project records for all projects in the team.\n\nThe persistent core model supports the response and query fields named in x-purple-suite-supported-response-fields and x-purple-suite-supported-query. Other fields/options return an explicit 400 errors envelope.",
"tags": [
"Projects"
],
"operationId": "getProjectsForTeam",
"parameters": [
{
"$ref": "#/components/parameters/limit"
},
{
"$ref": "#/components/parameters/offset"
},
{
"$ref": "#/components/parameters/archived_query_param"
},
{
"name": "opt_fields",
"in": "query",
"description": "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. Properties can include nested fields. To learn more, see the [input/output options guide](/docs/inputoutput-options#selecting-nested-fields).",
"required": false,
"example": [
"archived",
"color",
"completed",
"completed_at",
"completed_by",
"completed_by.name",
"created_at",
"created_from_template",
"created_from_template.name",
"current_status",
"current_status.author",
"current_status.author.name",
"current_status.color",
"current_status.created_at",
"current_status.created_by",
"current_status.created_by.name",
"current_status.html_text",
"current_status.modified_at",
"current_status.text",
"current_status.title",
"current_status_update",
"current_status_update.resource_subtype",
"current_status_update.title",
"custom_field_settings",
"custom_field_settings.custom_field",
"custom_field_settings.custom_field.asana_created_field",
"custom_field_settings.custom_field.created_by",
"custom_field_settings.custom_field.created_by.name",
"custom_field_settings.custom_field.currency_code",
"custom_field_settings.custom_field.custom_label",
"custom_field_settings.custom_field.custom_label_position",
"custom_field_settings.custom_field.date_value",
"custom_field_settings.custom_field.date_value.date",
"custom_field_settings.custom_field.date_value.date_time",
"custom_field_settings.custom_field.default_access_level",
"custom_field_settings.custom_field.description",
"custom_field_settings.custom_field.display_value",
"custom_field_settings.custom_field.enabled",
"custom_field_settings.custom_field.enum_options",
"custom_field_settings.custom_field.enum_options.color",
"custom_field_settings.custom_field.enum_options.enabled",
"custom_field_settings.custom_field.enum_options.name",
"custom_field_settings.custom_field.enum_value",
"custom_field_settings.custom_field.enum_value.color",
"custom_field_settings.custom_field.enum_value.enabled",
"custom_field_settings.custom_field.enum_value.name",
"custom_field_settings.custom_field.format",
"custom_field_settings.custom_field.has_notifications_enabled",
"custom_field_settings.custom_field.html_text_value",
"custom_field_settings.custom_field.id_prefix",
"custom_field_settings.custom_field.input_restrictions",
"custom_field_settings.custom_field.is_formula_field",
"custom_field_settings.custom_field.is_global_to_workspace",
"custom_field_settings.custom_field.is_value_read_only",
"custom_field_settings.custom_field.multi_enum_values",
"custom_field_settings.custom_field.multi_enum_values.color",
"custom_field_settings.custom_field.multi_enum_values.enabled",
"custom_field_settings.custom_field.multi_enum_values.name",
"custom_field_settings.custom_field.name",
"custom_field_settings.custom_field.number_value",
"custom_field_settings.custom_field.people_value",
"custom_field_settings.custom_field.people_value.name",
"custom_field_settings.custom_field.precision",
"custom_field_settings.custom_field.privacy_setting",
"custom_field_settings.custom_field.reference_value",
"custom_field_settings.custom_field.reference_value.name",
"custom_field_settings.custom_field.representation_type",
"custom_field_settings.custom_field.resource_subtype",
"custom_field_settings.custom_field.text_value",
"custom_field_settings.custom_field.type",
"custom_field_settings.is_important",
"custom_field_settings.parent",
"custom_field_settings.parent.name",
"custom_field_settings.parent.resource_subtype",
"custom_field_settings.project",
"custom_field_settings.project.name",
"custom_field_settings.project.resource_subtype",
"custom_fields",
"custom_fields.date_value",
"custom_fields.date_value.date",
"custom_fields.date_value.date_time",
"custom_fields.display_value",
"custom_fields.enabled",
"custom_fields.enum_options",
"custom_fields.enum_options.color",
"custom_fields.enum_options.enabled",
"custom_fields.enum_options.name",
"custom_fields.enum_value",
"custom_fields.enum_value.color",
"custom_fields.enum_value.enabled",
"custom_fields.enum_value.name",
"custom_fields.id_prefix",
"custom_fields.input_restrictions",
"custom_fields.is_formula_field",
"custom_fields.multi_enum_values",
"custom_fields.multi_enum_values.color",
"custom_fields.multi_enum_values.enabled",
"custom_fields.multi_enum_values.name",
"custom_fields.name",
"custom_fields.number_value",
"custom_fields.representation_type",
"custom_fields.text_value",
"custom_fields.type",
"custom_type",
"custom_type.asana_created_type_identifier",
"custom_type.name",
"default_access_level",
"default_view",
"due_date",
"due_on",
"followers",
"followers.name",
"html_notes",
"icon",
"members",
"members.name",
"minimum_access_level_for_customization",
"minimum_access_level_for_sharing",
"modified_at",
"name",
"notes",
"offset",
"owner",
"path",
"permalink_url",
"privacy_setting",
"project_brief",
"public",
"resource_subtype",
"start_on",
"team",
"team.name",
"uri",
"workspace",
"workspace.name"
],
"schema": {
"type": "array",
"items": {
"type": "string",
"enum": [
"archived",
"color",
"completed",
"completed_at",
"completed_by",
"completed_by.name",
"created_at",
"created_from_template",
"created_from_template.name",
"current_status",
"current_status.author",
"current_status.author.name",
"current_status.color",
"current_status.created_at",
"current_status.created_by",
"current_status.created_by.name",
"current_status.html_text",
"current_status.modified_at",
"current_status.text",
"current_status.title",
"current_status_update",
"current_status_update.resource_subtype",
"current_status_update.title",
"custom_field_settings",
"custom_field_settings.custom_field",
"custom_field_settings.custom_field.asana_created_field",
"custom_field_settings.custom_field.created_by",
"custom_field_settings.custom_field.created_by.name",
"custom_field_settings.custom_field.currency_code",
"custom_field_settings.custom_field.custom_label",
"custom_field_settings.custom_field.custom_label_position",
"custom_field_settings.custom_field.date_value",
"custom_field_settings.custom_field.date_value.date",
"custom_field_settings.custom_field.date_value.date_time",
"custom_field_settings.custom_field.default_access_level",
"custom_field_settings.custom_field.description",
"custom_field_settings.custom_field.display_value",
"custom_field_settings.custom_field.enabled",
"custom_field_settings.custom_field.enum_options",
"custom_field_settings.custom_field.enum_options.color",
"custom_field_settings.custom_field.enum_options.enabled",
"custom_field_settings.custom_field.enum_options.name",
"custom_field_settings.custom_field.enum_value",
"custom_field_settings.custom_field.enum_value.color",
"custom_field_settings.custom_field.enum_value.enabled",
"custom_field_settings.custom_field.enum_value.name",
"custom_field_settings.custom_field.format",
"custom_field_settings.custom_field.has_notifications_enabled",
"custom_field_settings.custom_field.html_text_value",
"custom_field_settings.custom_field.id_prefix",
"custom_field_settings.custom_field.input_restrictions",
"custom_field_settings.custom_field.is_formula_field",
"custom_field_settings.custom_field.is_global_to_workspace",
"custom_field_settings.custom_field.is_value_read_only",
"custom_field_settings.custom_field.multi_enum_values",
"custom_field_settings.custom_field.multi_enum_values.color",
"custom_field_settings.custom_field.multi_enum_values.enabled",
"custom_field_settings.custom_field.multi_enum_values.name",
"custom_field_settings.custom_field.name",
"custom_field_settings.custom_field.number_value",
"custom_field_settings.custom_field.people_value",
"custom_field_settings.custom_field.people_value.name",
"custom_field_settings.custom_field.precision",
"custom_field_settings.custom_field.privacy_setting",
"custom_field_settings.custom_field.reference_value",
"custom_field_settings.custom_field.reference_value.name",
"custom_field_settings.custom_field.representation_type",
"custom_field_settings.custom_field.resource_subtype",
"custom_field_settings.custom_field.text_value",
"custom_field_settings.custom_field.type",
"custom_field_settings.is_important",
"custom_field_settings.parent",
"custom_field_settings.parent.name",
"custom_field_settings.parent.resource_subtype",
"custom_field_settings.project",
"custom_field_settings.project.name",
"custom_field_settings.project.resource_subtype",
"custom_fields",
"custom_fields.date_value",
"custom_fields.date_value.date",
"custom_fields.date_value.date_time",
"custom_fields.display_value",
"custom_fields.enabled",
"custom_fields.enum_options",
"custom_fields.enum_options.color",
"custom_fields.enum_options.enabled",
"custom_fields.enum_options.name",
"custom_fields.enum_value",
"custom_fields.enum_value.color",
"custom_fields.enum_value.enabled",
"custom_fields.enum_value.name",
"custom_fields.id_prefix",
"custom_fields.input_restrictions",
"custom_fields.is_formula_field",
"custom_fields.multi_enum_values",
"custom_fields.multi_enum_values.color",
"custom_fields.multi_enum_values.enabled",
"custom_fields.multi_enum_values.name",
"custom_fields.name",
"custom_fields.number_value",
"custom_fields.representation_type",
"custom_fields.text_value",
"custom_fields.type",
"custom_type",
"custom_type.asana_created_type_identifier",
"custom_type.name",
"default_access_level",
"default_view",
"due_date",
"due_on",
"followers",
"followers.name",
"html_notes",
"icon",
"members",
"members.name",
"minimum_access_level_for_customization",
"minimum_access_level_for_sharing",
"modified_at",
"name",
"notes",
"offset",
"owner",
"path",
"permalink_url",
"privacy_setting",
"project_brief",
"public",
"resource_subtype",
"start_on",
"team",
"team.name",
"uri",
"workspace",
"workspace.name"
]
}
},
"style": "form",
"explode": false
}
],
"responses": {
"200": {
"description": "Successfully retrieved the requested team's projects.",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"type": "array",
"items": {
"$ref": "#/components/schemas/ProjectCompact"
}
},
"next_page": {
"$ref": "#/components/schemas/NextPage"
}
}
}
}
}
},
"400": {
"$ref": "#/components/responses/BadRequest"
},
"401": {
"$ref": "#/components/responses/Unauthorized"
},
"403": {
"$ref": "#/components/responses/Forbidden"
},
"404": {
"$ref": "#/components/responses/NotFound"
},
"500": {
"$ref": "#/components/responses/InternalServerError"
}
},
"security": [
{
"personalAccessToken": []
},
{
"oauth2": [
"projects:read"
]
}
],
"x-readme": {
"code-samples": [
{
"language": "java",
"install": "<dependency><groupId>com.asana</groupId><artifactId>asana</artifactId><version>1.0.0</version></dependency>",
"code": "import com.asana.Client;\n\nClient client = Client.accessToken(\"PERSONAL_ACCESS_TOKEN\");\n\nList<Project> result = client.projects.getProjectsForTeam(teamGid, archived)\n .option(\"pretty\", true)\n .execute();"
},
{
"language": "node",
"install": "npm install asana",
"code": "const Asana = require('asana');\n\nlet client = new Asana.ApiClient();\nclient.authentications.token.accessToken = '<YOUR_ACCESS_TOKEN>';\n\nlet projectsApiInstance = new Asana.ProjectsApi(client);\nlet team_gid = \"159874\"; // String | Globally unique identifier for the team.\nlet opts = { \n 'limit': 50, \n 'offset': \"eyJ0eXAiOJiKV1iQLCJhbGciOiJIUzI1NiJ9\", \n 'archived': false, \n 'opt_fields': \"archived,color,completed,completed_at,completed_by,completed_by.name,created_at,created_from_template,created_from_template.name,current_status,current_status.author,current_status.author.name,current_status.color,current_status.created_at,current_status.created_by,current_status.created_by.name,current_status.html_text,current_status.modified_at,current_status.text,current_status.title,current_status_update,current_status_update.resource_subtype,current_status_update.title,custom_field_settings,custom_field_settings.custom_field,custom_field_settings.custom_field.asana_created_field,custom_field_settings.custom_field.created_by,custom_field_settings.custom_field.created_by.name,custom_field_settings.custom_field.currency_code,custom_field_settings.custom_field.custom_label,custom_field_settings.custom_field.custom_label_position,custom_field_settings.custom_field.date_value,custom_field_settings.custom_field.date_value.date,custom_field_settings.custom_field.date_value.date_time,custom_field_settings.custom_field.default_access_level,custom_field_settings.custom_field.description,custom_field_settings.custom_field.display_value,custom_field_settings.custom_field.enabled,custom_field_settings.custom_field.enum_options,custom_field_settings.custom_field.enum_options.color,custom_field_settings.custom_field.enum_options.enabled,custom_field_settings.custom_field.enum_options.name,custom_field_settings.custom_field.enum_value,custom_field_settings.custom_field.enum_value.color,custom_field_settings.custom_field.enum_value.enabled,custom_field_settings.custom_field.enum_value.name,custom_field_settings.custom_field.format,custom_field_settings.custom_field.has_notifications_enabled,custom_field_settings.custom_field.html_text_value,custom_field_settings.custom_field.id_prefix,custom_field_settings.custom_field.input_restrictions,custom_field_settings.custom_field.is_formula_field,custom_field_settings.custom_field.is_global_to_workspace,custom_field_settings.custom_field.is_value_read_only,custom_field_settings.custom_field.multi_enum_values,custom_field_settings.custom_field.multi_enum_values.color,custom_field_settings.custom_field.multi_enum_values.enabled,custom_field_settings.custom_field.multi_enum_values.name,custom_field_settings.custom_field.name,custom_field_settings.custom_field.number_value,custom_field_settings.custom_field.people_value,custom_field_settings.custom_field.people_value.name,custom_field_settings.custom_field.precision,custom_field_settings.custom_field.privacy_setting,custom_field_settings.custom_field.reference_value,custom_field_settings.custom_field.reference_value.name,custom_field_settings.custom_field.representation_type,custom_field_settings.custom_field.resource_subtype,custom_field_settings.custom_field.text_value,custom_field_settings.custom_field.type,custom_field_settings.is_important,custom_field_settings.parent,custom_field_settings.parent.name,custom_field_settings.parent.resource_subtype,custom_field_settings.project,custom_field_settings.project.name,custom_field_settings.project.resource_subtype,custom_fields,custom_fields.date_value,custom_fields.date_value.date,custom_fields.date_value.date_time,custom_fields.display_value,custom_fields.enabled,custom_fields.enum_options,custom_fields.enum_options.color,custom_fields.enum_options.enabled,custom_fields.enum_options.name,custom_fields.enum_value,custom_fields.enum_value.color,custom_fields.enum_value.enabled,custom_fields.enum_value.name,custom_fields.id_prefix,custom_fields.input_restrictions,custom_fields.is_formula_field,custom_fields.multi_enum_values,custom_fields.multi_enum_values.color,custom_fields.multi_enum_values.enabled,custom_fields.multi_enum_values.name,custom_fields.name,custom_fields.number_value,custom_fields.representation_type,custom_fields.text_value,custom_fields.type,custom_type,custom_type.asana_created_type_identifier,custom_type.name,default_access_level,default_view,due_date,due_on,followers,followers.name,html_notes,icon,members,members.name,minimum_access_level_for_customization,minimum_access_level_for_sharing,modified_at,name,notes,offset,owner,path,permalink_url,privacy_setting,project_brief,public,resource_subtype,start_on,team,team.name,uri,workspace,workspace.name\"\n};\nprojectsApiInstance.getProjectsForTeam(team_gid, opts).then((result) => {\n console.log('API called successfully. Returned data: ' + JSON.stringify(result.data, null, 2));\n}, (error) => {\n console.error(error.response.body);\n});",
"name": "node-sdk-v3"
},
{
"language": "node",
"install": "npm install asana@1.0.5",
"code": "const asana = require('asana');\n\nconst client = asana.Client.create().useAccessToken('PERSONAL_ACCESS_TOKEN');\n\nclient.projects.getProjectsForTeam(teamGid, {param: \"value\", param: \"value\", opt_pretty: true})\n .then((result) => {\n console.log(result);\n });",
"name": "node-sdk-v1"
},
{
"language": "python",
"install": "pip install asana",
"code": "import asana\nfrom asana.rest import ApiException\nfrom pprint import pprint\n\nconfiguration = asana.Configuration()\nconfiguration.access_token = '<YOUR_ACCESS_TOKEN>'\napi_client = asana.ApiClient(configuration)\n\n# create an instance of the API class\nprojects_api_instance = asana.ProjectsApi(api_client)\nteam_gid = \"159874\" # str | Globally unique identifier for the team.\nopts = {\n 'limit': 50, # int | Results per page. The number of objects to return per page. The value must be between 1 and 100.\n 'offset': \"eyJ0eXAiOJiKV1iQLCJhbGciOiJIUzI1NiJ9\", # str | 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.*\n 'archived': False, # bool | Only return projects whose `archived` field takes on the value of this parameter.\n 'opt_fields': \"archived,color,completed,completed_at,completed_by,completed_by.name,created_at,created_from_template,created_from_template.name,current_status,current_status.author,current_status.author.name,current_status.color,current_status.created_at,current_status.created_by,current_status.created_by.name,current_status.html_text,current_status.modified_at,current_status.text,current_status.title,current_status_update,current_status_update.resource_subtype,current_status_update.title,custom_field_settings,custom_field_settings.custom_field,custom_field_settings.custom_field.asana_created_field,custom_field_settings.custom_field.created_by,custom_field_settings.custom_field.created_by.name,custom_field_settings.custom_field.currency_code,custom_field_settings.custom_field.custom_label,custom_field_settings.custom_field.custom_label_position,custom_field_settings.custom_field.date_value,custom_field_settings.custom_field.date_value.date,custom_field_settings.custom_field.date_value.date_time,custom_field_settings.custom_field.default_access_level,custom_field_settings.custom_field.description,custom_field_settings.custom_field.display_value,custom_field_settings.custom_field.enabled,custom_field_settings.custom_field.enum_options,custom_field_settings.custom_field.enum_options.color,custom_field_settings.custom_field.enum_options.enabled,custom_field_settings.custom_field.enum_options.name,custom_field_settings.custom_field.enum_value,custom_field_settings.custom_field.enum_value.color,custom_field_settings.custom_field.enum_value.enabled,custom_field_settings.custom_field.enum_value.name,custom_field_settings.custom_field.format,custom_field_settings.custom_field.has_notifications_enabled,custom_field_settings.custom_field.html_text_value,custom_field_settings.custom_field.id_prefix,custom_field_settings.custom_field.input_restrictions,custom_field_settings.custom_field.is_formula_field,custom_field_settings.custom_field.is_global_to_workspace,custom_field_settings.custom_field.is_value_read_only,custom_field_settings.custom_field.multi_enum_values,custom_field_settings.custom_field.multi_enum_values.color,custom_field_settings.custom_field.multi_enum_values.enabled,custom_field_settings.custom_field.multi_enum_values.name,custom_field_settings.custom_field.name,custom_field_settings.custom_field.number_value,custom_field_settings.custom_field.people_value,custom_field_settings.custom_field.people_value.name,custom_field_settings.custom_field.precision,custom_field_settings.custom_field.privacy_setting,custom_field_settings.custom_field.reference_value,custom_field_settings.custom_field.reference_value.name,custom_field_settings.custom_field.representation_type,custom_field_settings.custom_field.resource_subtype,custom_field_settings.custom_field.text_value,custom_field_settings.custom_field.type,custom_field_settings.is_important,custom_field_settings.parent,custom_field_settings.parent.name,custom_field_settings.parent.resource_subtype,custom_field_settings.project,custom_field_settings.project.name,custom_field_settings.project.resource_subtype,custom_fields,custom_fields.date_value,custom_fields.date_value.date,custom_fields.date_value.date_time,custom_fields.display_value,custom_fields.enabled,custom_fields.enum_options,custom_fields.enum_options.color,custom_fields.enum_options.enabled,custom_fields.enum_options.name,custom_fields.enum_value,custom_fields.enum_value.color,custom_fields.enum_value.enabled,custom_fields.enum_value.name,custom_fields.id_prefix,custom_fields.input_restrictions,custom_fields.is_formula_field,custom_fields.multi_enum_values,custom_fields.multi_enum_values.color,custom_fields.multi_enum_values.enabled,custom_fields.multi_enum_values.name,custom_fields.name,custom_fields.number_value,custom_fields.representation_type,custom_fields.text_value,custom_fields.type,custom_type,custom_type.asana_created_type_identifier,custom_type.name,default_access_level,default_view,due_date,due_on,followers,followers.name,html_notes,icon,members,members.name,minimum_access_level_for_customization,minimum_access_level_for_sharing,modified_at,name,notes,offset,owner,path,permalink_url,privacy_setting,project_brief,public,resource_subtype,start_on,team,team.name,uri,workspace,workspace.name\", # list[str] | 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.\n}\n\ntry:\n # Get a team's projects\n api_response = projects_api_instance.get_projects_for_team(team_gid, opts)\n for data in api_response:\n pprint(data)\nexcept ApiException as e:\n print(\"Exception when calling ProjectsApi->get_projects_for_team: %s\\n\" % e)",
"name": "python-sdk-v5"
},
{
"language": "python",
"install": "pip install asana==3.2.3",
"code": "import asana\n\nclient = asana.Client.access_token('PERSONAL_ACCESS_TOKEN')\n\nresult = client.projects.get_projects_for_team(team_gid, {'param': 'value', 'param': 'value'}, opt_pretty=True)",
"name": "python-sdk-v3"
},
{
"language": "php",
"install": "composer require asana/asana",
"code": "<?php\nrequire 'vendor/autoload.php';\n\n$client = Asana\\Client::accessToken('PERSONAL_ACCESS_TOKEN');\n\n$result = $client->projects->getProjectsForTeam($team_gid, array('param' => 'value', 'param' => 'value'), array('opt_pretty' => 'true'))"
},
{
"language": "ruby",
"install": "gem install asana",
"code": "require 'asana'\n\nclient = Asana::Client.new do |c|\n c.authentication :access_token, 'PERSONAL_ACCESS_TOKEN'\nend\n\nresult = client.projects.get_projects_for_team(team_gid: 'team_gid', param: \"value\", param: \"value\", options: {pretty: true})"
}
]
},
"x-purple-suite-runtime": "modeled-core",
"x-purple-suite-supported-query": [
"opt_pretty",
"limit",
"offset",
"archived",
"opt_fields"
],
"x-purple-suite-supported-response-fields": [
"gid",
"resource_type",
"resource_subtype",
"name",
"notes",
"completed",
"completed_at",
"created_at",
"modified_at",
"assignee",
"assignee_status",
"workspace",
"projects",
"memberships",
"parent",
"due_on",
"start_on",
"tags",
"dependencies",
"num_subtasks",
"archived",
"public",
"color",
"default_view",
"team",
"project",
"section",
"text",
"created_by",
"target",
"type",
"email",
"photo",
"is_organization"
]
}
POST /api/1.0/teams/{team_gid}/projects
Create a project in a team
<b>Required scope: </b><code>projects:write</code>
Creates a project shared with the given team.
Returns the full record of the newly created project.
The persistent core model supports the response and query fields named in x-purple-suite-supported-response-fields and x-purple-suite-supported-query. Other fields/options return an explicit 400 errors envelope.
Authentication
[
{
"personalAccessToken": []
},
{
"oauth2": [
"projects:write"
]
}
]
Path-level parameters and metadata
{
"parameters": [
{
"$ref": "#/components/parameters/team_path_gid"
},
{
"$ref": "#/components/parameters/pretty"
}
]
}
Request, responses and operation details
{
"summary": "Create a project in a team",
"description": "<b>Required scope: </b><code>projects:write</code>\n\nCreates a project shared with the given team.\n\nReturns the full record of the newly created project.\n\nThe persistent core model supports the response and query fields named in x-purple-suite-supported-response-fields and x-purple-suite-supported-query. Other fields/options return an explicit 400 errors envelope.",
"tags": [
"Projects"
],
"operationId": "createProjectForTeam",
"parameters": [
{
"name": "opt_fields",
"in": "query",
"description": "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. Properties can include nested fields. To learn more, see the [input/output options guide](/docs/inputoutput-options#selecting-nested-fields).",
"required": false,
"example": [
"archived",
"color",
"completed",
"completed_at",
"completed_by",
"completed_by.name",
"created_at",
"created_from_template",
"created_from_template.name",
"current_status",
"current_status.author",
"current_status.author.name",
"current_status.color",
"current_status.created_at",
"current_status.created_by",
"current_status.created_by.name",
"current_status.html_text",
"current_status.modified_at",
"current_status.text",
"current_status.title",
"current_status_update",
"current_status_update.resource_subtype",
"current_status_update.title",
"custom_field_settings",
"custom_field_settings.custom_field",
"custom_field_settings.custom_field.asana_created_field",
"custom_field_settings.custom_field.created_by",
"custom_field_settings.custom_field.created_by.name",
"custom_field_settings.custom_field.currency_code",
"custom_field_settings.custom_field.custom_label",
"custom_field_settings.custom_field.custom_label_position",
"custom_field_settings.custom_field.date_value",
"custom_field_settings.custom_field.date_value.date",
"custom_field_settings.custom_field.date_value.date_time",
"custom_field_settings.custom_field.default_access_level",
"custom_field_settings.custom_field.description",
"custom_field_settings.custom_field.display_value",
"custom_field_settings.custom_field.enabled",
"custom_field_settings.custom_field.enum_options",
"custom_field_settings.custom_field.enum_options.color",
"custom_field_settings.custom_field.enum_options.enabled",
"custom_field_settings.custom_field.enum_options.name",
"custom_field_settings.custom_field.enum_value",
"custom_field_settings.custom_field.enum_value.color",
"custom_field_settings.custom_field.enum_value.enabled",
"custom_field_settings.custom_field.enum_value.name",
"custom_field_settings.custom_field.format",
"custom_field_settings.custom_field.has_notifications_enabled",
"custom_field_settings.custom_field.html_text_value",
"custom_field_settings.custom_field.id_prefix",
"custom_field_settings.custom_field.input_restrictions",
"custom_field_settings.custom_field.is_formula_field",
"custom_field_settings.custom_field.is_global_to_workspace",
"custom_field_settings.custom_field.is_value_read_only",
"custom_field_settings.custom_field.multi_enum_values",
"custom_field_settings.custom_field.multi_enum_values.color",
"custom_field_settings.custom_field.multi_enum_values.enabled",
"custom_field_settings.custom_field.multi_enum_values.name",
"custom_field_settings.custom_field.name",
"custom_field_settings.custom_field.number_value",
"custom_field_settings.custom_field.people_value",
"custom_field_settings.custom_field.people_value.name",
"custom_field_settings.custom_field.precision",
"custom_field_settings.custom_field.privacy_setting",
"custom_field_settings.custom_field.reference_value",
"custom_field_settings.custom_field.reference_value.name",
"custom_field_settings.custom_field.representation_type",
"custom_field_settings.custom_field.resource_subtype",
"custom_field_settings.custom_field.text_value",
"custom_field_settings.custom_field.type",
"custom_field_settings.is_important",
"custom_field_settings.parent",
"custom_field_settings.parent.name",
"custom_field_settings.parent.resource_subtype",
"custom_field_settings.project",
"custom_field_settings.project.name",
"custom_field_settings.project.resource_subtype",
"custom_fields",
"custom_fields.date_value",
"custom_fields.date_value.date",
"custom_fields.date_value.date_time",
"custom_fields.display_value",
"custom_fields.enabled",
"custom_fields.enum_options",
"custom_fields.enum_options.color",
"custom_fields.enum_options.enabled",
"custom_fields.enum_options.name",
"custom_fields.enum_value",
"custom_fields.enum_value.color",
"custom_fields.enum_value.enabled",
"custom_fields.enum_value.name",
"custom_fields.id_prefix",
"custom_fields.input_restrictions",
"custom_fields.is_formula_field",
"custom_fields.multi_enum_values",
"custom_fields.multi_enum_values.color",
"custom_fields.multi_enum_values.enabled",
"custom_fields.multi_enum_values.name",
"custom_fields.name",
"custom_fields.number_value",
"custom_fields.representation_type",
"custom_fields.text_value",
"custom_fields.type",
"custom_type",
"custom_type.asana_created_type_identifier",
"custom_type.name",
"default_access_level",
"default_view",
"due_date",
"due_on",
"followers",
"followers.name",
"html_notes",
"icon",
"members",
"members.name",
"minimum_access_level_for_customization",
"minimum_access_level_for_sharing",
"modified_at",
"name",
"notes",
"owner",
"permalink_url",
"privacy_setting",
"project_brief",
"public",
"resource_subtype",
"start_on",
"team",
"team.name",
"workspace",
"workspace.name"
],
"schema": {
"type": "array",
"items": {
"type": "string",
"enum": [
"archived",
"color",
"completed",
"completed_at",
"completed_by",
"completed_by.name",
"created_at",
"created_from_template",
"created_from_template.name",
"current_status",
"current_status.author",
"current_status.author.name",
"current_status.color",
"current_status.created_at",
"current_status.created_by",
"current_status.created_by.name",
"current_status.html_text",
"current_status.modified_at",
"current_status.text",
"current_status.title",
"current_status_update",
"current_status_update.resource_subtype",
"current_status_update.title",
"custom_field_settings",
"custom_field_settings.custom_field",
"custom_field_settings.custom_field.asana_created_field",
"custom_field_settings.custom_field.created_by",
"custom_field_settings.custom_field.created_by.name",
"custom_field_settings.custom_field.currency_code",
"custom_field_settings.custom_field.custom_label",
"custom_field_settings.custom_field.custom_label_position",
"custom_field_settings.custom_field.date_value",
"custom_field_settings.custom_field.date_value.date",
"custom_field_settings.custom_field.date_value.date_time",
"custom_field_settings.custom_field.default_access_level",
"custom_field_settings.custom_field.description",
"custom_field_settings.custom_field.display_value",
"custom_field_settings.custom_field.enabled",
"custom_field_settings.custom_field.enum_options",
"custom_field_settings.custom_field.enum_options.color",
"custom_field_settings.custom_field.enum_options.enabled",
"custom_field_settings.custom_field.enum_options.name",
"custom_field_settings.custom_field.enum_value",
"custom_field_settings.custom_field.enum_value.color",
"custom_field_settings.custom_field.enum_value.enabled",
"custom_field_settings.custom_field.enum_value.name",
"custom_field_settings.custom_field.format",
"custom_field_settings.custom_field.has_notifications_enabled",
"custom_field_settings.custom_field.html_text_value",
"custom_field_settings.custom_field.id_prefix",
"custom_field_settings.custom_field.input_restrictions",
"custom_field_settings.custom_field.is_formula_field",
"custom_field_settings.custom_field.is_global_to_workspace",
"custom_field_settings.custom_field.is_value_read_only",
"custom_field_settings.custom_field.multi_enum_values",
"custom_field_settings.custom_field.multi_enum_values.color",
"custom_field_settings.custom_field.multi_enum_values.enabled",
"custom_field_settings.custom_field.multi_enum_values.name",
"custom_field_settings.custom_field.name",
"custom_field_settings.custom_field.number_value",
"custom_field_settings.custom_field.people_value",
"custom_field_settings.custom_field.people_value.name",
"custom_field_settings.custom_field.precision",
"custom_field_settings.custom_field.privacy_setting",
"custom_field_settings.custom_field.reference_value",
"custom_field_settings.custom_field.reference_value.name",
"custom_field_settings.custom_field.representation_type",
"custom_field_settings.custom_field.resource_subtype",
"custom_field_settings.custom_field.text_value",
"custom_field_settings.custom_field.type",
"custom_field_settings.is_important",
"custom_field_settings.parent",
"custom_field_settings.parent.name",
"custom_field_settings.parent.resource_subtype",
"custom_field_settings.project",
"custom_field_settings.project.name",
"custom_field_settings.project.resource_subtype",
"custom_fields",
"custom_fields.date_value",
"custom_fields.date_value.date",
"custom_fields.date_value.date_time",
"custom_fields.display_value",
"custom_fields.enabled",
"custom_fields.enum_options",
"custom_fields.enum_options.color",
"custom_fields.enum_options.enabled",
"custom_fields.enum_options.name",
"custom_fields.enum_value",
"custom_fields.enum_value.color",
"custom_fields.enum_value.enabled",
"custom_fields.enum_value.name",
"custom_fields.id_prefix",
"custom_fields.input_restrictions",
"custom_fields.is_formula_field",
"custom_fields.multi_enum_values",
"custom_fields.multi_enum_values.color",
"custom_fields.multi_enum_values.enabled",
"custom_fields.multi_enum_values.name",
"custom_fields.name",
"custom_fields.number_value",
"custom_fields.representation_type",
"custom_fields.text_value",
"custom_fields.type",
"custom_type",
"custom_type.asana_created_type_identifier",
"custom_type.name",
"default_access_level",
"default_view",
"due_date",
"due_on",
"followers",
"followers.name",
"html_notes",
"icon",
"members",
"members.name",
"minimum_access_level_for_customization",
"minimum_access_level_for_sharing",
"modified_at",
"name",
"notes",
"owner",
"permalink_url",
"privacy_setting",
"project_brief",
"public",
"resource_subtype",
"start_on",
"team",
"team.name",
"workspace",
"workspace.name"
]
}
},
"style": "form",
"explode": false
}
],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
"data"
],
"additionalProperties": false,
"properties": {
"data": {
"type": "object",
"additionalProperties": false,
"required": [
"name"
],
"properties": {
"name": {
"type": "string"
},
"notes": {
"type": "string"
},
"workspace": {
"type": "string"
},
"team": {
"type": "string"
},
"archived": {
"type": "boolean"
},
"public": {
"type": "boolean"
},
"color": {
"type": "string",
"nullable": true
},
"due_on": {
"type": "string",
"nullable": true,
"format": "date"
},
"start_on": {
"type": "string",
"nullable": true,
"format": "date"
},
"default_view": {
"enum": [
"list",
"board",
"calendar",
"timeline"
]
}
}
}
}
}
},
"application/x-www-form-urlencoded": {
"schema": {
"type": "object",
"additionalProperties": false,
"required": [
"name"
],
"properties": {
"name": {
"type": "string"
},
"notes": {
"type": "string"
},
"workspace": {
"type": "string"
},
"team": {
"type": "string"
},
"archived": {
"type": "boolean"
},
"public": {
"type": "boolean"
},
"color": {
"type": "string",
"nullable": true
},
"due_on": {
"type": "string",
"nullable": true,
"format": "date"
},
"start_on": {
"type": "string",
"nullable": true,
"format": "date"
},
"default_view": {
"enum": [
"list",
"board",
"calendar",
"timeline"
]
}
}
}
}
}
},
"responses": {
"201": {
"description": "Successfully created the specified project.",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"$ref": "#/components/schemas/ProjectResponse"
}
}
}
}
}
},
"400": {
"$ref": "#/components/responses/BadRequest"
},
"401": {
"$ref": "#/components/responses/Unauthorized"
},
"403": {
"$ref": "#/components/responses/Forbidden"
},
"404": {
"$ref": "#/components/responses/NotFound"
},
"500": {
"$ref": "#/components/responses/InternalServerError"
}
},
"security": [
{
"personalAccessToken": []
},
{
"oauth2": [
"projects:write"
]
}
],
"x-readme": {
"code-samples": [
{
"language": "java",
"install": "<dependency><groupId>com.asana</groupId><artifactId>asana</artifactId><version>1.0.0</version></dependency>",
"code": "import com.asana.Client;\n\nClient client = Client.accessToken(\"PERSONAL_ACCESS_TOKEN\");\n\nProject result = client.projects.createProjectForTeam(teamGid)\n .data(\"field\", \"value\")\n .data(\"field\", \"value\")\n .option(\"pretty\", true)\n .execute();"
},
{
"language": "node",
"install": "npm install asana",
"code": "const Asana = require('asana');\n\nlet client = new Asana.ApiClient();\nclient.authentications.token.accessToken = '<YOUR_ACCESS_TOKEN>';\n\nlet projectsApiInstance = new Asana.ProjectsApi(client);\nlet body = {\"data\": {\"<PARAM_1>\": \"<VALUE_1>\", \"<PARAM_2>\": \"<VALUE_2>\",}}; // Object | The new project to create.\nlet team_gid = \"159874\"; // String | Globally unique identifier for the team.\nlet opts = { \n 'opt_fields': \"archived,color,completed,completed_at,completed_by,completed_by.name,created_at,created_from_template,created_from_template.name,current_status,current_status.author,current_status.author.name,current_status.color,current_status.created_at,current_status.created_by,current_status.created_by.name,current_status.html_text,current_status.modified_at,current_status.text,current_status.title,current_status_update,current_status_update.resource_subtype,current_status_update.title,custom_field_settings,custom_field_settings.custom_field,custom_field_settings.custom_field.asana_created_field,custom_field_settings.custom_field.created_by,custom_field_settings.custom_field.created_by.name,custom_field_settings.custom_field.currency_code,custom_field_settings.custom_field.custom_label,custom_field_settings.custom_field.custom_label_position,custom_field_settings.custom_field.date_value,custom_field_settings.custom_field.date_value.date,custom_field_settings.custom_field.date_value.date_time,custom_field_settings.custom_field.default_access_level,custom_field_settings.custom_field.description,custom_field_settings.custom_field.display_value,custom_field_settings.custom_field.enabled,custom_field_settings.custom_field.enum_options,custom_field_settings.custom_field.enum_options.color,custom_field_settings.custom_field.enum_options.enabled,custom_field_settings.custom_field.enum_options.name,custom_field_settings.custom_field.enum_value,custom_field_settings.custom_field.enum_value.color,custom_field_settings.custom_field.enum_value.enabled,custom_field_settings.custom_field.enum_value.name,custom_field_settings.custom_field.format,custom_field_settings.custom_field.has_notifications_enabled,custom_field_settings.custom_field.html_text_value,custom_field_settings.custom_field.id_prefix,custom_field_settings.custom_field.input_restrictions,custom_field_settings.custom_field.is_formula_field,custom_field_settings.custom_field.is_global_to_workspace,custom_field_settings.custom_field.is_value_read_only,custom_field_settings.custom_field.multi_enum_values,custom_field_settings.custom_field.multi_enum_values.color,custom_field_settings.custom_field.multi_enum_values.enabled,custom_field_settings.custom_field.multi_enum_values.name,custom_field_settings.custom_field.name,custom_field_settings.custom_field.number_value,custom_field_settings.custom_field.people_value,custom_field_settings.custom_field.people_value.name,custom_field_settings.custom_field.precision,custom_field_settings.custom_field.privacy_setting,custom_field_settings.custom_field.reference_value,custom_field_settings.custom_field.reference_value.name,custom_field_settings.custom_field.representation_type,custom_field_settings.custom_field.resource_subtype,custom_field_settings.custom_field.text_value,custom_field_settings.custom_field.type,custom_field_settings.is_important,custom_field_settings.parent,custom_field_settings.parent.name,custom_field_settings.parent.resource_subtype,custom_field_settings.project,custom_field_settings.project.name,custom_field_settings.project.resource_subtype,custom_fields,custom_fields.date_value,custom_fields.date_value.date,custom_fields.date_value.date_time,custom_fields.display_value,custom_fields.enabled,custom_fields.enum_options,custom_fields.enum_options.color,custom_fields.enum_options.enabled,custom_fields.enum_options.name,custom_fields.enum_value,custom_fields.enum_value.color,custom_fields.enum_value.enabled,custom_fields.enum_value.name,custom_fields.id_prefix,custom_fields.input_restrictions,custom_fields.is_formula_field,custom_fields.multi_enum_values,custom_fields.multi_enum_values.color,custom_fields.multi_enum_values.enabled,custom_fields.multi_enum_values.name,custom_fields.name,custom_fields.number_value,custom_fields.representation_type,custom_fields.text_value,custom_fields.type,custom_type,custom_type.asana_created_type_identifier,custom_type.name,default_access_level,default_view,due_date,due_on,followers,followers.name,html_notes,icon,members,members.name,minimum_access_level_for_customization,minimum_access_level_for_sharing,modified_at,name,notes,owner,permalink_url,privacy_setting,project_brief,public,resource_subtype,start_on,team,team.name,workspace,workspace.name\"\n};\nprojectsApiInstance.createProjectForTeam(body, team_gid, opts).then((result) => {\n console.log('API called successfully. Returned data: ' + JSON.stringify(result.data, null, 2));\n}, (error) => {\n console.error(error.response.body);\n});",
"name": "node-sdk-v3"
},
{
"language": "node",
"install": "npm install asana@1.0.5",
"code": "const asana = require('asana');\n\nconst client = asana.Client.create().useAccessToken('PERSONAL_ACCESS_TOKEN');\n\nclient.projects.createProjectForTeam(teamGid, {field: \"value\", field: \"value\", pretty: true})\n .then((result) => {\n console.log(result);\n });",
"name": "node-sdk-v1"
},
{
"language": "python",
"install": "pip install asana",
"code": "import asana\nfrom asana.rest import ApiException\nfrom pprint import pprint\n\nconfiguration = asana.Configuration()\nconfiguration.access_token = '<YOUR_ACCESS_TOKEN>'\napi_client = asana.ApiClient(configuration)\n\n# create an instance of the API class\nprojects_api_instance = asana.ProjectsApi(api_client)\nbody = {\"data\": {\"<PARAM_1>\": \"<VALUE_1>\", \"<PARAM_2>\": \"<VALUE_2>\",}} # dict | The new project to create.\nteam_gid = \"159874\" # str | Globally unique identifier for the team.\nopts = {\n 'opt_fields': \"archived,color,completed,completed_at,completed_by,completed_by.name,created_at,created_from_template,created_from_template.name,current_status,current_status.author,current_status.author.name,current_status.color,current_status.created_at,current_status.created_by,current_status.created_by.name,current_status.html_text,current_status.modified_at,current_status.text,current_status.title,current_status_update,current_status_update.resource_subtype,current_status_update.title,custom_field_settings,custom_field_settings.custom_field,custom_field_settings.custom_field.asana_created_field,custom_field_settings.custom_field.created_by,custom_field_settings.custom_field.created_by.name,custom_field_settings.custom_field.currency_code,custom_field_settings.custom_field.custom_label,custom_field_settings.custom_field.custom_label_position,custom_field_settings.custom_field.date_value,custom_field_settings.custom_field.date_value.date,custom_field_settings.custom_field.date_value.date_time,custom_field_settings.custom_field.default_access_level,custom_field_settings.custom_field.description,custom_field_settings.custom_field.display_value,custom_field_settings.custom_field.enabled,custom_field_settings.custom_field.enum_options,custom_field_settings.custom_field.enum_options.color,custom_field_settings.custom_field.enum_options.enabled,custom_field_settings.custom_field.enum_options.name,custom_field_settings.custom_field.enum_value,custom_field_settings.custom_field.enum_value.color,custom_field_settings.custom_field.enum_value.enabled,custom_field_settings.custom_field.enum_value.name,custom_field_settings.custom_field.format,custom_field_settings.custom_field.has_notifications_enabled,custom_field_settings.custom_field.html_text_value,custom_field_settings.custom_field.id_prefix,custom_field_settings.custom_field.input_restrictions,custom_field_settings.custom_field.is_formula_field,custom_field_settings.custom_field.is_global_to_workspace,custom_field_settings.custom_field.is_value_read_only,custom_field_settings.custom_field.multi_enum_values,custom_field_settings.custom_field.multi_enum_values.color,custom_field_settings.custom_field.multi_enum_values.enabled,custom_field_settings.custom_field.multi_enum_values.name,custom_field_settings.custom_field.name,custom_field_settings.custom_field.number_value,custom_field_settings.custom_field.people_value,custom_field_settings.custom_field.people_value.name,custom_field_settings.custom_field.precision,custom_field_settings.custom_field.privacy_setting,custom_field_settings.custom_field.reference_value,custom_field_settings.custom_field.reference_value.name,custom_field_settings.custom_field.representation_type,custom_field_settings.custom_field.resource_subtype,custom_field_settings.custom_field.text_value,custom_field_settings.custom_field.type,custom_field_settings.is_important,custom_field_settings.parent,custom_field_settings.parent.name,custom_field_settings.parent.resource_subtype,custom_field_settings.project,custom_field_settings.project.name,custom_field_settings.project.resource_subtype,custom_fields,custom_fields.date_value,custom_fields.date_value.date,custom_fields.date_value.date_time,custom_fields.display_value,custom_fields.enabled,custom_fields.enum_options,custom_fields.enum_options.color,custom_fields.enum_options.enabled,custom_fields.enum_options.name,custom_fields.enum_value,custom_fields.enum_value.color,custom_fields.enum_value.enabled,custom_fields.enum_value.name,custom_fields.id_prefix,custom_fields.input_restrictions,custom_fields.is_formula_field,custom_fields.multi_enum_values,custom_fields.multi_enum_values.color,custom_fields.multi_enum_values.enabled,custom_fields.multi_enum_values.name,custom_fields.name,custom_fields.number_value,custom_fields.representation_type,custom_fields.text_value,custom_fields.type,custom_type,custom_type.asana_created_type_identifier,custom_type.name,default_access_level,default_view,due_date,due_on,followers,followers.name,html_notes,icon,members,members.name,minimum_access_level_for_customization,minimum_access_level_for_sharing,modified_at,name,notes,owner,permalink_url,privacy_setting,project_brief,public,resource_subtype,start_on,team,team.name,workspace,workspace.name\", # list[str] | 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.\n}\n\ntry:\n # Create a project in a team\n api_response = projects_api_instance.create_project_for_team(body, team_gid, opts)\n pprint(api_response)\nexcept ApiException as e:\n print(\"Exception when calling ProjectsApi->create_project_for_team: %s\\n\" % e)",
"name": "python-sdk-v5"
},
{
"language": "python",
"install": "pip install asana==3.2.3",
"code": "import asana\n\nclient = asana.Client.access_token('PERSONAL_ACCESS_TOKEN')\n\nresult = client.projects.create_project_for_team(team_gid, {'field': 'value', 'field': 'value'}, opt_pretty=True)",
"name": "python-sdk-v3"
},
{
"language": "php",
"install": "composer require asana/asana",
"code": "<?php\nrequire 'vendor/autoload.php';\n\n$client = Asana\\Client::accessToken('PERSONAL_ACCESS_TOKEN');\n\n$result = $client->projects->createProjectForTeam($team_gid, array('field' => 'value', 'field' => 'value'), array('opt_pretty' => 'true'))"
},
{
"language": "ruby",
"install": "gem install asana",
"code": "require 'asana'\n\nclient = Asana::Client.new do |c|\n c.authentication :access_token, 'PERSONAL_ACCESS_TOKEN'\nend\n\nresult = client.projects.create_project_for_team(team_gid: 'team_gid', field: \"value\", field: \"value\", options: {pretty: true})"
}
]
},
"x-purple-suite-runtime": "modeled-core",
"x-purple-suite-supported-query": [
"opt_pretty",
"opt_fields"
],
"x-purple-suite-supported-response-fields": [
"gid",
"resource_type",
"resource_subtype",
"name",
"notes",
"completed",
"completed_at",
"created_at",
"modified_at",
"assignee",
"assignee_status",
"workspace",
"projects",
"memberships",
"parent",
"due_on",
"start_on",
"tags",
"dependencies",
"num_subtasks",
"archived",
"public",
"color",
"default_view",
"team",
"project",
"section",
"text",
"created_by",
"target",
"type",
"email",
"photo",
"is_organization"
]
}
GET /api/1.0/workspaces/{workspace_gid}/projects
Get all projects in a workspace
<b>Required scope: </b><code>projects:read</code>
Returns the compact project records for all projects in the workspace.
*Note: This endpoint may timeout for large domains. To fetch projects shared with a specific team, use `GET /memberships` with `member` set to the team GID and `resource_subtype` set to `project_membership`.*
The persistent core model supports the response and query fields named in x-purple-suite-supported-response-fields and x-purple-suite-supported-query. Other fields/options return an explicit 400 errors envelope.
Authentication
[
{
"personalAccessToken": []
},
{
"oauth2": [
"projects:read"
]
}
]
Path-level parameters and metadata
{
"parameters": [
{
"$ref": "#/components/parameters/workspace_path_gid"
},
{
"$ref": "#/components/parameters/pretty"
}
]
}
Request, responses and operation details
{
"summary": "Get all projects in a workspace",
"description": "<b>Required scope: </b><code>projects:read</code>\n\nReturns the compact project records for all projects in the workspace.\n*Note: This endpoint may timeout for large domains. To fetch projects shared with a specific team, use `GET /memberships` with `member` set to the team GID and `resource_subtype` set to `project_membership`.*\n\nThe persistent core model supports the response and query fields named in x-purple-suite-supported-response-fields and x-purple-suite-supported-query. Other fields/options return an explicit 400 errors envelope.",
"tags": [
"Projects"
],
"operationId": "getProjectsForWorkspace",
"parameters": [
{
"$ref": "#/components/parameters/limit"
},
{
"$ref": "#/components/parameters/offset"
},
{
"$ref": "#/components/parameters/archived_query_param"
},
{
"name": "opt_fields",
"in": "query",
"description": "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. Properties can include nested fields. To learn more, see the [input/output options guide](/docs/inputoutput-options#selecting-nested-fields).",
"required": false,
"example": [
"archived",
"color",
"completed",
"completed_at",
"completed_by",
"completed_by.name",
"created_at",
"created_from_template",
"created_from_template.name",
"current_status",
"current_status.author",
"current_status.author.name",
"current_status.color",
"current_status.created_at",
"current_status.created_by",
"current_status.created_by.name",
"current_status.html_text",
"current_status.modified_at",
"current_status.text",
"current_status.title",
"current_status_update",
"current_status_update.resource_subtype",
"current_status_update.title",
"custom_field_settings",
"custom_field_settings.custom_field",
"custom_field_settings.custom_field.asana_created_field",
"custom_field_settings.custom_field.created_by",
"custom_field_settings.custom_field.created_by.name",
"custom_field_settings.custom_field.currency_code",
"custom_field_settings.custom_field.custom_label",
"custom_field_settings.custom_field.custom_label_position",
"custom_field_settings.custom_field.date_value",
"custom_field_settings.custom_field.date_value.date",
"custom_field_settings.custom_field.date_value.date_time",
"custom_field_settings.custom_field.default_access_level",
"custom_field_settings.custom_field.description",
"custom_field_settings.custom_field.display_value",
"custom_field_settings.custom_field.enabled",
"custom_field_settings.custom_field.enum_options",
"custom_field_settings.custom_field.enum_options.color",
"custom_field_settings.custom_field.enum_options.enabled",
"custom_field_settings.custom_field.enum_options.name",
"custom_field_settings.custom_field.enum_value",
"custom_field_settings.custom_field.enum_value.color",
"custom_field_settings.custom_field.enum_value.enabled",
"custom_field_settings.custom_field.enum_value.name",
"custom_field_settings.custom_field.format",
"custom_field_settings.custom_field.has_notifications_enabled",
"custom_field_settings.custom_field.html_text_value",
"custom_field_settings.custom_field.id_prefix",
"custom_field_settings.custom_field.input_restrictions",
"custom_field_settings.custom_field.is_formula_field",
"custom_field_settings.custom_field.is_global_to_workspace",
"custom_field_settings.custom_field.is_value_read_only",
"custom_field_settings.custom_field.multi_enum_values",
"custom_field_settings.custom_field.multi_enum_values.color",
"custom_field_settings.custom_field.multi_enum_values.enabled",
"custom_field_settings.custom_field.multi_enum_values.name",
"custom_field_settings.custom_field.name",
"custom_field_settings.custom_field.number_value",
"custom_field_settings.custom_field.people_value",
"custom_field_settings.custom_field.people_value.name",
"custom_field_settings.custom_field.precision",
"custom_field_settings.custom_field.privacy_setting",
"custom_field_settings.custom_field.reference_value",
"custom_field_settings.custom_field.reference_value.name",
"custom_field_settings.custom_field.representation_type",
"custom_field_settings.custom_field.resource_subtype",
"custom_field_settings.custom_field.text_value",
"custom_field_settings.custom_field.type",
"custom_field_settings.is_important",
"custom_field_settings.parent",
"custom_field_settings.parent.name",
"custom_field_settings.parent.resource_subtype",
"custom_field_settings.project",
"custom_field_settings.project.name",
"custom_field_settings.project.resource_subtype",
"custom_fields",
"custom_fields.date_value",
"custom_fields.date_value.date",
"custom_fields.date_value.date_time",
"custom_fields.display_value",
"custom_fields.enabled",
"custom_fields.enum_options",
"custom_fields.enum_options.color",
"custom_fields.enum_options.enabled",
"custom_fields.enum_options.name",
"custom_fields.enum_value",
"custom_fields.enum_value.color",
"custom_fields.enum_value.enabled",
"custom_fields.enum_value.name",
"custom_fields.id_prefix",
"custom_fields.input_restrictions",
"custom_fields.is_formula_field",
"custom_fields.multi_enum_values",
"custom_fields.multi_enum_values.color",
"custom_fields.multi_enum_values.enabled",
"custom_fields.multi_enum_values.name",
"custom_fields.name",
"custom_fields.number_value",
"custom_fields.representation_type",
"custom_fields.text_value",
"custom_fields.type",
"custom_type",
"custom_type.asana_created_type_identifier",
"custom_type.name",
"default_access_level",
"default_view",
"due_date",
"due_on",
"followers",
"followers.name",
"html_notes",
"icon",
"members",
"members.name",
"minimum_access_level_for_customization",
"minimum_access_level_for_sharing",
"modified_at",
"name",
"notes",
"offset",
"owner",
"path",
"permalink_url",
"privacy_setting",
"project_brief",
"public",
"resource_subtype",
"start_on",
"team",
"team.name",
"uri",
"workspace",
"workspace.name"
],
"schema": {
"type": "array",
"items": {
"type": "string",
"enum": [
"archived",
"color",
"completed",
"completed_at",
"completed_by",
"completed_by.name",
"created_at",
"created_from_template",
"created_from_template.name",
"current_status",
"current_status.author",
"current_status.author.name",
"current_status.color",
"current_status.created_at",
"current_status.created_by",
"current_status.created_by.name",
"current_status.html_text",
"current_status.modified_at",
"current_status.text",
"current_status.title",
"current_status_update",
"current_status_update.resource_subtype",
"current_status_update.title",
"custom_field_settings",
"custom_field_settings.custom_field",
"custom_field_settings.custom_field.asana_created_field",
"custom_field_settings.custom_field.created_by",
"custom_field_settings.custom_field.created_by.name",
"custom_field_settings.custom_field.currency_code",
"custom_field_settings.custom_field.custom_label",
"custom_field_settings.custom_field.custom_label_position",
"custom_field_settings.custom_field.date_value",
"custom_field_settings.custom_field.date_value.date",
"custom_field_settings.custom_field.date_value.date_time",
"custom_field_settings.custom_field.default_access_level",
"custom_field_settings.custom_field.description",
"custom_field_settings.custom_field.display_value",
"custom_field_settings.custom_field.enabled",
"custom_field_settings.custom_field.enum_options",
"custom_field_settings.custom_field.enum_options.color",
"custom_field_settings.custom_field.enum_options.enabled",
"custom_field_settings.custom_field.enum_options.name",
"custom_field_settings.custom_field.enum_value",
"custom_field_settings.custom_field.enum_value.color",
"custom_field_settings.custom_field.enum_value.enabled",
"custom_field_settings.custom_field.enum_value.name",
"custom_field_settings.custom_field.format",
"custom_field_settings.custom_field.has_notifications_enabled",
"custom_field_settings.custom_field.html_text_value",
"custom_field_settings.custom_field.id_prefix",
"custom_field_settings.custom_field.input_restrictions",
"custom_field_settings.custom_field.is_formula_field",
"custom_field_settings.custom_field.is_global_to_workspace",
"custom_field_settings.custom_field.is_value_read_only",
"custom_field_settings.custom_field.multi_enum_values",
"custom_field_settings.custom_field.multi_enum_values.color",
"custom_field_settings.custom_field.multi_enum_values.enabled",
"custom_field_settings.custom_field.multi_enum_values.name",
"custom_field_settings.custom_field.name",
"custom_field_settings.custom_field.number_value",
"custom_field_settings.custom_field.people_value",
"custom_field_settings.custom_field.people_value.name",
"custom_field_settings.custom_field.precision",
"custom_field_settings.custom_field.privacy_setting",
"custom_field_settings.custom_field.reference_value",
"custom_field_settings.custom_field.reference_value.name",
"custom_field_settings.custom_field.representation_type",
"custom_field_settings.custom_field.resource_subtype",
"custom_field_settings.custom_field.text_value",
"custom_field_settings.custom_field.type",
"custom_field_settings.is_important",
"custom_field_settings.parent",
"custom_field_settings.parent.name",
"custom_field_settings.parent.resource_subtype",
"custom_field_settings.project",
"custom_field_settings.project.name",
"custom_field_settings.project.resource_subtype",
"custom_fields",
"custom_fields.date_value",
"custom_fields.date_value.date",
"custom_fields.date_value.date_time",
"custom_fields.display_value",
"custom_fields.enabled",
"custom_fields.enum_options",
"custom_fields.enum_options.color",
"custom_fields.enum_options.enabled",
"custom_fields.enum_options.name",
"custom_fields.enum_value",
"custom_fields.enum_value.color",
"custom_fields.enum_value.enabled",
"custom_fields.enum_value.name",
"custom_fields.id_prefix",
"custom_fields.input_restrictions",
"custom_fields.is_formula_field",
"custom_fields.multi_enum_values",
"custom_fields.multi_enum_values.color",
"custom_fields.multi_enum_values.enabled",
"custom_fields.multi_enum_values.name",
"custom_fields.name",
"custom_fields.number_value",
"custom_fields.representation_type",
"custom_fields.text_value",
"custom_fields.type",
"custom_type",
"custom_type.asana_created_type_identifier",
"custom_type.name",
"default_access_level",
"default_view",
"due_date",
"due_on",
"followers",
"followers.name",
"html_notes",
"icon",
"members",
"members.name",
"minimum_access_level_for_customization",
"minimum_access_level_for_sharing",
"modified_at",
"name",
"notes",
"offset",
"owner",
"path",
"permalink_url",
"privacy_setting",
"project_brief",
"public",
"resource_subtype",
"start_on",
"team",
"team.name",
"uri",
"workspace",
"workspace.name"
]
}
},
"style": "form",
"explode": false
}
],
"responses": {
"200": {
"description": "Successfully retrieved the requested workspace's projects.",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"type": "array",
"items": {
"$ref": "#/components/schemas/ProjectCompact"
}
},
"next_page": {
"$ref": "#/components/schemas/NextPage"
}
}
}
}
}
},
"400": {
"$ref": "#/components/responses/BadRequest"
},
"401": {
"$ref": "#/components/responses/Unauthorized"
},
"403": {
"$ref": "#/components/responses/Forbidden"
},
"404": {
"$ref": "#/components/responses/NotFound"
},
"500": {
"$ref": "#/components/responses/InternalServerError"
}
},
"security": [
{
"personalAccessToken": []
},
{
"oauth2": [
"projects:read"
]
}
],
"x-readme": {
"code-samples": [
{
"language": "java",
"install": "<dependency><groupId>com.asana</groupId><artifactId>asana</artifactId><version>1.0.0</version></dependency>",
"code": "import com.asana.Client;\n\nClient client = Client.accessToken(\"PERSONAL_ACCESS_TOKEN\");\n\nList<Project> result = client.projects.getProjectsForWorkspace(workspaceGid, archived)\n .option(\"pretty\", true)\n .execute();"
},
{
"language": "node",
"install": "npm install asana",
"code": "const Asana = require('asana');\n\nlet client = new Asana.ApiClient();\nclient.authentications.token.accessToken = '<YOUR_ACCESS_TOKEN>';\n\nlet projectsApiInstance = new Asana.ProjectsApi(client);\nlet workspace_gid = \"12345\"; // String | Globally unique identifier for the workspace or organization.\nlet opts = { \n 'limit': 50, \n 'offset': \"eyJ0eXAiOJiKV1iQLCJhbGciOiJIUzI1NiJ9\", \n 'archived': false, \n 'opt_fields': \"archived,color,completed,completed_at,completed_by,completed_by.name,created_at,created_from_template,created_from_template.name,current_status,current_status.author,current_status.author.name,current_status.color,current_status.created_at,current_status.created_by,current_status.created_by.name,current_status.html_text,current_status.modified_at,current_status.text,current_status.title,current_status_update,current_status_update.resource_subtype,current_status_update.title,custom_field_settings,custom_field_settings.custom_field,custom_field_settings.custom_field.asana_created_field,custom_field_settings.custom_field.created_by,custom_field_settings.custom_field.created_by.name,custom_field_settings.custom_field.currency_code,custom_field_settings.custom_field.custom_label,custom_field_settings.custom_field.custom_label_position,custom_field_settings.custom_field.date_value,custom_field_settings.custom_field.date_value.date,custom_field_settings.custom_field.date_value.date_time,custom_field_settings.custom_field.default_access_level,custom_field_settings.custom_field.description,custom_field_settings.custom_field.display_value,custom_field_settings.custom_field.enabled,custom_field_settings.custom_field.enum_options,custom_field_settings.custom_field.enum_options.color,custom_field_settings.custom_field.enum_options.enabled,custom_field_settings.custom_field.enum_options.name,custom_field_settings.custom_field.enum_value,custom_field_settings.custom_field.enum_value.color,custom_field_settings.custom_field.enum_value.enabled,custom_field_settings.custom_field.enum_value.name,custom_field_settings.custom_field.format,custom_field_settings.custom_field.has_notifications_enabled,custom_field_settings.custom_field.html_text_value,custom_field_settings.custom_field.id_prefix,custom_field_settings.custom_field.input_restrictions,custom_field_settings.custom_field.is_formula_field,custom_field_settings.custom_field.is_global_to_workspace,custom_field_settings.custom_field.is_value_read_only,custom_field_settings.custom_field.multi_enum_values,custom_field_settings.custom_field.multi_enum_values.color,custom_field_settings.custom_field.multi_enum_values.enabled,custom_field_settings.custom_field.multi_enum_values.name,custom_field_settings.custom_field.name,custom_field_settings.custom_field.number_value,custom_field_settings.custom_field.people_value,custom_field_settings.custom_field.people_value.name,custom_field_settings.custom_field.precision,custom_field_settings.custom_field.privacy_setting,custom_field_settings.custom_field.reference_value,custom_field_settings.custom_field.reference_value.name,custom_field_settings.custom_field.representation_type,custom_field_settings.custom_field.resource_subtype,custom_field_settings.custom_field.text_value,custom_field_settings.custom_field.type,custom_field_settings.is_important,custom_field_settings.parent,custom_field_settings.parent.name,custom_field_settings.parent.resource_subtype,custom_field_settings.project,custom_field_settings.project.name,custom_field_settings.project.resource_subtype,custom_fields,custom_fields.date_value,custom_fields.date_value.date,custom_fields.date_value.date_time,custom_fields.display_value,custom_fields.enabled,custom_fields.enum_options,custom_fields.enum_options.color,custom_fields.enum_options.enabled,custom_fields.enum_options.name,custom_fields.enum_value,custom_fields.enum_value.color,custom_fields.enum_value.enabled,custom_fields.enum_value.name,custom_fields.id_prefix,custom_fields.input_restrictions,custom_fields.is_formula_field,custom_fields.multi_enum_values,custom_fields.multi_enum_values.color,custom_fields.multi_enum_values.enabled,custom_fields.multi_enum_values.name,custom_fields.name,custom_fields.number_value,custom_fields.representation_type,custom_fields.text_value,custom_fields.type,custom_type,custom_type.asana_created_type_identifier,custom_type.name,default_access_level,default_view,due_date,due_on,followers,followers.name,html_notes,icon,members,members.name,minimum_access_level_for_customization,minimum_access_level_for_sharing,modified_at,name,notes,offset,owner,path,permalink_url,privacy_setting,project_brief,public,resource_subtype,start_on,team,team.name,uri,workspace,workspace.name\"\n};\nprojectsApiInstance.getProjectsForWorkspace(workspace_gid, opts).then((result) => {\n console.log('API called successfully. Returned data: ' + JSON.stringify(result.data, null, 2));\n}, (error) => {\n console.error(error.response.body);\n});",
"name": "node-sdk-v3"
},
{
"language": "node",
"install": "npm install asana@1.0.5",
"code": "const asana = require('asana');\n\nconst client = asana.Client.create().useAccessToken('PERSONAL_ACCESS_TOKEN');\n\nclient.projects.getProjectsForWorkspace(workspaceGid, {param: \"value\", param: \"value\", opt_pretty: true})\n .then((result) => {\n console.log(result);\n });",
"name": "node-sdk-v1"
},
{
"language": "python",
"install": "pip install asana",
"code": "import asana\nfrom asana.rest import ApiException\nfrom pprint import pprint\n\nconfiguration = asana.Configuration()\nconfiguration.access_token = '<YOUR_ACCESS_TOKEN>'\napi_client = asana.ApiClient(configuration)\n\n# create an instance of the API class\nprojects_api_instance = asana.ProjectsApi(api_client)\nworkspace_gid = \"12345\" # str | Globally unique identifier for the workspace or organization.\nopts = {\n 'limit': 50, # int | Results per page. The number of objects to return per page. The value must be between 1 and 100.\n 'offset': \"eyJ0eXAiOJiKV1iQLCJhbGciOiJIUzI1NiJ9\", # str | 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.*\n 'archived': False, # bool | Only return projects whose `archived` field takes on the value of this parameter.\n 'opt_fields': \"archived,color,completed,completed_at,completed_by,completed_by.name,created_at,created_from_template,created_from_template.name,current_status,current_status.author,current_status.author.name,current_status.color,current_status.created_at,current_status.created_by,current_status.created_by.name,current_status.html_text,current_status.modified_at,current_status.text,current_status.title,current_status_update,current_status_update.resource_subtype,current_status_update.title,custom_field_settings,custom_field_settings.custom_field,custom_field_settings.custom_field.asana_created_field,custom_field_settings.custom_field.created_by,custom_field_settings.custom_field.created_by.name,custom_field_settings.custom_field.currency_code,custom_field_settings.custom_field.custom_label,custom_field_settings.custom_field.custom_label_position,custom_field_settings.custom_field.date_value,custom_field_settings.custom_field.date_value.date,custom_field_settings.custom_field.date_value.date_time,custom_field_settings.custom_field.default_access_level,custom_field_settings.custom_field.description,custom_field_settings.custom_field.display_value,custom_field_settings.custom_field.enabled,custom_field_settings.custom_field.enum_options,custom_field_settings.custom_field.enum_options.color,custom_field_settings.custom_field.enum_options.enabled,custom_field_settings.custom_field.enum_options.name,custom_field_settings.custom_field.enum_value,custom_field_settings.custom_field.enum_value.color,custom_field_settings.custom_field.enum_value.enabled,custom_field_settings.custom_field.enum_value.name,custom_field_settings.custom_field.format,custom_field_settings.custom_field.has_notifications_enabled,custom_field_settings.custom_field.html_text_value,custom_field_settings.custom_field.id_prefix,custom_field_settings.custom_field.input_restrictions,custom_field_settings.custom_field.is_formula_field,custom_field_settings.custom_field.is_global_to_workspace,custom_field_settings.custom_field.is_value_read_only,custom_field_settings.custom_field.multi_enum_values,custom_field_settings.custom_field.multi_enum_values.color,custom_field_settings.custom_field.multi_enum_values.enabled,custom_field_settings.custom_field.multi_enum_values.name,custom_field_settings.custom_field.name,custom_field_settings.custom_field.number_value,custom_field_settings.custom_field.people_value,custom_field_settings.custom_field.people_value.name,custom_field_settings.custom_field.precision,custom_field_settings.custom_field.privacy_setting,custom_field_settings.custom_field.reference_value,custom_field_settings.custom_field.reference_value.name,custom_field_settings.custom_field.representation_type,custom_field_settings.custom_field.resource_subtype,custom_field_settings.custom_field.text_value,custom_field_settings.custom_field.type,custom_field_settings.is_important,custom_field_settings.parent,custom_field_settings.parent.name,custom_field_settings.parent.resource_subtype,custom_field_settings.project,custom_field_settings.project.name,custom_field_settings.project.resource_subtype,custom_fields,custom_fields.date_value,custom_fields.date_value.date,custom_fields.date_value.date_time,custom_fields.display_value,custom_fields.enabled,custom_fields.enum_options,custom_fields.enum_options.color,custom_fields.enum_options.enabled,custom_fields.enum_options.name,custom_fields.enum_value,custom_fields.enum_value.color,custom_fields.enum_value.enabled,custom_fields.enum_value.name,custom_fields.id_prefix,custom_fields.input_restrictions,custom_fields.is_formula_field,custom_fields.multi_enum_values,custom_fields.multi_enum_values.color,custom_fields.multi_enum_values.enabled,custom_fields.multi_enum_values.name,custom_fields.name,custom_fields.number_value,custom_fields.representation_type,custom_fields.text_value,custom_fields.type,custom_type,custom_type.asana_created_type_identifier,custom_type.name,default_access_level,default_view,due_date,due_on,followers,followers.name,html_notes,icon,members,members.name,minimum_access_level_for_customization,minimum_access_level_for_sharing,modified_at,name,notes,offset,owner,path,permalink_url,privacy_setting,project_brief,public,resource_subtype,start_on,team,team.name,uri,workspace,workspace.name\", # list[str] | 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.\n}\n\ntry:\n # Get all projects in a workspace\n api_response = projects_api_instance.get_projects_for_workspace(workspace_gid, opts)\n for data in api_response:\n pprint(data)\nexcept ApiException as e:\n print(\"Exception when calling ProjectsApi->get_projects_for_workspace: %s\\n\" % e)",
"name": "python-sdk-v5"
},
{
"language": "python",
"install": "pip install asana==3.2.3",
"code": "import asana\n\nclient = asana.Client.access_token('PERSONAL_ACCESS_TOKEN')\n\nresult = client.projects.get_projects_for_workspace(workspace_gid, {'param': 'value', 'param': 'value'}, opt_pretty=True)",
"name": "python-sdk-v3"
},
{
"language": "php",
"install": "composer require asana/asana",
"code": "<?php\nrequire 'vendor/autoload.php';\n\n$client = Asana\\Client::accessToken('PERSONAL_ACCESS_TOKEN');\n\n$result = $client->projects->getProjectsForWorkspace($workspace_gid, array('param' => 'value', 'param' => 'value'), array('opt_pretty' => 'true'))"
},
{
"language": "ruby",
"install": "gem install asana",
"code": "require 'asana'\n\nclient = Asana::Client.new do |c|\n c.authentication :access_token, 'PERSONAL_ACCESS_TOKEN'\nend\n\nresult = client.projects.get_projects_for_workspace(workspace_gid: 'workspace_gid', param: \"value\", param: \"value\", options: {pretty: true})"
}
]
},
"x-purple-suite-runtime": "modeled-core",
"x-purple-suite-supported-query": [
"opt_pretty",
"limit",
"offset",
"archived",
"opt_fields"
],
"x-purple-suite-supported-response-fields": [
"gid",
"resource_type",
"resource_subtype",
"name",
"notes",
"completed",
"completed_at",
"created_at",
"modified_at",
"assignee",
"assignee_status",
"workspace",
"projects",
"memberships",
"parent",
"due_on",
"start_on",
"tags",
"dependencies",
"num_subtasks",
"archived",
"public",
"color",
"default_view",
"team",
"project",
"section",
"text",
"created_by",
"target",
"type",
"email",
"photo",
"is_organization"
]
}
POST /api/1.0/workspaces/{workspace_gid}/projects
Create a project in a workspace
<b>Required scope: </b><code>projects:write</code>
Creates a project in the workspace.
If the workspace for your project is an organization, you must also
supply a team to share the project with.
Returns the full record of the newly created project.
The persistent core model supports the response and query fields named in x-purple-suite-supported-response-fields and x-purple-suite-supported-query. Other fields/options return an explicit 400 errors envelope.
Authentication
[
{
"personalAccessToken": []
},
{
"oauth2": [
"projects:write"
]
}
]
Path-level parameters and metadata
{
"parameters": [
{
"$ref": "#/components/parameters/workspace_path_gid"
},
{
"$ref": "#/components/parameters/pretty"
}
]
}
Request, responses and operation details
{
"summary": "Create a project in a workspace",
"description": "<b>Required scope: </b><code>projects:write</code>\n\nCreates a project in the workspace.\n\nIf the workspace for your project is an organization, you must also\nsupply a team to share the project with.\n\nReturns the full record of the newly created project.\n\nThe persistent core model supports the response and query fields named in x-purple-suite-supported-response-fields and x-purple-suite-supported-query. Other fields/options return an explicit 400 errors envelope.",
"tags": [
"Projects"
],
"operationId": "createProjectForWorkspace",
"parameters": [
{
"name": "opt_fields",
"in": "query",
"description": "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. Properties can include nested fields. To learn more, see the [input/output options guide](/docs/inputoutput-options#selecting-nested-fields).",
"required": false,
"example": [
"archived",
"color",
"completed",
"completed_at",
"completed_by",
"completed_by.name",
"created_at",
"created_from_template",
"created_from_template.name",
"current_status",
"current_status.author",
"current_status.author.name",
"current_status.color",
"current_status.created_at",
"current_status.created_by",
"current_status.created_by.name",
"current_status.html_text",
"current_status.modified_at",
"current_status.text",
"current_status.title",
"current_status_update",
"current_status_update.resource_subtype",
"current_status_update.title",
"custom_field_settings",
"custom_field_settings.custom_field",
"custom_field_settings.custom_field.asana_created_field",
"custom_field_settings.custom_field.created_by",
"custom_field_settings.custom_field.created_by.name",
"custom_field_settings.custom_field.currency_code",
"custom_field_settings.custom_field.custom_label",
"custom_field_settings.custom_field.custom_label_position",
"custom_field_settings.custom_field.date_value",
"custom_field_settings.custom_field.date_value.date",
"custom_field_settings.custom_field.date_value.date_time",
"custom_field_settings.custom_field.default_access_level",
"custom_field_settings.custom_field.description",
"custom_field_settings.custom_field.display_value",
"custom_field_settings.custom_field.enabled",
"custom_field_settings.custom_field.enum_options",
"custom_field_settings.custom_field.enum_options.color",
"custom_field_settings.custom_field.enum_options.enabled",
"custom_field_settings.custom_field.enum_options.name",
"custom_field_settings.custom_field.enum_value",
"custom_field_settings.custom_field.enum_value.color",
"custom_field_settings.custom_field.enum_value.enabled",
"custom_field_settings.custom_field.enum_value.name",
"custom_field_settings.custom_field.format",
"custom_field_settings.custom_field.has_notifications_enabled",
"custom_field_settings.custom_field.html_text_value",
"custom_field_settings.custom_field.id_prefix",
"custom_field_settings.custom_field.input_restrictions",
"custom_field_settings.custom_field.is_formula_field",
"custom_field_settings.custom_field.is_global_to_workspace",
"custom_field_settings.custom_field.is_value_read_only",
"custom_field_settings.custom_field.multi_enum_values",
"custom_field_settings.custom_field.multi_enum_values.color",
"custom_field_settings.custom_field.multi_enum_values.enabled",
"custom_field_settings.custom_field.multi_enum_values.name",
"custom_field_settings.custom_field.name",
"custom_field_settings.custom_field.number_value",
"custom_field_settings.custom_field.people_value",
"custom_field_settings.custom_field.people_value.name",
"custom_field_settings.custom_field.precision",
"custom_field_settings.custom_field.privacy_setting",
"custom_field_settings.custom_field.reference_value",
"custom_field_settings.custom_field.reference_value.name",
"custom_field_settings.custom_field.representation_type",
"custom_field_settings.custom_field.resource_subtype",
"custom_field_settings.custom_field.text_value",
"custom_field_settings.custom_field.type",
"custom_field_settings.is_important",
"custom_field_settings.parent",
"custom_field_settings.parent.name",
"custom_field_settings.parent.resource_subtype",
"custom_field_settings.project",
"custom_field_settings.project.name",
"custom_field_settings.project.resource_subtype",
"custom_fields",
"custom_fields.date_value",
"custom_fields.date_value.date",
"custom_fields.date_value.date_time",
"custom_fields.display_value",
"custom_fields.enabled",
"custom_fields.enum_options",
"custom_fields.enum_options.color",
"custom_fields.enum_options.enabled",
"custom_fields.enum_options.name",
"custom_fields.enum_value",
"custom_fields.enum_value.color",
"custom_fields.enum_value.enabled",
"custom_fields.enum_value.name",
"custom_fields.id_prefix",
"custom_fields.input_restrictions",
"custom_fields.is_formula_field",
"custom_fields.multi_enum_values",
"custom_fields.multi_enum_values.color",
"custom_fields.multi_enum_values.enabled",
"custom_fields.multi_enum_values.name",
"custom_fields.name",
"custom_fields.number_value",
"custom_fields.representation_type",
"custom_fields.text_value",
"custom_fields.type",
"custom_type",
"custom_type.asana_created_type_identifier",
"custom_type.name",
"default_access_level",
"default_view",
"due_date",
"due_on",
"followers",
"followers.name",
"html_notes",
"icon",
"members",
"members.name",
"minimum_access_level_for_customization",
"minimum_access_level_for_sharing",
"modified_at",
"name",
"notes",
"owner",
"permalink_url",
"privacy_setting",
"project_brief",
"public",
"resource_subtype",
"start_on",
"team",
"team.name",
"workspace",
"workspace.name"
],
"schema": {
"type": "array",
"items": {
"type": "string",
"enum": [
"archived",
"color",
"completed",
"completed_at",
"completed_by",
"completed_by.name",
"created_at",
"created_from_template",
"created_from_template.name",
"current_status",
"current_status.author",
"current_status.author.name",
"current_status.color",
"current_status.created_at",
"current_status.created_by",
"current_status.created_by.name",
"current_status.html_text",
"current_status.modified_at",
"current_status.text",
"current_status.title",
"current_status_update",
"current_status_update.resource_subtype",
"current_status_update.title",
"custom_field_settings",
"custom_field_settings.custom_field",
"custom_field_settings.custom_field.asana_created_field",
"custom_field_settings.custom_field.created_by",
"custom_field_settings.custom_field.created_by.name",
"custom_field_settings.custom_field.currency_code",
"custom_field_settings.custom_field.custom_label",
"custom_field_settings.custom_field.custom_label_position",
"custom_field_settings.custom_field.date_value",
"custom_field_settings.custom_field.date_value.date",
"custom_field_settings.custom_field.date_value.date_time",
"custom_field_settings.custom_field.default_access_level",
"custom_field_settings.custom_field.description",
"custom_field_settings.custom_field.display_value",
"custom_field_settings.custom_field.enabled",
"custom_field_settings.custom_field.enum_options",
"custom_field_settings.custom_field.enum_options.color",
"custom_field_settings.custom_field.enum_options.enabled",
"custom_field_settings.custom_field.enum_options.name",
"custom_field_settings.custom_field.enum_value",
"custom_field_settings.custom_field.enum_value.color",
"custom_field_settings.custom_field.enum_value.enabled",
"custom_field_settings.custom_field.enum_value.name",
"custom_field_settings.custom_field.format",
"custom_field_settings.custom_field.has_notifications_enabled",
"custom_field_settings.custom_field.html_text_value",
"custom_field_settings.custom_field.id_prefix",
"custom_field_settings.custom_field.input_restrictions",
"custom_field_settings.custom_field.is_formula_field",
"custom_field_settings.custom_field.is_global_to_workspace",
"custom_field_settings.custom_field.is_value_read_only",
"custom_field_settings.custom_field.multi_enum_values",
"custom_field_settings.custom_field.multi_enum_values.color",
"custom_field_settings.custom_field.multi_enum_values.enabled",
"custom_field_settings.custom_field.multi_enum_values.name",
"custom_field_settings.custom_field.name",
"custom_field_settings.custom_field.number_value",
"custom_field_settings.custom_field.people_value",
"custom_field_settings.custom_field.people_value.name",
"custom_field_settings.custom_field.precision",
"custom_field_settings.custom_field.privacy_setting",
"custom_field_settings.custom_field.reference_value",
"custom_field_settings.custom_field.reference_value.name",
"custom_field_settings.custom_field.representation_type",
"custom_field_settings.custom_field.resource_subtype",
"custom_field_settings.custom_field.text_value",
"custom_field_settings.custom_field.type",
"custom_field_settings.is_important",
"custom_field_settings.parent",
"custom_field_settings.parent.name",
"custom_field_settings.parent.resource_subtype",
"custom_field_settings.project",
"custom_field_settings.project.name",
"custom_field_settings.project.resource_subtype",
"custom_fields",
"custom_fields.date_value",
"custom_fields.date_value.date",
"custom_fields.date_value.date_time",
"custom_fields.display_value",
"custom_fields.enabled",
"custom_fields.enum_options",
"custom_fields.enum_options.color",
"custom_fields.enum_options.enabled",
"custom_fields.enum_options.name",
"custom_fields.enum_value",
"custom_fields.enum_value.color",
"custom_fields.enum_value.enabled",
"custom_fields.enum_value.name",
"custom_fields.id_prefix",
"custom_fields.input_restrictions",
"custom_fields.is_formula_field",
"custom_fields.multi_enum_values",
"custom_fields.multi_enum_values.color",
"custom_fields.multi_enum_values.enabled",
"custom_fields.multi_enum_values.name",
"custom_fields.name",
"custom_fields.number_value",
"custom_fields.representation_type",
"custom_fields.text_value",
"custom_fields.type",
"custom_type",
"custom_type.asana_created_type_identifier",
"custom_type.name",
"default_access_level",
"default_view",
"due_date",
"due_on",
"followers",
"followers.name",
"html_notes",
"icon",
"members",
"members.name",
"minimum_access_level_for_customization",
"minimum_access_level_for_sharing",
"modified_at",
"name",
"notes",
"owner",
"permalink_url",
"privacy_setting",
"project_brief",
"public",
"resource_subtype",
"start_on",
"team",
"team.name",
"workspace",
"workspace.name"
]
}
},
"style": "form",
"explode": false
}
],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
"data"
],
"additionalProperties": false,
"properties": {
"data": {
"type": "object",
"additionalProperties": false,
"required": [
"name"
],
"properties": {
"name": {
"type": "string"
},
"notes": {
"type": "string"
},
"workspace": {
"type": "string"
},
"team": {
"type": "string"
},
"archived": {
"type": "boolean"
},
"public": {
"type": "boolean"
},
"color": {
"type": "string",
"nullable": true
},
"due_on": {
"type": "string",
"nullable": true,
"format": "date"
},
"start_on": {
"type": "string",
"nullable": true,
"format": "date"
},
"default_view": {
"enum": [
"list",
"board",
"calendar",
"timeline"
]
}
}
}
}
}
},
"application/x-www-form-urlencoded": {
"schema": {
"type": "object",
"additionalProperties": false,
"required": [
"name"
],
"properties": {
"name": {
"type": "string"
},
"notes": {
"type": "string"
},
"workspace": {
"type": "string"
},
"team": {
"type": "string"
},
"archived": {
"type": "boolean"
},
"public": {
"type": "boolean"
},
"color": {
"type": "string",
"nullable": true
},
"due_on": {
"type": "string",
"nullable": true,
"format": "date"
},
"start_on": {
"type": "string",
"nullable": true,
"format": "date"
},
"default_view": {
"enum": [
"list",
"board",
"calendar",
"timeline"
]
}
}
}
}
}
},
"responses": {
"201": {
"description": "Successfully created a new project in the specified workspace.",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"$ref": "#/components/schemas/ProjectResponse"
}
}
}
}
}
},
"400": {
"$ref": "#/components/responses/BadRequest"
},
"401": {
"$ref": "#/components/responses/Unauthorized"
},
"403": {
"$ref": "#/components/responses/Forbidden"
},
"404": {
"$ref": "#/components/responses/NotFound"
},
"500": {
"$ref": "#/components/responses/InternalServerError"
}
},
"security": [
{
"personalAccessToken": []
},
{
"oauth2": [
"projects:write"
]
}
],
"x-readme": {
"code-samples": [
{
"language": "java",
"install": "<dependency><groupId>com.asana</groupId><artifactId>asana</artifactId><version>1.0.0</version></dependency>",
"code": "import com.asana.Client;\n\nClient client = Client.accessToken(\"PERSONAL_ACCESS_TOKEN\");\n\nProject result = client.projects.createProjectForWorkspace(workspaceGid)\n .data(\"field\", \"value\")\n .data(\"field\", \"value\")\n .option(\"pretty\", true)\n .execute();"
},
{
"language": "node",
"install": "npm install asana",
"code": "const Asana = require('asana');\n\nlet client = new Asana.ApiClient();\nclient.authentications.token.accessToken = '<YOUR_ACCESS_TOKEN>';\n\nlet projectsApiInstance = new Asana.ProjectsApi(client);\nlet body = {\"data\": {\"<PARAM_1>\": \"<VALUE_1>\", \"<PARAM_2>\": \"<VALUE_2>\",}}; // Object | The new project to create.\nlet workspace_gid = \"12345\"; // String | Globally unique identifier for the workspace or organization.\nlet opts = { \n 'opt_fields': \"archived,color,completed,completed_at,completed_by,completed_by.name,created_at,created_from_template,created_from_template.name,current_status,current_status.author,current_status.author.name,current_status.color,current_status.created_at,current_status.created_by,current_status.created_by.name,current_status.html_text,current_status.modified_at,current_status.text,current_status.title,current_status_update,current_status_update.resource_subtype,current_status_update.title,custom_field_settings,custom_field_settings.custom_field,custom_field_settings.custom_field.asana_created_field,custom_field_settings.custom_field.created_by,custom_field_settings.custom_field.created_by.name,custom_field_settings.custom_field.currency_code,custom_field_settings.custom_field.custom_label,custom_field_settings.custom_field.custom_label_position,custom_field_settings.custom_field.date_value,custom_field_settings.custom_field.date_value.date,custom_field_settings.custom_field.date_value.date_time,custom_field_settings.custom_field.default_access_level,custom_field_settings.custom_field.description,custom_field_settings.custom_field.display_value,custom_field_settings.custom_field.enabled,custom_field_settings.custom_field.enum_options,custom_field_settings.custom_field.enum_options.color,custom_field_settings.custom_field.enum_options.enabled,custom_field_settings.custom_field.enum_options.name,custom_field_settings.custom_field.enum_value,custom_field_settings.custom_field.enum_value.color,custom_field_settings.custom_field.enum_value.enabled,custom_field_settings.custom_field.enum_value.name,custom_field_settings.custom_field.format,custom_field_settings.custom_field.has_notifications_enabled,custom_field_settings.custom_field.html_text_value,custom_field_settings.custom_field.id_prefix,custom_field_settings.custom_field.input_restrictions,custom_field_settings.custom_field.is_formula_field,custom_field_settings.custom_field.is_global_to_workspace,custom_field_settings.custom_field.is_value_read_only,custom_field_settings.custom_field.multi_enum_values,custom_field_settings.custom_field.multi_enum_values.color,custom_field_settings.custom_field.multi_enum_values.enabled,custom_field_settings.custom_field.multi_enum_values.name,custom_field_settings.custom_field.name,custom_field_settings.custom_field.number_value,custom_field_settings.custom_field.people_value,custom_field_settings.custom_field.people_value.name,custom_field_settings.custom_field.precision,custom_field_settings.custom_field.privacy_setting,custom_field_settings.custom_field.reference_value,custom_field_settings.custom_field.reference_value.name,custom_field_settings.custom_field.representation_type,custom_field_settings.custom_field.resource_subtype,custom_field_settings.custom_field.text_value,custom_field_settings.custom_field.type,custom_field_settings.is_important,custom_field_settings.parent,custom_field_settings.parent.name,custom_field_settings.parent.resource_subtype,custom_field_settings.project,custom_field_settings.project.name,custom_field_settings.project.resource_subtype,custom_fields,custom_fields.date_value,custom_fields.date_value.date,custom_fields.date_value.date_time,custom_fields.display_value,custom_fields.enabled,custom_fields.enum_options,custom_fields.enum_options.color,custom_fields.enum_options.enabled,custom_fields.enum_options.name,custom_fields.enum_value,custom_fields.enum_value.color,custom_fields.enum_value.enabled,custom_fields.enum_value.name,custom_fields.id_prefix,custom_fields.input_restrictions,custom_fields.is_formula_field,custom_fields.multi_enum_values,custom_fields.multi_enum_values.color,custom_fields.multi_enum_values.enabled,custom_fields.multi_enum_values.name,custom_fields.name,custom_fields.number_value,custom_fields.representation_type,custom_fields.text_value,custom_fields.type,custom_type,custom_type.asana_created_type_identifier,custom_type.name,default_access_level,default_view,due_date,due_on,followers,followers.name,html_notes,icon,members,members.name,minimum_access_level_for_customization,minimum_access_level_for_sharing,modified_at,name,notes,owner,permalink_url,privacy_setting,project_brief,public,resource_subtype,start_on,team,team.name,workspace,workspace.name\"\n};\nprojectsApiInstance.createProjectForWorkspace(body, workspace_gid, opts).then((result) => {\n console.log('API called successfully. Returned data: ' + JSON.stringify(result.data, null, 2));\n}, (error) => {\n console.error(error.response.body);\n});",
"name": "node-sdk-v3"
},
{
"language": "node",
"install": "npm install asana@1.0.5",
"code": "const asana = require('asana');\n\nconst client = asana.Client.create().useAccessToken('PERSONAL_ACCESS_TOKEN');\n\nclient.projects.createProjectForWorkspace(workspaceGid, {field: \"value\", field: \"value\", pretty: true})\n .then((result) => {\n console.log(result);\n });",
"name": "node-sdk-v1"
},
{
"language": "python",
"install": "pip install asana",
"code": "import asana\nfrom asana.rest import ApiException\nfrom pprint import pprint\n\nconfiguration = asana.Configuration()\nconfiguration.access_token = '<YOUR_ACCESS_TOKEN>'\napi_client = asana.ApiClient(configuration)\n\n# create an instance of the API class\nprojects_api_instance = asana.ProjectsApi(api_client)\nbody = {\"data\": {\"<PARAM_1>\": \"<VALUE_1>\", \"<PARAM_2>\": \"<VALUE_2>\",}} # dict | The new project to create.\nworkspace_gid = \"12345\" # str | Globally unique identifier for the workspace or organization.\nopts = {\n 'opt_fields': \"archived,color,completed,completed_at,completed_by,completed_by.name,created_at,created_from_template,created_from_template.name,current_status,current_status.author,current_status.author.name,current_status.color,current_status.created_at,current_status.created_by,current_status.created_by.name,current_status.html_text,current_status.modified_at,current_status.text,current_status.title,current_status_update,current_status_update.resource_subtype,current_status_update.title,custom_field_settings,custom_field_settings.custom_field,custom_field_settings.custom_field.asana_created_field,custom_field_settings.custom_field.created_by,custom_field_settings.custom_field.created_by.name,custom_field_settings.custom_field.currency_code,custom_field_settings.custom_field.custom_label,custom_field_settings.custom_field.custom_label_position,custom_field_settings.custom_field.date_value,custom_field_settings.custom_field.date_value.date,custom_field_settings.custom_field.date_value.date_time,custom_field_settings.custom_field.default_access_level,custom_field_settings.custom_field.description,custom_field_settings.custom_field.display_value,custom_field_settings.custom_field.enabled,custom_field_settings.custom_field.enum_options,custom_field_settings.custom_field.enum_options.color,custom_field_settings.custom_field.enum_options.enabled,custom_field_settings.custom_field.enum_options.name,custom_field_settings.custom_field.enum_value,custom_field_settings.custom_field.enum_value.color,custom_field_settings.custom_field.enum_value.enabled,custom_field_settings.custom_field.enum_value.name,custom_field_settings.custom_field.format,custom_field_settings.custom_field.has_notifications_enabled,custom_field_settings.custom_field.html_text_value,custom_field_settings.custom_field.id_prefix,custom_field_settings.custom_field.input_restrictions,custom_field_settings.custom_field.is_formula_field,custom_field_settings.custom_field.is_global_to_workspace,custom_field_settings.custom_field.is_value_read_only,custom_field_settings.custom_field.multi_enum_values,custom_field_settings.custom_field.multi_enum_values.color,custom_field_settings.custom_field.multi_enum_values.enabled,custom_field_settings.custom_field.multi_enum_values.name,custom_field_settings.custom_field.name,custom_field_settings.custom_field.number_value,custom_field_settings.custom_field.people_value,custom_field_settings.custom_field.people_value.name,custom_field_settings.custom_field.precision,custom_field_settings.custom_field.privacy_setting,custom_field_settings.custom_field.reference_value,custom_field_settings.custom_field.reference_value.name,custom_field_settings.custom_field.representation_type,custom_field_settings.custom_field.resource_subtype,custom_field_settings.custom_field.text_value,custom_field_settings.custom_field.type,custom_field_settings.is_important,custom_field_settings.parent,custom_field_settings.parent.name,custom_field_settings.parent.resource_subtype,custom_field_settings.project,custom_field_settings.project.name,custom_field_settings.project.resource_subtype,custom_fields,custom_fields.date_value,custom_fields.date_value.date,custom_fields.date_value.date_time,custom_fields.display_value,custom_fields.enabled,custom_fields.enum_options,custom_fields.enum_options.color,custom_fields.enum_options.enabled,custom_fields.enum_options.name,custom_fields.enum_value,custom_fields.enum_value.color,custom_fields.enum_value.enabled,custom_fields.enum_value.name,custom_fields.id_prefix,custom_fields.input_restrictions,custom_fields.is_formula_field,custom_fields.multi_enum_values,custom_fields.multi_enum_values.color,custom_fields.multi_enum_values.enabled,custom_fields.multi_enum_values.name,custom_fields.name,custom_fields.number_value,custom_fields.representation_type,custom_fields.text_value,custom_fields.type,custom_type,custom_type.asana_created_type_identifier,custom_type.name,default_access_level,default_view,due_date,due_on,followers,followers.name,html_notes,icon,members,members.name,minimum_access_level_for_customization,minimum_access_level_for_sharing,modified_at,name,notes,owner,permalink_url,privacy_setting,project_brief,public,resource_subtype,start_on,team,team.name,workspace,workspace.name\", # list[str] | 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.\n}\n\ntry:\n # Create a project in a workspace\n api_response = projects_api_instance.create_project_for_workspace(body, workspace_gid, opts)\n pprint(api_response)\nexcept ApiException as e:\n print(\"Exception when calling ProjectsApi->create_project_for_workspace: %s\\n\" % e)",
"name": "python-sdk-v5"
},
{
"language": "python",
"install": "pip install asana==3.2.3",
"code": "import asana\n\nclient = asana.Client.access_token('PERSONAL_ACCESS_TOKEN')\n\nresult = client.projects.create_project_for_workspace(workspace_gid, {'field': 'value', 'field': 'value'}, opt_pretty=True)",
"name": "python-sdk-v3"
},
{
"language": "php",
"install": "composer require asana/asana",
"code": "<?php\nrequire 'vendor/autoload.php';\n\n$client = Asana\\Client::accessToken('PERSONAL_ACCESS_TOKEN');\n\n$result = $client->projects->createProjectForWorkspace($workspace_gid, array('field' => 'value', 'field' => 'value'), array('opt_pretty' => 'true'))"
},
{
"language": "ruby",
"install": "gem install asana",
"code": "require 'asana'\n\nclient = Asana::Client.new do |c|\n c.authentication :access_token, 'PERSONAL_ACCESS_TOKEN'\nend\n\nresult = client.projects.create_project_for_workspace(workspace_gid: 'workspace_gid', field: \"value\", field: \"value\", options: {pretty: true})"
}
]
},
"x-purple-suite-runtime": "modeled-core",
"x-purple-suite-supported-query": [
"opt_pretty",
"opt_fields"
],
"x-purple-suite-supported-response-fields": [
"gid",
"resource_type",
"resource_subtype",
"name",
"notes",
"completed",
"completed_at",
"created_at",
"modified_at",
"assignee",
"assignee_status",
"workspace",
"projects",
"memberships",
"parent",
"due_on",
"start_on",
"tags",
"dependencies",
"num_subtasks",
"archived",
"public",
"color",
"default_view",
"team",
"project",
"section",
"text",
"created_by",
"target",
"type",
"email",
"photo",
"is_organization"
]
}
GET /api/1.0/workspaces/{workspace_gid}/projects/search
Search projects in a workspace
<b>Required scope: </b><code>projects:read</code>
To mirror the functionality of the Asana web app's advanced search feature, the Asana API has a project search endpoint that allows you to build complex filters to find and retrieve the exact data you need.
#### Premium access
Like the Asana web product's advance search feature, this search endpoint will only be available to premium Asana users. A user is premium if any of the following is true:
- The workspace in which the search is being performed is a premium workspace
- The user is a member of a premium team inside the workspace
Even if a user is only a member of a premium team inside a non-premium workspace, search will allow them to find data anywhere in the workspace, not just inside the premium team. Making a search request using credentials of a non-premium user will result in a `402 Payment Required` error.
#### Pagination
Search results are not stable; repeating the same query multiple times may return the data in a different order, even if the data do not change. Because of this, the traditional [pagination](/docs/pagination) available elsewhere in the Asana API is not available here. However, you can paginate manually by sorting the search results by their creation time and then modifying each subsequent query to exclude data you have already seen. Page sizes are limited to a maximum of 100 items, and can be specified by the `limit` query parameter.
#### Eventual consistency
Changes in Asana (regardless of whether they’re made though the web product or the API) are forwarded to our search infrastructure to be indexed. This process can take between 10 and 60 seconds to complete under normal operation, and longer during some production incidents. Making a change to a project that would alter its presence in a particular search query will not be reflected immediately. This is also true of the advanced search feature in the web product.
Because of this delay, the search endpoint is not suited for use cases that require immediate consistency after writes. If you need read-your-write behavior or strongly consistent results, we recommend using [Get multiple projects](/reference/getprojects) instead.
#### Rate limits
You may receive a `429 Too Many Requests` response if you hit any of our [rate limits](/docs/rate-limits).
#### Custom field parameters
| Parameter name | Custom field type | Accepted type |
|---|---|---|
| custom_fields.{gid}.is_set | All | Boolean |
| custom_fields.{gid}.value | Text | String |
| custom_fields.{gid}.value | Number | Number |
| custom_fields.{gid}.value | Enum | Enum option ID |
| custom_fields.{gid}.starts_with | Text only | String |
| custom_fields.{gid}.ends_with | Text only | String |
| custom_fields.{gid}.contains | Text only | String |
| custom_fields.{gid}.less_than | Number only | Number |
| custom_fields.{gid}.greater_than | Number only | Number |
For example, if the gid of the custom field is 12345, the query parameter to find projects where it is set would be `custom_fields.12345.is_set=true`. To match an exact value for an enum custom field, use the gid of the desired enum option and not the name of the enum option: `custom_fields.12345.value=67890`.
**Not Supported**: searching for multiple exact matches of a custom field, searching for multi-enum custom field
This operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.
Authentication
[
{
"personalAccessToken": []
},
{
"oauth2": [
"projects:read"
]
}
]
Path-level parameters and metadata
{
"parameters": [
{
"$ref": "#/components/parameters/workspace_path_gid"
},
{
"$ref": "#/components/parameters/pretty"
},
{
"name": "text",
"in": "query",
"description": "Performs full-text search on the project name.",
"schema": {
"type": "string"
},
"example": "Bugs"
},
{
"name": "sort_by",
"in": "query",
"description": "One of `due_date`, `created_at`, `completed_at`, `relevance`, or `modified_at`, defaults to `modified_at`.",
"schema": {
"type": "string",
"enum": [
"due_date",
"created_at",
"completed_at",
"modified_at",
"relevance"
],
"default": "modified_at"
},
"example": "modified_at"
},
{
"name": "sort_ascending",
"in": "query",
"description": "Default `false`.",
"schema": {
"type": "boolean",
"default": false
},
"example": false
},
{
"name": "completed",
"in": "query",
"description": "Filter on project completion status.",
"schema": {
"type": "boolean"
},
"example": false
},
{
"name": "teams.any",
"in": "query",
"description": "Comma-separated list of team IDs.",
"schema": {
"type": "string"
},
"example": "12345,67890"
},
{
"name": "owner.any",
"in": "query",
"description": "Comma-separated list of user identifiers to filter on as project owners. This can either be the string \"me\", an email, or the gid of a user.",
"schema": {
"type": "string"
},
"example": "12345,67890"
},
{
"name": "members.any",
"in": "query",
"description": "Comma-separated list of user identifiers to filter on as members. This can either be the string \"me\", an email, or the gid of a user.",
"schema": {
"type": "string"
},
"example": "12345,67890"
},
{
"name": "members.not",
"in": "query",
"description": "Comma-separated list of user identifiers to exclude as members. This can either be the string \"me\", an email, or the gid of a user.",
"schema": {
"type": "string"
},
"example": "12345,67890"
},
{
"name": "portfolios.any",
"in": "query",
"description": "Comma-separated list of portfolio IDs to filter on.",
"schema": {
"type": "string"
},
"example": "12345,67890"
},
{
"name": "completed_on",
"in": "query",
"description": "ISO 8601 date string or `null`.",
"schema": {
"type": "string",
"format": "date",
"nullable": true
},
"example": "2019-09-15"
},
{
"name": "completed_on.before",
"in": "query",
"description": "ISO 8601 date string.",
"schema": {
"type": "string",
"format": "date"
},
"example": "2019-09-15"
},
{
"name": "completed_on.after",
"in": "query",
"description": "ISO 8601 date string.",
"schema": {
"type": "string",
"format": "date"
},
"example": "2019-09-15"
},
{
"name": "completed_at.before",
"in": "query",
"description": "ISO 8601 datetime string.",
"schema": {
"type": "string",
"format": "date-time"
},
"example": "2019-04-15T01:01:46.055Z"
},
{
"name": "completed_at.after",
"in": "query",
"description": "ISO 8601 datetime string.",
"schema": {
"type": "string",
"format": "date-time"
},
"example": "2019-04-15T01:01:46.055Z"
},
{
"name": "created_on",
"in": "query",
"description": "ISO 8601 date string or `null`.",
"schema": {
"type": "string",
"format": "date",
"nullable": true
},
"example": "2019-09-15"
},
{
"name": "created_on.before",
"in": "query",
"description": "ISO 8601 date string.",
"schema": {
"type": "string",
"format": "date"
},
"example": "2019-09-15"
},
{
"name": "created_on.after",
"in": "query",
"description": "ISO 8601 date string.",
"schema": {
"type": "string",
"format": "date"
},
"example": "2019-09-15"
},
{
"name": "created_at.before",
"in": "query",
"description": "ISO 8601 datetime string.",
"schema": {
"type": "string",
"format": "date-time"
},
"example": "2019-04-15T01:01:46.055Z"
},
{
"name": "created_at.after",
"in": "query",
"description": "ISO 8601 datetime string.",
"schema": {
"type": "string",
"format": "date-time"
},
"example": "2019-04-15T01:01:46.055Z"
},
{
"name": "due_on",
"in": "query",
"description": "ISO 8601 date string or `null`.",
"schema": {
"type": "string",
"format": "date",
"nullable": true
},
"example": "2019-09-15"
},
{
"name": "due_on.before",
"in": "query",
"description": "ISO 8601 date string.",
"schema": {
"type": "string",
"format": "date"
},
"example": "2019-09-15"
},
{
"name": "due_on.after",
"in": "query",
"description": "ISO 8601 date string.",
"schema": {
"type": "string",
"format": "date"
},
"example": "2019-09-15"
},
{
"name": "due_at.before",
"in": "query",
"description": "ISO 8601 datetime string.",
"schema": {
"type": "string",
"format": "date-time"
},
"example": "2019-04-15T01:01:46.055Z"
},
{
"name": "due_at.after",
"in": "query",
"description": "ISO 8601 datetime string.",
"schema": {
"type": "string",
"format": "date-time"
},
"example": "2019-04-15T01:01:46.055Z"
},
{
"name": "start_on",
"in": "query",
"description": "ISO 8601 date string or `null`.",
"schema": {
"type": "string",
"format": "date",
"nullable": true
},
"example": "2019-09-15"
},
{
"name": "start_on.before",
"in": "query",
"description": "ISO 8601 date string.",
"schema": {
"type": "string",
"format": "date"
},
"example": "2019-09-15"
},
{
"name": "start_on.after",
"in": "query",
"description": "ISO 8601 date string.",
"schema": {
"type": "string",
"format": "date"
},
"example": "2019-09-15"
}
]
}
Request, responses and operation details
{
"summary": "Search projects in a workspace",
"description": "<b>Required scope: </b><code>projects:read</code>\n\nTo mirror the functionality of the Asana web app's advanced search feature, the Asana API has a project search endpoint that allows you to build complex filters to find and retrieve the exact data you need.\n#### Premium access\nLike the Asana web product's advance search feature, this search endpoint will only be available to premium Asana users. A user is premium if any of the following is true:\n\n- The workspace in which the search is being performed is a premium workspace\n- The user is a member of a premium team inside the workspace\n\nEven if a user is only a member of a premium team inside a non-premium workspace, search will allow them to find data anywhere in the workspace, not just inside the premium team. Making a search request using credentials of a non-premium user will result in a `402 Payment Required` error.\n#### Pagination\nSearch results are not stable; repeating the same query multiple times may return the data in a different order, even if the data do not change. Because of this, the traditional [pagination](/docs/pagination) available elsewhere in the Asana API is not available here. However, you can paginate manually by sorting the search results by their creation time and then modifying each subsequent query to exclude data you have already seen. Page sizes are limited to a maximum of 100 items, and can be specified by the `limit` query parameter.\n#### Eventual consistency\nChanges in Asana (regardless of whether they’re made though the web product or the API) are forwarded to our search infrastructure to be indexed. This process can take between 10 and 60 seconds to complete under normal operation, and longer during some production incidents. Making a change to a project that would alter its presence in a particular search query will not be reflected immediately. This is also true of the advanced search feature in the web product.\nBecause of this delay, the search endpoint is not suited for use cases that require immediate consistency after writes. If you need read-your-write behavior or strongly consistent results, we recommend using [Get multiple projects](/reference/getprojects) instead.\n#### Rate limits\nYou may receive a `429 Too Many Requests` response if you hit any of our [rate limits](/docs/rate-limits).\n#### Custom field parameters\n| Parameter name | Custom field type | Accepted type |\n|---|---|---|\n| custom_fields.{gid}.is_set | All | Boolean |\n| custom_fields.{gid}.value | Text | String |\n| custom_fields.{gid}.value | Number | Number |\n| custom_fields.{gid}.value | Enum | Enum option ID |\n| custom_fields.{gid}.starts_with | Text only | String |\n| custom_fields.{gid}.ends_with | Text only | String |\n| custom_fields.{gid}.contains | Text only | String |\n| custom_fields.{gid}.less_than | Number only | Number |\n| custom_fields.{gid}.greater_than | Number only | Number |\n\n\nFor example, if the gid of the custom field is 12345, the query parameter to find projects where it is set would be `custom_fields.12345.is_set=true`. To match an exact value for an enum custom field, use the gid of the desired enum option and not the name of the enum option: `custom_fields.12345.value=67890`.\n\n**Not Supported**: searching for multiple exact matches of a custom field, searching for multi-enum custom field\n\nThis operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.",
"tags": [
"Projects"
],
"operationId": "searchProjectsForWorkspace",
"parameters": [
{
"name": "opt_fields",
"in": "query",
"description": "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. Properties can include nested fields. To learn more, see the [input/output options guide](/docs/inputoutput-options#selecting-nested-fields).",
"required": false,
"example": [
"archived",
"color",
"completed",
"completed_at",
"completed_by",
"completed_by.name",
"created_at",
"created_from_template",
"created_from_template.name",
"current_status",
"current_status.author",
"current_status.author.name",
"current_status.color",
"current_status.created_at",
"current_status.created_by",
"current_status.created_by.name",
"current_status.html_text",
"current_status.modified_at",
"current_status.text",
"current_status.title",
"current_status_update",
"current_status_update.resource_subtype",
"current_status_update.title",
"custom_field_settings",
"custom_field_settings.custom_field",
"custom_field_settings.custom_field.asana_created_field",
"custom_field_settings.custom_field.created_by",
"custom_field_settings.custom_field.created_by.name",
"custom_field_settings.custom_field.currency_code",
"custom_field_settings.custom_field.custom_label",
"custom_field_settings.custom_field.custom_label_position",
"custom_field_settings.custom_field.date_value",
"custom_field_settings.custom_field.date_value.date",
"custom_field_settings.custom_field.date_value.date_time",
"custom_field_settings.custom_field.default_access_level",
"custom_field_settings.custom_field.description",
"custom_field_settings.custom_field.display_value",
"custom_field_settings.custom_field.enabled",
"custom_field_settings.custom_field.enum_options",
"custom_field_settings.custom_field.enum_options.color",
"custom_field_settings.custom_field.enum_options.enabled",
"custom_field_settings.custom_field.enum_options.name",
"custom_field_settings.custom_field.enum_value",
"custom_field_settings.custom_field.enum_value.color",
"custom_field_settings.custom_field.enum_value.enabled",
"custom_field_settings.custom_field.enum_value.name",
"custom_field_settings.custom_field.format",
"custom_field_settings.custom_field.has_notifications_enabled",
"custom_field_settings.custom_field.html_text_value",
"custom_field_settings.custom_field.id_prefix",
"custom_field_settings.custom_field.input_restrictions",
"custom_field_settings.custom_field.is_formula_field",
"custom_field_settings.custom_field.is_global_to_workspace",
"custom_field_settings.custom_field.is_value_read_only",
"custom_field_settings.custom_field.multi_enum_values",
"custom_field_settings.custom_field.multi_enum_values.color",
"custom_field_settings.custom_field.multi_enum_values.enabled",
"custom_field_settings.custom_field.multi_enum_values.name",
"custom_field_settings.custom_field.name",
"custom_field_settings.custom_field.number_value",
"custom_field_settings.custom_field.people_value",
"custom_field_settings.custom_field.people_value.name",
"custom_field_settings.custom_field.precision",
"custom_field_settings.custom_field.privacy_setting",
"custom_field_settings.custom_field.reference_value",
"custom_field_settings.custom_field.reference_value.name",
"custom_field_settings.custom_field.representation_type",
"custom_field_settings.custom_field.resource_subtype",
"custom_field_settings.custom_field.text_value",
"custom_field_settings.custom_field.type",
"custom_field_settings.is_important",
"custom_field_settings.parent",
"custom_field_settings.parent.name",
"custom_field_settings.parent.resource_subtype",
"custom_field_settings.project",
"custom_field_settings.project.name",
"custom_field_settings.project.resource_subtype",
"custom_fields",
"custom_fields.date_value",
"custom_fields.date_value.date",
"custom_fields.date_value.date_time",
"custom_fields.display_value",
"custom_fields.enabled",
"custom_fields.enum_options",
"custom_fields.enum_options.color",
"custom_fields.enum_options.enabled",
"custom_fields.enum_options.name",
"custom_fields.enum_value",
"custom_fields.enum_value.color",
"custom_fields.enum_value.enabled",
"custom_fields.enum_value.name",
"custom_fields.id_prefix",
"custom_fields.input_restrictions",
"custom_fields.is_formula_field",
"custom_fields.multi_enum_values",
"custom_fields.multi_enum_values.color",
"custom_fields.multi_enum_values.enabled",
"custom_fields.multi_enum_values.name",
"custom_fields.name",
"custom_fields.number_value",
"custom_fields.representation_type",
"custom_fields.text_value",
"custom_fields.type",
"custom_type",
"custom_type.asana_created_type_identifier",
"custom_type.name",
"default_access_level",
"default_view",
"due_date",
"due_on",
"followers",
"followers.name",
"html_notes",
"icon",
"members",
"members.name",
"minimum_access_level_for_customization",
"minimum_access_level_for_sharing",
"modified_at",
"name",
"notes",
"owner",
"permalink_url",
"privacy_setting",
"project_brief",
"public",
"resource_subtype",
"start_on",
"team",
"team.name",
"workspace",
"workspace.name"
],
"schema": {
"type": "array",
"items": {
"type": "string",
"enum": [
"archived",
"color",
"completed",
"completed_at",
"completed_by",
"completed_by.name",
"created_at",
"created_from_template",
"created_from_template.name",
"current_status",
"current_status.author",
"current_status.author.name",
"current_status.color",
"current_status.created_at",
"current_status.created_by",
"current_status.created_by.name",
"current_status.html_text",
"current_status.modified_at",
"current_status.text",
"current_status.title",
"current_status_update",
"current_status_update.resource_subtype",
"current_status_update.title",
"custom_field_settings",
"custom_field_settings.custom_field",
"custom_field_settings.custom_field.asana_created_field",
"custom_field_settings.custom_field.created_by",
"custom_field_settings.custom_field.created_by.name",
"custom_field_settings.custom_field.currency_code",
"custom_field_settings.custom_field.custom_label",
"custom_field_settings.custom_field.custom_label_position",
"custom_field_settings.custom_field.date_value",
"custom_field_settings.custom_field.date_value.date",
"custom_field_settings.custom_field.date_value.date_time",
"custom_field_settings.custom_field.default_access_level",
"custom_field_settings.custom_field.description",
"custom_field_settings.custom_field.display_value",
"custom_field_settings.custom_field.enabled",
"custom_field_settings.custom_field.enum_options",
"custom_field_settings.custom_field.enum_options.color",
"custom_field_settings.custom_field.enum_options.enabled",
"custom_field_settings.custom_field.enum_options.name",
"custom_field_settings.custom_field.enum_value",
"custom_field_settings.custom_field.enum_value.color",
"custom_field_settings.custom_field.enum_value.enabled",
"custom_field_settings.custom_field.enum_value.name",
"custom_field_settings.custom_field.format",
"custom_field_settings.custom_field.has_notifications_enabled",
"custom_field_settings.custom_field.html_text_value",
"custom_field_settings.custom_field.id_prefix",
"custom_field_settings.custom_field.input_restrictions",
"custom_field_settings.custom_field.is_formula_field",
"custom_field_settings.custom_field.is_global_to_workspace",
"custom_field_settings.custom_field.is_value_read_only",
"custom_field_settings.custom_field.multi_enum_values",
"custom_field_settings.custom_field.multi_enum_values.color",
"custom_field_settings.custom_field.multi_enum_values.enabled",
"custom_field_settings.custom_field.multi_enum_values.name",
"custom_field_settings.custom_field.name",
"custom_field_settings.custom_field.number_value",
"custom_field_settings.custom_field.people_value",
"custom_field_settings.custom_field.people_value.name",
"custom_field_settings.custom_field.precision",
"custom_field_settings.custom_field.privacy_setting",
"custom_field_settings.custom_field.reference_value",
"custom_field_settings.custom_field.reference_value.name",
"custom_field_settings.custom_field.representation_type",
"custom_field_settings.custom_field.resource_subtype",
"custom_field_settings.custom_field.text_value",
"custom_field_settings.custom_field.type",
"custom_field_settings.is_important",
"custom_field_settings.parent",
"custom_field_settings.parent.name",
"custom_field_settings.parent.resource_subtype",
"custom_field_settings.project",
"custom_field_settings.project.name",
"custom_field_settings.project.resource_subtype",
"custom_fields",
"custom_fields.date_value",
"custom_fields.date_value.date",
"custom_fields.date_value.date_time",
"custom_fields.display_value",
"custom_fields.enabled",
"custom_fields.enum_options",
"custom_fields.enum_options.color",
"custom_fields.enum_options.enabled",
"custom_fields.enum_options.name",
"custom_fields.enum_value",
"custom_fields.enum_value.color",
"custom_fields.enum_value.enabled",
"custom_fields.enum_value.name",
"custom_fields.id_prefix",
"custom_fields.input_restrictions",
"custom_fields.is_formula_field",
"custom_fields.multi_enum_values",
"custom_fields.multi_enum_values.color",
"custom_fields.multi_enum_values.enabled",
"custom_fields.multi_enum_values.name",
"custom_fields.name",
"custom_fields.number_value",
"custom_fields.representation_type",
"custom_fields.text_value",
"custom_fields.type",
"custom_type",
"custom_type.asana_created_type_identifier",
"custom_type.name",
"default_access_level",
"default_view",
"due_date",
"due_on",
"followers",
"followers.name",
"html_notes",
"icon",
"members",
"members.name",
"minimum_access_level_for_customization",
"minimum_access_level_for_sharing",
"modified_at",
"name",
"notes",
"owner",
"permalink_url",
"privacy_setting",
"project_brief",
"public",
"resource_subtype",
"start_on",
"team",
"team.name",
"workspace",
"workspace.name"
]
}
},
"style": "form",
"explode": false
}
],
"responses": {
"200": {
"description": "Successfully retrieved matching projects.",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"type": "array",
"items": {
"$ref": "#/components/schemas/ProjectCompact"
}
}
}
}
}
}
},
"400": {
"$ref": "#/components/responses/BadRequest"
},
"401": {
"$ref": "#/components/responses/Unauthorized"
},
"402": {
"$ref": "#/components/responses/PaymentRequired"
},
"403": {
"$ref": "#/components/responses/Forbidden"
},
"404": {
"$ref": "#/components/responses/NotFound"
},
"500": {
"$ref": "#/components/responses/InternalServerError"
}
},
"security": [
{
"personalAccessToken": []
},
{
"oauth2": [
"projects:read"
]
}
],
"x-readme": {
"code-samples": [
{
"language": "node",
"install": "npm install asana",
"code": "const Asana = require('asana');\n\nlet client = new Asana.ApiClient();\nclient.authentications.token.accessToken = '<YOUR_ACCESS_TOKEN>';\n\nlet projectsApiInstance = new Asana.ProjectsApi(client);\nlet workspace_gid = \"12345\"; // String | Globally unique identifier for the workspace or organization.\nlet opts = { \n 'text': \"Bugs\", \n 'sort_by': \"modified_at\", \n 'sort_ascending': false, \n 'completed': false, \n 'teams.any': \"12345,67890\", \n 'owner.any': \"12345,67890\", \n 'members.any': \"12345,67890\", \n 'members.not': \"12345,67890\", \n 'portfolios.any': \"12345,67890\", \n 'completed_on': \"2019-09-15\", \n 'completed_on.before': \"2019-09-15\", \n 'completed_on.after': \"2019-09-15\", \n 'completed_at.before': \"2019-04-15T01:01:46.055Z\", \n 'completed_at.after': \"2019-04-15T01:01:46.055Z\", \n 'created_on': \"2019-09-15\", \n 'created_on.before': \"2019-09-15\", \n 'created_on.after': \"2019-09-15\", \n 'created_at.before': \"2019-04-15T01:01:46.055Z\", \n 'created_at.after': \"2019-04-15T01:01:46.055Z\", \n 'due_on': \"2019-09-15\", \n 'due_on.before': \"2019-09-15\", \n 'due_on.after': \"2019-09-15\", \n 'due_at.before': \"2019-04-15T01:01:46.055Z\", \n 'due_at.after': \"2019-04-15T01:01:46.055Z\", \n 'start_on': \"2019-09-15\", \n 'start_on.before': \"2019-09-15\", \n 'start_on.after': \"2019-09-15\", \n 'opt_fields': \"archived,color,completed,completed_at,completed_by,completed_by.name,created_at,created_from_template,created_from_template.name,current_status,current_status.author,current_status.author.name,current_status.color,current_status.created_at,current_status.created_by,current_status.created_by.name,current_status.html_text,current_status.modified_at,current_status.text,current_status.title,current_status_update,current_status_update.resource_subtype,current_status_update.title,custom_field_settings,custom_field_settings.custom_field,custom_field_settings.custom_field.asana_created_field,custom_field_settings.custom_field.created_by,custom_field_settings.custom_field.created_by.name,custom_field_settings.custom_field.currency_code,custom_field_settings.custom_field.custom_label,custom_field_settings.custom_field.custom_label_position,custom_field_settings.custom_field.date_value,custom_field_settings.custom_field.date_value.date,custom_field_settings.custom_field.date_value.date_time,custom_field_settings.custom_field.default_access_level,custom_field_settings.custom_field.description,custom_field_settings.custom_field.display_value,custom_field_settings.custom_field.enabled,custom_field_settings.custom_field.enum_options,custom_field_settings.custom_field.enum_options.color,custom_field_settings.custom_field.enum_options.enabled,custom_field_settings.custom_field.enum_options.name,custom_field_settings.custom_field.enum_value,custom_field_settings.custom_field.enum_value.color,custom_field_settings.custom_field.enum_value.enabled,custom_field_settings.custom_field.enum_value.name,custom_field_settings.custom_field.format,custom_field_settings.custom_field.has_notifications_enabled,custom_field_settings.custom_field.html_text_value,custom_field_settings.custom_field.id_prefix,custom_field_settings.custom_field.input_restrictions,custom_field_settings.custom_field.is_formula_field,custom_field_settings.custom_field.is_global_to_workspace,custom_field_settings.custom_field.is_value_read_only,custom_field_settings.custom_field.multi_enum_values,custom_field_settings.custom_field.multi_enum_values.color,custom_field_settings.custom_field.multi_enum_values.enabled,custom_field_settings.custom_field.multi_enum_values.name,custom_field_settings.custom_field.name,custom_field_settings.custom_field.number_value,custom_field_settings.custom_field.people_value,custom_field_settings.custom_field.people_value.name,custom_field_settings.custom_field.precision,custom_field_settings.custom_field.privacy_setting,custom_field_settings.custom_field.reference_value,custom_field_settings.custom_field.reference_value.name,custom_field_settings.custom_field.representation_type,custom_field_settings.custom_field.resource_subtype,custom_field_settings.custom_field.text_value,custom_field_settings.custom_field.type,custom_field_settings.is_important,custom_field_settings.parent,custom_field_settings.parent.name,custom_field_settings.parent.resource_subtype,custom_field_settings.project,custom_field_settings.project.name,custom_field_settings.project.resource_subtype,custom_fields,custom_fields.date_value,custom_fields.date_value.date,custom_fields.date_value.date_time,custom_fields.display_value,custom_fields.enabled,custom_fields.enum_options,custom_fields.enum_options.color,custom_fields.enum_options.enabled,custom_fields.enum_options.name,custom_fields.enum_value,custom_fields.enum_value.color,custom_fields.enum_value.enabled,custom_fields.enum_value.name,custom_fields.id_prefix,custom_fields.input_restrictions,custom_fields.is_formula_field,custom_fields.multi_enum_values,custom_fields.multi_enum_values.color,custom_fields.multi_enum_values.enabled,custom_fields.multi_enum_values.name,custom_fields.name,custom_fields.number_value,custom_fields.representation_type,custom_fields.text_value,custom_fields.type,custom_type,custom_type.asana_created_type_identifier,custom_type.name,default_access_level,default_view,due_date,due_on,followers,followers.name,html_notes,icon,members,members.name,minimum_access_level_for_customization,minimum_access_level_for_sharing,modified_at,name,notes,owner,permalink_url,privacy_setting,project_brief,public,resource_subtype,start_on,team,team.name,workspace,workspace.name\"\n};\nprojectsApiInstance.searchProjectsForWorkspace(workspace_gid, opts).then((result) => {\n console.log('API called successfully. Returned data: ' + JSON.stringify(result.data, null, 2));\n}, (error) => {\n console.error(error.response.body);\n});",
"name": "node-sdk-v3"
},
{
"language": "python",
"install": "pip install asana",
"code": "import asana\nfrom asana.rest import ApiException\nfrom pprint import pprint\n\nconfiguration = asana.Configuration()\nconfiguration.access_token = '<YOUR_ACCESS_TOKEN>'\napi_client = asana.ApiClient(configuration)\n\n# create an instance of the API class\nprojects_api_instance = asana.ProjectsApi(api_client)\nworkspace_gid = \"12345\" # str | Globally unique identifier for the workspace or organization.\nopts = {\n 'text': \"Bugs\", # str | Performs full-text search on the project name.\n 'sort_by': \"modified_at\", # str | One of `due_date`, `created_at`, `completed_at`, `relevance`, or `modified_at`, defaults to `modified_at`.\n 'sort_ascending': False, # bool | Default `false`.\n 'completed': False, # bool | Filter on project completion status.\n 'teams.any': \"12345,67890\", # str | Comma-separated list of team IDs.\n 'owner.any': \"12345,67890\", # str | Comma-separated list of user identifiers to filter on as project owners. This can either be the string \\\"me\\\", an email, or the gid of a user.\n 'members.any': \"12345,67890\", # str | Comma-separated list of user identifiers to filter on as members. This can either be the string \\\"me\\\", an email, or the gid of a user.\n 'members.not': \"12345,67890\", # str | Comma-separated list of user identifiers to exclude as members. This can either be the string \\\"me\\\", an email, or the gid of a user.\n 'portfolios.any': \"12345,67890\", # str | Comma-separated list of portfolio IDs to filter on.\n 'completed_on': '2019-09-15', # date | ISO 8601 date string or `null`.\n 'completed_on.before': '2019-09-15', # date | ISO 8601 date string.\n 'completed_on.after': '2019-09-15', # date | ISO 8601 date string.\n 'completed_at.before': '2019-04-15T01:01:46.055Z', # datetime | ISO 8601 datetime string.\n 'completed_at.after': '2019-04-15T01:01:46.055Z', # datetime | ISO 8601 datetime string.\n 'created_on': '2019-09-15', # date | ISO 8601 date string or `null`.\n 'created_on.before': '2019-09-15', # date | ISO 8601 date string.\n 'created_on.after': '2019-09-15', # date | ISO 8601 date string.\n 'created_at.before': '2019-04-15T01:01:46.055Z', # datetime | ISO 8601 datetime string.\n 'created_at.after': '2019-04-15T01:01:46.055Z', # datetime | ISO 8601 datetime string.\n 'due_on': '2019-09-15', # date | ISO 8601 date string or `null`.\n 'due_on.before': '2019-09-15', # date | ISO 8601 date string.\n 'due_on.after': '2019-09-15', # date | ISO 8601 date string.\n 'due_at.before': '2019-04-15T01:01:46.055Z', # datetime | ISO 8601 datetime string.\n 'due_at.after': '2019-04-15T01:01:46.055Z', # datetime | ISO 8601 datetime string.\n 'start_on': '2019-09-15', # date | ISO 8601 date string or `null`.\n 'start_on.before': '2019-09-15', # date | ISO 8601 date string.\n 'start_on.after': '2019-09-15', # date | ISO 8601 date string.\n 'opt_fields': \"archived,color,completed,completed_at,completed_by,completed_by.name,created_at,created_from_template,created_from_template.name,current_status,current_status.author,current_status.author.name,current_status.color,current_status.created_at,current_status.created_by,current_status.created_by.name,current_status.html_text,current_status.modified_at,current_status.text,current_status.title,current_status_update,current_status_update.resource_subtype,current_status_update.title,custom_field_settings,custom_field_settings.custom_field,custom_field_settings.custom_field.asana_created_field,custom_field_settings.custom_field.created_by,custom_field_settings.custom_field.created_by.name,custom_field_settings.custom_field.currency_code,custom_field_settings.custom_field.custom_label,custom_field_settings.custom_field.custom_label_position,custom_field_settings.custom_field.date_value,custom_field_settings.custom_field.date_value.date,custom_field_settings.custom_field.date_value.date_time,custom_field_settings.custom_field.default_access_level,custom_field_settings.custom_field.description,custom_field_settings.custom_field.display_value,custom_field_settings.custom_field.enabled,custom_field_settings.custom_field.enum_options,custom_field_settings.custom_field.enum_options.color,custom_field_settings.custom_field.enum_options.enabled,custom_field_settings.custom_field.enum_options.name,custom_field_settings.custom_field.enum_value,custom_field_settings.custom_field.enum_value.color,custom_field_settings.custom_field.enum_value.enabled,custom_field_settings.custom_field.enum_value.name,custom_field_settings.custom_field.format,custom_field_settings.custom_field.has_notifications_enabled,custom_field_settings.custom_field.html_text_value,custom_field_settings.custom_field.id_prefix,custom_field_settings.custom_field.input_restrictions,custom_field_settings.custom_field.is_formula_field,custom_field_settings.custom_field.is_global_to_workspace,custom_field_settings.custom_field.is_value_read_only,custom_field_settings.custom_field.multi_enum_values,custom_field_settings.custom_field.multi_enum_values.color,custom_field_settings.custom_field.multi_enum_values.enabled,custom_field_settings.custom_field.multi_enum_values.name,custom_field_settings.custom_field.name,custom_field_settings.custom_field.number_value,custom_field_settings.custom_field.people_value,custom_field_settings.custom_field.people_value.name,custom_field_settings.custom_field.precision,custom_field_settings.custom_field.privacy_setting,custom_field_settings.custom_field.reference_value,custom_field_settings.custom_field.reference_value.name,custom_field_settings.custom_field.representation_type,custom_field_settings.custom_field.resource_subtype,custom_field_settings.custom_field.text_value,custom_field_settings.custom_field.type,custom_field_settings.is_important,custom_field_settings.parent,custom_field_settings.parent.name,custom_field_settings.parent.resource_subtype,custom_field_settings.project,custom_field_settings.project.name,custom_field_settings.project.resource_subtype,custom_fields,custom_fields.date_value,custom_fields.date_value.date,custom_fields.date_value.date_time,custom_fields.display_value,custom_fields.enabled,custom_fields.enum_options,custom_fields.enum_options.color,custom_fields.enum_options.enabled,custom_fields.enum_options.name,custom_fields.enum_value,custom_fields.enum_value.color,custom_fields.enum_value.enabled,custom_fields.enum_value.name,custom_fields.id_prefix,custom_fields.input_restrictions,custom_fields.is_formula_field,custom_fields.multi_enum_values,custom_fields.multi_enum_values.color,custom_fields.multi_enum_values.enabled,custom_fields.multi_enum_values.name,custom_fields.name,custom_fields.number_value,custom_fields.representation_type,custom_fields.text_value,custom_fields.type,custom_type,custom_type.asana_created_type_identifier,custom_type.name,default_access_level,default_view,due_date,due_on,followers,followers.name,html_notes,icon,members,members.name,minimum_access_level_for_customization,minimum_access_level_for_sharing,modified_at,name,notes,owner,permalink_url,privacy_setting,project_brief,public,resource_subtype,start_on,team,team.name,workspace,workspace.name\", # list[str] | 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.\n}\n\ntry:\n # Search projects in a workspace\n api_response = projects_api_instance.search_projects_for_workspace(workspace_gid, opts)\n for data in api_response:\n pprint(data)\nexcept ApiException as e:\n print(\"Exception when calling ProjectsApi->search_projects_for_workspace: %s\\n\" % e)",
"name": "python-sdk-v5"
}
]
},
"x-purple-suite-runtime": "unavailable"
}
POST /api/1.0/projects/{project_gid}/addCustomFieldSetting
Add a custom field to a project
<b>Required scope: </b><code>projects:write</code>
Custom fields are associated with projects by way of custom field settings. This method creates a setting for the project.
This operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.
Authentication
[
{
"personalAccessToken": []
},
{
"oauth2": [
"projects:write"
]
}
]
Path-level parameters and metadata
{
"parameters": [
{
"$ref": "#/components/parameters/project_path_gid"
},
{
"$ref": "#/components/parameters/pretty"
}
]
}
Request, responses and operation details
{
"summary": "Add a custom field to a project",
"description": "<b>Required scope: </b><code>projects:write</code>\n\nCustom fields are associated with projects by way of custom field settings. This method creates a setting for the project.\n\nThis operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.",
"tags": [
"Projects"
],
"operationId": "addCustomFieldSettingForProject",
"parameters": [
{
"name": "opt_fields",
"in": "query",
"description": "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. Properties can include nested fields. To learn more, see the [input/output options guide](/docs/inputoutput-options#selecting-nested-fields).",
"required": false,
"example": [
"custom_field",
"custom_field.asana_created_field",
"custom_field.created_by",
"custom_field.created_by.name",
"custom_field.currency_code",
"custom_field.custom_label",
"custom_field.custom_label_position",
"custom_field.date_value",
"custom_field.date_value.date",
"custom_field.date_value.date_time",
"custom_field.default_access_level",
"custom_field.description",
"custom_field.display_value",
"custom_field.enabled",
"custom_field.enum_options",
"custom_field.enum_options.color",
"custom_field.enum_options.enabled",
"custom_field.enum_options.name",
"custom_field.enum_value",
"custom_field.enum_value.color",
"custom_field.enum_value.enabled",
"custom_field.enum_value.name",
"custom_field.format",
"custom_field.has_notifications_enabled",
"custom_field.html_text_value",
"custom_field.id_prefix",
"custom_field.input_restrictions",
"custom_field.is_formula_field",
"custom_field.is_global_to_workspace",
"custom_field.is_value_read_only",
"custom_field.multi_enum_values",
"custom_field.multi_enum_values.color",
"custom_field.multi_enum_values.enabled",
"custom_field.multi_enum_values.name",
"custom_field.name",
"custom_field.number_value",
"custom_field.people_value",
"custom_field.people_value.name",
"custom_field.precision",
"custom_field.privacy_setting",
"custom_field.reference_value",
"custom_field.reference_value.name",
"custom_field.representation_type",
"custom_field.resource_subtype",
"custom_field.text_value",
"custom_field.type",
"is_important",
"parent",
"parent.name",
"parent.resource_subtype",
"project",
"project.name",
"project.resource_subtype"
],
"schema": {
"type": "array",
"items": {
"type": "string",
"enum": [
"custom_field",
"custom_field.asana_created_field",
"custom_field.created_by",
"custom_field.created_by.name",
"custom_field.currency_code",
"custom_field.custom_label",
"custom_field.custom_label_position",
"custom_field.date_value",
"custom_field.date_value.date",
"custom_field.date_value.date_time",
"custom_field.default_access_level",
"custom_field.description",
"custom_field.display_value",
"custom_field.enabled",
"custom_field.enum_options",
"custom_field.enum_options.color",
"custom_field.enum_options.enabled",
"custom_field.enum_options.name",
"custom_field.enum_value",
"custom_field.enum_value.color",
"custom_field.enum_value.enabled",
"custom_field.enum_value.name",
"custom_field.format",
"custom_field.has_notifications_enabled",
"custom_field.html_text_value",
"custom_field.id_prefix",
"custom_field.input_restrictions",
"custom_field.is_formula_field",
"custom_field.is_global_to_workspace",
"custom_field.is_value_read_only",
"custom_field.multi_enum_values",
"custom_field.multi_enum_values.color",
"custom_field.multi_enum_values.enabled",
"custom_field.multi_enum_values.name",
"custom_field.name",
"custom_field.number_value",
"custom_field.people_value",
"custom_field.people_value.name",
"custom_field.precision",
"custom_field.privacy_setting",
"custom_field.reference_value",
"custom_field.reference_value.name",
"custom_field.representation_type",
"custom_field.resource_subtype",
"custom_field.text_value",
"custom_field.type",
"is_important",
"parent",
"parent.name",
"parent.resource_subtype",
"project",
"project.name",
"project.resource_subtype"
]
}
},
"style": "form",
"explode": false
}
],
"requestBody": {
"description": "Information about the custom field setting.",
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"$ref": "#/components/schemas/AddCustomFieldSettingRequest"
}
}
}
}
}
},
"responses": {
"200": {
"description": "Successfully added the custom field to the project.",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"$ref": "#/components/schemas/CustomFieldSettingResponse"
}
}
}
}
}
},
"400": {
"$ref": "#/components/responses/BadRequest"
},
"401": {
"$ref": "#/components/responses/Unauthorized"
},
"403": {
"$ref": "#/components/responses/Forbidden"
},
"404": {
"$ref": "#/components/responses/NotFound"
},
"500": {
"$ref": "#/components/responses/InternalServerError"
}
},
"security": [
{
"personalAccessToken": []
},
{
"oauth2": [
"projects:write"
]
}
],
"x-readme": {
"code-samples": [
{
"language": "java",
"install": "<dependency><groupId>com.asana</groupId><artifactId>asana</artifactId><version>1.0.0</version></dependency>",
"code": "import com.asana.Client;\n\nClient client = Client.accessToken(\"PERSONAL_ACCESS_TOKEN\");\n\nCustomFieldSetting result = client.projects.addCustomFieldSettingForProject(projectGid)\n .data(\"field\", \"value\")\n .data(\"field\", \"value\")\n .option(\"pretty\", true)\n .execute();"
},
{
"language": "node",
"install": "npm install asana",
"code": "const Asana = require('asana');\n\nlet client = new Asana.ApiClient();\nclient.authentications.token.accessToken = '<YOUR_ACCESS_TOKEN>';\n\nlet projectsApiInstance = new Asana.ProjectsApi(client);\nlet body = {\"data\": {\"<PARAM_1>\": \"<VALUE_1>\", \"<PARAM_2>\": \"<VALUE_2>\",}}; // Object | Information about the custom field setting.\nlet project_gid = \"1331\"; // String | Globally unique identifier for the project.\nlet opts = { \n 'opt_fields': \"custom_field,custom_field.asana_created_field,custom_field.created_by,custom_field.created_by.name,custom_field.currency_code,custom_field.custom_label,custom_field.custom_label_position,custom_field.date_value,custom_field.date_value.date,custom_field.date_value.date_time,custom_field.default_access_level,custom_field.description,custom_field.display_value,custom_field.enabled,custom_field.enum_options,custom_field.enum_options.color,custom_field.enum_options.enabled,custom_field.enum_options.name,custom_field.enum_value,custom_field.enum_value.color,custom_field.enum_value.enabled,custom_field.enum_value.name,custom_field.format,custom_field.has_notifications_enabled,custom_field.html_text_value,custom_field.id_prefix,custom_field.input_restrictions,custom_field.is_formula_field,custom_field.is_global_to_workspace,custom_field.is_value_read_only,custom_field.multi_enum_values,custom_field.multi_enum_values.color,custom_field.multi_enum_values.enabled,custom_field.multi_enum_values.name,custom_field.name,custom_field.number_value,custom_field.people_value,custom_field.people_value.name,custom_field.precision,custom_field.privacy_setting,custom_field.reference_value,custom_field.reference_value.name,custom_field.representation_type,custom_field.resource_subtype,custom_field.text_value,custom_field.type,is_important,parent,parent.name,parent.resource_subtype,project,project.name,project.resource_subtype\"\n};\nprojectsApiInstance.addCustomFieldSettingForProject(body, project_gid, opts).then((result) => {\n console.log('API called successfully. Returned data: ' + JSON.stringify(result.data, null, 2));\n}, (error) => {\n console.error(error.response.body);\n});",
"name": "node-sdk-v3"
},
{
"language": "node",
"install": "npm install asana@1.0.5",
"code": "const asana = require('asana');\n\nconst client = asana.Client.create().useAccessToken('PERSONAL_ACCESS_TOKEN');\n\nclient.projects.addCustomFieldSettingForProject(projectGid, {field: \"value\", field: \"value\", pretty: true})\n .then((result) => {\n console.log(result);\n });",
"name": "node-sdk-v1"
},
{
"language": "python",
"install": "pip install asana",
"code": "import asana\nfrom asana.rest import ApiException\nfrom pprint import pprint\n\nconfiguration = asana.Configuration()\nconfiguration.access_token = '<YOUR_ACCESS_TOKEN>'\napi_client = asana.ApiClient(configuration)\n\n# create an instance of the API class\nprojects_api_instance = asana.ProjectsApi(api_client)\nbody = {\"data\": {\"<PARAM_1>\": \"<VALUE_1>\", \"<PARAM_2>\": \"<VALUE_2>\",}} # dict | Information about the custom field setting.\nproject_gid = \"1331\" # str | Globally unique identifier for the project.\nopts = {\n 'opt_fields': \"custom_field,custom_field.asana_created_field,custom_field.created_by,custom_field.created_by.name,custom_field.currency_code,custom_field.custom_label,custom_field.custom_label_position,custom_field.date_value,custom_field.date_value.date,custom_field.date_value.date_time,custom_field.default_access_level,custom_field.description,custom_field.display_value,custom_field.enabled,custom_field.enum_options,custom_field.enum_options.color,custom_field.enum_options.enabled,custom_field.enum_options.name,custom_field.enum_value,custom_field.enum_value.color,custom_field.enum_value.enabled,custom_field.enum_value.name,custom_field.format,custom_field.has_notifications_enabled,custom_field.html_text_value,custom_field.id_prefix,custom_field.input_restrictions,custom_field.is_formula_field,custom_field.is_global_to_workspace,custom_field.is_value_read_only,custom_field.multi_enum_values,custom_field.multi_enum_values.color,custom_field.multi_enum_values.enabled,custom_field.multi_enum_values.name,custom_field.name,custom_field.number_value,custom_field.people_value,custom_field.people_value.name,custom_field.precision,custom_field.privacy_setting,custom_field.reference_value,custom_field.reference_value.name,custom_field.representation_type,custom_field.resource_subtype,custom_field.text_value,custom_field.type,is_important,parent,parent.name,parent.resource_subtype,project,project.name,project.resource_subtype\", # list[str] | 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.\n}\n\ntry:\n # Add a custom field to a project\n api_response = projects_api_instance.add_custom_field_setting_for_project(body, project_gid, opts)\n pprint(api_response)\nexcept ApiException as e:\n print(\"Exception when calling ProjectsApi->add_custom_field_setting_for_project: %s\\n\" % e)",
"name": "python-sdk-v5"
},
{
"language": "python",
"install": "pip install asana==3.2.3",
"code": "import asana\n\nclient = asana.Client.access_token('PERSONAL_ACCESS_TOKEN')\n\nresult = client.projects.add_custom_field_setting_for_project(project_gid, {'field': 'value', 'field': 'value'}, opt_pretty=True)",
"name": "python-sdk-v3"
},
{
"language": "php",
"install": "composer require asana/asana",
"code": "<?php\nrequire 'vendor/autoload.php';\n\n$client = Asana\\Client::accessToken('PERSONAL_ACCESS_TOKEN');\n\n$result = $client->projects->addCustomFieldSettingForProject($project_gid, array('field' => 'value', 'field' => 'value'), array('opt_pretty' => 'true'))"
},
{
"language": "ruby",
"install": "gem install asana",
"code": "require 'asana'\n\nclient = Asana::Client.new do |c|\n c.authentication :access_token, 'PERSONAL_ACCESS_TOKEN'\nend\n\nresult = client.projects.add_custom_field_setting_for_project(project_gid: 'project_gid', field: \"value\", field: \"value\", options: {pretty: true})"
}
]
},
"x-purple-suite-runtime": "unavailable"
}
POST /api/1.0/projects/{project_gid}/removeCustomFieldSetting
Remove a custom field from a project
<b>Required scope: </b><code>projects:write</code>
Removes a custom field setting from a project.
This operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.
Authentication
[
{
"personalAccessToken": []
},
{
"oauth2": [
"projects:write"
]
}
]
Path-level parameters and metadata
{
"parameters": [
{
"$ref": "#/components/parameters/project_path_gid"
},
{
"$ref": "#/components/parameters/pretty"
}
]
}
Request, responses and operation details
{
"summary": "Remove a custom field from a project",
"description": "<b>Required scope: </b><code>projects:write</code>\n\nRemoves a custom field setting from a project.\n\nThis operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.",
"tags": [
"Projects"
],
"operationId": "removeCustomFieldSettingForProject",
"security": [
{
"personalAccessToken": []
},
{
"oauth2": [
"projects:write"
]
}
],
"requestBody": {
"description": "Information about the custom field setting being removed.",
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"$ref": "#/components/schemas/RemoveCustomFieldSettingRequest"
}
}
}
}
}
},
"responses": {
"200": {
"description": "Successfully removed the custom field from the project.",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"$ref": "#/components/schemas/EmptyResponse"
}
}
}
}
}
},
"400": {
"$ref": "#/components/responses/BadRequest"
},
"401": {
"$ref": "#/components/responses/Unauthorized"
},
"403": {
"$ref": "#/components/responses/Forbidden"
},
"404": {
"$ref": "#/components/responses/NotFound"
},
"500": {
"$ref": "#/components/responses/InternalServerError"
}
},
"x-readme": {
"code-samples": [
{
"language": "java",
"install": "<dependency><groupId>com.asana</groupId><artifactId>asana</artifactId><version>1.0.0</version></dependency>",
"code": "import com.asana.Client;\n\nClient client = Client.accessToken(\"PERSONAL_ACCESS_TOKEN\");\n\nJsonElement result = client.projects.removeCustomFieldSettingForProject(projectGid)\n .data(\"field\", \"value\")\n .data(\"field\", \"value\")\n .option(\"pretty\", true)\n .execute();"
},
{
"language": "node",
"install": "npm install asana",
"code": "const Asana = require('asana');\n\nlet client = new Asana.ApiClient();\nclient.authentications.token.accessToken = '<YOUR_ACCESS_TOKEN>';\n\nlet projectsApiInstance = new Asana.ProjectsApi(client);\nlet body = {\"data\": {\"<PARAM_1>\": \"<VALUE_1>\", \"<PARAM_2>\": \"<VALUE_2>\",}}; // Object | Information about the custom field setting being removed.\nlet project_gid = \"1331\"; // String | Globally unique identifier for the project.\n\nprojectsApiInstance.removeCustomFieldSettingForProject(body, project_gid).then((result) => {\n console.log('API called successfully. Returned data: ' + JSON.stringify(result.data, null, 2));\n}, (error) => {\n console.error(error.response.body);\n});",
"name": "node-sdk-v3"
},
{
"language": "node",
"install": "npm install asana@1.0.5",
"code": "const asana = require('asana');\n\nconst client = asana.Client.create().useAccessToken('PERSONAL_ACCESS_TOKEN');\n\nclient.projects.removeCustomFieldSettingForProject(projectGid, {field: \"value\", field: \"value\", pretty: true})\n .then((result) => {\n console.log(result);\n });",
"name": "node-sdk-v1"
},
{
"language": "python",
"install": "pip install asana",
"code": "import asana\nfrom asana.rest import ApiException\nfrom pprint import pprint\n\nconfiguration = asana.Configuration()\nconfiguration.access_token = '<YOUR_ACCESS_TOKEN>'\napi_client = asana.ApiClient(configuration)\n\n# create an instance of the API class\nprojects_api_instance = asana.ProjectsApi(api_client)\nbody = {\"data\": {\"<PARAM_1>\": \"<VALUE_1>\", \"<PARAM_2>\": \"<VALUE_2>\",}} # dict | Information about the custom field setting being removed.\nproject_gid = \"1331\" # str | Globally unique identifier for the project.\n\n\ntry:\n # Remove a custom field from a project\n api_response = projects_api_instance.remove_custom_field_setting_for_project(body, project_gid)\n pprint(api_response)\nexcept ApiException as e:\n print(\"Exception when calling ProjectsApi->remove_custom_field_setting_for_project: %s\\n\" % e)",
"name": "python-sdk-v5"
},
{
"language": "python",
"install": "pip install asana==3.2.3",
"code": "import asana\n\nclient = asana.Client.access_token('PERSONAL_ACCESS_TOKEN')\n\nresult = client.projects.remove_custom_field_setting_for_project(project_gid, {'field': 'value', 'field': 'value'}, opt_pretty=True)",
"name": "python-sdk-v3"
},
{
"language": "php",
"install": "composer require asana/asana",
"code": "<?php\nrequire 'vendor/autoload.php';\n\n$client = Asana\\Client::accessToken('PERSONAL_ACCESS_TOKEN');\n\n$result = $client->projects->removeCustomFieldSettingForProject($project_gid, array('field' => 'value', 'field' => 'value'), array('opt_pretty' => 'true'))"
},
{
"language": "ruby",
"install": "gem install asana",
"code": "require 'asana'\n\nclient = Asana::Client.new do |c|\n c.authentication :access_token, 'PERSONAL_ACCESS_TOKEN'\nend\n\nresult = client.projects.remove_custom_field_setting_for_project(project_gid: 'project_gid', field: \"value\", field: \"value\", options: {pretty: true})"
}
]
},
"x-purple-suite-runtime": "unavailable"
}
GET /api/1.0/projects/{project_gid}/task_counts
Get task count of a project
<b>Required scope: </b><code>projects:read</code>
<table>
<tr>
<th>Field</th>
<th>Required Scope</th>
</tr>
<tr>
<td><code>team</code></td>
<td><code>teams:read</code></td>
</tr>
<tr>
<td><code>custom_type</code></td>
<td><code>custom_types:read</code></td>
</tr>
</table>
Get an object that holds task count fields. **All fields are excluded by default**. You must [opt in](/docs/inputoutput-options) using `opt_fields` to get any information from this endpoint.
This endpoint has an additional [rate limit](/docs/rate-limits) and each field counts especially high against our [cost limits](/docs/rate-limits#cost-limits).
Milestones are just tasks, so they are included in the `num_tasks`, `num_incomplete_tasks`, and `num_completed_tasks` counts.
This operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.
Authentication
[
{
"personalAccessToken": []
},
{
"oauth2": [
"projects:read"
]
}
]
Path-level parameters and metadata
{
"parameters": [
{
"$ref": "#/components/parameters/project_path_gid"
},
{
"$ref": "#/components/parameters/pretty"
}
]
}
Request, responses and operation details
{
"summary": "Get task count of a project",
"description": "<b>Required scope: </b><code>projects:read</code>\n\n<table>\n <tr>\n <th>Field</th>\n <th>Required Scope</th>\n </tr>\n <tr>\n <td><code>team</code></td>\n <td><code>teams:read</code></td>\n </tr>\n <tr>\n <td><code>custom_type</code></td>\n <td><code>custom_types:read</code></td>\n </tr>\n</table>\n\nGet an object that holds task count fields. **All fields are excluded by default**. You must [opt in](/docs/inputoutput-options) using `opt_fields` to get any information from this endpoint.\n\nThis endpoint has an additional [rate limit](/docs/rate-limits) and each field counts especially high against our [cost limits](/docs/rate-limits#cost-limits).\n\nMilestones are just tasks, so they are included in the `num_tasks`, `num_incomplete_tasks`, and `num_completed_tasks` counts.\n\nThis operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.",
"tags": [
"Projects"
],
"operationId": "getTaskCountsForProject",
"parameters": [
{
"name": "opt_fields",
"in": "query",
"description": "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. Properties can include nested fields. To learn more, see the [input/output options guide](/docs/inputoutput-options#selecting-nested-fields).",
"required": false,
"example": [
"num_completed_milestones",
"num_completed_tasks",
"num_incomplete_milestones",
"num_incomplete_tasks",
"num_milestones",
"num_tasks"
],
"schema": {
"type": "array",
"items": {
"type": "string",
"enum": [
"num_completed_milestones",
"num_completed_tasks",
"num_incomplete_milestones",
"num_incomplete_tasks",
"num_milestones",
"num_tasks"
]
}
},
"style": "form",
"explode": false
}
],
"responses": {
"200": {
"description": "Successfully retrieved the requested project's task counts.",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"$ref": "#/components/schemas/TaskCountResponse"
}
}
}
}
}
},
"400": {
"$ref": "#/components/responses/BadRequest"
},
"401": {
"$ref": "#/components/responses/Unauthorized"
},
"403": {
"$ref": "#/components/responses/Forbidden"
},
"404": {
"$ref": "#/components/responses/NotFound"
},
"500": {
"$ref": "#/components/responses/InternalServerError"
}
},
"security": [
{
"personalAccessToken": []
},
{
"oauth2": [
"projects:read"
]
}
],
"x-readme": {
"code-samples": [
{
"language": "java",
"install": "<dependency><groupId>com.asana</groupId><artifactId>asana</artifactId><version>1.0.0</version></dependency>",
"code": "import com.asana.Client;\n\nClient client = Client.accessToken(\"PERSONAL_ACCESS_TOKEN\");\n\nJsonElement result = client.projects.getTaskCountsForProject(projectGid)\n .option(\"pretty\", true)\n .execute();"
},
{
"language": "node",
"install": "npm install asana",
"code": "const Asana = require('asana');\n\nlet client = new Asana.ApiClient();\nclient.authentications.token.accessToken = '<YOUR_ACCESS_TOKEN>';\n\nlet projectsApiInstance = new Asana.ProjectsApi(client);\nlet project_gid = \"1331\"; // String | Globally unique identifier for the project.\nlet opts = { \n 'opt_fields': \"num_completed_milestones,num_completed_tasks,num_incomplete_milestones,num_incomplete_tasks,num_milestones,num_tasks\"\n};\nprojectsApiInstance.getTaskCountsForProject(project_gid, opts).then((result) => {\n console.log('API called successfully. Returned data: ' + JSON.stringify(result.data, null, 2));\n}, (error) => {\n console.error(error.response.body);\n});",
"name": "node-sdk-v3"
},
{
"language": "node",
"install": "npm install asana@1.0.5",
"code": "const asana = require('asana');\n\nconst client = asana.Client.create().useAccessToken('PERSONAL_ACCESS_TOKEN');\n\nclient.projects.getTaskCountsForProject(projectGid, {param: \"value\", param: \"value\", opt_pretty: true})\n .then((result) => {\n console.log(result);\n });",
"name": "node-sdk-v1"
},
{
"language": "python",
"install": "pip install asana",
"code": "import asana\nfrom asana.rest import ApiException\nfrom pprint import pprint\n\nconfiguration = asana.Configuration()\nconfiguration.access_token = '<YOUR_ACCESS_TOKEN>'\napi_client = asana.ApiClient(configuration)\n\n# create an instance of the API class\nprojects_api_instance = asana.ProjectsApi(api_client)\nproject_gid = \"1331\" # str | Globally unique identifier for the project.\nopts = {\n 'opt_fields': \"num_completed_milestones,num_completed_tasks,num_incomplete_milestones,num_incomplete_tasks,num_milestones,num_tasks\", # list[str] | 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.\n}\n\ntry:\n # Get task count of a project\n api_response = projects_api_instance.get_task_counts_for_project(project_gid, opts)\n pprint(api_response)\nexcept ApiException as e:\n print(\"Exception when calling ProjectsApi->get_task_counts_for_project: %s\\n\" % e)",
"name": "python-sdk-v5"
},
{
"language": "python",
"install": "pip install asana==3.2.3",
"code": "import asana\n\nclient = asana.Client.access_token('PERSONAL_ACCESS_TOKEN')\n\nresult = client.projects.get_task_counts_for_project(project_gid, {'param': 'value', 'param': 'value'}, opt_pretty=True)",
"name": "python-sdk-v3"
},
{
"language": "php",
"install": "composer require asana/asana",
"code": "<?php\nrequire 'vendor/autoload.php';\n\n$client = Asana\\Client::accessToken('PERSONAL_ACCESS_TOKEN');\n\n$result = $client->projects->getTaskCountsForProject($project_gid, array('param' => 'value', 'param' => 'value'), array('opt_pretty' => 'true'))"
},
{
"language": "ruby",
"install": "gem install asana",
"code": "require 'asana'\n\nclient = Asana::Client.new do |c|\n c.authentication :access_token, 'PERSONAL_ACCESS_TOKEN'\nend\n\nresult = client.projects.get_task_counts_for_project(project_gid: 'project_gid', param: \"value\", param: \"value\", options: {pretty: true})"
}
]
},
"x-purple-suite-runtime": "unavailable"
}
POST /api/1.0/projects/{project_gid}/addMembers
Add users to a project
Adds the specified list of users as members of the project. Note that a user being added as a member may also be added as a *follower* as a result of this operation. This is because the user's default notification settings (i.e., in the "Notifications" tab of "My Profile Settings") will override this endpoint's default behavior of setting "Tasks added" notifications to `false`.
Returns the updated project record.
This operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.
Authentication
[
{
"personalAccessToken": []
},
{
"oauth2": []
}
]
Path-level parameters and metadata
{
"parameters": [
{
"$ref": "#/components/parameters/project_path_gid"
},
{
"$ref": "#/components/parameters/pretty"
}
]
}
Request, responses and operation details
{
"summary": "Add users to a project",
"description": "Adds the specified list of users as members of the project. Note that a user being added as a member may also be added as a *follower* as a result of this operation. This is because the user's default notification settings (i.e., in the \"Notifications\" tab of \"My Profile Settings\") will override this endpoint's default behavior of setting \"Tasks added\" notifications to `false`.\nReturns the updated project record.\n\nThis operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.",
"tags": [
"Projects"
],
"operationId": "addMembersForProject",
"parameters": [
{
"name": "opt_fields",
"in": "query",
"description": "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. Properties can include nested fields. To learn more, see the [input/output options guide](/docs/inputoutput-options#selecting-nested-fields).",
"required": false,
"example": [
"archived",
"color",
"completed",
"completed_at",
"completed_by",
"completed_by.name",
"created_at",
"created_from_template",
"created_from_template.name",
"current_status",
"current_status.author",
"current_status.author.name",
"current_status.color",
"current_status.created_at",
"current_status.created_by",
"current_status.created_by.name",
"current_status.html_text",
"current_status.modified_at",
"current_status.text",
"current_status.title",
"current_status_update",
"current_status_update.resource_subtype",
"current_status_update.title",
"custom_field_settings",
"custom_field_settings.custom_field",
"custom_field_settings.custom_field.asana_created_field",
"custom_field_settings.custom_field.created_by",
"custom_field_settings.custom_field.created_by.name",
"custom_field_settings.custom_field.currency_code",
"custom_field_settings.custom_field.custom_label",
"custom_field_settings.custom_field.custom_label_position",
"custom_field_settings.custom_field.date_value",
"custom_field_settings.custom_field.date_value.date",
"custom_field_settings.custom_field.date_value.date_time",
"custom_field_settings.custom_field.default_access_level",
"custom_field_settings.custom_field.description",
"custom_field_settings.custom_field.display_value",
"custom_field_settings.custom_field.enabled",
"custom_field_settings.custom_field.enum_options",
"custom_field_settings.custom_field.enum_options.color",
"custom_field_settings.custom_field.enum_options.enabled",
"custom_field_settings.custom_field.enum_options.name",
"custom_field_settings.custom_field.enum_value",
"custom_field_settings.custom_field.enum_value.color",
"custom_field_settings.custom_field.enum_value.enabled",
"custom_field_settings.custom_field.enum_value.name",
"custom_field_settings.custom_field.format",
"custom_field_settings.custom_field.has_notifications_enabled",
"custom_field_settings.custom_field.html_text_value",
"custom_field_settings.custom_field.id_prefix",
"custom_field_settings.custom_field.input_restrictions",
"custom_field_settings.custom_field.is_formula_field",
"custom_field_settings.custom_field.is_global_to_workspace",
"custom_field_settings.custom_field.is_value_read_only",
"custom_field_settings.custom_field.multi_enum_values",
"custom_field_settings.custom_field.multi_enum_values.color",
"custom_field_settings.custom_field.multi_enum_values.enabled",
"custom_field_settings.custom_field.multi_enum_values.name",
"custom_field_settings.custom_field.name",
"custom_field_settings.custom_field.number_value",
"custom_field_settings.custom_field.people_value",
"custom_field_settings.custom_field.people_value.name",
"custom_field_settings.custom_field.precision",
"custom_field_settings.custom_field.privacy_setting",
"custom_field_settings.custom_field.reference_value",
"custom_field_settings.custom_field.reference_value.name",
"custom_field_settings.custom_field.representation_type",
"custom_field_settings.custom_field.resource_subtype",
"custom_field_settings.custom_field.text_value",
"custom_field_settings.custom_field.type",
"custom_field_settings.is_important",
"custom_field_settings.parent",
"custom_field_settings.parent.name",
"custom_field_settings.parent.resource_subtype",
"custom_field_settings.project",
"custom_field_settings.project.name",
"custom_field_settings.project.resource_subtype",
"custom_fields",
"custom_fields.date_value",
"custom_fields.date_value.date",
"custom_fields.date_value.date_time",
"custom_fields.display_value",
"custom_fields.enabled",
"custom_fields.enum_options",
"custom_fields.enum_options.color",
"custom_fields.enum_options.enabled",
"custom_fields.enum_options.name",
"custom_fields.enum_value",
"custom_fields.enum_value.color",
"custom_fields.enum_value.enabled",
"custom_fields.enum_value.name",
"custom_fields.id_prefix",
"custom_fields.input_restrictions",
"custom_fields.is_formula_field",
"custom_fields.multi_enum_values",
"custom_fields.multi_enum_values.color",
"custom_fields.multi_enum_values.enabled",
"custom_fields.multi_enum_values.name",
"custom_fields.name",
"custom_fields.number_value",
"custom_fields.representation_type",
"custom_fields.text_value",
"custom_fields.type",
"custom_type",
"custom_type.asana_created_type_identifier",
"custom_type.name",
"default_access_level",
"default_view",
"due_date",
"due_on",
"followers",
"followers.name",
"html_notes",
"icon",
"members",
"members.name",
"minimum_access_level_for_customization",
"minimum_access_level_for_sharing",
"modified_at",
"name",
"notes",
"owner",
"permalink_url",
"privacy_setting",
"project_brief",
"public",
"resource_subtype",
"start_on",
"team",
"team.name",
"workspace",
"workspace.name"
],
"schema": {
"type": "array",
"items": {
"type": "string",
"enum": [
"archived",
"color",
"completed",
"completed_at",
"completed_by",
"completed_by.name",
"created_at",
"created_from_template",
"created_from_template.name",
"current_status",
"current_status.author",
"current_status.author.name",
"current_status.color",
"current_status.created_at",
"current_status.created_by",
"current_status.created_by.name",
"current_status.html_text",
"current_status.modified_at",
"current_status.text",
"current_status.title",
"current_status_update",
"current_status_update.resource_subtype",
"current_status_update.title",
"custom_field_settings",
"custom_field_settings.custom_field",
"custom_field_settings.custom_field.asana_created_field",
"custom_field_settings.custom_field.created_by",
"custom_field_settings.custom_field.created_by.name",
"custom_field_settings.custom_field.currency_code",
"custom_field_settings.custom_field.custom_label",
"custom_field_settings.custom_field.custom_label_position",
"custom_field_settings.custom_field.date_value",
"custom_field_settings.custom_field.date_value.date",
"custom_field_settings.custom_field.date_value.date_time",
"custom_field_settings.custom_field.default_access_level",
"custom_field_settings.custom_field.description",
"custom_field_settings.custom_field.display_value",
"custom_field_settings.custom_field.enabled",
"custom_field_settings.custom_field.enum_options",
"custom_field_settings.custom_field.enum_options.color",
"custom_field_settings.custom_field.enum_options.enabled",
"custom_field_settings.custom_field.enum_options.name",
"custom_field_settings.custom_field.enum_value",
"custom_field_settings.custom_field.enum_value.color",
"custom_field_settings.custom_field.enum_value.enabled",
"custom_field_settings.custom_field.enum_value.name",
"custom_field_settings.custom_field.format",
"custom_field_settings.custom_field.has_notifications_enabled",
"custom_field_settings.custom_field.html_text_value",
"custom_field_settings.custom_field.id_prefix",
"custom_field_settings.custom_field.input_restrictions",
"custom_field_settings.custom_field.is_formula_field",
"custom_field_settings.custom_field.is_global_to_workspace",
"custom_field_settings.custom_field.is_value_read_only",
"custom_field_settings.custom_field.multi_enum_values",
"custom_field_settings.custom_field.multi_enum_values.color",
"custom_field_settings.custom_field.multi_enum_values.enabled",
"custom_field_settings.custom_field.multi_enum_values.name",
"custom_field_settings.custom_field.name",
"custom_field_settings.custom_field.number_value",
"custom_field_settings.custom_field.people_value",
"custom_field_settings.custom_field.people_value.name",
"custom_field_settings.custom_field.precision",
"custom_field_settings.custom_field.privacy_setting",
"custom_field_settings.custom_field.reference_value",
"custom_field_settings.custom_field.reference_value.name",
"custom_field_settings.custom_field.representation_type",
"custom_field_settings.custom_field.resource_subtype",
"custom_field_settings.custom_field.text_value",
"custom_field_settings.custom_field.type",
"custom_field_settings.is_important",
"custom_field_settings.parent",
"custom_field_settings.parent.name",
"custom_field_settings.parent.resource_subtype",
"custom_field_settings.project",
"custom_field_settings.project.name",
"custom_field_settings.project.resource_subtype",
"custom_fields",
"custom_fields.date_value",
"custom_fields.date_value.date",
"custom_fields.date_value.date_time",
"custom_fields.display_value",
"custom_fields.enabled",
"custom_fields.enum_options",
"custom_fields.enum_options.color",
"custom_fields.enum_options.enabled",
"custom_fields.enum_options.name",
"custom_fields.enum_value",
"custom_fields.enum_value.color",
"custom_fields.enum_value.enabled",
"custom_fields.enum_value.name",
"custom_fields.id_prefix",
"custom_fields.input_restrictions",
"custom_fields.is_formula_field",
"custom_fields.multi_enum_values",
"custom_fields.multi_enum_values.color",
"custom_fields.multi_enum_values.enabled",
"custom_fields.multi_enum_values.name",
"custom_fields.name",
"custom_fields.number_value",
"custom_fields.representation_type",
"custom_fields.text_value",
"custom_fields.type",
"custom_type",
"custom_type.asana_created_type_identifier",
"custom_type.name",
"default_access_level",
"default_view",
"due_date",
"due_on",
"followers",
"followers.name",
"html_notes",
"icon",
"members",
"members.name",
"minimum_access_level_for_customization",
"minimum_access_level_for_sharing",
"modified_at",
"name",
"notes",
"owner",
"permalink_url",
"privacy_setting",
"project_brief",
"public",
"resource_subtype",
"start_on",
"team",
"team.name",
"workspace",
"workspace.name"
]
}
},
"style": "form",
"explode": false
}
],
"requestBody": {
"description": "Information about the members being added.",
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"$ref": "#/components/schemas/AddMembersRequest"
}
}
}
}
}
},
"responses": {
"200": {
"description": "Successfully added members to the project.",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"$ref": "#/components/schemas/ProjectResponse"
}
}
}
}
}
},
"400": {
"$ref": "#/components/responses/BadRequest"
},
"401": {
"$ref": "#/components/responses/Unauthorized"
},
"403": {
"$ref": "#/components/responses/Forbidden"
},
"404": {
"$ref": "#/components/responses/NotFound"
},
"500": {
"$ref": "#/components/responses/InternalServerError"
}
},
"security": [
{
"personalAccessToken": []
},
{
"oauth2": []
}
],
"x-readme": {
"code-samples": [
{
"language": "java",
"install": "<dependency><groupId>com.asana</groupId><artifactId>asana</artifactId><version>1.0.0</version></dependency>",
"code": "import com.asana.Client;\n\nClient client = Client.accessToken(\"PERSONAL_ACCESS_TOKEN\");\n\nProject result = client.projects.addMembersForProject(projectGid)\n .data(\"field\", \"value\")\n .data(\"field\", \"value\")\n .option(\"pretty\", true)\n .execute();"
},
{
"language": "node",
"install": "npm install asana",
"code": "const Asana = require('asana');\n\nlet client = new Asana.ApiClient();\nclient.authentications.token.accessToken = '<YOUR_ACCESS_TOKEN>';\n\nlet projectsApiInstance = new Asana.ProjectsApi(client);\nlet body = {\"data\": {\"<PARAM_1>\": \"<VALUE_1>\", \"<PARAM_2>\": \"<VALUE_2>\",}}; // Object | Information about the members being added.\nlet project_gid = \"1331\"; // String | Globally unique identifier for the project.\nlet opts = { \n 'opt_fields': \"archived,color,completed,completed_at,completed_by,completed_by.name,created_at,created_from_template,created_from_template.name,current_status,current_status.author,current_status.author.name,current_status.color,current_status.created_at,current_status.created_by,current_status.created_by.name,current_status.html_text,current_status.modified_at,current_status.text,current_status.title,current_status_update,current_status_update.resource_subtype,current_status_update.title,custom_field_settings,custom_field_settings.custom_field,custom_field_settings.custom_field.asana_created_field,custom_field_settings.custom_field.created_by,custom_field_settings.custom_field.created_by.name,custom_field_settings.custom_field.currency_code,custom_field_settings.custom_field.custom_label,custom_field_settings.custom_field.custom_label_position,custom_field_settings.custom_field.date_value,custom_field_settings.custom_field.date_value.date,custom_field_settings.custom_field.date_value.date_time,custom_field_settings.custom_field.default_access_level,custom_field_settings.custom_field.description,custom_field_settings.custom_field.display_value,custom_field_settings.custom_field.enabled,custom_field_settings.custom_field.enum_options,custom_field_settings.custom_field.enum_options.color,custom_field_settings.custom_field.enum_options.enabled,custom_field_settings.custom_field.enum_options.name,custom_field_settings.custom_field.enum_value,custom_field_settings.custom_field.enum_value.color,custom_field_settings.custom_field.enum_value.enabled,custom_field_settings.custom_field.enum_value.name,custom_field_settings.custom_field.format,custom_field_settings.custom_field.has_notifications_enabled,custom_field_settings.custom_field.html_text_value,custom_field_settings.custom_field.id_prefix,custom_field_settings.custom_field.input_restrictions,custom_field_settings.custom_field.is_formula_field,custom_field_settings.custom_field.is_global_to_workspace,custom_field_settings.custom_field.is_value_read_only,custom_field_settings.custom_field.multi_enum_values,custom_field_settings.custom_field.multi_enum_values.color,custom_field_settings.custom_field.multi_enum_values.enabled,custom_field_settings.custom_field.multi_enum_values.name,custom_field_settings.custom_field.name,custom_field_settings.custom_field.number_value,custom_field_settings.custom_field.people_value,custom_field_settings.custom_field.people_value.name,custom_field_settings.custom_field.precision,custom_field_settings.custom_field.privacy_setting,custom_field_settings.custom_field.reference_value,custom_field_settings.custom_field.reference_value.name,custom_field_settings.custom_field.representation_type,custom_field_settings.custom_field.resource_subtype,custom_field_settings.custom_field.text_value,custom_field_settings.custom_field.type,custom_field_settings.is_important,custom_field_settings.parent,custom_field_settings.parent.name,custom_field_settings.parent.resource_subtype,custom_field_settings.project,custom_field_settings.project.name,custom_field_settings.project.resource_subtype,custom_fields,custom_fields.date_value,custom_fields.date_value.date,custom_fields.date_value.date_time,custom_fields.display_value,custom_fields.enabled,custom_fields.enum_options,custom_fields.enum_options.color,custom_fields.enum_options.enabled,custom_fields.enum_options.name,custom_fields.enum_value,custom_fields.enum_value.color,custom_fields.enum_value.enabled,custom_fields.enum_value.name,custom_fields.id_prefix,custom_fields.input_restrictions,custom_fields.is_formula_field,custom_fields.multi_enum_values,custom_fields.multi_enum_values.color,custom_fields.multi_enum_values.enabled,custom_fields.multi_enum_values.name,custom_fields.name,custom_fields.number_value,custom_fields.representation_type,custom_fields.text_value,custom_fields.type,custom_type,custom_type.asana_created_type_identifier,custom_type.name,default_access_level,default_view,due_date,due_on,followers,followers.name,html_notes,icon,members,members.name,minimum_access_level_for_customization,minimum_access_level_for_sharing,modified_at,name,notes,owner,permalink_url,privacy_setting,project_brief,public,resource_subtype,start_on,team,team.name,workspace,workspace.name\"\n};\nprojectsApiInstance.addMembersForProject(body, project_gid, opts).then((result) => {\n console.log('API called successfully. Returned data: ' + JSON.stringify(result.data, null, 2));\n}, (error) => {\n console.error(error.response.body);\n});",
"name": "node-sdk-v3"
},
{
"language": "node",
"install": "npm install asana@1.0.5",
"code": "const asana = require('asana');\n\nconst client = asana.Client.create().useAccessToken('PERSONAL_ACCESS_TOKEN');\n\nclient.projects.addMembersForProject(projectGid, {field: \"value\", field: \"value\", pretty: true})\n .then((result) => {\n console.log(result);\n });",
"name": "node-sdk-v1"
},
{
"language": "python",
"install": "pip install asana",
"code": "import asana\nfrom asana.rest import ApiException\nfrom pprint import pprint\n\nconfiguration = asana.Configuration()\nconfiguration.access_token = '<YOUR_ACCESS_TOKEN>'\napi_client = asana.ApiClient(configuration)\n\n# create an instance of the API class\nprojects_api_instance = asana.ProjectsApi(api_client)\nbody = {\"data\": {\"<PARAM_1>\": \"<VALUE_1>\", \"<PARAM_2>\": \"<VALUE_2>\",}} # dict | Information about the members being added.\nproject_gid = \"1331\" # str | Globally unique identifier for the project.\nopts = {\n 'opt_fields': \"archived,color,completed,completed_at,completed_by,completed_by.name,created_at,created_from_template,created_from_template.name,current_status,current_status.author,current_status.author.name,current_status.color,current_status.created_at,current_status.created_by,current_status.created_by.name,current_status.html_text,current_status.modified_at,current_status.text,current_status.title,current_status_update,current_status_update.resource_subtype,current_status_update.title,custom_field_settings,custom_field_settings.custom_field,custom_field_settings.custom_field.asana_created_field,custom_field_settings.custom_field.created_by,custom_field_settings.custom_field.created_by.name,custom_field_settings.custom_field.currency_code,custom_field_settings.custom_field.custom_label,custom_field_settings.custom_field.custom_label_position,custom_field_settings.custom_field.date_value,custom_field_settings.custom_field.date_value.date,custom_field_settings.custom_field.date_value.date_time,custom_field_settings.custom_field.default_access_level,custom_field_settings.custom_field.description,custom_field_settings.custom_field.display_value,custom_field_settings.custom_field.enabled,custom_field_settings.custom_field.enum_options,custom_field_settings.custom_field.enum_options.color,custom_field_settings.custom_field.enum_options.enabled,custom_field_settings.custom_field.enum_options.name,custom_field_settings.custom_field.enum_value,custom_field_settings.custom_field.enum_value.color,custom_field_settings.custom_field.enum_value.enabled,custom_field_settings.custom_field.enum_value.name,custom_field_settings.custom_field.format,custom_field_settings.custom_field.has_notifications_enabled,custom_field_settings.custom_field.html_text_value,custom_field_settings.custom_field.id_prefix,custom_field_settings.custom_field.input_restrictions,custom_field_settings.custom_field.is_formula_field,custom_field_settings.custom_field.is_global_to_workspace,custom_field_settings.custom_field.is_value_read_only,custom_field_settings.custom_field.multi_enum_values,custom_field_settings.custom_field.multi_enum_values.color,custom_field_settings.custom_field.multi_enum_values.enabled,custom_field_settings.custom_field.multi_enum_values.name,custom_field_settings.custom_field.name,custom_field_settings.custom_field.number_value,custom_field_settings.custom_field.people_value,custom_field_settings.custom_field.people_value.name,custom_field_settings.custom_field.precision,custom_field_settings.custom_field.privacy_setting,custom_field_settings.custom_field.reference_value,custom_field_settings.custom_field.reference_value.name,custom_field_settings.custom_field.representation_type,custom_field_settings.custom_field.resource_subtype,custom_field_settings.custom_field.text_value,custom_field_settings.custom_field.type,custom_field_settings.is_important,custom_field_settings.parent,custom_field_settings.parent.name,custom_field_settings.parent.resource_subtype,custom_field_settings.project,custom_field_settings.project.name,custom_field_settings.project.resource_subtype,custom_fields,custom_fields.date_value,custom_fields.date_value.date,custom_fields.date_value.date_time,custom_fields.display_value,custom_fields.enabled,custom_fields.enum_options,custom_fields.enum_options.color,custom_fields.enum_options.enabled,custom_fields.enum_options.name,custom_fields.enum_value,custom_fields.enum_value.color,custom_fields.enum_value.enabled,custom_fields.enum_value.name,custom_fields.id_prefix,custom_fields.input_restrictions,custom_fields.is_formula_field,custom_fields.multi_enum_values,custom_fields.multi_enum_values.color,custom_fields.multi_enum_values.enabled,custom_fields.multi_enum_values.name,custom_fields.name,custom_fields.number_value,custom_fields.representation_type,custom_fields.text_value,custom_fields.type,custom_type,custom_type.asana_created_type_identifier,custom_type.name,default_access_level,default_view,due_date,due_on,followers,followers.name,html_notes,icon,members,members.name,minimum_access_level_for_customization,minimum_access_level_for_sharing,modified_at,name,notes,owner,permalink_url,privacy_setting,project_brief,public,resource_subtype,start_on,team,team.name,workspace,workspace.name\", # list[str] | 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.\n}\n\ntry:\n # Add users to a project\n api_response = projects_api_instance.add_members_for_project(body, project_gid, opts)\n pprint(api_response)\nexcept ApiException as e:\n print(\"Exception when calling ProjectsApi->add_members_for_project: %s\\n\" % e)",
"name": "python-sdk-v5"
},
{
"language": "python",
"install": "pip install asana==3.2.3",
"code": "import asana\n\nclient = asana.Client.access_token('PERSONAL_ACCESS_TOKEN')\n\nresult = client.projects.add_members_for_project(project_gid, {'field': 'value', 'field': 'value'}, opt_pretty=True)",
"name": "python-sdk-v3"
},
{
"language": "php",
"install": "composer require asana/asana",
"code": "<?php\nrequire 'vendor/autoload.php';\n\n$client = Asana\\Client::accessToken('PERSONAL_ACCESS_TOKEN');\n\n$result = $client->projects->addMembersForProject($project_gid, array('field' => 'value', 'field' => 'value'), array('opt_pretty' => 'true'))"
},
{
"language": "ruby",
"install": "gem install asana",
"code": "require 'asana'\n\nclient = Asana::Client.new do |c|\n c.authentication :access_token, 'PERSONAL_ACCESS_TOKEN'\nend\n\nresult = client.projects.add_members_for_project(project_gid: 'project_gid', field: \"value\", field: \"value\", options: {pretty: true})"
}
]
},
"x-purple-suite-runtime": "unavailable"
}
POST /api/1.0/projects/{project_gid}/removeMembers
Remove users from a project
Removes the specified list of users from members of the project.
Returns the updated project record.
This operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.
Authentication
[
{
"personalAccessToken": []
},
{
"oauth2": []
}
]
Path-level parameters and metadata
{
"parameters": [
{
"$ref": "#/components/parameters/project_path_gid"
},
{
"$ref": "#/components/parameters/pretty"
}
]
}
Request, responses and operation details
{
"summary": "Remove users from a project",
"description": "Removes the specified list of users from members of the project.\nReturns the updated project record.\n\nThis operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.",
"tags": [
"Projects"
],
"operationId": "removeMembersForProject",
"parameters": [
{
"name": "opt_fields",
"in": "query",
"description": "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. Properties can include nested fields. To learn more, see the [input/output options guide](/docs/inputoutput-options#selecting-nested-fields).",
"required": false,
"example": [
"archived",
"color",
"completed",
"completed_at",
"completed_by",
"completed_by.name",
"created_at",
"created_from_template",
"created_from_template.name",
"current_status",
"current_status.author",
"current_status.author.name",
"current_status.color",
"current_status.created_at",
"current_status.created_by",
"current_status.created_by.name",
"current_status.html_text",
"current_status.modified_at",
"current_status.text",
"current_status.title",
"current_status_update",
"current_status_update.resource_subtype",
"current_status_update.title",
"custom_field_settings",
"custom_field_settings.custom_field",
"custom_field_settings.custom_field.asana_created_field",
"custom_field_settings.custom_field.created_by",
"custom_field_settings.custom_field.created_by.name",
"custom_field_settings.custom_field.currency_code",
"custom_field_settings.custom_field.custom_label",
"custom_field_settings.custom_field.custom_label_position",
"custom_field_settings.custom_field.date_value",
"custom_field_settings.custom_field.date_value.date",
"custom_field_settings.custom_field.date_value.date_time",
"custom_field_settings.custom_field.default_access_level",
"custom_field_settings.custom_field.description",
"custom_field_settings.custom_field.display_value",
"custom_field_settings.custom_field.enabled",
"custom_field_settings.custom_field.enum_options",
"custom_field_settings.custom_field.enum_options.color",
"custom_field_settings.custom_field.enum_options.enabled",
"custom_field_settings.custom_field.enum_options.name",
"custom_field_settings.custom_field.enum_value",
"custom_field_settings.custom_field.enum_value.color",
"custom_field_settings.custom_field.enum_value.enabled",
"custom_field_settings.custom_field.enum_value.name",
"custom_field_settings.custom_field.format",
"custom_field_settings.custom_field.has_notifications_enabled",
"custom_field_settings.custom_field.html_text_value",
"custom_field_settings.custom_field.id_prefix",
"custom_field_settings.custom_field.input_restrictions",
"custom_field_settings.custom_field.is_formula_field",
"custom_field_settings.custom_field.is_global_to_workspace",
"custom_field_settings.custom_field.is_value_read_only",
"custom_field_settings.custom_field.multi_enum_values",
"custom_field_settings.custom_field.multi_enum_values.color",
"custom_field_settings.custom_field.multi_enum_values.enabled",
"custom_field_settings.custom_field.multi_enum_values.name",
"custom_field_settings.custom_field.name",
"custom_field_settings.custom_field.number_value",
"custom_field_settings.custom_field.people_value",
"custom_field_settings.custom_field.people_value.name",
"custom_field_settings.custom_field.precision",
"custom_field_settings.custom_field.privacy_setting",
"custom_field_settings.custom_field.reference_value",
"custom_field_settings.custom_field.reference_value.name",
"custom_field_settings.custom_field.representation_type",
"custom_field_settings.custom_field.resource_subtype",
"custom_field_settings.custom_field.text_value",
"custom_field_settings.custom_field.type",
"custom_field_settings.is_important",
"custom_field_settings.parent",
"custom_field_settings.parent.name",
"custom_field_settings.parent.resource_subtype",
"custom_field_settings.project",
"custom_field_settings.project.name",
"custom_field_settings.project.resource_subtype",
"custom_fields",
"custom_fields.date_value",
"custom_fields.date_value.date",
"custom_fields.date_value.date_time",
"custom_fields.display_value",
"custom_fields.enabled",
"custom_fields.enum_options",
"custom_fields.enum_options.color",
"custom_fields.enum_options.enabled",
"custom_fields.enum_options.name",
"custom_fields.enum_value",
"custom_fields.enum_value.color",
"custom_fields.enum_value.enabled",
"custom_fields.enum_value.name",
"custom_fields.id_prefix",
"custom_fields.input_restrictions",
"custom_fields.is_formula_field",
"custom_fields.multi_enum_values",
"custom_fields.multi_enum_values.color",
"custom_fields.multi_enum_values.enabled",
"custom_fields.multi_enum_values.name",
"custom_fields.name",
"custom_fields.number_value",
"custom_fields.representation_type",
"custom_fields.text_value",
"custom_fields.type",
"custom_type",
"custom_type.asana_created_type_identifier",
"custom_type.name",
"default_access_level",
"default_view",
"due_date",
"due_on",
"followers",
"followers.name",
"html_notes",
"icon",
"members",
"members.name",
"minimum_access_level_for_customization",
"minimum_access_level_for_sharing",
"modified_at",
"name",
"notes",
"owner",
"permalink_url",
"privacy_setting",
"project_brief",
"public",
"resource_subtype",
"start_on",
"team",
"team.name",
"workspace",
"workspace.name"
],
"schema": {
"type": "array",
"items": {
"type": "string",
"enum": [
"archived",
"color",
"completed",
"completed_at",
"completed_by",
"completed_by.name",
"created_at",
"created_from_template",
"created_from_template.name",
"current_status",
"current_status.author",
"current_status.author.name",
"current_status.color",
"current_status.created_at",
"current_status.created_by",
"current_status.created_by.name",
"current_status.html_text",
"current_status.modified_at",
"current_status.text",
"current_status.title",
"current_status_update",
"current_status_update.resource_subtype",
"current_status_update.title",
"custom_field_settings",
"custom_field_settings.custom_field",
"custom_field_settings.custom_field.asana_created_field",
"custom_field_settings.custom_field.created_by",
"custom_field_settings.custom_field.created_by.name",
"custom_field_settings.custom_field.currency_code",
"custom_field_settings.custom_field.custom_label",
"custom_field_settings.custom_field.custom_label_position",
"custom_field_settings.custom_field.date_value",
"custom_field_settings.custom_field.date_value.date",
"custom_field_settings.custom_field.date_value.date_time",
"custom_field_settings.custom_field.default_access_level",
"custom_field_settings.custom_field.description",
"custom_field_settings.custom_field.display_value",
"custom_field_settings.custom_field.enabled",
"custom_field_settings.custom_field.enum_options",
"custom_field_settings.custom_field.enum_options.color",
"custom_field_settings.custom_field.enum_options.enabled",
"custom_field_settings.custom_field.enum_options.name",
"custom_field_settings.custom_field.enum_value",
"custom_field_settings.custom_field.enum_value.color",
"custom_field_settings.custom_field.enum_value.enabled",
"custom_field_settings.custom_field.enum_value.name",
"custom_field_settings.custom_field.format",
"custom_field_settings.custom_field.has_notifications_enabled",
"custom_field_settings.custom_field.html_text_value",
"custom_field_settings.custom_field.id_prefix",
"custom_field_settings.custom_field.input_restrictions",
"custom_field_settings.custom_field.is_formula_field",
"custom_field_settings.custom_field.is_global_to_workspace",
"custom_field_settings.custom_field.is_value_read_only",
"custom_field_settings.custom_field.multi_enum_values",
"custom_field_settings.custom_field.multi_enum_values.color",
"custom_field_settings.custom_field.multi_enum_values.enabled",
"custom_field_settings.custom_field.multi_enum_values.name",
"custom_field_settings.custom_field.name",
"custom_field_settings.custom_field.number_value",
"custom_field_settings.custom_field.people_value",
"custom_field_settings.custom_field.people_value.name",
"custom_field_settings.custom_field.precision",
"custom_field_settings.custom_field.privacy_setting",
"custom_field_settings.custom_field.reference_value",
"custom_field_settings.custom_field.reference_value.name",
"custom_field_settings.custom_field.representation_type",
"custom_field_settings.custom_field.resource_subtype",
"custom_field_settings.custom_field.text_value",
"custom_field_settings.custom_field.type",
"custom_field_settings.is_important",
"custom_field_settings.parent",
"custom_field_settings.parent.name",
"custom_field_settings.parent.resource_subtype",
"custom_field_settings.project",
"custom_field_settings.project.name",
"custom_field_settings.project.resource_subtype",
"custom_fields",
"custom_fields.date_value",
"custom_fields.date_value.date",
"custom_fields.date_value.date_time",
"custom_fields.display_value",
"custom_fields.enabled",
"custom_fields.enum_options",
"custom_fields.enum_options.color",
"custom_fields.enum_options.enabled",
"custom_fields.enum_options.name",
"custom_fields.enum_value",
"custom_fields.enum_value.color",
"custom_fields.enum_value.enabled",
"custom_fields.enum_value.name",
"custom_fields.id_prefix",
"custom_fields.input_restrictions",
"custom_fields.is_formula_field",
"custom_fields.multi_enum_values",
"custom_fields.multi_enum_values.color",
"custom_fields.multi_enum_values.enabled",
"custom_fields.multi_enum_values.name",
"custom_fields.name",
"custom_fields.number_value",
"custom_fields.representation_type",
"custom_fields.text_value",
"custom_fields.type",
"custom_type",
"custom_type.asana_created_type_identifier",
"custom_type.name",
"default_access_level",
"default_view",
"due_date",
"due_on",
"followers",
"followers.name",
"html_notes",
"icon",
"members",
"members.name",
"minimum_access_level_for_customization",
"minimum_access_level_for_sharing",
"modified_at",
"name",
"notes",
"owner",
"permalink_url",
"privacy_setting",
"project_brief",
"public",
"resource_subtype",
"start_on",
"team",
"team.name",
"workspace",
"workspace.name"
]
}
},
"style": "form",
"explode": false
}
],
"requestBody": {
"description": "Information about the members being removed.",
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"$ref": "#/components/schemas/RemoveMembersRequest"
}
}
}
}
}
},
"responses": {
"200": {
"description": "Successfully removed the members from the project.",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"$ref": "#/components/schemas/ProjectResponse"
}
}
}
}
}
},
"400": {
"$ref": "#/components/responses/BadRequest"
},
"401": {
"$ref": "#/components/responses/Unauthorized"
},
"403": {
"$ref": "#/components/responses/Forbidden"
},
"404": {
"$ref": "#/components/responses/NotFound"
},
"500": {
"$ref": "#/components/responses/InternalServerError"
}
},
"security": [
{
"personalAccessToken": []
},
{
"oauth2": []
}
],
"x-readme": {
"code-samples": [
{
"language": "java",
"install": "<dependency><groupId>com.asana</groupId><artifactId>asana</artifactId><version>1.0.0</version></dependency>",
"code": "import com.asana.Client;\n\nClient client = Client.accessToken(\"PERSONAL_ACCESS_TOKEN\");\n\nProject result = client.projects.removeMembersForProject(projectGid)\n .data(\"field\", \"value\")\n .data(\"field\", \"value\")\n .option(\"pretty\", true)\n .execute();"
},
{
"language": "node",
"install": "npm install asana",
"code": "const Asana = require('asana');\n\nlet client = new Asana.ApiClient();\nclient.authentications.token.accessToken = '<YOUR_ACCESS_TOKEN>';\n\nlet projectsApiInstance = new Asana.ProjectsApi(client);\nlet body = {\"data\": {\"<PARAM_1>\": \"<VALUE_1>\", \"<PARAM_2>\": \"<VALUE_2>\",}}; // Object | Information about the members being removed.\nlet project_gid = \"1331\"; // String | Globally unique identifier for the project.\nlet opts = { \n 'opt_fields': \"archived,color,completed,completed_at,completed_by,completed_by.name,created_at,created_from_template,created_from_template.name,current_status,current_status.author,current_status.author.name,current_status.color,current_status.created_at,current_status.created_by,current_status.created_by.name,current_status.html_text,current_status.modified_at,current_status.text,current_status.title,current_status_update,current_status_update.resource_subtype,current_status_update.title,custom_field_settings,custom_field_settings.custom_field,custom_field_settings.custom_field.asana_created_field,custom_field_settings.custom_field.created_by,custom_field_settings.custom_field.created_by.name,custom_field_settings.custom_field.currency_code,custom_field_settings.custom_field.custom_label,custom_field_settings.custom_field.custom_label_position,custom_field_settings.custom_field.date_value,custom_field_settings.custom_field.date_value.date,custom_field_settings.custom_field.date_value.date_time,custom_field_settings.custom_field.default_access_level,custom_field_settings.custom_field.description,custom_field_settings.custom_field.display_value,custom_field_settings.custom_field.enabled,custom_field_settings.custom_field.enum_options,custom_field_settings.custom_field.enum_options.color,custom_field_settings.custom_field.enum_options.enabled,custom_field_settings.custom_field.enum_options.name,custom_field_settings.custom_field.enum_value,custom_field_settings.custom_field.enum_value.color,custom_field_settings.custom_field.enum_value.enabled,custom_field_settings.custom_field.enum_value.name,custom_field_settings.custom_field.format,custom_field_settings.custom_field.has_notifications_enabled,custom_field_settings.custom_field.html_text_value,custom_field_settings.custom_field.id_prefix,custom_field_settings.custom_field.input_restrictions,custom_field_settings.custom_field.is_formula_field,custom_field_settings.custom_field.is_global_to_workspace,custom_field_settings.custom_field.is_value_read_only,custom_field_settings.custom_field.multi_enum_values,custom_field_settings.custom_field.multi_enum_values.color,custom_field_settings.custom_field.multi_enum_values.enabled,custom_field_settings.custom_field.multi_enum_values.name,custom_field_settings.custom_field.name,custom_field_settings.custom_field.number_value,custom_field_settings.custom_field.people_value,custom_field_settings.custom_field.people_value.name,custom_field_settings.custom_field.precision,custom_field_settings.custom_field.privacy_setting,custom_field_settings.custom_field.reference_value,custom_field_settings.custom_field.reference_value.name,custom_field_settings.custom_field.representation_type,custom_field_settings.custom_field.resource_subtype,custom_field_settings.custom_field.text_value,custom_field_settings.custom_field.type,custom_field_settings.is_important,custom_field_settings.parent,custom_field_settings.parent.name,custom_field_settings.parent.resource_subtype,custom_field_settings.project,custom_field_settings.project.name,custom_field_settings.project.resource_subtype,custom_fields,custom_fields.date_value,custom_fields.date_value.date,custom_fields.date_value.date_time,custom_fields.display_value,custom_fields.enabled,custom_fields.enum_options,custom_fields.enum_options.color,custom_fields.enum_options.enabled,custom_fields.enum_options.name,custom_fields.enum_value,custom_fields.enum_value.color,custom_fields.enum_value.enabled,custom_fields.enum_value.name,custom_fields.id_prefix,custom_fields.input_restrictions,custom_fields.is_formula_field,custom_fields.multi_enum_values,custom_fields.multi_enum_values.color,custom_fields.multi_enum_values.enabled,custom_fields.multi_enum_values.name,custom_fields.name,custom_fields.number_value,custom_fields.representation_type,custom_fields.text_value,custom_fields.type,custom_type,custom_type.asana_created_type_identifier,custom_type.name,default_access_level,default_view,due_date,due_on,followers,followers.name,html_notes,icon,members,members.name,minimum_access_level_for_customization,minimum_access_level_for_sharing,modified_at,name,notes,owner,permalink_url,privacy_setting,project_brief,public,resource_subtype,start_on,team,team.name,workspace,workspace.name\"\n};\nprojectsApiInstance.removeMembersForProject(body, project_gid, opts).then((result) => {\n console.log('API called successfully. Returned data: ' + JSON.stringify(result.data, null, 2));\n}, (error) => {\n console.error(error.response.body);\n});",
"name": "node-sdk-v3"
},
{
"language": "node",
"install": "npm install asana@1.0.5",
"code": "const asana = require('asana');\n\nconst client = asana.Client.create().useAccessToken('PERSONAL_ACCESS_TOKEN');\n\nclient.projects.removeMembersForProject(projectGid, {field: \"value\", field: \"value\", pretty: true})\n .then((result) => {\n console.log(result);\n });",
"name": "node-sdk-v1"
},
{
"language": "python",
"install": "pip install asana",
"code": "import asana\nfrom asana.rest import ApiException\nfrom pprint import pprint\n\nconfiguration = asana.Configuration()\nconfiguration.access_token = '<YOUR_ACCESS_TOKEN>'\napi_client = asana.ApiClient(configuration)\n\n# create an instance of the API class\nprojects_api_instance = asana.ProjectsApi(api_client)\nbody = {\"data\": {\"<PARAM_1>\": \"<VALUE_1>\", \"<PARAM_2>\": \"<VALUE_2>\",}} # dict | Information about the members being removed.\nproject_gid = \"1331\" # str | Globally unique identifier for the project.\nopts = {\n 'opt_fields': \"archived,color,completed,completed_at,completed_by,completed_by.name,created_at,created_from_template,created_from_template.name,current_status,current_status.author,current_status.author.name,current_status.color,current_status.created_at,current_status.created_by,current_status.created_by.name,current_status.html_text,current_status.modified_at,current_status.text,current_status.title,current_status_update,current_status_update.resource_subtype,current_status_update.title,custom_field_settings,custom_field_settings.custom_field,custom_field_settings.custom_field.asana_created_field,custom_field_settings.custom_field.created_by,custom_field_settings.custom_field.created_by.name,custom_field_settings.custom_field.currency_code,custom_field_settings.custom_field.custom_label,custom_field_settings.custom_field.custom_label_position,custom_field_settings.custom_field.date_value,custom_field_settings.custom_field.date_value.date,custom_field_settings.custom_field.date_value.date_time,custom_field_settings.custom_field.default_access_level,custom_field_settings.custom_field.description,custom_field_settings.custom_field.display_value,custom_field_settings.custom_field.enabled,custom_field_settings.custom_field.enum_options,custom_field_settings.custom_field.enum_options.color,custom_field_settings.custom_field.enum_options.enabled,custom_field_settings.custom_field.enum_options.name,custom_field_settings.custom_field.enum_value,custom_field_settings.custom_field.enum_value.color,custom_field_settings.custom_field.enum_value.enabled,custom_field_settings.custom_field.enum_value.name,custom_field_settings.custom_field.format,custom_field_settings.custom_field.has_notifications_enabled,custom_field_settings.custom_field.html_text_value,custom_field_settings.custom_field.id_prefix,custom_field_settings.custom_field.input_restrictions,custom_field_settings.custom_field.is_formula_field,custom_field_settings.custom_field.is_global_to_workspace,custom_field_settings.custom_field.is_value_read_only,custom_field_settings.custom_field.multi_enum_values,custom_field_settings.custom_field.multi_enum_values.color,custom_field_settings.custom_field.multi_enum_values.enabled,custom_field_settings.custom_field.multi_enum_values.name,custom_field_settings.custom_field.name,custom_field_settings.custom_field.number_value,custom_field_settings.custom_field.people_value,custom_field_settings.custom_field.people_value.name,custom_field_settings.custom_field.precision,custom_field_settings.custom_field.privacy_setting,custom_field_settings.custom_field.reference_value,custom_field_settings.custom_field.reference_value.name,custom_field_settings.custom_field.representation_type,custom_field_settings.custom_field.resource_subtype,custom_field_settings.custom_field.text_value,custom_field_settings.custom_field.type,custom_field_settings.is_important,custom_field_settings.parent,custom_field_settings.parent.name,custom_field_settings.parent.resource_subtype,custom_field_settings.project,custom_field_settings.project.name,custom_field_settings.project.resource_subtype,custom_fields,custom_fields.date_value,custom_fields.date_value.date,custom_fields.date_value.date_time,custom_fields.display_value,custom_fields.enabled,custom_fields.enum_options,custom_fields.enum_options.color,custom_fields.enum_options.enabled,custom_fields.enum_options.name,custom_fields.enum_value,custom_fields.enum_value.color,custom_fields.enum_value.enabled,custom_fields.enum_value.name,custom_fields.id_prefix,custom_fields.input_restrictions,custom_fields.is_formula_field,custom_fields.multi_enum_values,custom_fields.multi_enum_values.color,custom_fields.multi_enum_values.enabled,custom_fields.multi_enum_values.name,custom_fields.name,custom_fields.number_value,custom_fields.representation_type,custom_fields.text_value,custom_fields.type,custom_type,custom_type.asana_created_type_identifier,custom_type.name,default_access_level,default_view,due_date,due_on,followers,followers.name,html_notes,icon,members,members.name,minimum_access_level_for_customization,minimum_access_level_for_sharing,modified_at,name,notes,owner,permalink_url,privacy_setting,project_brief,public,resource_subtype,start_on,team,team.name,workspace,workspace.name\", # list[str] | 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.\n}\n\ntry:\n # Remove users from a project\n api_response = projects_api_instance.remove_members_for_project(body, project_gid, opts)\n pprint(api_response)\nexcept ApiException as e:\n print(\"Exception when calling ProjectsApi->remove_members_for_project: %s\\n\" % e)",
"name": "python-sdk-v5"
},
{
"language": "python",
"install": "pip install asana==3.2.3",
"code": "import asana\n\nclient = asana.Client.access_token('PERSONAL_ACCESS_TOKEN')\n\nresult = client.projects.remove_members_for_project(project_gid, {'field': 'value', 'field': 'value'}, opt_pretty=True)",
"name": "python-sdk-v3"
},
{
"language": "php",
"install": "composer require asana/asana",
"code": "<?php\nrequire 'vendor/autoload.php';\n\n$client = Asana\\Client::accessToken('PERSONAL_ACCESS_TOKEN');\n\n$result = $client->projects->removeMembersForProject($project_gid, array('field' => 'value', 'field' => 'value'), array('opt_pretty' => 'true'))"
},
{
"language": "ruby",
"install": "gem install asana",
"code": "require 'asana'\n\nclient = Asana::Client.new do |c|\n c.authentication :access_token, 'PERSONAL_ACCESS_TOKEN'\nend\n\nresult = client.projects.remove_members_for_project(project_gid: 'project_gid', field: \"value\", field: \"value\", options: {pretty: true})"
}
]
},
"x-purple-suite-runtime": "unavailable"
}
POST /api/1.0/projects/{project_gid}/addFollowers
Add followers to a project
Adds the specified list of users as followers to the project. Followers are a subset of members who have opted in to receive "tasks added" notifications for a project. Therefore, if the users are not already members of the project, they will also become members as a result of this operation.
Returns the updated project record.
This operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.
Authentication
[
{
"personalAccessToken": []
},
{
"oauth2": []
}
]
Path-level parameters and metadata
{
"parameters": [
{
"$ref": "#/components/parameters/project_path_gid"
},
{
"$ref": "#/components/parameters/pretty"
}
]
}
Request, responses and operation details
{
"summary": "Add followers to a project",
"description": "Adds the specified list of users as followers to the project. Followers are a subset of members who have opted in to receive \"tasks added\" notifications for a project. Therefore, if the users are not already members of the project, they will also become members as a result of this operation.\nReturns the updated project record.\n\nThis operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.",
"tags": [
"Projects"
],
"operationId": "addFollowersForProject",
"parameters": [
{
"name": "opt_fields",
"in": "query",
"description": "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. Properties can include nested fields. To learn more, see the [input/output options guide](/docs/inputoutput-options#selecting-nested-fields).",
"required": false,
"example": [
"archived",
"color",
"completed",
"completed_at",
"completed_by",
"completed_by.name",
"created_at",
"created_from_template",
"created_from_template.name",
"current_status",
"current_status.author",
"current_status.author.name",
"current_status.color",
"current_status.created_at",
"current_status.created_by",
"current_status.created_by.name",
"current_status.html_text",
"current_status.modified_at",
"current_status.text",
"current_status.title",
"current_status_update",
"current_status_update.resource_subtype",
"current_status_update.title",
"custom_field_settings",
"custom_field_settings.custom_field",
"custom_field_settings.custom_field.asana_created_field",
"custom_field_settings.custom_field.created_by",
"custom_field_settings.custom_field.created_by.name",
"custom_field_settings.custom_field.currency_code",
"custom_field_settings.custom_field.custom_label",
"custom_field_settings.custom_field.custom_label_position",
"custom_field_settings.custom_field.date_value",
"custom_field_settings.custom_field.date_value.date",
"custom_field_settings.custom_field.date_value.date_time",
"custom_field_settings.custom_field.default_access_level",
"custom_field_settings.custom_field.description",
"custom_field_settings.custom_field.display_value",
"custom_field_settings.custom_field.enabled",
"custom_field_settings.custom_field.enum_options",
"custom_field_settings.custom_field.enum_options.color",
"custom_field_settings.custom_field.enum_options.enabled",
"custom_field_settings.custom_field.enum_options.name",
"custom_field_settings.custom_field.enum_value",
"custom_field_settings.custom_field.enum_value.color",
"custom_field_settings.custom_field.enum_value.enabled",
"custom_field_settings.custom_field.enum_value.name",
"custom_field_settings.custom_field.format",
"custom_field_settings.custom_field.has_notifications_enabled",
"custom_field_settings.custom_field.html_text_value",
"custom_field_settings.custom_field.id_prefix",
"custom_field_settings.custom_field.input_restrictions",
"custom_field_settings.custom_field.is_formula_field",
"custom_field_settings.custom_field.is_global_to_workspace",
"custom_field_settings.custom_field.is_value_read_only",
"custom_field_settings.custom_field.multi_enum_values",
"custom_field_settings.custom_field.multi_enum_values.color",
"custom_field_settings.custom_field.multi_enum_values.enabled",
"custom_field_settings.custom_field.multi_enum_values.name",
"custom_field_settings.custom_field.name",
"custom_field_settings.custom_field.number_value",
"custom_field_settings.custom_field.people_value",
"custom_field_settings.custom_field.people_value.name",
"custom_field_settings.custom_field.precision",
"custom_field_settings.custom_field.privacy_setting",
"custom_field_settings.custom_field.reference_value",
"custom_field_settings.custom_field.reference_value.name",
"custom_field_settings.custom_field.representation_type",
"custom_field_settings.custom_field.resource_subtype",
"custom_field_settings.custom_field.text_value",
"custom_field_settings.custom_field.type",
"custom_field_settings.is_important",
"custom_field_settings.parent",
"custom_field_settings.parent.name",
"custom_field_settings.parent.resource_subtype",
"custom_field_settings.project",
"custom_field_settings.project.name",
"custom_field_settings.project.resource_subtype",
"custom_fields",
"custom_fields.date_value",
"custom_fields.date_value.date",
"custom_fields.date_value.date_time",
"custom_fields.display_value",
"custom_fields.enabled",
"custom_fields.enum_options",
"custom_fields.enum_options.color",
"custom_fields.enum_options.enabled",
"custom_fields.enum_options.name",
"custom_fields.enum_value",
"custom_fields.enum_value.color",
"custom_fields.enum_value.enabled",
"custom_fields.enum_value.name",
"custom_fields.id_prefix",
"custom_fields.input_restrictions",
"custom_fields.is_formula_field",
"custom_fields.multi_enum_values",
"custom_fields.multi_enum_values.color",
"custom_fields.multi_enum_values.enabled",
"custom_fields.multi_enum_values.name",
"custom_fields.name",
"custom_fields.number_value",
"custom_fields.representation_type",
"custom_fields.text_value",
"custom_fields.type",
"custom_type",
"custom_type.asana_created_type_identifier",
"custom_type.name",
"default_access_level",
"default_view",
"due_date",
"due_on",
"followers",
"followers.name",
"html_notes",
"icon",
"members",
"members.name",
"minimum_access_level_for_customization",
"minimum_access_level_for_sharing",
"modified_at",
"name",
"notes",
"owner",
"permalink_url",
"privacy_setting",
"project_brief",
"public",
"resource_subtype",
"start_on",
"team",
"team.name",
"workspace",
"workspace.name"
],
"schema": {
"type": "array",
"items": {
"type": "string",
"enum": [
"archived",
"color",
"completed",
"completed_at",
"completed_by",
"completed_by.name",
"created_at",
"created_from_template",
"created_from_template.name",
"current_status",
"current_status.author",
"current_status.author.name",
"current_status.color",
"current_status.created_at",
"current_status.created_by",
"current_status.created_by.name",
"current_status.html_text",
"current_status.modified_at",
"current_status.text",
"current_status.title",
"current_status_update",
"current_status_update.resource_subtype",
"current_status_update.title",
"custom_field_settings",
"custom_field_settings.custom_field",
"custom_field_settings.custom_field.asana_created_field",
"custom_field_settings.custom_field.created_by",
"custom_field_settings.custom_field.created_by.name",
"custom_field_settings.custom_field.currency_code",
"custom_field_settings.custom_field.custom_label",
"custom_field_settings.custom_field.custom_label_position",
"custom_field_settings.custom_field.date_value",
"custom_field_settings.custom_field.date_value.date",
"custom_field_settings.custom_field.date_value.date_time",
"custom_field_settings.custom_field.default_access_level",
"custom_field_settings.custom_field.description",
"custom_field_settings.custom_field.display_value",
"custom_field_settings.custom_field.enabled",
"custom_field_settings.custom_field.enum_options",
"custom_field_settings.custom_field.enum_options.color",
"custom_field_settings.custom_field.enum_options.enabled",
"custom_field_settings.custom_field.enum_options.name",
"custom_field_settings.custom_field.enum_value",
"custom_field_settings.custom_field.enum_value.color",
"custom_field_settings.custom_field.enum_value.enabled",
"custom_field_settings.custom_field.enum_value.name",
"custom_field_settings.custom_field.format",
"custom_field_settings.custom_field.has_notifications_enabled",
"custom_field_settings.custom_field.html_text_value",
"custom_field_settings.custom_field.id_prefix",
"custom_field_settings.custom_field.input_restrictions",
"custom_field_settings.custom_field.is_formula_field",
"custom_field_settings.custom_field.is_global_to_workspace",
"custom_field_settings.custom_field.is_value_read_only",
"custom_field_settings.custom_field.multi_enum_values",
"custom_field_settings.custom_field.multi_enum_values.color",
"custom_field_settings.custom_field.multi_enum_values.enabled",
"custom_field_settings.custom_field.multi_enum_values.name",
"custom_field_settings.custom_field.name",
"custom_field_settings.custom_field.number_value",
"custom_field_settings.custom_field.people_value",
"custom_field_settings.custom_field.people_value.name",
"custom_field_settings.custom_field.precision",
"custom_field_settings.custom_field.privacy_setting",
"custom_field_settings.custom_field.reference_value",
"custom_field_settings.custom_field.reference_value.name",
"custom_field_settings.custom_field.representation_type",
"custom_field_settings.custom_field.resource_subtype",
"custom_field_settings.custom_field.text_value",
"custom_field_settings.custom_field.type",
"custom_field_settings.is_important",
"custom_field_settings.parent",
"custom_field_settings.parent.name",
"custom_field_settings.parent.resource_subtype",
"custom_field_settings.project",
"custom_field_settings.project.name",
"custom_field_settings.project.resource_subtype",
"custom_fields",
"custom_fields.date_value",
"custom_fields.date_value.date",
"custom_fields.date_value.date_time",
"custom_fields.display_value",
"custom_fields.enabled",
"custom_fields.enum_options",
"custom_fields.enum_options.color",
"custom_fields.enum_options.enabled",
"custom_fields.enum_options.name",
"custom_fields.enum_value",
"custom_fields.enum_value.color",
"custom_fields.enum_value.enabled",
"custom_fields.enum_value.name",
"custom_fields.id_prefix",
"custom_fields.input_restrictions",
"custom_fields.is_formula_field",
"custom_fields.multi_enum_values",
"custom_fields.multi_enum_values.color",
"custom_fields.multi_enum_values.enabled",
"custom_fields.multi_enum_values.name",
"custom_fields.name",
"custom_fields.number_value",
"custom_fields.representation_type",
"custom_fields.text_value",
"custom_fields.type",
"custom_type",
"custom_type.asana_created_type_identifier",
"custom_type.name",
"default_access_level",
"default_view",
"due_date",
"due_on",
"followers",
"followers.name",
"html_notes",
"icon",
"members",
"members.name",
"minimum_access_level_for_customization",
"minimum_access_level_for_sharing",
"modified_at",
"name",
"notes",
"owner",
"permalink_url",
"privacy_setting",
"project_brief",
"public",
"resource_subtype",
"start_on",
"team",
"team.name",
"workspace",
"workspace.name"
]
}
},
"style": "form",
"explode": false
}
],
"requestBody": {
"description": "Information about the followers being added.",
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"$ref": "#/components/schemas/AddFollowersRequest"
}
}
}
}
}
},
"responses": {
"200": {
"description": "Successfully added followers to the project.",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"$ref": "#/components/schemas/ProjectResponse"
}
}
}
}
}
},
"400": {
"$ref": "#/components/responses/BadRequest"
},
"401": {
"$ref": "#/components/responses/Unauthorized"
},
"403": {
"$ref": "#/components/responses/Forbidden"
},
"404": {
"$ref": "#/components/responses/NotFound"
},
"500": {
"$ref": "#/components/responses/InternalServerError"
}
},
"security": [
{
"personalAccessToken": []
},
{
"oauth2": []
}
],
"x-readme": {
"code-samples": [
{
"language": "java",
"install": "<dependency><groupId>com.asana</groupId><artifactId>asana</artifactId><version>1.0.0</version></dependency>",
"code": "import com.asana.Client;\n\nClient client = Client.accessToken(\"PERSONAL_ACCESS_TOKEN\");\n\nProject result = client.projects.addFollowersForProject(projectGid)\n .data(\"field\", \"value\")\n .data(\"field\", \"value\")\n .option(\"pretty\", true)\n .execute();"
},
{
"language": "node",
"install": "npm install asana",
"code": "const Asana = require('asana');\n\nlet client = new Asana.ApiClient();\nclient.authentications.token.accessToken = '<YOUR_ACCESS_TOKEN>';\n\nlet projectsApiInstance = new Asana.ProjectsApi(client);\nlet body = {\"data\": {\"<PARAM_1>\": \"<VALUE_1>\", \"<PARAM_2>\": \"<VALUE_2>\",}}; // Object | Information about the followers being added.\nlet project_gid = \"1331\"; // String | Globally unique identifier for the project.\nlet opts = { \n 'opt_fields': \"archived,color,completed,completed_at,completed_by,completed_by.name,created_at,created_from_template,created_from_template.name,current_status,current_status.author,current_status.author.name,current_status.color,current_status.created_at,current_status.created_by,current_status.created_by.name,current_status.html_text,current_status.modified_at,current_status.text,current_status.title,current_status_update,current_status_update.resource_subtype,current_status_update.title,custom_field_settings,custom_field_settings.custom_field,custom_field_settings.custom_field.asana_created_field,custom_field_settings.custom_field.created_by,custom_field_settings.custom_field.created_by.name,custom_field_settings.custom_field.currency_code,custom_field_settings.custom_field.custom_label,custom_field_settings.custom_field.custom_label_position,custom_field_settings.custom_field.date_value,custom_field_settings.custom_field.date_value.date,custom_field_settings.custom_field.date_value.date_time,custom_field_settings.custom_field.default_access_level,custom_field_settings.custom_field.description,custom_field_settings.custom_field.display_value,custom_field_settings.custom_field.enabled,custom_field_settings.custom_field.enum_options,custom_field_settings.custom_field.enum_options.color,custom_field_settings.custom_field.enum_options.enabled,custom_field_settings.custom_field.enum_options.name,custom_field_settings.custom_field.enum_value,custom_field_settings.custom_field.enum_value.color,custom_field_settings.custom_field.enum_value.enabled,custom_field_settings.custom_field.enum_value.name,custom_field_settings.custom_field.format,custom_field_settings.custom_field.has_notifications_enabled,custom_field_settings.custom_field.html_text_value,custom_field_settings.custom_field.id_prefix,custom_field_settings.custom_field.input_restrictions,custom_field_settings.custom_field.is_formula_field,custom_field_settings.custom_field.is_global_to_workspace,custom_field_settings.custom_field.is_value_read_only,custom_field_settings.custom_field.multi_enum_values,custom_field_settings.custom_field.multi_enum_values.color,custom_field_settings.custom_field.multi_enum_values.enabled,custom_field_settings.custom_field.multi_enum_values.name,custom_field_settings.custom_field.name,custom_field_settings.custom_field.number_value,custom_field_settings.custom_field.people_value,custom_field_settings.custom_field.people_value.name,custom_field_settings.custom_field.precision,custom_field_settings.custom_field.privacy_setting,custom_field_settings.custom_field.reference_value,custom_field_settings.custom_field.reference_value.name,custom_field_settings.custom_field.representation_type,custom_field_settings.custom_field.resource_subtype,custom_field_settings.custom_field.text_value,custom_field_settings.custom_field.type,custom_field_settings.is_important,custom_field_settings.parent,custom_field_settings.parent.name,custom_field_settings.parent.resource_subtype,custom_field_settings.project,custom_field_settings.project.name,custom_field_settings.project.resource_subtype,custom_fields,custom_fields.date_value,custom_fields.date_value.date,custom_fields.date_value.date_time,custom_fields.display_value,custom_fields.enabled,custom_fields.enum_options,custom_fields.enum_options.color,custom_fields.enum_options.enabled,custom_fields.enum_options.name,custom_fields.enum_value,custom_fields.enum_value.color,custom_fields.enum_value.enabled,custom_fields.enum_value.name,custom_fields.id_prefix,custom_fields.input_restrictions,custom_fields.is_formula_field,custom_fields.multi_enum_values,custom_fields.multi_enum_values.color,custom_fields.multi_enum_values.enabled,custom_fields.multi_enum_values.name,custom_fields.name,custom_fields.number_value,custom_fields.representation_type,custom_fields.text_value,custom_fields.type,custom_type,custom_type.asana_created_type_identifier,custom_type.name,default_access_level,default_view,due_date,due_on,followers,followers.name,html_notes,icon,members,members.name,minimum_access_level_for_customization,minimum_access_level_for_sharing,modified_at,name,notes,owner,permalink_url,privacy_setting,project_brief,public,resource_subtype,start_on,team,team.name,workspace,workspace.name\"\n};\nprojectsApiInstance.addFollowersForProject(body, project_gid, opts).then((result) => {\n console.log('API called successfully. Returned data: ' + JSON.stringify(result.data, null, 2));\n}, (error) => {\n console.error(error.response.body);\n});",
"name": "node-sdk-v3"
},
{
"language": "node",
"install": "npm install asana@1.0.5",
"code": "const asana = require('asana');\n\nconst client = asana.Client.create().useAccessToken('PERSONAL_ACCESS_TOKEN');\n\nclient.projects.addFollowersForProject(projectGid, {field: \"value\", field: \"value\", pretty: true})\n .then((result) => {\n console.log(result);\n });",
"name": "node-sdk-v1"
},
{
"language": "python",
"install": "pip install asana",
"code": "import asana\nfrom asana.rest import ApiException\nfrom pprint import pprint\n\nconfiguration = asana.Configuration()\nconfiguration.access_token = '<YOUR_ACCESS_TOKEN>'\napi_client = asana.ApiClient(configuration)\n\n# create an instance of the API class\nprojects_api_instance = asana.ProjectsApi(api_client)\nbody = {\"data\": {\"<PARAM_1>\": \"<VALUE_1>\", \"<PARAM_2>\": \"<VALUE_2>\",}} # dict | Information about the followers being added.\nproject_gid = \"1331\" # str | Globally unique identifier for the project.\nopts = {\n 'opt_fields': \"archived,color,completed,completed_at,completed_by,completed_by.name,created_at,created_from_template,created_from_template.name,current_status,current_status.author,current_status.author.name,current_status.color,current_status.created_at,current_status.created_by,current_status.created_by.name,current_status.html_text,current_status.modified_at,current_status.text,current_status.title,current_status_update,current_status_update.resource_subtype,current_status_update.title,custom_field_settings,custom_field_settings.custom_field,custom_field_settings.custom_field.asana_created_field,custom_field_settings.custom_field.created_by,custom_field_settings.custom_field.created_by.name,custom_field_settings.custom_field.currency_code,custom_field_settings.custom_field.custom_label,custom_field_settings.custom_field.custom_label_position,custom_field_settings.custom_field.date_value,custom_field_settings.custom_field.date_value.date,custom_field_settings.custom_field.date_value.date_time,custom_field_settings.custom_field.default_access_level,custom_field_settings.custom_field.description,custom_field_settings.custom_field.display_value,custom_field_settings.custom_field.enabled,custom_field_settings.custom_field.enum_options,custom_field_settings.custom_field.enum_options.color,custom_field_settings.custom_field.enum_options.enabled,custom_field_settings.custom_field.enum_options.name,custom_field_settings.custom_field.enum_value,custom_field_settings.custom_field.enum_value.color,custom_field_settings.custom_field.enum_value.enabled,custom_field_settings.custom_field.enum_value.name,custom_field_settings.custom_field.format,custom_field_settings.custom_field.has_notifications_enabled,custom_field_settings.custom_field.html_text_value,custom_field_settings.custom_field.id_prefix,custom_field_settings.custom_field.input_restrictions,custom_field_settings.custom_field.is_formula_field,custom_field_settings.custom_field.is_global_to_workspace,custom_field_settings.custom_field.is_value_read_only,custom_field_settings.custom_field.multi_enum_values,custom_field_settings.custom_field.multi_enum_values.color,custom_field_settings.custom_field.multi_enum_values.enabled,custom_field_settings.custom_field.multi_enum_values.name,custom_field_settings.custom_field.name,custom_field_settings.custom_field.number_value,custom_field_settings.custom_field.people_value,custom_field_settings.custom_field.people_value.name,custom_field_settings.custom_field.precision,custom_field_settings.custom_field.privacy_setting,custom_field_settings.custom_field.reference_value,custom_field_settings.custom_field.reference_value.name,custom_field_settings.custom_field.representation_type,custom_field_settings.custom_field.resource_subtype,custom_field_settings.custom_field.text_value,custom_field_settings.custom_field.type,custom_field_settings.is_important,custom_field_settings.parent,custom_field_settings.parent.name,custom_field_settings.parent.resource_subtype,custom_field_settings.project,custom_field_settings.project.name,custom_field_settings.project.resource_subtype,custom_fields,custom_fields.date_value,custom_fields.date_value.date,custom_fields.date_value.date_time,custom_fields.display_value,custom_fields.enabled,custom_fields.enum_options,custom_fields.enum_options.color,custom_fields.enum_options.enabled,custom_fields.enum_options.name,custom_fields.enum_value,custom_fields.enum_value.color,custom_fields.enum_value.enabled,custom_fields.enum_value.name,custom_fields.id_prefix,custom_fields.input_restrictions,custom_fields.is_formula_field,custom_fields.multi_enum_values,custom_fields.multi_enum_values.color,custom_fields.multi_enum_values.enabled,custom_fields.multi_enum_values.name,custom_fields.name,custom_fields.number_value,custom_fields.representation_type,custom_fields.text_value,custom_fields.type,custom_type,custom_type.asana_created_type_identifier,custom_type.name,default_access_level,default_view,due_date,due_on,followers,followers.name,html_notes,icon,members,members.name,minimum_access_level_for_customization,minimum_access_level_for_sharing,modified_at,name,notes,owner,permalink_url,privacy_setting,project_brief,public,resource_subtype,start_on,team,team.name,workspace,workspace.name\", # list[str] | 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.\n}\n\ntry:\n # Add followers to a project\n api_response = projects_api_instance.add_followers_for_project(body, project_gid, opts)\n pprint(api_response)\nexcept ApiException as e:\n print(\"Exception when calling ProjectsApi->add_followers_for_project: %s\\n\" % e)",
"name": "python-sdk-v5"
},
{
"language": "python",
"install": "pip install asana==3.2.3",
"code": "import asana\n\nclient = asana.Client.access_token('PERSONAL_ACCESS_TOKEN')\n\nresult = client.projects.add_followers_for_project(project_gid, {'field': 'value', 'field': 'value'}, opt_pretty=True)",
"name": "python-sdk-v3"
},
{
"language": "php",
"install": "composer require asana/asana",
"code": "<?php\nrequire 'vendor/autoload.php';\n\n$client = Asana\\Client::accessToken('PERSONAL_ACCESS_TOKEN');\n\n$result = $client->projects->addFollowersForProject($project_gid, array('field' => 'value', 'field' => 'value'), array('opt_pretty' => 'true'))"
},
{
"language": "ruby",
"install": "gem install asana",
"code": "require 'asana'\n\nclient = Asana::Client.new do |c|\n c.authentication :access_token, 'PERSONAL_ACCESS_TOKEN'\nend\n\nresult = client.projects.add_followers_for_project(project_gid: 'project_gid', field: \"value\", field: \"value\", options: {pretty: true})"
}
]
},
"x-purple-suite-runtime": "unavailable"
}
POST /api/1.0/projects/{project_gid}/removeFollowers
Remove followers from a project
Removes the specified list of users from following the project, this will not affect project membership status.
Returns the updated project record.
This operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.
Authentication
[
{
"personalAccessToken": []
},
{
"oauth2": []
}
]
Path-level parameters and metadata
{
"parameters": [
{
"$ref": "#/components/parameters/project_path_gid"
},
{
"$ref": "#/components/parameters/pretty"
}
]
}
Request, responses and operation details
{
"summary": "Remove followers from a project",
"description": "Removes the specified list of users from following the project, this will not affect project membership status.\nReturns the updated project record.\n\nThis operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.",
"tags": [
"Projects"
],
"operationId": "removeFollowersForProject",
"parameters": [
{
"name": "opt_fields",
"in": "query",
"description": "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. Properties can include nested fields. To learn more, see the [input/output options guide](/docs/inputoutput-options#selecting-nested-fields).",
"required": false,
"example": [
"archived",
"color",
"completed",
"completed_at",
"completed_by",
"completed_by.name",
"created_at",
"created_from_template",
"created_from_template.name",
"current_status",
"current_status.author",
"current_status.author.name",
"current_status.color",
"current_status.created_at",
"current_status.created_by",
"current_status.created_by.name",
"current_status.html_text",
"current_status.modified_at",
"current_status.text",
"current_status.title",
"current_status_update",
"current_status_update.resource_subtype",
"current_status_update.title",
"custom_field_settings",
"custom_field_settings.custom_field",
"custom_field_settings.custom_field.asana_created_field",
"custom_field_settings.custom_field.created_by",
"custom_field_settings.custom_field.created_by.name",
"custom_field_settings.custom_field.currency_code",
"custom_field_settings.custom_field.custom_label",
"custom_field_settings.custom_field.custom_label_position",
"custom_field_settings.custom_field.date_value",
"custom_field_settings.custom_field.date_value.date",
"custom_field_settings.custom_field.date_value.date_time",
"custom_field_settings.custom_field.default_access_level",
"custom_field_settings.custom_field.description",
"custom_field_settings.custom_field.display_value",
"custom_field_settings.custom_field.enabled",
"custom_field_settings.custom_field.enum_options",
"custom_field_settings.custom_field.enum_options.color",
"custom_field_settings.custom_field.enum_options.enabled",
"custom_field_settings.custom_field.enum_options.name",
"custom_field_settings.custom_field.enum_value",
"custom_field_settings.custom_field.enum_value.color",
"custom_field_settings.custom_field.enum_value.enabled",
"custom_field_settings.custom_field.enum_value.name",
"custom_field_settings.custom_field.format",
"custom_field_settings.custom_field.has_notifications_enabled",
"custom_field_settings.custom_field.html_text_value",
"custom_field_settings.custom_field.id_prefix",
"custom_field_settings.custom_field.input_restrictions",
"custom_field_settings.custom_field.is_formula_field",
"custom_field_settings.custom_field.is_global_to_workspace",
"custom_field_settings.custom_field.is_value_read_only",
"custom_field_settings.custom_field.multi_enum_values",
"custom_field_settings.custom_field.multi_enum_values.color",
"custom_field_settings.custom_field.multi_enum_values.enabled",
"custom_field_settings.custom_field.multi_enum_values.name",
"custom_field_settings.custom_field.name",
"custom_field_settings.custom_field.number_value",
"custom_field_settings.custom_field.people_value",
"custom_field_settings.custom_field.people_value.name",
"custom_field_settings.custom_field.precision",
"custom_field_settings.custom_field.privacy_setting",
"custom_field_settings.custom_field.reference_value",
"custom_field_settings.custom_field.reference_value.name",
"custom_field_settings.custom_field.representation_type",
"custom_field_settings.custom_field.resource_subtype",
"custom_field_settings.custom_field.text_value",
"custom_field_settings.custom_field.type",
"custom_field_settings.is_important",
"custom_field_settings.parent",
"custom_field_settings.parent.name",
"custom_field_settings.parent.resource_subtype",
"custom_field_settings.project",
"custom_field_settings.project.name",
"custom_field_settings.project.resource_subtype",
"custom_fields",
"custom_fields.date_value",
"custom_fields.date_value.date",
"custom_fields.date_value.date_time",
"custom_fields.display_value",
"custom_fields.enabled",
"custom_fields.enum_options",
"custom_fields.enum_options.color",
"custom_fields.enum_options.enabled",
"custom_fields.enum_options.name",
"custom_fields.enum_value",
"custom_fields.enum_value.color",
"custom_fields.enum_value.enabled",
"custom_fields.enum_value.name",
"custom_fields.id_prefix",
"custom_fields.input_restrictions",
"custom_fields.is_formula_field",
"custom_fields.multi_enum_values",
"custom_fields.multi_enum_values.color",
"custom_fields.multi_enum_values.enabled",
"custom_fields.multi_enum_values.name",
"custom_fields.name",
"custom_fields.number_value",
"custom_fields.representation_type",
"custom_fields.text_value",
"custom_fields.type",
"custom_type",
"custom_type.asana_created_type_identifier",
"custom_type.name",
"default_access_level",
"default_view",
"due_date",
"due_on",
"followers",
"followers.name",
"html_notes",
"icon",
"members",
"members.name",
"minimum_access_level_for_customization",
"minimum_access_level_for_sharing",
"modified_at",
"name",
"notes",
"owner",
"permalink_url",
"privacy_setting",
"project_brief",
"public",
"resource_subtype",
"start_on",
"team",
"team.name",
"workspace",
"workspace.name"
],
"schema": {
"type": "array",
"items": {
"type": "string",
"enum": [
"archived",
"color",
"completed",
"completed_at",
"completed_by",
"completed_by.name",
"created_at",
"created_from_template",
"created_from_template.name",
"current_status",
"current_status.author",
"current_status.author.name",
"current_status.color",
"current_status.created_at",
"current_status.created_by",
"current_status.created_by.name",
"current_status.html_text",
"current_status.modified_at",
"current_status.text",
"current_status.title",
"current_status_update",
"current_status_update.resource_subtype",
"current_status_update.title",
"custom_field_settings",
"custom_field_settings.custom_field",
"custom_field_settings.custom_field.asana_created_field",
"custom_field_settings.custom_field.created_by",
"custom_field_settings.custom_field.created_by.name",
"custom_field_settings.custom_field.currency_code",
"custom_field_settings.custom_field.custom_label",
"custom_field_settings.custom_field.custom_label_position",
"custom_field_settings.custom_field.date_value",
"custom_field_settings.custom_field.date_value.date",
"custom_field_settings.custom_field.date_value.date_time",
"custom_field_settings.custom_field.default_access_level",
"custom_field_settings.custom_field.description",
"custom_field_settings.custom_field.display_value",
"custom_field_settings.custom_field.enabled",
"custom_field_settings.custom_field.enum_options",
"custom_field_settings.custom_field.enum_options.color",
"custom_field_settings.custom_field.enum_options.enabled",
"custom_field_settings.custom_field.enum_options.name",
"custom_field_settings.custom_field.enum_value",
"custom_field_settings.custom_field.enum_value.color",
"custom_field_settings.custom_field.enum_value.enabled",
"custom_field_settings.custom_field.enum_value.name",
"custom_field_settings.custom_field.format",
"custom_field_settings.custom_field.has_notifications_enabled",
"custom_field_settings.custom_field.html_text_value",
"custom_field_settings.custom_field.id_prefix",
"custom_field_settings.custom_field.input_restrictions",
"custom_field_settings.custom_field.is_formula_field",
"custom_field_settings.custom_field.is_global_to_workspace",
"custom_field_settings.custom_field.is_value_read_only",
"custom_field_settings.custom_field.multi_enum_values",
"custom_field_settings.custom_field.multi_enum_values.color",
"custom_field_settings.custom_field.multi_enum_values.enabled",
"custom_field_settings.custom_field.multi_enum_values.name",
"custom_field_settings.custom_field.name",
"custom_field_settings.custom_field.number_value",
"custom_field_settings.custom_field.people_value",
"custom_field_settings.custom_field.people_value.name",
"custom_field_settings.custom_field.precision",
"custom_field_settings.custom_field.privacy_setting",
"custom_field_settings.custom_field.reference_value",
"custom_field_settings.custom_field.reference_value.name",
"custom_field_settings.custom_field.representation_type",
"custom_field_settings.custom_field.resource_subtype",
"custom_field_settings.custom_field.text_value",
"custom_field_settings.custom_field.type",
"custom_field_settings.is_important",
"custom_field_settings.parent",
"custom_field_settings.parent.name",
"custom_field_settings.parent.resource_subtype",
"custom_field_settings.project",
"custom_field_settings.project.name",
"custom_field_settings.project.resource_subtype",
"custom_fields",
"custom_fields.date_value",
"custom_fields.date_value.date",
"custom_fields.date_value.date_time",
"custom_fields.display_value",
"custom_fields.enabled",
"custom_fields.enum_options",
"custom_fields.enum_options.color",
"custom_fields.enum_options.enabled",
"custom_fields.enum_options.name",
"custom_fields.enum_value",
"custom_fields.enum_value.color",
"custom_fields.enum_value.enabled",
"custom_fields.enum_value.name",
"custom_fields.id_prefix",
"custom_fields.input_restrictions",
"custom_fields.is_formula_field",
"custom_fields.multi_enum_values",
"custom_fields.multi_enum_values.color",
"custom_fields.multi_enum_values.enabled",
"custom_fields.multi_enum_values.name",
"custom_fields.name",
"custom_fields.number_value",
"custom_fields.representation_type",
"custom_fields.text_value",
"custom_fields.type",
"custom_type",
"custom_type.asana_created_type_identifier",
"custom_type.name",
"default_access_level",
"default_view",
"due_date",
"due_on",
"followers",
"followers.name",
"html_notes",
"icon",
"members",
"members.name",
"minimum_access_level_for_customization",
"minimum_access_level_for_sharing",
"modified_at",
"name",
"notes",
"owner",
"permalink_url",
"privacy_setting",
"project_brief",
"public",
"resource_subtype",
"start_on",
"team",
"team.name",
"workspace",
"workspace.name"
]
}
},
"style": "form",
"explode": false
}
],
"requestBody": {
"description": "Information about the followers being removed.",
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"$ref": "#/components/schemas/RemoveFollowersRequest"
}
}
}
}
}
},
"responses": {
"200": {
"description": "Successfully removed followers from the project.",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"$ref": "#/components/schemas/ProjectResponse"
}
}
}
}
}
},
"400": {
"$ref": "#/components/responses/BadRequest"
},
"401": {
"$ref": "#/components/responses/Unauthorized"
},
"403": {
"$ref": "#/components/responses/Forbidden"
},
"404": {
"$ref": "#/components/responses/NotFound"
},
"500": {
"$ref": "#/components/responses/InternalServerError"
}
},
"security": [
{
"personalAccessToken": []
},
{
"oauth2": []
}
],
"x-readme": {
"code-samples": [
{
"language": "java",
"install": "<dependency><groupId>com.asana</groupId><artifactId>asana</artifactId><version>1.0.0</version></dependency>",
"code": "import com.asana.Client;\n\nClient client = Client.accessToken(\"PERSONAL_ACCESS_TOKEN\");\n\nProject result = client.projects.removeFollowersForProject(projectGid)\n .data(\"field\", \"value\")\n .data(\"field\", \"value\")\n .option(\"pretty\", true)\n .execute();"
},
{
"language": "node",
"install": "npm install asana",
"code": "const Asana = require('asana');\n\nlet client = new Asana.ApiClient();\nclient.authentications.token.accessToken = '<YOUR_ACCESS_TOKEN>';\n\nlet projectsApiInstance = new Asana.ProjectsApi(client);\nlet body = {\"data\": {\"<PARAM_1>\": \"<VALUE_1>\", \"<PARAM_2>\": \"<VALUE_2>\",}}; // Object | Information about the followers being removed.\nlet project_gid = \"1331\"; // String | Globally unique identifier for the project.\nlet opts = { \n 'opt_fields': \"archived,color,completed,completed_at,completed_by,completed_by.name,created_at,created_from_template,created_from_template.name,current_status,current_status.author,current_status.author.name,current_status.color,current_status.created_at,current_status.created_by,current_status.created_by.name,current_status.html_text,current_status.modified_at,current_status.text,current_status.title,current_status_update,current_status_update.resource_subtype,current_status_update.title,custom_field_settings,custom_field_settings.custom_field,custom_field_settings.custom_field.asana_created_field,custom_field_settings.custom_field.created_by,custom_field_settings.custom_field.created_by.name,custom_field_settings.custom_field.currency_code,custom_field_settings.custom_field.custom_label,custom_field_settings.custom_field.custom_label_position,custom_field_settings.custom_field.date_value,custom_field_settings.custom_field.date_value.date,custom_field_settings.custom_field.date_value.date_time,custom_field_settings.custom_field.default_access_level,custom_field_settings.custom_field.description,custom_field_settings.custom_field.display_value,custom_field_settings.custom_field.enabled,custom_field_settings.custom_field.enum_options,custom_field_settings.custom_field.enum_options.color,custom_field_settings.custom_field.enum_options.enabled,custom_field_settings.custom_field.enum_options.name,custom_field_settings.custom_field.enum_value,custom_field_settings.custom_field.enum_value.color,custom_field_settings.custom_field.enum_value.enabled,custom_field_settings.custom_field.enum_value.name,custom_field_settings.custom_field.format,custom_field_settings.custom_field.has_notifications_enabled,custom_field_settings.custom_field.html_text_value,custom_field_settings.custom_field.id_prefix,custom_field_settings.custom_field.input_restrictions,custom_field_settings.custom_field.is_formula_field,custom_field_settings.custom_field.is_global_to_workspace,custom_field_settings.custom_field.is_value_read_only,custom_field_settings.custom_field.multi_enum_values,custom_field_settings.custom_field.multi_enum_values.color,custom_field_settings.custom_field.multi_enum_values.enabled,custom_field_settings.custom_field.multi_enum_values.name,custom_field_settings.custom_field.name,custom_field_settings.custom_field.number_value,custom_field_settings.custom_field.people_value,custom_field_settings.custom_field.people_value.name,custom_field_settings.custom_field.precision,custom_field_settings.custom_field.privacy_setting,custom_field_settings.custom_field.reference_value,custom_field_settings.custom_field.reference_value.name,custom_field_settings.custom_field.representation_type,custom_field_settings.custom_field.resource_subtype,custom_field_settings.custom_field.text_value,custom_field_settings.custom_field.type,custom_field_settings.is_important,custom_field_settings.parent,custom_field_settings.parent.name,custom_field_settings.parent.resource_subtype,custom_field_settings.project,custom_field_settings.project.name,custom_field_settings.project.resource_subtype,custom_fields,custom_fields.date_value,custom_fields.date_value.date,custom_fields.date_value.date_time,custom_fields.display_value,custom_fields.enabled,custom_fields.enum_options,custom_fields.enum_options.color,custom_fields.enum_options.enabled,custom_fields.enum_options.name,custom_fields.enum_value,custom_fields.enum_value.color,custom_fields.enum_value.enabled,custom_fields.enum_value.name,custom_fields.id_prefix,custom_fields.input_restrictions,custom_fields.is_formula_field,custom_fields.multi_enum_values,custom_fields.multi_enum_values.color,custom_fields.multi_enum_values.enabled,custom_fields.multi_enum_values.name,custom_fields.name,custom_fields.number_value,custom_fields.representation_type,custom_fields.text_value,custom_fields.type,custom_type,custom_type.asana_created_type_identifier,custom_type.name,default_access_level,default_view,due_date,due_on,followers,followers.name,html_notes,icon,members,members.name,minimum_access_level_for_customization,minimum_access_level_for_sharing,modified_at,name,notes,owner,permalink_url,privacy_setting,project_brief,public,resource_subtype,start_on,team,team.name,workspace,workspace.name\"\n};\nprojectsApiInstance.removeFollowersForProject(body, project_gid, opts).then((result) => {\n console.log('API called successfully. Returned data: ' + JSON.stringify(result.data, null, 2));\n}, (error) => {\n console.error(error.response.body);\n});",
"name": "node-sdk-v3"
},
{
"language": "node",
"install": "npm install asana@1.0.5",
"code": "const asana = require('asana');\n\nconst client = asana.Client.create().useAccessToken('PERSONAL_ACCESS_TOKEN');\n\nclient.projects.removeFollowersForProject(projectGid, {field: \"value\", field: \"value\", pretty: true})\n .then((result) => {\n console.log(result);\n });",
"name": "node-sdk-v1"
},
{
"language": "python",
"install": "pip install asana",
"code": "import asana\nfrom asana.rest import ApiException\nfrom pprint import pprint\n\nconfiguration = asana.Configuration()\nconfiguration.access_token = '<YOUR_ACCESS_TOKEN>'\napi_client = asana.ApiClient(configuration)\n\n# create an instance of the API class\nprojects_api_instance = asana.ProjectsApi(api_client)\nbody = {\"data\": {\"<PARAM_1>\": \"<VALUE_1>\", \"<PARAM_2>\": \"<VALUE_2>\",}} # dict | Information about the followers being removed.\nproject_gid = \"1331\" # str | Globally unique identifier for the project.\nopts = {\n 'opt_fields': \"archived,color,completed,completed_at,completed_by,completed_by.name,created_at,created_from_template,created_from_template.name,current_status,current_status.author,current_status.author.name,current_status.color,current_status.created_at,current_status.created_by,current_status.created_by.name,current_status.html_text,current_status.modified_at,current_status.text,current_status.title,current_status_update,current_status_update.resource_subtype,current_status_update.title,custom_field_settings,custom_field_settings.custom_field,custom_field_settings.custom_field.asana_created_field,custom_field_settings.custom_field.created_by,custom_field_settings.custom_field.created_by.name,custom_field_settings.custom_field.currency_code,custom_field_settings.custom_field.custom_label,custom_field_settings.custom_field.custom_label_position,custom_field_settings.custom_field.date_value,custom_field_settings.custom_field.date_value.date,custom_field_settings.custom_field.date_value.date_time,custom_field_settings.custom_field.default_access_level,custom_field_settings.custom_field.description,custom_field_settings.custom_field.display_value,custom_field_settings.custom_field.enabled,custom_field_settings.custom_field.enum_options,custom_field_settings.custom_field.enum_options.color,custom_field_settings.custom_field.enum_options.enabled,custom_field_settings.custom_field.enum_options.name,custom_field_settings.custom_field.enum_value,custom_field_settings.custom_field.enum_value.color,custom_field_settings.custom_field.enum_value.enabled,custom_field_settings.custom_field.enum_value.name,custom_field_settings.custom_field.format,custom_field_settings.custom_field.has_notifications_enabled,custom_field_settings.custom_field.html_text_value,custom_field_settings.custom_field.id_prefix,custom_field_settings.custom_field.input_restrictions,custom_field_settings.custom_field.is_formula_field,custom_field_settings.custom_field.is_global_to_workspace,custom_field_settings.custom_field.is_value_read_only,custom_field_settings.custom_field.multi_enum_values,custom_field_settings.custom_field.multi_enum_values.color,custom_field_settings.custom_field.multi_enum_values.enabled,custom_field_settings.custom_field.multi_enum_values.name,custom_field_settings.custom_field.name,custom_field_settings.custom_field.number_value,custom_field_settings.custom_field.people_value,custom_field_settings.custom_field.people_value.name,custom_field_settings.custom_field.precision,custom_field_settings.custom_field.privacy_setting,custom_field_settings.custom_field.reference_value,custom_field_settings.custom_field.reference_value.name,custom_field_settings.custom_field.representation_type,custom_field_settings.custom_field.resource_subtype,custom_field_settings.custom_field.text_value,custom_field_settings.custom_field.type,custom_field_settings.is_important,custom_field_settings.parent,custom_field_settings.parent.name,custom_field_settings.parent.resource_subtype,custom_field_settings.project,custom_field_settings.project.name,custom_field_settings.project.resource_subtype,custom_fields,custom_fields.date_value,custom_fields.date_value.date,custom_fields.date_value.date_time,custom_fields.display_value,custom_fields.enabled,custom_fields.enum_options,custom_fields.enum_options.color,custom_fields.enum_options.enabled,custom_fields.enum_options.name,custom_fields.enum_value,custom_fields.enum_value.color,custom_fields.enum_value.enabled,custom_fields.enum_value.name,custom_fields.id_prefix,custom_fields.input_restrictions,custom_fields.is_formula_field,custom_fields.multi_enum_values,custom_fields.multi_enum_values.color,custom_fields.multi_enum_values.enabled,custom_fields.multi_enum_values.name,custom_fields.name,custom_fields.number_value,custom_fields.representation_type,custom_fields.text_value,custom_fields.type,custom_type,custom_type.asana_created_type_identifier,custom_type.name,default_access_level,default_view,due_date,due_on,followers,followers.name,html_notes,icon,members,members.name,minimum_access_level_for_customization,minimum_access_level_for_sharing,modified_at,name,notes,owner,permalink_url,privacy_setting,project_brief,public,resource_subtype,start_on,team,team.name,workspace,workspace.name\", # list[str] | 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.\n}\n\ntry:\n # Remove followers from a project\n api_response = projects_api_instance.remove_followers_for_project(body, project_gid, opts)\n pprint(api_response)\nexcept ApiException as e:\n print(\"Exception when calling ProjectsApi->remove_followers_for_project: %s\\n\" % e)",
"name": "python-sdk-v5"
},
{
"language": "python",
"install": "pip install asana==3.2.3",
"code": "import asana\n\nclient = asana.Client.access_token('PERSONAL_ACCESS_TOKEN')\n\nresult = client.projects.remove_followers_for_project(project_gid, {'field': 'value', 'field': 'value'}, opt_pretty=True)",
"name": "python-sdk-v3"
},
{
"language": "php",
"install": "composer require asana/asana",
"code": "<?php\nrequire 'vendor/autoload.php';\n\n$client = Asana\\Client::accessToken('PERSONAL_ACCESS_TOKEN');\n\n$result = $client->projects->removeFollowersForProject($project_gid, array('field' => 'value', 'field' => 'value'), array('opt_pretty' => 'true'))"
},
{
"language": "ruby",
"install": "gem install asana",
"code": "require 'asana'\n\nclient = Asana::Client.new do |c|\n c.authentication :access_token, 'PERSONAL_ACCESS_TOKEN'\nend\n\nresult = client.projects.remove_followers_for_project(project_gid: 'project_gid', field: \"value\", field: \"value\", options: {pretty: true})"
}
]
},
"x-purple-suite-runtime": "unavailable"
}
POST /api/1.0/projects/{project_gid}/saveAsTemplate
Create a project template from a project
Creates and returns a job that will asynchronously handle the project template creation.
This operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.
Authentication
[
{
"personalAccessToken": []
},
{
"oauth2": []
}
]
Path-level parameters and metadata
{
"parameters": [
{
"$ref": "#/components/parameters/project_path_gid"
},
{
"$ref": "#/components/parameters/pretty"
}
]
}
Request, responses and operation details
{
"summary": "Create a project template from a project",
"description": "Creates and returns a job that will asynchronously handle the project template creation.\n\nThis operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.",
"tags": [
"Projects"
],
"operationId": "projectSaveAsTemplate",
"parameters": [
{
"name": "opt_fields",
"in": "query",
"description": "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. Properties can include nested fields. To learn more, see the [input/output options guide](/docs/inputoutput-options#selecting-nested-fields).",
"required": false,
"example": [
"new_graph_export",
"new_graph_export.completed_at",
"new_graph_export.created_at",
"new_graph_export.download_url",
"new_portfolio",
"new_portfolio.name",
"new_portfolio.resource_subtype",
"new_project",
"new_project.name",
"new_project.resource_subtype",
"new_project_template",
"new_project_template.name",
"new_resource_export",
"new_resource_export.completed_at",
"new_resource_export.created_at",
"new_resource_export.download_url",
"new_task",
"new_task.created_by",
"new_task.name",
"new_task.resource_subtype",
"resource_subtype",
"status"
],
"schema": {
"type": "array",
"items": {
"type": "string",
"enum": [
"new_graph_export",
"new_graph_export.completed_at",
"new_graph_export.created_at",
"new_graph_export.download_url",
"new_portfolio",
"new_portfolio.name",
"new_portfolio.resource_subtype",
"new_project",
"new_project.name",
"new_project.resource_subtype",
"new_project_template",
"new_project_template.name",
"new_resource_export",
"new_resource_export.completed_at",
"new_resource_export.created_at",
"new_resource_export.download_url",
"new_task",
"new_task.created_by",
"new_task.name",
"new_task.resource_subtype",
"resource_subtype",
"status"
]
}
},
"style": "form",
"explode": false
}
],
"requestBody": {
"description": "Describes the inputs used for creating a project template, such as the resulting project template's name, which team it should be created in.",
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"$ref": "#/components/schemas/ProjectSaveAsTemplateRequest"
}
}
}
}
}
},
"responses": {
"201": {
"description": "Successfully created the job to handle project template creation.",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"$ref": "#/components/schemas/JobResponse"
}
}
}
}
}
},
"400": {
"$ref": "#/components/responses/BadRequest"
},
"401": {
"$ref": "#/components/responses/Unauthorized"
},
"403": {
"$ref": "#/components/responses/Forbidden"
},
"404": {
"$ref": "#/components/responses/NotFound"
},
"500": {
"$ref": "#/components/responses/InternalServerError"
}
},
"security": [
{
"personalAccessToken": []
},
{
"oauth2": []
}
],
"x-readme": {
"code-samples": [
{
"language": "java",
"install": "<dependency><groupId>com.asana</groupId><artifactId>asana</artifactId><version>1.0.0</version></dependency>",
"code": "import com.asana.Client;\n\nClient client = Client.accessToken(\"PERSONAL_ACCESS_TOKEN\");\n\nJob result = client.projects.projectSaveAsTemplate(projectGid)\n .data(\"field\", \"value\")\n .data(\"field\", \"value\")\n .option(\"pretty\", true)\n .execute();"
},
{
"language": "node",
"install": "npm install asana",
"code": "const Asana = require('asana');\n\nlet client = new Asana.ApiClient();\nclient.authentications.token.accessToken = '<YOUR_ACCESS_TOKEN>';\n\nlet projectsApiInstance = new Asana.ProjectsApi(client);\nlet body = {\"data\": {\"<PARAM_1>\": \"<VALUE_1>\", \"<PARAM_2>\": \"<VALUE_2>\",}}; // Object | Describes the inputs used for creating a project template, such as the resulting project template's name, which team it should be created in.\nlet project_gid = \"1331\"; // String | Globally unique identifier for the project.\nlet opts = { \n 'opt_fields': \"new_graph_export,new_graph_export.completed_at,new_graph_export.created_at,new_graph_export.download_url,new_portfolio,new_portfolio.name,new_portfolio.resource_subtype,new_project,new_project.name,new_project.resource_subtype,new_project_template,new_project_template.name,new_resource_export,new_resource_export.completed_at,new_resource_export.created_at,new_resource_export.download_url,new_task,new_task.created_by,new_task.name,new_task.resource_subtype,resource_subtype,status\"\n};\nprojectsApiInstance.projectSaveAsTemplate(body, project_gid, opts).then((result) => {\n console.log('API called successfully. Returned data: ' + JSON.stringify(result.data, null, 2));\n}, (error) => {\n console.error(error.response.body);\n});",
"name": "node-sdk-v3"
},
{
"language": "node",
"install": "npm install asana@1.0.5",
"code": "const asana = require('asana');\n\nconst client = asana.Client.create().useAccessToken('PERSONAL_ACCESS_TOKEN');\n\nclient.projects.projectSaveAsTemplate(projectGid, {field: \"value\", field: \"value\", pretty: true})\n .then((result) => {\n console.log(result);\n });",
"name": "node-sdk-v1"
},
{
"language": "python",
"install": "pip install asana",
"code": "import asana\nfrom asana.rest import ApiException\nfrom pprint import pprint\n\nconfiguration = asana.Configuration()\nconfiguration.access_token = '<YOUR_ACCESS_TOKEN>'\napi_client = asana.ApiClient(configuration)\n\n# create an instance of the API class\nprojects_api_instance = asana.ProjectsApi(api_client)\nbody = {\"data\": {\"<PARAM_1>\": \"<VALUE_1>\", \"<PARAM_2>\": \"<VALUE_2>\",}} # dict | Describes the inputs used for creating a project template, such as the resulting project template's name, which team it should be created in.\nproject_gid = \"1331\" # str | Globally unique identifier for the project.\nopts = {\n 'opt_fields': \"new_graph_export,new_graph_export.completed_at,new_graph_export.created_at,new_graph_export.download_url,new_portfolio,new_portfolio.name,new_portfolio.resource_subtype,new_project,new_project.name,new_project.resource_subtype,new_project_template,new_project_template.name,new_resource_export,new_resource_export.completed_at,new_resource_export.created_at,new_resource_export.download_url,new_task,new_task.created_by,new_task.name,new_task.resource_subtype,resource_subtype,status\", # list[str] | 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.\n}\n\ntry:\n # Create a project template from a project\n api_response = projects_api_instance.project_save_as_template(body, project_gid, opts)\n pprint(api_response)\nexcept ApiException as e:\n print(\"Exception when calling ProjectsApi->project_save_as_template: %s\\n\" % e)",
"name": "python-sdk-v5"
},
{
"language": "python",
"install": "pip install asana==3.2.3",
"code": "import asana\n\nclient = asana.Client.access_token('PERSONAL_ACCESS_TOKEN')\n\nresult = client.projects.project_save_as_template(project_gid, {'field': 'value', 'field': 'value'}, opt_pretty=True)",
"name": "python-sdk-v3"
},
{
"language": "php",
"install": "composer require asana/asana",
"code": "<?php\nrequire 'vendor/autoload.php';\n\n$client = Asana\\Client::accessToken('PERSONAL_ACCESS_TOKEN');\n\n$result = $client->projects->projectSaveAsTemplate($project_gid, array('field' => 'value', 'field' => 'value'), array('opt_pretty' => 'true'))"
},
{
"language": "ruby",
"install": "gem install asana",
"code": "require 'asana'\n\nclient = Asana::Client.new do |c|\n c.authentication :access_token, 'PERSONAL_ACCESS_TOKEN'\nend\n\nresult = client.projects.project_save_as_template(project_gid: 'project_gid', field: \"value\", field: \"value\", options: {pretty: true})"
}
]
},
"x-purple-suite-runtime": "unavailable"
}
GET /api/1.0/rates
Get multiple rates
Returns a list of `rate` records. The possible types for `parent` in this request are `project`. An additional `resource` (`user` GID or `placeholder` GID) can be passed in to filter to a specific rate.
Modifying placeholder rates is only available for Enterprise and Enterprise+ users.
This operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.
Authentication
[
{
"personalAccessToken": []
},
{
"oauth2": []
}
]
Path-level parameters and metadata
{
"parameters": [
{
"$ref": "#/components/parameters/pretty"
}
]
}
Request, responses and operation details
{
"summary": "Get multiple rates",
"description": "Returns a list of `rate` records. The possible types for `parent` in this request are `project`. An additional `resource` (`user` GID or `placeholder` GID) can be passed in to filter to a specific rate.\n\nModifying placeholder rates is only available for Enterprise and Enterprise+ users.\n\nThis operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.",
"tags": [
"Rates"
],
"operationId": "getRates",
"parameters": [
{
"name": "parent",
"in": "query",
"description": "Globally unique identifier for `project`.",
"schema": {
"type": "string"
},
"example": "159874"
},
{
"name": "resource",
"in": "query",
"description": "Globally unique identifier for `user` or `placeholder`.",
"schema": {
"type": "string"
},
"example": "1061493"
},
{
"$ref": "#/components/parameters/limit"
},
{
"$ref": "#/components/parameters/offset"
},
{
"name": "opt_fields",
"in": "query",
"description": "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. Properties can include nested fields. To learn more, see the [input/output options guide](/docs/inputoutput-options#selecting-nested-fields).",
"required": false,
"example": [
"offset",
"path",
"uri"
],
"schema": {
"type": "array",
"items": {
"type": "string",
"enum": [
"offset",
"path",
"uri"
]
}
},
"style": "form",
"explode": false
}
],
"responses": {
"200": {
"description": "Successfully retrieved the requested rates.",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"type": "array",
"items": {
"$ref": "#/components/schemas/RateOrPlaceholderCompact"
}
},
"next_page": {
"$ref": "#/components/schemas/NextPage"
}
}
}
}
}
},
"400": {
"$ref": "#/components/responses/BadRequest"
},
"401": {
"$ref": "#/components/responses/Unauthorized"
},
"402": {
"$ref": "#/components/responses/PaymentRequired"
},
"403": {
"$ref": "#/components/responses/Forbidden"
},
"404": {
"$ref": "#/components/responses/NotFound"
},
"500": {
"$ref": "#/components/responses/InternalServerError"
}
},
"security": [
{
"personalAccessToken": []
},
{
"oauth2": []
}
],
"x-readme": {
"code-samples": [
{
"language": "node",
"install": "npm install asana",
"code": "const Asana = require('asana');\n\nlet client = new Asana.ApiClient();\nclient.authentications.token.accessToken = '<YOUR_ACCESS_TOKEN>';\n\nlet ratesApiInstance = new Asana.RatesApi(client);\nlet opts = { \n 'parent': \"159874\", \n 'resource': \"1061493\", \n 'limit': 50, \n 'offset': \"eyJ0eXAiOJiKV1iQLCJhbGciOiJIUzI1NiJ9\", \n 'opt_fields': \"offset,path,uri\"\n};\nratesApiInstance.getRates(opts).then((result) => {\n console.log('API called successfully. Returned data: ' + JSON.stringify(result.data, null, 2));\n}, (error) => {\n console.error(error.response.body);\n});",
"name": "node-sdk-v3"
},
{
"language": "python",
"install": "pip install asana",
"code": "import asana\nfrom asana.rest import ApiException\nfrom pprint import pprint\n\nconfiguration = asana.Configuration()\nconfiguration.access_token = '<YOUR_ACCESS_TOKEN>'\napi_client = asana.ApiClient(configuration)\n\n# create an instance of the API class\nrates_api_instance = asana.RatesApi(api_client)\nopts = {\n 'parent': \"159874\", # str | Globally unique identifier for `project`.\n 'resource': \"1061493\", # str | Globally unique identifier for `user` or `placeholder`.\n 'limit': 50, # int | Results per page. The number of objects to return per page. The value must be between 1 and 100.\n 'offset': \"eyJ0eXAiOJiKV1iQLCJhbGciOiJIUzI1NiJ9\", # str | 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.*\n 'opt_fields': \"offset,path,uri\", # list[str] | 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.\n}\n\ntry:\n # Get multiple rates\n api_response = rates_api_instance.get_rates(opts)\n for data in api_response:\n pprint(data)\nexcept ApiException as e:\n print(\"Exception when calling RatesApi->get_rates: %s\\n\" % e)",
"name": "python-sdk-v5"
}
]
},
"x-purple-suite-runtime": "unavailable"
}
POST /api/1.0/rates
Create a rate
Creates a new rate for a `parent` + `resource` combination.
This operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.
Authentication
[
{
"personalAccessToken": []
},
{
"oauth2": []
}
]
Path-level parameters and metadata
{
"parameters": [
{
"$ref": "#/components/parameters/pretty"
}
]
}
Request, responses and operation details
{
"summary": "Create a rate",
"description": "Creates a new rate for a `parent` + `resource` combination.\n\nThis operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.",
"tags": [
"Rates"
],
"operationId": "createRate",
"parameters": [
{
"name": "opt_fields",
"in": "query",
"description": "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. Properties can include nested fields. To learn more, see the [input/output options guide](/docs/inputoutput-options#selecting-nested-fields).",
"required": false,
"example": [
"created_by",
"created_by.name",
"currency_code",
"parent",
"parent.name",
"parent.resource_subtype",
"rate",
"resource",
"resource.name"
],
"schema": {
"type": "array",
"items": {
"type": "string",
"enum": [
"created_by",
"created_by.name",
"currency_code",
"parent",
"parent.name",
"parent.resource_subtype",
"rate",
"resource",
"resource.name"
]
}
},
"style": "form",
"explode": false
}
],
"requestBody": {
"description": "The rate to create.",
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"$ref": "#/components/schemas/RateRequest"
}
}
}
}
}
},
"responses": {
"201": {
"description": "Successfully created a new rate.",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"$ref": "#/components/schemas/RateResponse"
}
}
}
}
}
},
"400": {
"$ref": "#/components/responses/BadRequest"
},
"401": {
"$ref": "#/components/responses/Unauthorized"
},
"402": {
"$ref": "#/components/responses/PaymentRequired"
},
"403": {
"$ref": "#/components/responses/Forbidden"
},
"404": {
"$ref": "#/components/responses/NotFound"
},
"500": {
"$ref": "#/components/responses/InternalServerError"
}
},
"security": [
{
"personalAccessToken": []
},
{
"oauth2": []
}
],
"x-readme": {
"code-samples": [
{
"language": "node",
"install": "npm install asana",
"code": "const Asana = require('asana');\n\nlet client = new Asana.ApiClient();\nclient.authentications.token.accessToken = '<YOUR_ACCESS_TOKEN>';\n\nlet ratesApiInstance = new Asana.RatesApi(client);\nlet body = {\"data\": {\"<PARAM_1>\": \"<VALUE_1>\", \"<PARAM_2>\": \"<VALUE_2>\",}}; // Object | The rate to create.\nlet opts = { \n 'opt_fields': \"created_by,created_by.name,currency_code,parent,parent.name,parent.resource_subtype,rate,resource,resource.name\"\n};\nratesApiInstance.createRate(body, opts).then((result) => {\n console.log('API called successfully. Returned data: ' + JSON.stringify(result.data, null, 2));\n}, (error) => {\n console.error(error.response.body);\n});",
"name": "node-sdk-v3"
},
{
"language": "python",
"install": "pip install asana",
"code": "import asana\nfrom asana.rest import ApiException\nfrom pprint import pprint\n\nconfiguration = asana.Configuration()\nconfiguration.access_token = '<YOUR_ACCESS_TOKEN>'\napi_client = asana.ApiClient(configuration)\n\n# create an instance of the API class\nrates_api_instance = asana.RatesApi(api_client)\nbody = {\"data\": {\"<PARAM_1>\": \"<VALUE_1>\", \"<PARAM_2>\": \"<VALUE_2>\",}} # dict | The rate to create.\nopts = {\n 'opt_fields': \"created_by,created_by.name,currency_code,parent,parent.name,parent.resource_subtype,rate,resource,resource.name\", # list[str] | 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.\n}\n\ntry:\n # Create a rate\n api_response = rates_api_instance.create_rate(body, opts)\n pprint(api_response)\nexcept ApiException as e:\n print(\"Exception when calling RatesApi->create_rate: %s\\n\" % e)",
"name": "python-sdk-v5"
}
]
},
"x-purple-suite-runtime": "unavailable"
}
GET /api/1.0/rates/{rate_gid}
Get a rate
Returns the complete rate record for a single rate.
This operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.
Authentication
[
{
"personalAccessToken": []
},
{
"oauth2": []
}
]
Path-level parameters and metadata
{
"parameters": [
{
"$ref": "#/components/parameters/rate_path_gid"
},
{
"$ref": "#/components/parameters/pretty"
}
]
}
Request, responses and operation details
{
"summary": "Get a rate",
"description": "Returns the complete rate record for a single rate.\n\nThis operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.",
"tags": [
"Rates"
],
"operationId": "getRate",
"parameters": [
{
"name": "opt_fields",
"in": "query",
"description": "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. Properties can include nested fields. To learn more, see the [input/output options guide](/docs/inputoutput-options#selecting-nested-fields).",
"required": false,
"example": [
"created_by",
"created_by.name",
"currency_code",
"parent",
"parent.name",
"parent.resource_subtype",
"rate",
"resource",
"resource.name"
],
"schema": {
"type": "array",
"items": {
"type": "string",
"enum": [
"created_by",
"created_by.name",
"currency_code",
"parent",
"parent.name",
"parent.resource_subtype",
"rate",
"resource",
"resource.name"
]
}
},
"style": "form",
"explode": false
}
],
"responses": {
"200": {
"description": "Successfully retrieved the record for a single rate.",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"$ref": "#/components/schemas/RateResponse"
}
}
}
}
}
},
"400": {
"$ref": "#/components/responses/BadRequest"
},
"401": {
"$ref": "#/components/responses/Unauthorized"
},
"402": {
"$ref": "#/components/responses/PaymentRequired"
},
"403": {
"$ref": "#/components/responses/Forbidden"
},
"404": {
"$ref": "#/components/responses/NotFound"
},
"500": {
"$ref": "#/components/responses/InternalServerError"
}
},
"security": [
{
"personalAccessToken": []
},
{
"oauth2": []
}
],
"x-readme": {
"code-samples": [
{
"language": "node",
"install": "npm install asana",
"code": "const Asana = require('asana');\n\nlet client = new Asana.ApiClient();\nclient.authentications.token.accessToken = '<YOUR_ACCESS_TOKEN>';\n\nlet ratesApiInstance = new Asana.RatesApi(client);\nlet rate_gid = \"12345\"; // String | Globally unique identifier for the rate.\nlet opts = { \n 'opt_fields': \"created_by,created_by.name,currency_code,parent,parent.name,parent.resource_subtype,rate,resource,resource.name\"\n};\nratesApiInstance.getRate(rate_gid, opts).then((result) => {\n console.log('API called successfully. Returned data: ' + JSON.stringify(result.data, null, 2));\n}, (error) => {\n console.error(error.response.body);\n});",
"name": "node-sdk-v3"
},
{
"language": "python",
"install": "pip install asana",
"code": "import asana\nfrom asana.rest import ApiException\nfrom pprint import pprint\n\nconfiguration = asana.Configuration()\nconfiguration.access_token = '<YOUR_ACCESS_TOKEN>'\napi_client = asana.ApiClient(configuration)\n\n# create an instance of the API class\nrates_api_instance = asana.RatesApi(api_client)\nrate_gid = \"12345\" # str | Globally unique identifier for the rate.\nopts = {\n 'opt_fields': \"created_by,created_by.name,currency_code,parent,parent.name,parent.resource_subtype,rate,resource,resource.name\", # list[str] | 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.\n}\n\ntry:\n # Get a rate\n api_response = rates_api_instance.get_rate(rate_gid, opts)\n pprint(api_response)\nexcept ApiException as e:\n print(\"Exception when calling RatesApi->get_rate: %s\\n\" % e)",
"name": "python-sdk-v5"
}
]
},
"x-purple-suite-runtime": "unavailable"
}
PUT /api/1.0/rates/{rate_gid}
Update a rate
An existing rate can be updated by making a PUT request on the URL for
that rate. Only the fields provided in the `data` block will be updated;
any unspecified fields will remain unchanged. (note that at this time, the only field that can be updated is the `rate` field.)
Returns the complete updated rate record.
This operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.
Authentication
[
{
"personalAccessToken": []
},
{
"oauth2": []
}
]
Path-level parameters and metadata
{
"parameters": [
{
"$ref": "#/components/parameters/rate_path_gid"
},
{
"$ref": "#/components/parameters/pretty"
}
]
}
Request, responses and operation details
{
"summary": "Update a rate",
"description": "An existing rate can be updated by making a PUT request on the URL for\nthat rate. Only the fields provided in the `data` block will be updated;\nany unspecified fields will remain unchanged. (note that at this time, the only field that can be updated is the `rate` field.)\n\nReturns the complete updated rate record.\n\nThis operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.",
"tags": [
"Rates"
],
"operationId": "updateRate",
"parameters": [
{
"name": "opt_fields",
"in": "query",
"description": "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. Properties can include nested fields. To learn more, see the [input/output options guide](/docs/inputoutput-options#selecting-nested-fields).",
"required": false,
"example": [
"created_by",
"created_by.name",
"currency_code",
"parent",
"parent.name",
"parent.resource_subtype",
"rate",
"resource",
"resource.name"
],
"schema": {
"type": "array",
"items": {
"type": "string",
"enum": [
"created_by",
"created_by.name",
"currency_code",
"parent",
"parent.name",
"parent.resource_subtype",
"rate",
"resource",
"resource.name"
]
}
},
"style": "form",
"explode": false
}
],
"requestBody": {
"description": "The updated fields for the rate.",
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"$ref": "#/components/schemas/RateUpdateRequest"
}
}
}
}
}
},
"responses": {
"200": {
"description": "Successfully updated the rate.",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"$ref": "#/components/schemas/RateResponse"
}
}
}
}
}
},
"400": {
"$ref": "#/components/responses/BadRequest"
},
"401": {
"$ref": "#/components/responses/Unauthorized"
},
"402": {
"$ref": "#/components/responses/PaymentRequired"
},
"403": {
"$ref": "#/components/responses/Forbidden"
},
"404": {
"$ref": "#/components/responses/NotFound"
},
"500": {
"$ref": "#/components/responses/InternalServerError"
}
},
"security": [
{
"personalAccessToken": []
},
{
"oauth2": []
}
],
"x-readme": {
"code-samples": [
{
"language": "node",
"install": "npm install asana",
"code": "const Asana = require('asana');\n\nlet client = new Asana.ApiClient();\nclient.authentications.token.accessToken = '<YOUR_ACCESS_TOKEN>';\n\nlet ratesApiInstance = new Asana.RatesApi(client);\nlet body = {\"data\": {\"<PARAM_1>\": \"<VALUE_1>\", \"<PARAM_2>\": \"<VALUE_2>\",}}; // Object | The updated fields for the rate.\nlet rate_gid = \"12345\"; // String | Globally unique identifier for the rate.\nlet opts = { \n 'opt_fields': \"created_by,created_by.name,currency_code,parent,parent.name,parent.resource_subtype,rate,resource,resource.name\"\n};\nratesApiInstance.updateRate(body, rate_gid, opts).then((result) => {\n console.log('API called successfully. Returned data: ' + JSON.stringify(result.data, null, 2));\n}, (error) => {\n console.error(error.response.body);\n});",
"name": "node-sdk-v3"
},
{
"language": "python",
"install": "pip install asana",
"code": "import asana\nfrom asana.rest import ApiException\nfrom pprint import pprint\n\nconfiguration = asana.Configuration()\nconfiguration.access_token = '<YOUR_ACCESS_TOKEN>'\napi_client = asana.ApiClient(configuration)\n\n# create an instance of the API class\nrates_api_instance = asana.RatesApi(api_client)\nbody = {\"data\": {\"<PARAM_1>\": \"<VALUE_1>\", \"<PARAM_2>\": \"<VALUE_2>\",}} # dict | The updated fields for the rate.\nrate_gid = \"12345\" # str | Globally unique identifier for the rate.\nopts = {\n 'opt_fields': \"created_by,created_by.name,currency_code,parent,parent.name,parent.resource_subtype,rate,resource,resource.name\", # list[str] | 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.\n}\n\ntry:\n # Update a rate\n api_response = rates_api_instance.update_rate(body, rate_gid, opts)\n pprint(api_response)\nexcept ApiException as e:\n print(\"Exception when calling RatesApi->update_rate: %s\\n\" % e)",
"name": "python-sdk-v5"
}
]
},
"x-purple-suite-runtime": "unavailable"
}
DELETE /api/1.0/rates/{rate_gid}
Delete a rate
Deletes a rate.
This operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.
Authentication
[
{
"personalAccessToken": []
},
{
"oauth2": []
}
]
Path-level parameters and metadata
{
"parameters": [
{
"$ref": "#/components/parameters/rate_path_gid"
},
{
"$ref": "#/components/parameters/pretty"
}
]
}
Request, responses and operation details
{
"summary": "Delete a rate",
"description": "Deletes a rate.\n\nThis operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.",
"tags": [
"Rates"
],
"operationId": "deleteRate",
"responses": {
"200": {
"description": "Successfully deleted the rate.",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"$ref": "#/components/schemas/EmptyResponse"
}
}
}
}
}
},
"400": {
"$ref": "#/components/responses/BadRequest"
},
"401": {
"$ref": "#/components/responses/Unauthorized"
},
"402": {
"$ref": "#/components/responses/PaymentRequired"
},
"403": {
"$ref": "#/components/responses/Forbidden"
},
"404": {
"$ref": "#/components/responses/NotFound"
},
"500": {
"$ref": "#/components/responses/InternalServerError"
}
},
"security": [
{
"personalAccessToken": []
},
{
"oauth2": []
}
],
"x-readme": {
"code-samples": [
{
"language": "node",
"install": "npm install asana",
"code": "const Asana = require('asana');\n\nlet client = new Asana.ApiClient();\nclient.authentications.token.accessToken = '<YOUR_ACCESS_TOKEN>';\n\nlet ratesApiInstance = new Asana.RatesApi(client);\nlet rate_gid = \"12345\"; // String | Globally unique identifier for the rate.\n\nratesApiInstance.deleteRate(rate_gid).then((result) => {\n console.log('API called successfully. Returned data: ' + JSON.stringify(result.data, null, 2));\n}, (error) => {\n console.error(error.response.body);\n});",
"name": "node-sdk-v3"
},
{
"language": "python",
"install": "pip install asana",
"code": "import asana\nfrom asana.rest import ApiException\nfrom pprint import pprint\n\nconfiguration = asana.Configuration()\nconfiguration.access_token = '<YOUR_ACCESS_TOKEN>'\napi_client = asana.ApiClient(configuration)\n\n# create an instance of the API class\nrates_api_instance = asana.RatesApi(api_client)\nrate_gid = \"12345\" # str | Globally unique identifier for the rate.\n\n\ntry:\n # Delete a rate\n api_response = rates_api_instance.delete_rate(rate_gid)\n pprint(api_response)\nexcept ApiException as e:\n print(\"Exception when calling RatesApi->delete_rate: %s\\n\" % e)",
"name": "python-sdk-v5"
}
]
},
"x-purple-suite-runtime": "unavailable"
}
GET /api/1.0/reactions
Get reactions with an emoji base on an object.
Returns the reactions with a specified emoji base character on the object.
This operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.
Authentication
[
{
"personalAccessToken": []
},
{
"oauth2": []
}
]
Path-level parameters and metadata
{
"parameters": [
{
"$ref": "#/components/parameters/pretty"
},
{
"$ref": "#/components/parameters/limit"
},
{
"$ref": "#/components/parameters/offset"
}
]
}
Request, responses and operation details
{
"summary": "Get reactions with an emoji base on an object.",
"description": "Returns the reactions with a specified emoji base character on the object.\n\nThis operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.",
"operationId": "getReactionsOnObject",
"tags": [
"Reactions"
],
"parameters": [
{
"name": "target",
"required": true,
"in": "query",
"description": "Globally unique identifier for object to fetch reactions from. Must be a GID for a status update or story.",
"schema": {
"type": "string"
},
"example": "159874"
},
{
"name": "emoji_base",
"required": true,
"in": "query",
"description": "Only return reactions with this emoji base character.",
"schema": {
"type": "string"
},
"example": "👍"
}
],
"responses": {
"200": {
"description": "Successfully retrieved the specified object's reactions.",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"type": "array",
"items": {
"$ref": "#/components/schemas/ReactionCompact"
}
},
"next_page": {
"$ref": "#/components/schemas/NextPage"
}
}
}
}
}
},
"400": {
"$ref": "#/components/responses/BadRequest"
},
"401": {
"$ref": "#/components/responses/Unauthorized"
},
"403": {
"$ref": "#/components/responses/Forbidden"
},
"404": {
"$ref": "#/components/responses/NotFound"
},
"500": {
"$ref": "#/components/responses/InternalServerError"
}
},
"security": [
{
"personalAccessToken": []
},
{
"oauth2": []
}
],
"x-readme": {
"code-samples": [
{
"language": "node",
"install": "npm install asana",
"code": "const Asana = require('asana');\n\nlet client = new Asana.ApiClient();\nclient.authentications.token.accessToken = '<YOUR_ACCESS_TOKEN>';\n\nlet reactionsApiInstance = new Asana.ReactionsApi(client);\nlet target = \"159874\"; // String | Globally unique identifier for object to fetch reactions from. Must be a GID for a status update or story.\nlet emoji_base = \"👍\"; // String | Only return reactions with this emoji base character.\nlet opts = { \n 'limit': 50, \n 'offset': \"eyJ0eXAiOJiKV1iQLCJhbGciOiJIUzI1NiJ9\"\n};\nreactionsApiInstance.getReactionsOnObject(target, emoji_base, opts).then((result) => {\n console.log('API called successfully. Returned data: ' + JSON.stringify(result.data, null, 2));\n}, (error) => {\n console.error(error.response.body);\n});",
"name": "node-sdk-v3"
},
{
"language": "python",
"install": "pip install asana",
"code": "import asana\nfrom asana.rest import ApiException\nfrom pprint import pprint\n\nconfiguration = asana.Configuration()\nconfiguration.access_token = '<YOUR_ACCESS_TOKEN>'\napi_client = asana.ApiClient(configuration)\n\n# create an instance of the API class\nreactions_api_instance = asana.ReactionsApi(api_client)\ntarget = \"159874\" # str | Globally unique identifier for object to fetch reactions from. Must be a GID for a status update or story.\nemoji_base = \"👍\" # str | Only return reactions with this emoji base character.\nopts = {\n 'limit': 50, # int | Results per page. The number of objects to return per page. The value must be between 1 and 100.\n 'offset': \"eyJ0eXAiOJiKV1iQLCJhbGciOiJIUzI1NiJ9\", # str | 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.*\n}\n\ntry:\n # Get reactions with an emoji base on an object.\n api_response = reactions_api_instance.get_reactions_on_object(target, emoji_base, opts)\n for data in api_response:\n pprint(data)\nexcept ApiException as e:\n print(\"Exception when calling ReactionsApi->get_reactions_on_object: %s\\n\" % e)",
"name": "python-sdk-v5"
}
]
},
"x-purple-suite-runtime": "unavailable"
}
GET /api/1.0/roles
Get multiple roles
<b>Required scope: </b><code>roles:read</code>
Returns all RBAC roles for a workspace.
This operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.
Authentication
[
{
"personalAccessToken": []
},
{
"oauth2": [
"roles:read"
]
}
]
Path-level parameters and metadata
{
"parameters": [
{
"$ref": "#/components/parameters/pretty"
}
]
}
Request, responses and operation details
{
"summary": "Get multiple roles",
"description": "<b>Required scope: </b><code>roles:read</code>\n\nReturns all RBAC roles for a workspace.\n\nThis operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.",
"tags": [
"Roles"
],
"operationId": "getRoles",
"parameters": [
{
"$ref": "#/components/parameters/limit"
},
{
"$ref": "#/components/parameters/offset"
},
{
"name": "workspace",
"in": "query",
"required": true,
"description": "The workspace or organization to filter roles on.",
"schema": {
"type": "string"
},
"example": "1331"
},
{
"$ref": "#/components/parameters/archived_query_param"
},
{
"name": "opt_fields",
"in": "query",
"description": "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. Properties can include nested fields. To learn more, see the [input/output options guide](/docs/inputoutput-options#selecting-nested-fields).",
"required": false,
"example": [
"base_role_type",
"creation_time",
"description",
"is_standard_role",
"modified_at",
"name",
"offset",
"path",
"permissions",
"permissions.allowed_guest_invites",
"permissions.assign_roles",
"permissions.create_and_edit_ai_automations",
"permissions.create_and_edit_ai_teammates",
"permissions.create_app_authorization",
"permissions.create_global_custom_fields",
"permissions.create_goal",
"permissions.create_pat_authorization",
"permissions.create_portfolio",
"permissions.create_project",
"permissions.create_read_only_link",
"permissions.create_team",
"permissions.download_mobile_attachments",
"permissions.export_project_data",
"permissions.import_data",
"permissions.manage_roles",
"permissions.proactive_ai",
"permissions.share_goal_with_domain",
"permissions.share_portfolios_with_org",
"permissions.share_teams_with_org",
"permissions.standard_ai",
"permissions.task_deletion_policy",
"permissions.upload_attachments",
"permissions.view_public_teams",
"permissions.view_shared_with_org_portfolios",
"permissions.view_shared_with_org_projects",
"permissions.view_shared_with_org_tasks",
"uri",
"workspace",
"workspace.name"
],
"schema": {
"type": "array",
"items": {
"type": "string",
"enum": [
"base_role_type",
"creation_time",
"description",
"is_standard_role",
"modified_at",
"name",
"offset",
"path",
"permissions",
"permissions.allowed_guest_invites",
"permissions.assign_roles",
"permissions.create_and_edit_ai_automations",
"permissions.create_and_edit_ai_teammates",
"permissions.create_app_authorization",
"permissions.create_global_custom_fields",
"permissions.create_goal",
"permissions.create_pat_authorization",
"permissions.create_portfolio",
"permissions.create_project",
"permissions.create_read_only_link",
"permissions.create_team",
"permissions.download_mobile_attachments",
"permissions.export_project_data",
"permissions.import_data",
"permissions.manage_roles",
"permissions.proactive_ai",
"permissions.share_goal_with_domain",
"permissions.share_portfolios_with_org",
"permissions.share_teams_with_org",
"permissions.standard_ai",
"permissions.task_deletion_policy",
"permissions.upload_attachments",
"permissions.view_public_teams",
"permissions.view_shared_with_org_portfolios",
"permissions.view_shared_with_org_projects",
"permissions.view_shared_with_org_tasks",
"uri",
"workspace",
"workspace.name"
]
}
},
"style": "form",
"explode": false
}
],
"responses": {
"200": {
"description": "Successfully retrieved roles.",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"type": "array",
"items": {
"$ref": "#/components/schemas/RbacRoleCompact"
}
},
"next_page": {
"$ref": "#/components/schemas/NextPage"
}
}
}
}
}
},
"400": {
"$ref": "#/components/responses/BadRequest"
},
"401": {
"$ref": "#/components/responses/Unauthorized"
},
"403": {
"$ref": "#/components/responses/Forbidden"
},
"404": {
"$ref": "#/components/responses/NotFound"
},
"500": {
"$ref": "#/components/responses/InternalServerError"
}
},
"security": [
{
"personalAccessToken": []
},
{
"oauth2": [
"roles:read"
]
}
],
"x-readme": {
"code-samples": [
{
"language": "node",
"install": "npm install asana",
"code": "const Asana = require('asana');\n\nlet client = new Asana.ApiClient();\nclient.authentications.token.accessToken = '<YOUR_ACCESS_TOKEN>';\n\nlet rolesApiInstance = new Asana.RolesApi(client);\nlet opts = { \n 'limit': 50, \n 'offset': \"eyJ0eXAiOJiKV1iQLCJhbGciOiJIUzI1NiJ9\", \n 'workspace': \"1331\", \n 'archived': false, \n 'opt_fields': \"base_role_type,creation_time,description,is_standard_role,modified_at,name,offset,path,permissions,permissions.allowed_guest_invites,permissions.assign_roles,permissions.create_and_edit_ai_automations,permissions.create_and_edit_ai_teammates,permissions.create_app_authorization,permissions.create_global_custom_fields,permissions.create_goal,permissions.create_pat_authorization,permissions.create_portfolio,permissions.create_project,permissions.create_read_only_link,permissions.create_team,permissions.download_mobile_attachments,permissions.export_project_data,permissions.import_data,permissions.manage_roles,permissions.proactive_ai,permissions.share_goal_with_domain,permissions.share_portfolios_with_org,permissions.share_teams_with_org,permissions.standard_ai,permissions.task_deletion_policy,permissions.upload_attachments,permissions.view_public_teams,permissions.view_shared_with_org_portfolios,permissions.view_shared_with_org_projects,permissions.view_shared_with_org_tasks,uri,workspace,workspace.name\"\n};\nrolesApiInstance.getRoles(opts).then((result) => {\n console.log('API called successfully. Returned data: ' + JSON.stringify(result.data, null, 2));\n}, (error) => {\n console.error(error.response.body);\n});",
"name": "node-sdk-v3"
},
{
"language": "python",
"install": "pip install asana",
"code": "import asana\nfrom asana.rest import ApiException\nfrom pprint import pprint\n\nconfiguration = asana.Configuration()\nconfiguration.access_token = '<YOUR_ACCESS_TOKEN>'\napi_client = asana.ApiClient(configuration)\n\n# create an instance of the API class\nroles_api_instance = asana.RolesApi(api_client)\nopts = {\n 'limit': 50, # int | Results per page. The number of objects to return per page. The value must be between 1 and 100.\n 'offset': \"eyJ0eXAiOJiKV1iQLCJhbGciOiJIUzI1NiJ9\", # str | 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.*\n 'workspace': \"1331\", # str | The workspace or organization to filter roles on.\n 'archived': False, # bool | Only return projects whose `archived` field takes on the value of this parameter.\n 'opt_fields': \"base_role_type,creation_time,description,is_standard_role,modified_at,name,offset,path,permissions,permissions.allowed_guest_invites,permissions.assign_roles,permissions.create_and_edit_ai_automations,permissions.create_and_edit_ai_teammates,permissions.create_app_authorization,permissions.create_global_custom_fields,permissions.create_goal,permissions.create_pat_authorization,permissions.create_portfolio,permissions.create_project,permissions.create_read_only_link,permissions.create_team,permissions.download_mobile_attachments,permissions.export_project_data,permissions.import_data,permissions.manage_roles,permissions.proactive_ai,permissions.share_goal_with_domain,permissions.share_portfolios_with_org,permissions.share_teams_with_org,permissions.standard_ai,permissions.task_deletion_policy,permissions.upload_attachments,permissions.view_public_teams,permissions.view_shared_with_org_portfolios,permissions.view_shared_with_org_projects,permissions.view_shared_with_org_tasks,uri,workspace,workspace.name\", # list[str] | 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.\n}\n\ntry:\n # Get multiple roles\n api_response = roles_api_instance.get_roles(opts)\n for data in api_response:\n pprint(data)\nexcept ApiException as e:\n print(\"Exception when calling RolesApi->get_roles: %s\\n\" % e)",
"name": "python-sdk-v5"
}
]
},
"x-purple-suite-runtime": "unavailable"
}
POST /api/1.0/roles
Create a role
<b>Required scope: </b><code>roles:write</code>
Creates a new RBAC role in the workspace.
This operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.
Authentication
[
{
"personalAccessToken": []
},
{
"oauth2": [
"roles:write"
]
}
]
Path-level parameters and metadata
{
"parameters": [
{
"$ref": "#/components/parameters/pretty"
}
]
}
Request, responses and operation details
{
"summary": "Create a role",
"description": "<b>Required scope: </b><code>roles:write</code>\n\nCreates a new RBAC role in the workspace.\n\nThis operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.",
"tags": [
"Roles"
],
"operationId": "createRole",
"parameters": [
{
"name": "opt_fields",
"in": "query",
"description": "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. Properties can include nested fields. To learn more, see the [input/output options guide](/docs/inputoutput-options#selecting-nested-fields).",
"required": false,
"example": [
"base_role_type",
"creation_time",
"description",
"is_standard_role",
"modified_at",
"name",
"permissions",
"permissions.allowed_guest_invites",
"permissions.assign_roles",
"permissions.create_and_edit_ai_automations",
"permissions.create_and_edit_ai_teammates",
"permissions.create_app_authorization",
"permissions.create_global_custom_fields",
"permissions.create_goal",
"permissions.create_pat_authorization",
"permissions.create_portfolio",
"permissions.create_project",
"permissions.create_read_only_link",
"permissions.create_team",
"permissions.download_mobile_attachments",
"permissions.export_project_data",
"permissions.import_data",
"permissions.manage_roles",
"permissions.proactive_ai",
"permissions.share_goal_with_domain",
"permissions.share_portfolios_with_org",
"permissions.share_teams_with_org",
"permissions.standard_ai",
"permissions.task_deletion_policy",
"permissions.upload_attachments",
"permissions.view_public_teams",
"permissions.view_shared_with_org_portfolios",
"permissions.view_shared_with_org_projects",
"permissions.view_shared_with_org_tasks",
"workspace",
"workspace.name"
],
"schema": {
"type": "array",
"items": {
"type": "string",
"enum": [
"base_role_type",
"creation_time",
"description",
"is_standard_role",
"modified_at",
"name",
"permissions",
"permissions.allowed_guest_invites",
"permissions.assign_roles",
"permissions.create_and_edit_ai_automations",
"permissions.create_and_edit_ai_teammates",
"permissions.create_app_authorization",
"permissions.create_global_custom_fields",
"permissions.create_goal",
"permissions.create_pat_authorization",
"permissions.create_portfolio",
"permissions.create_project",
"permissions.create_read_only_link",
"permissions.create_team",
"permissions.download_mobile_attachments",
"permissions.export_project_data",
"permissions.import_data",
"permissions.manage_roles",
"permissions.proactive_ai",
"permissions.share_goal_with_domain",
"permissions.share_portfolios_with_org",
"permissions.share_teams_with_org",
"permissions.standard_ai",
"permissions.task_deletion_policy",
"permissions.upload_attachments",
"permissions.view_public_teams",
"permissions.view_shared_with_org_portfolios",
"permissions.view_shared_with_org_projects",
"permissions.view_shared_with_org_tasks",
"workspace",
"workspace.name"
]
}
},
"style": "form",
"explode": false
}
],
"requestBody": {
"description": "The role to create.",
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"$ref": "#/components/schemas/RbacRoleRequest"
}
}
}
}
}
},
"responses": {
"201": {
"description": "Successfully created a new role.",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"$ref": "#/components/schemas/RbacRoleResponse"
}
}
}
}
}
},
"400": {
"$ref": "#/components/responses/BadRequest"
},
"401": {
"$ref": "#/components/responses/Unauthorized"
},
"403": {
"$ref": "#/components/responses/Forbidden"
},
"404": {
"$ref": "#/components/responses/NotFound"
},
"500": {
"$ref": "#/components/responses/InternalServerError"
}
},
"security": [
{
"personalAccessToken": []
},
{
"oauth2": [
"roles:write"
]
}
],
"x-readme": {
"code-samples": [
{
"language": "node",
"install": "npm install asana",
"code": "const Asana = require('asana');\n\nlet client = new Asana.ApiClient();\nclient.authentications.token.accessToken = '<YOUR_ACCESS_TOKEN>';\n\nlet rolesApiInstance = new Asana.RolesApi(client);\nlet body = {\"data\": {\"<PARAM_1>\": \"<VALUE_1>\", \"<PARAM_2>\": \"<VALUE_2>\",}}; // Object | The role to create.\nlet opts = { \n 'opt_fields': \"base_role_type,creation_time,description,is_standard_role,modified_at,name,permissions,permissions.allowed_guest_invites,permissions.assign_roles,permissions.create_and_edit_ai_automations,permissions.create_and_edit_ai_teammates,permissions.create_app_authorization,permissions.create_global_custom_fields,permissions.create_goal,permissions.create_pat_authorization,permissions.create_portfolio,permissions.create_project,permissions.create_read_only_link,permissions.create_team,permissions.download_mobile_attachments,permissions.export_project_data,permissions.import_data,permissions.manage_roles,permissions.proactive_ai,permissions.share_goal_with_domain,permissions.share_portfolios_with_org,permissions.share_teams_with_org,permissions.standard_ai,permissions.task_deletion_policy,permissions.upload_attachments,permissions.view_public_teams,permissions.view_shared_with_org_portfolios,permissions.view_shared_with_org_projects,permissions.view_shared_with_org_tasks,workspace,workspace.name\"\n};\nrolesApiInstance.createRole(body, opts).then((result) => {\n console.log('API called successfully. Returned data: ' + JSON.stringify(result.data, null, 2));\n}, (error) => {\n console.error(error.response.body);\n});",
"name": "node-sdk-v3"
},
{
"language": "python",
"install": "pip install asana",
"code": "import asana\nfrom asana.rest import ApiException\nfrom pprint import pprint\n\nconfiguration = asana.Configuration()\nconfiguration.access_token = '<YOUR_ACCESS_TOKEN>'\napi_client = asana.ApiClient(configuration)\n\n# create an instance of the API class\nroles_api_instance = asana.RolesApi(api_client)\nbody = {\"data\": {\"<PARAM_1>\": \"<VALUE_1>\", \"<PARAM_2>\": \"<VALUE_2>\",}} # dict | The role to create.\nopts = {\n 'opt_fields': \"base_role_type,creation_time,description,is_standard_role,modified_at,name,permissions,permissions.allowed_guest_invites,permissions.assign_roles,permissions.create_and_edit_ai_automations,permissions.create_and_edit_ai_teammates,permissions.create_app_authorization,permissions.create_global_custom_fields,permissions.create_goal,permissions.create_pat_authorization,permissions.create_portfolio,permissions.create_project,permissions.create_read_only_link,permissions.create_team,permissions.download_mobile_attachments,permissions.export_project_data,permissions.import_data,permissions.manage_roles,permissions.proactive_ai,permissions.share_goal_with_domain,permissions.share_portfolios_with_org,permissions.share_teams_with_org,permissions.standard_ai,permissions.task_deletion_policy,permissions.upload_attachments,permissions.view_public_teams,permissions.view_shared_with_org_portfolios,permissions.view_shared_with_org_projects,permissions.view_shared_with_org_tasks,workspace,workspace.name\", # list[str] | 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.\n}\n\ntry:\n # Create a role\n api_response = roles_api_instance.create_role(body, opts)\n pprint(api_response)\nexcept ApiException as e:\n print(\"Exception when calling RolesApi->create_role: %s\\n\" % e)",
"name": "python-sdk-v5"
}
]
},
"x-purple-suite-runtime": "unavailable"
}
GET /api/1.0/roles/{role_gid}
Get a role
<b>Required scope: </b><code>roles:read</code>
Returns the complete role record for a single role.
This operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.
Authentication
[
{
"personalAccessToken": []
},
{
"oauth2": [
"roles:read"
]
}
]
Path-level parameters and metadata
{
"parameters": [
{
"$ref": "#/components/parameters/role_path_gid"
},
{
"$ref": "#/components/parameters/pretty"
}
]
}
Request, responses and operation details
{
"summary": "Get a role",
"description": "<b>Required scope: </b><code>roles:read</code>\n\nReturns the complete role record for a single role.\n\nThis operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.",
"tags": [
"Roles"
],
"operationId": "getRole",
"parameters": [
{
"name": "opt_fields",
"in": "query",
"description": "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. Properties can include nested fields. To learn more, see the [input/output options guide](/docs/inputoutput-options#selecting-nested-fields).",
"required": false,
"example": [
"base_role_type",
"creation_time",
"description",
"is_standard_role",
"modified_at",
"name",
"permissions",
"permissions.allowed_guest_invites",
"permissions.assign_roles",
"permissions.create_and_edit_ai_automations",
"permissions.create_and_edit_ai_teammates",
"permissions.create_app_authorization",
"permissions.create_global_custom_fields",
"permissions.create_goal",
"permissions.create_pat_authorization",
"permissions.create_portfolio",
"permissions.create_project",
"permissions.create_read_only_link",
"permissions.create_team",
"permissions.download_mobile_attachments",
"permissions.export_project_data",
"permissions.import_data",
"permissions.manage_roles",
"permissions.proactive_ai",
"permissions.share_goal_with_domain",
"permissions.share_portfolios_with_org",
"permissions.share_teams_with_org",
"permissions.standard_ai",
"permissions.task_deletion_policy",
"permissions.upload_attachments",
"permissions.view_public_teams",
"permissions.view_shared_with_org_portfolios",
"permissions.view_shared_with_org_projects",
"permissions.view_shared_with_org_tasks",
"workspace",
"workspace.name"
],
"schema": {
"type": "array",
"items": {
"type": "string",
"enum": [
"base_role_type",
"creation_time",
"description",
"is_standard_role",
"modified_at",
"name",
"permissions",
"permissions.allowed_guest_invites",
"permissions.assign_roles",
"permissions.create_and_edit_ai_automations",
"permissions.create_and_edit_ai_teammates",
"permissions.create_app_authorization",
"permissions.create_global_custom_fields",
"permissions.create_goal",
"permissions.create_pat_authorization",
"permissions.create_portfolio",
"permissions.create_project",
"permissions.create_read_only_link",
"permissions.create_team",
"permissions.download_mobile_attachments",
"permissions.export_project_data",
"permissions.import_data",
"permissions.manage_roles",
"permissions.proactive_ai",
"permissions.share_goal_with_domain",
"permissions.share_portfolios_with_org",
"permissions.share_teams_with_org",
"permissions.standard_ai",
"permissions.task_deletion_policy",
"permissions.upload_attachments",
"permissions.view_public_teams",
"permissions.view_shared_with_org_portfolios",
"permissions.view_shared_with_org_projects",
"permissions.view_shared_with_org_tasks",
"workspace",
"workspace.name"
]
}
},
"style": "form",
"explode": false
}
],
"responses": {
"200": {
"description": "Successfully retrieved the requested role.",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"$ref": "#/components/schemas/RbacRoleResponse"
}
}
}
}
}
},
"400": {
"$ref": "#/components/responses/BadRequest"
},
"401": {
"$ref": "#/components/responses/Unauthorized"
},
"403": {
"$ref": "#/components/responses/Forbidden"
},
"404": {
"$ref": "#/components/responses/NotFound"
},
"500": {
"$ref": "#/components/responses/InternalServerError"
}
},
"security": [
{
"personalAccessToken": []
},
{
"oauth2": [
"roles:read"
]
}
],
"x-readme": {
"code-samples": [
{
"language": "node",
"install": "npm install asana",
"code": "const Asana = require('asana');\n\nlet client = new Asana.ApiClient();\nclient.authentications.token.accessToken = '<YOUR_ACCESS_TOKEN>';\n\nlet rolesApiInstance = new Asana.RolesApi(client);\nlet role_gid = \"12345\"; // String | Globally unique identifier for the role.\nlet opts = { \n 'opt_fields': \"base_role_type,creation_time,description,is_standard_role,modified_at,name,permissions,permissions.allowed_guest_invites,permissions.assign_roles,permissions.create_and_edit_ai_automations,permissions.create_and_edit_ai_teammates,permissions.create_app_authorization,permissions.create_global_custom_fields,permissions.create_goal,permissions.create_pat_authorization,permissions.create_portfolio,permissions.create_project,permissions.create_read_only_link,permissions.create_team,permissions.download_mobile_attachments,permissions.export_project_data,permissions.import_data,permissions.manage_roles,permissions.proactive_ai,permissions.share_goal_with_domain,permissions.share_portfolios_with_org,permissions.share_teams_with_org,permissions.standard_ai,permissions.task_deletion_policy,permissions.upload_attachments,permissions.view_public_teams,permissions.view_shared_with_org_portfolios,permissions.view_shared_with_org_projects,permissions.view_shared_with_org_tasks,workspace,workspace.name\"\n};\nrolesApiInstance.getRole(role_gid, opts).then((result) => {\n console.log('API called successfully. Returned data: ' + JSON.stringify(result.data, null, 2));\n}, (error) => {\n console.error(error.response.body);\n});",
"name": "node-sdk-v3"
},
{
"language": "python",
"install": "pip install asana",
"code": "import asana\nfrom asana.rest import ApiException\nfrom pprint import pprint\n\nconfiguration = asana.Configuration()\nconfiguration.access_token = '<YOUR_ACCESS_TOKEN>'\napi_client = asana.ApiClient(configuration)\n\n# create an instance of the API class\nroles_api_instance = asana.RolesApi(api_client)\nrole_gid = \"12345\" # str | Globally unique identifier for the role.\nopts = {\n 'opt_fields': \"base_role_type,creation_time,description,is_standard_role,modified_at,name,permissions,permissions.allowed_guest_invites,permissions.assign_roles,permissions.create_and_edit_ai_automations,permissions.create_and_edit_ai_teammates,permissions.create_app_authorization,permissions.create_global_custom_fields,permissions.create_goal,permissions.create_pat_authorization,permissions.create_portfolio,permissions.create_project,permissions.create_read_only_link,permissions.create_team,permissions.download_mobile_attachments,permissions.export_project_data,permissions.import_data,permissions.manage_roles,permissions.proactive_ai,permissions.share_goal_with_domain,permissions.share_portfolios_with_org,permissions.share_teams_with_org,permissions.standard_ai,permissions.task_deletion_policy,permissions.upload_attachments,permissions.view_public_teams,permissions.view_shared_with_org_portfolios,permissions.view_shared_with_org_projects,permissions.view_shared_with_org_tasks,workspace,workspace.name\", # list[str] | 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.\n}\n\ntry:\n # Get a role\n api_response = roles_api_instance.get_role(role_gid, opts)\n pprint(api_response)\nexcept ApiException as e:\n print(\"Exception when calling RolesApi->get_role: %s\\n\" % e)",
"name": "python-sdk-v5"
}
]
},
"x-purple-suite-runtime": "unavailable"
}
PUT /api/1.0/roles/{role_gid}
Update a role
<b>Required scope: </b><code>roles:write</code>
Updates a role in a workspace.
This operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.
Authentication
[
{
"personalAccessToken": []
},
{
"oauth2": [
"roles:write"
]
}
]
Path-level parameters and metadata
{
"parameters": [
{
"$ref": "#/components/parameters/role_path_gid"
},
{
"$ref": "#/components/parameters/pretty"
}
]
}
Request, responses and operation details
{
"summary": "Update a role",
"description": "<b>Required scope: </b><code>roles:write</code>\n\nUpdates a role in a workspace.\n\nThis operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.",
"tags": [
"Roles"
],
"operationId": "updateRole",
"parameters": [
{
"name": "opt_fields",
"in": "query",
"description": "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. Properties can include nested fields. To learn more, see the [input/output options guide](/docs/inputoutput-options#selecting-nested-fields).",
"required": false,
"example": [
"base_role_type",
"creation_time",
"description",
"is_standard_role",
"modified_at",
"name",
"permissions",
"permissions.allowed_guest_invites",
"permissions.assign_roles",
"permissions.create_and_edit_ai_automations",
"permissions.create_and_edit_ai_teammates",
"permissions.create_app_authorization",
"permissions.create_global_custom_fields",
"permissions.create_goal",
"permissions.create_pat_authorization",
"permissions.create_portfolio",
"permissions.create_project",
"permissions.create_read_only_link",
"permissions.create_team",
"permissions.download_mobile_attachments",
"permissions.export_project_data",
"permissions.import_data",
"permissions.manage_roles",
"permissions.proactive_ai",
"permissions.share_goal_with_domain",
"permissions.share_portfolios_with_org",
"permissions.share_teams_with_org",
"permissions.standard_ai",
"permissions.task_deletion_policy",
"permissions.upload_attachments",
"permissions.view_public_teams",
"permissions.view_shared_with_org_portfolios",
"permissions.view_shared_with_org_projects",
"permissions.view_shared_with_org_tasks",
"workspace",
"workspace.name"
],
"schema": {
"type": "array",
"items": {
"type": "string",
"enum": [
"base_role_type",
"creation_time",
"description",
"is_standard_role",
"modified_at",
"name",
"permissions",
"permissions.allowed_guest_invites",
"permissions.assign_roles",
"permissions.create_and_edit_ai_automations",
"permissions.create_and_edit_ai_teammates",
"permissions.create_app_authorization",
"permissions.create_global_custom_fields",
"permissions.create_goal",
"permissions.create_pat_authorization",
"permissions.create_portfolio",
"permissions.create_project",
"permissions.create_read_only_link",
"permissions.create_team",
"permissions.download_mobile_attachments",
"permissions.export_project_data",
"permissions.import_data",
"permissions.manage_roles",
"permissions.proactive_ai",
"permissions.share_goal_with_domain",
"permissions.share_portfolios_with_org",
"permissions.share_teams_with_org",
"permissions.standard_ai",
"permissions.task_deletion_policy",
"permissions.upload_attachments",
"permissions.view_public_teams",
"permissions.view_shared_with_org_portfolios",
"permissions.view_shared_with_org_projects",
"permissions.view_shared_with_org_tasks",
"workspace",
"workspace.name"
]
}
},
"style": "form",
"explode": false
}
],
"requestBody": {
"description": "The updated fields for the role.",
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"$ref": "#/components/schemas/RbacRoleUpdateRequest"
}
}
}
}
}
},
"responses": {
"200": {
"description": "Successfully updated the role.",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"$ref": "#/components/schemas/RbacRoleResponse"
}
}
}
}
}
},
"400": {
"$ref": "#/components/responses/BadRequest"
},
"401": {
"$ref": "#/components/responses/Unauthorized"
},
"403": {
"$ref": "#/components/responses/Forbidden"
},
"404": {
"$ref": "#/components/responses/NotFound"
},
"500": {
"$ref": "#/components/responses/InternalServerError"
}
},
"security": [
{
"personalAccessToken": []
},
{
"oauth2": [
"roles:write"
]
}
],
"x-readme": {
"code-samples": [
{
"language": "node",
"install": "npm install asana",
"code": "const Asana = require('asana');\n\nlet client = new Asana.ApiClient();\nclient.authentications.token.accessToken = '<YOUR_ACCESS_TOKEN>';\n\nlet rolesApiInstance = new Asana.RolesApi(client);\nlet body = {\"data\": {\"<PARAM_1>\": \"<VALUE_1>\", \"<PARAM_2>\": \"<VALUE_2>\",}}; // Object | The updated fields for the role.\nlet role_gid = \"12345\"; // String | Globally unique identifier for the role.\nlet opts = { \n 'opt_fields': \"base_role_type,creation_time,description,is_standard_role,modified_at,name,permissions,permissions.allowed_guest_invites,permissions.assign_roles,permissions.create_and_edit_ai_automations,permissions.create_and_edit_ai_teammates,permissions.create_app_authorization,permissions.create_global_custom_fields,permissions.create_goal,permissions.create_pat_authorization,permissions.create_portfolio,permissions.create_project,permissions.create_read_only_link,permissions.create_team,permissions.download_mobile_attachments,permissions.export_project_data,permissions.import_data,permissions.manage_roles,permissions.proactive_ai,permissions.share_goal_with_domain,permissions.share_portfolios_with_org,permissions.share_teams_with_org,permissions.standard_ai,permissions.task_deletion_policy,permissions.upload_attachments,permissions.view_public_teams,permissions.view_shared_with_org_portfolios,permissions.view_shared_with_org_projects,permissions.view_shared_with_org_tasks,workspace,workspace.name\"\n};\nrolesApiInstance.updateRole(body, role_gid, opts).then((result) => {\n console.log('API called successfully. Returned data: ' + JSON.stringify(result.data, null, 2));\n}, (error) => {\n console.error(error.response.body);\n});",
"name": "node-sdk-v3"
},
{
"language": "python",
"install": "pip install asana",
"code": "import asana\nfrom asana.rest import ApiException\nfrom pprint import pprint\n\nconfiguration = asana.Configuration()\nconfiguration.access_token = '<YOUR_ACCESS_TOKEN>'\napi_client = asana.ApiClient(configuration)\n\n# create an instance of the API class\nroles_api_instance = asana.RolesApi(api_client)\nbody = {\"data\": {\"<PARAM_1>\": \"<VALUE_1>\", \"<PARAM_2>\": \"<VALUE_2>\",}} # dict | The updated fields for the role.\nrole_gid = \"12345\" # str | Globally unique identifier for the role.\nopts = {\n 'opt_fields': \"base_role_type,creation_time,description,is_standard_role,modified_at,name,permissions,permissions.allowed_guest_invites,permissions.assign_roles,permissions.create_and_edit_ai_automations,permissions.create_and_edit_ai_teammates,permissions.create_app_authorization,permissions.create_global_custom_fields,permissions.create_goal,permissions.create_pat_authorization,permissions.create_portfolio,permissions.create_project,permissions.create_read_only_link,permissions.create_team,permissions.download_mobile_attachments,permissions.export_project_data,permissions.import_data,permissions.manage_roles,permissions.proactive_ai,permissions.share_goal_with_domain,permissions.share_portfolios_with_org,permissions.share_teams_with_org,permissions.standard_ai,permissions.task_deletion_policy,permissions.upload_attachments,permissions.view_public_teams,permissions.view_shared_with_org_portfolios,permissions.view_shared_with_org_projects,permissions.view_shared_with_org_tasks,workspace,workspace.name\", # list[str] | 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.\n}\n\ntry:\n # Update a role\n api_response = roles_api_instance.update_role(body, role_gid, opts)\n pprint(api_response)\nexcept ApiException as e:\n print(\"Exception when calling RolesApi->update_role: %s\\n\" % e)",
"name": "python-sdk-v5"
}
]
},
"x-purple-suite-runtime": "unavailable"
}
DELETE /api/1.0/roles/{role_gid}
Delete a role
<b>Required scope: </b><code>roles:delete</code>
Deletes a role from a workspace.
This operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.
Authentication
[
{
"personalAccessToken": []
},
{
"oauth2": [
"roles:delete"
]
}
]
Path-level parameters and metadata
{
"parameters": [
{
"$ref": "#/components/parameters/role_path_gid"
},
{
"$ref": "#/components/parameters/pretty"
}
]
}
Request, responses and operation details
{
"summary": "Delete a role",
"description": "<b>Required scope: </b><code>roles:delete</code>\n\nDeletes a role from a workspace.\n\nThis operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.",
"tags": [
"Roles"
],
"operationId": "deleteRole",
"responses": {
"200": {
"description": "Successfully deleted the specified role.",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"$ref": "#/components/schemas/EmptyResponse"
}
}
}
}
}
},
"400": {
"$ref": "#/components/responses/BadRequest"
},
"401": {
"$ref": "#/components/responses/Unauthorized"
},
"403": {
"$ref": "#/components/responses/Forbidden"
},
"404": {
"$ref": "#/components/responses/NotFound"
},
"500": {
"$ref": "#/components/responses/InternalServerError"
}
},
"security": [
{
"personalAccessToken": []
},
{
"oauth2": [
"roles:delete"
]
}
],
"x-readme": {
"code-samples": [
{
"language": "node",
"install": "npm install asana",
"code": "const Asana = require('asana');\n\nlet client = new Asana.ApiClient();\nclient.authentications.token.accessToken = '<YOUR_ACCESS_TOKEN>';\n\nlet rolesApiInstance = new Asana.RolesApi(client);\nlet role_gid = \"12345\"; // String | Globally unique identifier for the role.\n\nrolesApiInstance.deleteRole(role_gid).then((result) => {\n console.log('API called successfully. Returned data: ' + JSON.stringify(result.data, null, 2));\n}, (error) => {\n console.error(error.response.body);\n});",
"name": "node-sdk-v3"
},
{
"language": "python",
"install": "pip install asana",
"code": "import asana\nfrom asana.rest import ApiException\nfrom pprint import pprint\n\nconfiguration = asana.Configuration()\nconfiguration.access_token = '<YOUR_ACCESS_TOKEN>'\napi_client = asana.ApiClient(configuration)\n\n# create an instance of the API class\nroles_api_instance = asana.RolesApi(api_client)\nrole_gid = \"12345\" # str | Globally unique identifier for the role.\n\n\ntry:\n # Delete a role\n api_response = roles_api_instance.delete_role(role_gid)\n pprint(api_response)\nexcept ApiException as e:\n print(\"Exception when calling RolesApi->delete_role: %s\\n\" % e)",
"name": "python-sdk-v5"
}
]
},
"x-purple-suite-runtime": "unavailable"
}
POST /api/1.0/rule_triggers/{rule_trigger_gid}/run
Trigger a rule
Trigger a rule which uses an ["incoming web request"](/docs/incoming-web-requests) trigger.
This operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.
Authentication
[
{
"personalAccessToken": []
},
{
"oauth2": []
}
]
Path-level parameters and metadata
{
"parameters": [
{
"$ref": "#/components/parameters/rule_trigger_path_gid"
}
]
}
Request, responses and operation details
{
"summary": "Trigger a rule",
"description": "Trigger a rule which uses an [\"incoming web request\"](/docs/incoming-web-requests) trigger.\n\nThis operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.",
"tags": [
"Rules"
],
"operationId": "triggerRule",
"requestBody": {
"description": "A dictionary of variables accessible from within the rule.",
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"$ref": "#/components/schemas/RuleTriggerRequest"
}
}
}
}
}
},
"responses": {
"200": {
"description": "Successfully triggered a rule.",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"$ref": "#/components/schemas/RuleTriggerResponse"
}
}
}
}
}
},
"400": {
"$ref": "#/components/responses/BadRequest"
},
"401": {
"$ref": "#/components/responses/Unauthorized"
},
"402": {
"$ref": "#/components/responses/PaymentRequired"
},
"403": {
"$ref": "#/components/responses/Forbidden"
},
"404": {
"$ref": "#/components/responses/NotFound"
},
"500": {
"$ref": "#/components/responses/InternalServerError"
}
},
"security": [
{
"personalAccessToken": []
},
{
"oauth2": []
}
],
"x-readme": {
"code-samples": [
{
"language": "node",
"install": "npm install asana",
"code": "const Asana = require('asana');\n\nlet client = new Asana.ApiClient();\nclient.authentications.token.accessToken = '<YOUR_ACCESS_TOKEN>';\n\nlet rulesApiInstance = new Asana.RulesApi(client);\nlet body = {\"data\": {\"<PARAM_1>\": \"<VALUE_1>\", \"<PARAM_2>\": \"<VALUE_2>\",}}; // Object | A dictionary of variables accessible from within the rule.\nlet rule_trigger_gid = \"12345\"; // String | The ID of the incoming web request trigger. This value is a path parameter that is automatically generated for the API endpoint.\n\nrulesApiInstance.triggerRule(body, rule_trigger_gid).then((result) => {\n console.log('API called successfully. Returned data: ' + JSON.stringify(result.data, null, 2));\n}, (error) => {\n console.error(error.response.body);\n});",
"name": "node-sdk-v3"
},
{
"language": "node",
"install": "npm install asana@1.0.5",
"code": "const asana = require('asana');\n\nconst client = asana.Client.create().useAccessToken('PERSONAL_ACCESS_TOKEN');\n\nclient.rules.triggerRule(ruleTriggerGid, {field: \"value\", field: \"value\", pretty: true})\n .then((result) => {\n console.log(result);\n });",
"name": "node-sdk-v1"
},
{
"language": "python",
"install": "pip install asana",
"code": "import asana\nfrom asana.rest import ApiException\nfrom pprint import pprint\n\nconfiguration = asana.Configuration()\nconfiguration.access_token = '<YOUR_ACCESS_TOKEN>'\napi_client = asana.ApiClient(configuration)\n\n# create an instance of the API class\nrules_api_instance = asana.RulesApi(api_client)\nbody = {\"data\": {\"<PARAM_1>\": \"<VALUE_1>\", \"<PARAM_2>\": \"<VALUE_2>\",}} # dict | A dictionary of variables accessible from within the rule.\nrule_trigger_gid = \"12345\" # str | The ID of the incoming web request trigger. This value is a path parameter that is automatically generated for the API endpoint.\n\n\ntry:\n # Trigger a rule\n api_response = rules_api_instance.trigger_rule(body, rule_trigger_gid)\n pprint(api_response)\nexcept ApiException as e:\n print(\"Exception when calling RulesApi->trigger_rule: %s\\n\" % e)",
"name": "python-sdk-v5"
},
{
"language": "python",
"install": "pip install asana==3.2.3",
"code": "import asana\n\nclient = asana.Client.access_token('PERSONAL_ACCESS_TOKEN')\n\nresult = client.rules.trigger_rule(rule_trigger_gid, {'field': 'value', 'field': 'value'}, opt_pretty=True)",
"name": "python-sdk-v3"
}
]
},
"x-purple-suite-runtime": "unavailable"
}
GET /api/1.0/sections/{section_gid}
Get a section
Returns the complete record for a single section.
The persistent core model supports the response and query fields named in x-purple-suite-supported-response-fields and x-purple-suite-supported-query. Other fields/options return an explicit 400 errors envelope.
Authentication
[
{
"personalAccessToken": []
},
{
"oauth2": []
}
]
Path-level parameters and metadata
{
"parameters": [
{
"$ref": "#/components/parameters/section_path_gid"
},
{
"$ref": "#/components/parameters/pretty"
}
]
}
Request, responses and operation details
{
"summary": "Get a section",
"description": "Returns the complete record for a single section.\n\nThe persistent core model supports the response and query fields named in x-purple-suite-supported-response-fields and x-purple-suite-supported-query. Other fields/options return an explicit 400 errors envelope.",
"tags": [
"Sections"
],
"operationId": "getSection",
"parameters": [
{
"name": "opt_fields",
"in": "query",
"description": "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. Properties can include nested fields. To learn more, see the [input/output options guide](/docs/inputoutput-options#selecting-nested-fields).",
"required": false,
"example": [
"created_at",
"name",
"project",
"project.name",
"project.resource_subtype",
"projects",
"projects.name",
"projects.resource_subtype"
],
"schema": {
"type": "array",
"items": {
"type": "string",
"enum": [
"created_at",
"name",
"project",
"project.name",
"project.resource_subtype",
"projects",
"projects.name",
"projects.resource_subtype"
]
}
},
"style": "form",
"explode": false
}
],
"responses": {
"200": {
"description": "Successfully retrieved section.",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"$ref": "#/components/schemas/SectionResponse"
}
}
}
}
}
},
"400": {
"$ref": "#/components/responses/BadRequest"
},
"401": {
"$ref": "#/components/responses/Unauthorized"
},
"403": {
"$ref": "#/components/responses/Forbidden"
},
"404": {
"$ref": "#/components/responses/NotFound"
},
"500": {
"$ref": "#/components/responses/InternalServerError"
}
},
"security": [
{
"personalAccessToken": []
},
{
"oauth2": []
}
],
"x-readme": {
"code-samples": [
{
"language": "java",
"install": "<dependency><groupId>com.asana</groupId><artifactId>asana</artifactId><version>1.0.0</version></dependency>",
"code": "import com.asana.Client;\n\nClient client = Client.accessToken(\"PERSONAL_ACCESS_TOKEN\");\n\nSection result = client.sections.getSection(sectionGid)\n .option(\"pretty\", true)\n .execute();"
},
{
"language": "node",
"install": "npm install asana",
"code": "const Asana = require('asana');\n\nlet client = new Asana.ApiClient();\nclient.authentications.token.accessToken = '<YOUR_ACCESS_TOKEN>';\n\nlet sectionsApiInstance = new Asana.SectionsApi(client);\nlet section_gid = \"321654\"; // String | The globally unique identifier for the section.\nlet opts = { \n 'opt_fields': \"created_at,name,project,project.name,project.resource_subtype,projects,projects.name,projects.resource_subtype\"\n};\nsectionsApiInstance.getSection(section_gid, opts).then((result) => {\n console.log('API called successfully. Returned data: ' + JSON.stringify(result.data, null, 2));\n}, (error) => {\n console.error(error.response.body);\n});",
"name": "node-sdk-v3"
},
{
"language": "node",
"install": "npm install asana@1.0.5",
"code": "const asana = require('asana');\n\nconst client = asana.Client.create().useAccessToken('PERSONAL_ACCESS_TOKEN');\n\nclient.sections.getSection(sectionGid, {param: \"value\", param: \"value\", opt_pretty: true})\n .then((result) => {\n console.log(result);\n });",
"name": "node-sdk-v1"
},
{
"language": "python",
"install": "pip install asana",
"code": "import asana\nfrom asana.rest import ApiException\nfrom pprint import pprint\n\nconfiguration = asana.Configuration()\nconfiguration.access_token = '<YOUR_ACCESS_TOKEN>'\napi_client = asana.ApiClient(configuration)\n\n# create an instance of the API class\nsections_api_instance = asana.SectionsApi(api_client)\nsection_gid = \"321654\" # str | The globally unique identifier for the section.\nopts = {\n 'opt_fields': \"created_at,name,project,project.name,project.resource_subtype,projects,projects.name,projects.resource_subtype\", # list[str] | 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.\n}\n\ntry:\n # Get a section\n api_response = sections_api_instance.get_section(section_gid, opts)\n pprint(api_response)\nexcept ApiException as e:\n print(\"Exception when calling SectionsApi->get_section: %s\\n\" % e)",
"name": "python-sdk-v5"
},
{
"language": "python",
"install": "pip install asana==3.2.3",
"code": "import asana\n\nclient = asana.Client.access_token('PERSONAL_ACCESS_TOKEN')\n\nresult = client.sections.get_section(section_gid, {'param': 'value', 'param': 'value'}, opt_pretty=True)",
"name": "python-sdk-v3"
},
{
"language": "php",
"install": "composer require asana/asana",
"code": "<?php\nrequire 'vendor/autoload.php';\n\n$client = Asana\\Client::accessToken('PERSONAL_ACCESS_TOKEN');\n\n$result = $client->sections->getSection($section_gid, array('param' => 'value', 'param' => 'value'), array('opt_pretty' => 'true'))"
},
{
"language": "ruby",
"install": "gem install asana",
"code": "require 'asana'\n\nclient = Asana::Client.new do |c|\n c.authentication :access_token, 'PERSONAL_ACCESS_TOKEN'\nend\n\nresult = client.sections.get_section(section_gid: 'section_gid', param: \"value\", param: \"value\", options: {pretty: true})"
}
]
},
"x-purple-suite-runtime": "modeled-core",
"x-purple-suite-supported-query": [
"opt_pretty",
"opt_fields"
],
"x-purple-suite-supported-response-fields": [
"gid",
"resource_type",
"resource_subtype",
"name",
"notes",
"completed",
"completed_at",
"created_at",
"modified_at",
"assignee",
"assignee_status",
"workspace",
"projects",
"memberships",
"parent",
"due_on",
"start_on",
"tags",
"dependencies",
"num_subtasks",
"archived",
"public",
"color",
"default_view",
"team",
"project",
"section",
"text",
"created_by",
"target",
"type",
"email",
"photo",
"is_organization"
]
}
PUT /api/1.0/sections/{section_gid}
Update a section
A specific, existing section can be updated by making a PUT request on
the URL for that project. Only the fields provided in the `data` block
will be updated; any unspecified fields will remain unchanged. (note that
at this time, the only field that can be updated is the `name` field.)
When using this method, it is best to specify only those fields you wish
to change, or else you may overwrite changes made by another user since
you last retrieved the task.
Returns the complete updated section record.
The persistent core model supports the response and query fields named in x-purple-suite-supported-response-fields and x-purple-suite-supported-query. Other fields/options return an explicit 400 errors envelope.
Authentication
[
{
"personalAccessToken": []
},
{
"oauth2": []
}
]
Path-level parameters and metadata
{
"parameters": [
{
"$ref": "#/components/parameters/section_path_gid"
},
{
"$ref": "#/components/parameters/pretty"
}
]
}
Request, responses and operation details
{
"summary": "Update a section",
"description": "A specific, existing section can be updated by making a PUT request on\nthe URL for that project. Only the fields provided in the `data` block\nwill be updated; any unspecified fields will remain unchanged. (note that\nat this time, the only field that can be updated is the `name` field.)\n\nWhen using this method, it is best to specify only those fields you wish\nto change, or else you may overwrite changes made by another user since\nyou last retrieved the task.\n\nReturns the complete updated section record.\n\nThe persistent core model supports the response and query fields named in x-purple-suite-supported-response-fields and x-purple-suite-supported-query. Other fields/options return an explicit 400 errors envelope.",
"tags": [
"Sections"
],
"operationId": "updateSection",
"parameters": [
{
"name": "opt_fields",
"in": "query",
"description": "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. Properties can include nested fields. To learn more, see the [input/output options guide](/docs/inputoutput-options#selecting-nested-fields).",
"required": false,
"example": [
"created_at",
"name",
"project",
"project.name",
"project.resource_subtype",
"projects",
"projects.name",
"projects.resource_subtype"
],
"schema": {
"type": "array",
"items": {
"type": "string",
"enum": [
"created_at",
"name",
"project",
"project.name",
"project.resource_subtype",
"projects",
"projects.name",
"projects.resource_subtype"
]
}
},
"style": "form",
"explode": false
}
],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
"data"
],
"additionalProperties": false,
"properties": {
"data": {
"type": "object",
"additionalProperties": false,
"required": [],
"properties": {
"name": {
"type": "string"
}
}
}
}
}
},
"application/x-www-form-urlencoded": {
"schema": {
"type": "object",
"additionalProperties": false,
"required": [],
"properties": {
"name": {
"type": "string"
}
}
}
}
}
},
"responses": {
"200": {
"description": "Successfully updated the specified section.",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"$ref": "#/components/schemas/SectionResponse"
}
}
}
}
}
},
"400": {
"$ref": "#/components/responses/BadRequest"
},
"401": {
"$ref": "#/components/responses/Unauthorized"
},
"403": {
"$ref": "#/components/responses/Forbidden"
},
"404": {
"$ref": "#/components/responses/NotFound"
},
"500": {
"$ref": "#/components/responses/InternalServerError"
}
},
"security": [
{
"personalAccessToken": []
},
{
"oauth2": []
}
],
"x-readme": {
"code-samples": [
{
"language": "java",
"install": "<dependency><groupId>com.asana</groupId><artifactId>asana</artifactId><version>1.0.0</version></dependency>",
"code": "import com.asana.Client;\n\nClient client = Client.accessToken(\"PERSONAL_ACCESS_TOKEN\");\n\nSection result = client.sections.updateSection(sectionGid)\n .data(\"field\", \"value\")\n .data(\"field\", \"value\")\n .option(\"pretty\", true)\n .execute();"
},
{
"language": "node",
"install": "npm install asana",
"code": "const Asana = require('asana');\n\nlet client = new Asana.ApiClient();\nclient.authentications.token.accessToken = '<YOUR_ACCESS_TOKEN>';\n\nlet sectionsApiInstance = new Asana.SectionsApi(client);\nlet section_gid = \"321654\"; // String | The globally unique identifier for the section.\nlet opts = { \n 'body': {\"data\": {\"<PARAM_1>\": \"<VALUE_1>\", \"<PARAM_2>\": \"<VALUE_2>\",}}, \n 'opt_fields': \"created_at,name,project,project.name,project.resource_subtype,projects,projects.name,projects.resource_subtype\"\n};\nsectionsApiInstance.updateSection(section_gid, opts).then((result) => {\n console.log('API called successfully. Returned data: ' + JSON.stringify(result.data, null, 2));\n}, (error) => {\n console.error(error.response.body);\n});",
"name": "node-sdk-v3"
},
{
"language": "node",
"install": "npm install asana@1.0.5",
"code": "const asana = require('asana');\n\nconst client = asana.Client.create().useAccessToken('PERSONAL_ACCESS_TOKEN');\n\nclient.sections.updateSection(sectionGid, {field: \"value\", field: \"value\", pretty: true})\n .then((result) => {\n console.log(result);\n });",
"name": "node-sdk-v1"
},
{
"language": "python",
"install": "pip install asana",
"code": "import asana\nfrom asana.rest import ApiException\nfrom pprint import pprint\n\nconfiguration = asana.Configuration()\nconfiguration.access_token = '<YOUR_ACCESS_TOKEN>'\napi_client = asana.ApiClient(configuration)\n\n# create an instance of the API class\nsections_api_instance = asana.SectionsApi(api_client)\nsection_gid = \"321654\" # str | The globally unique identifier for the section.\nopts = {\n 'body': {\"data\": {\"<PARAM_1>\": \"<VALUE_1>\", \"<PARAM_2>\": \"<VALUE_2>\",}}, # dict | The section to create.\n 'opt_fields': \"created_at,name,project,project.name,project.resource_subtype,projects,projects.name,projects.resource_subtype\", # list[str] | 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.\n}\n\ntry:\n # Update a section\n api_response = sections_api_instance.update_section(section_gid, opts)\n pprint(api_response)\nexcept ApiException as e:\n print(\"Exception when calling SectionsApi->update_section: %s\\n\" % e)",
"name": "python-sdk-v5"
},
{
"language": "python",
"install": "pip install asana==3.2.3",
"code": "import asana\n\nclient = asana.Client.access_token('PERSONAL_ACCESS_TOKEN')\n\nresult = client.sections.update_section(section_gid, {'field': 'value', 'field': 'value'}, opt_pretty=True)",
"name": "python-sdk-v3"
},
{
"language": "php",
"install": "composer require asana/asana",
"code": "<?php\nrequire 'vendor/autoload.php';\n\n$client = Asana\\Client::accessToken('PERSONAL_ACCESS_TOKEN');\n\n$result = $client->sections->updateSection($section_gid, array('field' => 'value', 'field' => 'value'), array('opt_pretty' => 'true'))"
},
{
"language": "ruby",
"install": "gem install asana",
"code": "require 'asana'\n\nclient = Asana::Client.new do |c|\n c.authentication :access_token, 'PERSONAL_ACCESS_TOKEN'\nend\n\nresult = client.sections.update_section(section_gid: 'section_gid', field: \"value\", field: \"value\", options: {pretty: true})"
}
]
},
"x-purple-suite-runtime": "modeled-core",
"x-purple-suite-supported-query": [
"opt_pretty",
"opt_fields"
],
"x-purple-suite-supported-response-fields": [
"gid",
"resource_type",
"resource_subtype",
"name",
"notes",
"completed",
"completed_at",
"created_at",
"modified_at",
"assignee",
"assignee_status",
"workspace",
"projects",
"memberships",
"parent",
"due_on",
"start_on",
"tags",
"dependencies",
"num_subtasks",
"archived",
"public",
"color",
"default_view",
"team",
"project",
"section",
"text",
"created_by",
"target",
"type",
"email",
"photo",
"is_organization"
]
}
DELETE /api/1.0/sections/{section_gid}
Delete a section
A specific, existing section can be deleted by making a DELETE request on
the URL for that section.
Note that sections must be empty to be deleted.
The last remaining section cannot be deleted.
Returns an empty data block.
The persistent core model supports the response and query fields named in x-purple-suite-supported-response-fields and x-purple-suite-supported-query. Other fields/options return an explicit 400 errors envelope.
Authentication
[
{
"personalAccessToken": []
},
{
"oauth2": []
}
]
Path-level parameters and metadata
{
"parameters": [
{
"$ref": "#/components/parameters/section_path_gid"
},
{
"$ref": "#/components/parameters/pretty"
}
]
}
Request, responses and operation details
{
"summary": "Delete a section",
"description": "A specific, existing section can be deleted by making a DELETE request on\nthe URL for that section.\n\nNote that sections must be empty to be deleted.\n\nThe last remaining section cannot be deleted.\n\nReturns an empty data block.\n\nThe persistent core model supports the response and query fields named in x-purple-suite-supported-response-fields and x-purple-suite-supported-query. Other fields/options return an explicit 400 errors envelope.",
"tags": [
"Sections"
],
"operationId": "deleteSection",
"responses": {
"200": {
"description": "Successfully deleted the specified section.",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"$ref": "#/components/schemas/EmptyResponse"
}
}
}
}
}
},
"400": {
"$ref": "#/components/responses/BadRequest"
},
"401": {
"$ref": "#/components/responses/Unauthorized"
},
"403": {
"$ref": "#/components/responses/Forbidden"
},
"404": {
"$ref": "#/components/responses/NotFound"
},
"500": {
"$ref": "#/components/responses/InternalServerError"
}
},
"security": [
{
"personalAccessToken": []
},
{
"oauth2": []
}
],
"x-readme": {
"code-samples": [
{
"language": "java",
"install": "<dependency><groupId>com.asana</groupId><artifactId>asana</artifactId><version>1.0.0</version></dependency>",
"code": "import com.asana.Client;\n\nClient client = Client.accessToken(\"PERSONAL_ACCESS_TOKEN\");\n\nJsonElement result = client.sections.deleteSection(sectionGid)\n .option(\"pretty\", true)\n .execute();"
},
{
"language": "node",
"install": "npm install asana",
"code": "const Asana = require('asana');\n\nlet client = new Asana.ApiClient();\nclient.authentications.token.accessToken = '<YOUR_ACCESS_TOKEN>';\n\nlet sectionsApiInstance = new Asana.SectionsApi(client);\nlet section_gid = \"321654\"; // String | The globally unique identifier for the section.\n\nsectionsApiInstance.deleteSection(section_gid).then((result) => {\n console.log('API called successfully. Returned data: ' + JSON.stringify(result.data, null, 2));\n}, (error) => {\n console.error(error.response.body);\n});",
"name": "node-sdk-v3"
},
{
"language": "node",
"install": "npm install asana@1.0.5",
"code": "const asana = require('asana');\n\nconst client = asana.Client.create().useAccessToken('PERSONAL_ACCESS_TOKEN');\n\nclient.sections.deleteSection(sectionGid)\n .then((result) => {\n console.log(result);\n });",
"name": "node-sdk-v1"
},
{
"language": "python",
"install": "pip install asana",
"code": "import asana\nfrom asana.rest import ApiException\nfrom pprint import pprint\n\nconfiguration = asana.Configuration()\nconfiguration.access_token = '<YOUR_ACCESS_TOKEN>'\napi_client = asana.ApiClient(configuration)\n\n# create an instance of the API class\nsections_api_instance = asana.SectionsApi(api_client)\nsection_gid = \"321654\" # str | The globally unique identifier for the section.\n\n\ntry:\n # Delete a section\n api_response = sections_api_instance.delete_section(section_gid)\n pprint(api_response)\nexcept ApiException as e:\n print(\"Exception when calling SectionsApi->delete_section: %s\\n\" % e)",
"name": "python-sdk-v5"
},
{
"language": "python",
"install": "pip install asana==3.2.3",
"code": "import asana\n\nclient = asana.Client.access_token('PERSONAL_ACCESS_TOKEN')\n\nresult = client.sections.delete_section(section_gid, opt_pretty=True)",
"name": "python-sdk-v3"
},
{
"language": "php",
"install": "composer require asana/asana",
"code": "<?php\nrequire 'vendor/autoload.php';\n\n$client = Asana\\Client::accessToken('PERSONAL_ACCESS_TOKEN');\n\n$result = $client->sections->deleteSection($section_gid, array('opt_pretty' => 'true'))"
},
{
"language": "ruby",
"install": "gem install asana",
"code": "require 'asana'\n\nclient = Asana::Client.new do |c|\n c.authentication :access_token, 'PERSONAL_ACCESS_TOKEN'\nend\n\nresult = client.sections.delete_section(section_gid: 'section_gid', options: {pretty: true})"
}
]
},
"x-purple-suite-runtime": "modeled-core",
"x-purple-suite-supported-query": [
"opt_pretty"
],
"x-purple-suite-supported-response-fields": [
"gid",
"resource_type",
"resource_subtype",
"name",
"notes",
"completed",
"completed_at",
"created_at",
"modified_at",
"assignee",
"assignee_status",
"workspace",
"projects",
"memberships",
"parent",
"due_on",
"start_on",
"tags",
"dependencies",
"num_subtasks",
"archived",
"public",
"color",
"default_view",
"team",
"project",
"section",
"text",
"created_by",
"target",
"type",
"email",
"photo",
"is_organization"
]
}
GET /api/1.0/projects/{project_gid}/sections
Get sections in a project
Returns the compact records for all sections in the specified project.
The persistent core model supports the response and query fields named in x-purple-suite-supported-response-fields and x-purple-suite-supported-query. Other fields/options return an explicit 400 errors envelope.
Authentication
[
{
"personalAccessToken": []
},
{
"oauth2": []
}
]
Path-level parameters and metadata
{
"parameters": [
{
"$ref": "#/components/parameters/project_path_gid"
},
{
"$ref": "#/components/parameters/pretty"
}
]
}
Request, responses and operation details
{
"summary": "Get sections in a project",
"description": "Returns the compact records for all sections in the specified project.\n\nThe persistent core model supports the response and query fields named in x-purple-suite-supported-response-fields and x-purple-suite-supported-query. Other fields/options return an explicit 400 errors envelope.",
"tags": [
"Sections"
],
"operationId": "getSectionsForProject",
"parameters": [
{
"$ref": "#/components/parameters/limit"
},
{
"$ref": "#/components/parameters/offset"
},
{
"name": "opt_fields",
"in": "query",
"description": "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. Properties can include nested fields. To learn more, see the [input/output options guide](/docs/inputoutput-options#selecting-nested-fields).",
"required": false,
"example": [
"created_at",
"name",
"offset",
"path",
"project",
"project.name",
"project.resource_subtype",
"projects",
"projects.name",
"projects.resource_subtype",
"uri"
],
"schema": {
"type": "array",
"items": {
"type": "string",
"enum": [
"created_at",
"name",
"offset",
"path",
"project",
"project.name",
"project.resource_subtype",
"projects",
"projects.name",
"projects.resource_subtype",
"uri"
]
}
},
"style": "form",
"explode": false
}
],
"responses": {
"200": {
"description": "Successfully retrieved sections in project.",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"type": "array",
"items": {
"$ref": "#/components/schemas/SectionCompact"
}
},
"next_page": {
"$ref": "#/components/schemas/NextPage"
}
}
}
}
}
},
"400": {
"$ref": "#/components/responses/BadRequest"
},
"401": {
"$ref": "#/components/responses/Unauthorized"
},
"403": {
"$ref": "#/components/responses/Forbidden"
},
"404": {
"$ref": "#/components/responses/NotFound"
},
"500": {
"$ref": "#/components/responses/InternalServerError"
}
},
"security": [
{
"personalAccessToken": []
},
{
"oauth2": []
}
],
"x-readme": {
"code-samples": [
{
"language": "java",
"install": "<dependency><groupId>com.asana</groupId><artifactId>asana</artifactId><version>1.0.0</version></dependency>",
"code": "import com.asana.Client;\n\nClient client = Client.accessToken(\"PERSONAL_ACCESS_TOKEN\");\n\nList<Section> result = client.sections.getSectionsForProject(projectGid)\n .option(\"pretty\", true)\n .execute();"
},
{
"language": "node",
"install": "npm install asana",
"code": "const Asana = require('asana');\n\nlet client = new Asana.ApiClient();\nclient.authentications.token.accessToken = '<YOUR_ACCESS_TOKEN>';\n\nlet sectionsApiInstance = new Asana.SectionsApi(client);\nlet project_gid = \"1331\"; // String | Globally unique identifier for the project.\nlet opts = { \n 'limit': 50, \n 'offset': \"eyJ0eXAiOJiKV1iQLCJhbGciOiJIUzI1NiJ9\", \n 'opt_fields': \"created_at,name,offset,path,project,project.name,project.resource_subtype,projects,projects.name,projects.resource_subtype,uri\"\n};\nsectionsApiInstance.getSectionsForProject(project_gid, opts).then((result) => {\n console.log('API called successfully. Returned data: ' + JSON.stringify(result.data, null, 2));\n}, (error) => {\n console.error(error.response.body);\n});",
"name": "node-sdk-v3"
},
{
"language": "node",
"install": "npm install asana@1.0.5",
"code": "const asana = require('asana');\n\nconst client = asana.Client.create().useAccessToken('PERSONAL_ACCESS_TOKEN');\n\nclient.sections.getSectionsForProject(projectGid, {param: \"value\", param: \"value\", opt_pretty: true})\n .then((result) => {\n console.log(result);\n });",
"name": "node-sdk-v1"
},
{
"language": "python",
"install": "pip install asana",
"code": "import asana\nfrom asana.rest import ApiException\nfrom pprint import pprint\n\nconfiguration = asana.Configuration()\nconfiguration.access_token = '<YOUR_ACCESS_TOKEN>'\napi_client = asana.ApiClient(configuration)\n\n# create an instance of the API class\nsections_api_instance = asana.SectionsApi(api_client)\nproject_gid = \"1331\" # str | Globally unique identifier for the project.\nopts = {\n 'limit': 50, # int | Results per page. The number of objects to return per page. The value must be between 1 and 100.\n 'offset': \"eyJ0eXAiOJiKV1iQLCJhbGciOiJIUzI1NiJ9\", # str | 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.*\n 'opt_fields': \"created_at,name,offset,path,project,project.name,project.resource_subtype,projects,projects.name,projects.resource_subtype,uri\", # list[str] | 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.\n}\n\ntry:\n # Get sections in a project\n api_response = sections_api_instance.get_sections_for_project(project_gid, opts)\n for data in api_response:\n pprint(data)\nexcept ApiException as e:\n print(\"Exception when calling SectionsApi->get_sections_for_project: %s\\n\" % e)",
"name": "python-sdk-v5"
},
{
"language": "python",
"install": "pip install asana==3.2.3",
"code": "import asana\n\nclient = asana.Client.access_token('PERSONAL_ACCESS_TOKEN')\n\nresult = client.sections.get_sections_for_project(project_gid, {'param': 'value', 'param': 'value'}, opt_pretty=True)",
"name": "python-sdk-v3"
},
{
"language": "php",
"install": "composer require asana/asana",
"code": "<?php\nrequire 'vendor/autoload.php';\n\n$client = Asana\\Client::accessToken('PERSONAL_ACCESS_TOKEN');\n\n$result = $client->sections->getSectionsForProject($project_gid, array('param' => 'value', 'param' => 'value'), array('opt_pretty' => 'true'))"
},
{
"language": "ruby",
"install": "gem install asana",
"code": "require 'asana'\n\nclient = Asana::Client.new do |c|\n c.authentication :access_token, 'PERSONAL_ACCESS_TOKEN'\nend\n\nresult = client.sections.get_sections_for_project(project_gid: 'project_gid', param: \"value\", param: \"value\", options: {pretty: true})"
}
]
},
"x-purple-suite-runtime": "modeled-core",
"x-purple-suite-supported-query": [
"opt_pretty",
"limit",
"offset",
"opt_fields"
],
"x-purple-suite-supported-response-fields": [
"gid",
"resource_type",
"resource_subtype",
"name",
"notes",
"completed",
"completed_at",
"created_at",
"modified_at",
"assignee",
"assignee_status",
"workspace",
"projects",
"memberships",
"parent",
"due_on",
"start_on",
"tags",
"dependencies",
"num_subtasks",
"archived",
"public",
"color",
"default_view",
"team",
"project",
"section",
"text",
"created_by",
"target",
"type",
"email",
"photo",
"is_organization"
]
}
POST /api/1.0/projects/{project_gid}/sections
Create a section in a project
Creates a new section in a project.
Returns the full record of the newly created section.
The persistent core model supports the response and query fields named in x-purple-suite-supported-response-fields and x-purple-suite-supported-query. Other fields/options return an explicit 400 errors envelope.
Authentication
[
{
"personalAccessToken": []
},
{
"oauth2": []
}
]
Path-level parameters and metadata
{
"parameters": [
{
"$ref": "#/components/parameters/project_path_gid"
},
{
"$ref": "#/components/parameters/pretty"
}
]
}
Request, responses and operation details
{
"summary": "Create a section in a project",
"description": "Creates a new section in a project.\nReturns the full record of the newly created section.\n\nThe persistent core model supports the response and query fields named in x-purple-suite-supported-response-fields and x-purple-suite-supported-query. Other fields/options return an explicit 400 errors envelope.",
"tags": [
"Sections"
],
"operationId": "createSectionForProject",
"parameters": [
{
"name": "opt_fields",
"in": "query",
"description": "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. Properties can include nested fields. To learn more, see the [input/output options guide](/docs/inputoutput-options#selecting-nested-fields).",
"required": false,
"example": [
"created_at",
"name",
"project",
"project.name",
"project.resource_subtype",
"projects",
"projects.name",
"projects.resource_subtype"
],
"schema": {
"type": "array",
"items": {
"type": "string",
"enum": [
"created_at",
"name",
"project",
"project.name",
"project.resource_subtype",
"projects",
"projects.name",
"projects.resource_subtype"
]
}
},
"style": "form",
"explode": false
}
],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
"data"
],
"additionalProperties": false,
"properties": {
"data": {
"type": "object",
"additionalProperties": false,
"required": [
"name"
],
"properties": {
"name": {
"type": "string"
}
}
}
}
}
},
"application/x-www-form-urlencoded": {
"schema": {
"type": "object",
"additionalProperties": false,
"required": [
"name"
],
"properties": {
"name": {
"type": "string"
}
}
}
}
}
},
"responses": {
"201": {
"description": "Successfully created the specified section.",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"$ref": "#/components/schemas/SectionResponse"
}
}
}
}
}
},
"400": {
"$ref": "#/components/responses/BadRequest"
},
"401": {
"$ref": "#/components/responses/Unauthorized"
},
"403": {
"$ref": "#/components/responses/Forbidden"
},
"404": {
"$ref": "#/components/responses/NotFound"
},
"500": {
"$ref": "#/components/responses/InternalServerError"
}
},
"security": [
{
"personalAccessToken": []
},
{
"oauth2": []
}
],
"x-readme": {
"code-samples": [
{
"language": "java",
"install": "<dependency><groupId>com.asana</groupId><artifactId>asana</artifactId><version>1.0.0</version></dependency>",
"code": "import com.asana.Client;\n\nClient client = Client.accessToken(\"PERSONAL_ACCESS_TOKEN\");\n\nSection result = client.sections.createSectionForProject(projectGid)\n .data(\"field\", \"value\")\n .data(\"field\", \"value\")\n .option(\"pretty\", true)\n .execute();"
},
{
"language": "node",
"install": "npm install asana",
"code": "const Asana = require('asana');\n\nlet client = new Asana.ApiClient();\nclient.authentications.token.accessToken = '<YOUR_ACCESS_TOKEN>';\n\nlet sectionsApiInstance = new Asana.SectionsApi(client);\nlet project_gid = \"1331\"; // String | Globally unique identifier for the project.\nlet opts = { \n 'body': {\"data\": {\"<PARAM_1>\": \"<VALUE_1>\", \"<PARAM_2>\": \"<VALUE_2>\",}}, \n 'opt_fields': \"created_at,name,project,project.name,project.resource_subtype,projects,projects.name,projects.resource_subtype\"\n};\nsectionsApiInstance.createSectionForProject(project_gid, opts).then((result) => {\n console.log('API called successfully. Returned data: ' + JSON.stringify(result.data, null, 2));\n}, (error) => {\n console.error(error.response.body);\n});",
"name": "node-sdk-v3"
},
{
"language": "node",
"install": "npm install asana@1.0.5",
"code": "const asana = require('asana');\n\nconst client = asana.Client.create().useAccessToken('PERSONAL_ACCESS_TOKEN');\n\nclient.sections.createSectionForProject(projectGid, {field: \"value\", field: \"value\", pretty: true})\n .then((result) => {\n console.log(result);\n });",
"name": "node-sdk-v1"
},
{
"language": "python",
"install": "pip install asana",
"code": "import asana\nfrom asana.rest import ApiException\nfrom pprint import pprint\n\nconfiguration = asana.Configuration()\nconfiguration.access_token = '<YOUR_ACCESS_TOKEN>'\napi_client = asana.ApiClient(configuration)\n\n# create an instance of the API class\nsections_api_instance = asana.SectionsApi(api_client)\nproject_gid = \"1331\" # str | Globally unique identifier for the project.\nopts = {\n 'body': {\"data\": {\"<PARAM_1>\": \"<VALUE_1>\", \"<PARAM_2>\": \"<VALUE_2>\",}}, # dict | The section to create.\n 'opt_fields': \"created_at,name,project,project.name,project.resource_subtype,projects,projects.name,projects.resource_subtype\", # list[str] | 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.\n}\n\ntry:\n # Create a section in a project\n api_response = sections_api_instance.create_section_for_project(project_gid, opts)\n pprint(api_response)\nexcept ApiException as e:\n print(\"Exception when calling SectionsApi->create_section_for_project: %s\\n\" % e)",
"name": "python-sdk-v5"
},
{
"language": "python",
"install": "pip install asana==3.2.3",
"code": "import asana\n\nclient = asana.Client.access_token('PERSONAL_ACCESS_TOKEN')\n\nresult = client.sections.create_section_for_project(project_gid, {'field': 'value', 'field': 'value'}, opt_pretty=True)",
"name": "python-sdk-v3"
},
{
"language": "php",
"install": "composer require asana/asana",
"code": "<?php\nrequire 'vendor/autoload.php';\n\n$client = Asana\\Client::accessToken('PERSONAL_ACCESS_TOKEN');\n\n$result = $client->sections->createSectionForProject($project_gid, array('field' => 'value', 'field' => 'value'), array('opt_pretty' => 'true'))"
},
{
"language": "ruby",
"install": "gem install asana",
"code": "require 'asana'\n\nclient = Asana::Client.new do |c|\n c.authentication :access_token, 'PERSONAL_ACCESS_TOKEN'\nend\n\nresult = client.sections.create_section_for_project(project_gid: 'project_gid', field: \"value\", field: \"value\", options: {pretty: true})"
}
]
},
"x-purple-suite-runtime": "modeled-core",
"x-purple-suite-supported-query": [
"opt_pretty",
"opt_fields"
],
"x-purple-suite-supported-response-fields": [
"gid",
"resource_type",
"resource_subtype",
"name",
"notes",
"completed",
"completed_at",
"created_at",
"modified_at",
"assignee",
"assignee_status",
"workspace",
"projects",
"memberships",
"parent",
"due_on",
"start_on",
"tags",
"dependencies",
"num_subtasks",
"archived",
"public",
"color",
"default_view",
"team",
"project",
"section",
"text",
"created_by",
"target",
"type",
"email",
"photo",
"is_organization"
]
}
POST /api/1.0/sections/{section_gid}/addTask
Add task to section
<b>Required scope: </b><code>tasks:write</code>
Add a task to a specific, existing section. This will remove the task from other sections of the project.
The task will be inserted at the top of a section unless an insert_before or insert_after parameter is declared.
This does not work for separators (tasks with the resource_subtype of section).
The persistent core model supports the response and query fields named in x-purple-suite-supported-response-fields and x-purple-suite-supported-query. Other fields/options return an explicit 400 errors envelope.
Authentication
[
{
"personalAccessToken": []
},
{
"oauth2": [
"tasks:write"
]
}
]
Path-level parameters and metadata
{
"parameters": [
{
"$ref": "#/components/parameters/section_path_gid"
},
{
"$ref": "#/components/parameters/pretty"
}
]
}
Request, responses and operation details
{
"summary": "Add task to section",
"description": "<b>Required scope: </b><code>tasks:write</code>\n\nAdd a task to a specific, existing section. This will remove the task from other sections of the project.\n\nThe task will be inserted at the top of a section unless an insert_before or insert_after parameter is declared.\n\nThis does not work for separators (tasks with the resource_subtype of section).\n\nThe persistent core model supports the response and query fields named in x-purple-suite-supported-response-fields and x-purple-suite-supported-query. Other fields/options return an explicit 400 errors envelope.",
"tags": [
"Sections"
],
"operationId": "addTaskForSection",
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
"data"
],
"additionalProperties": false,
"properties": {
"data": {
"type": "object",
"additionalProperties": false,
"required": [
"task"
],
"properties": {
"task": {
"type": "string"
}
}
}
}
}
},
"application/x-www-form-urlencoded": {
"schema": {
"type": "object",
"additionalProperties": false,
"required": [
"task"
],
"properties": {
"task": {
"type": "string"
}
}
}
}
}
},
"responses": {
"200": {
"description": "Successfully added the task.",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"$ref": "#/components/schemas/EmptyResponse"
}
}
}
}
}
},
"400": {
"$ref": "#/components/responses/BadRequest"
},
"401": {
"$ref": "#/components/responses/Unauthorized"
},
"403": {
"$ref": "#/components/responses/Forbidden"
},
"404": {
"$ref": "#/components/responses/NotFound"
},
"500": {
"$ref": "#/components/responses/InternalServerError"
}
},
"security": [
{
"personalAccessToken": []
},
{
"oauth2": [
"tasks:write"
]
}
],
"x-readme": {
"code-samples": [
{
"language": "java",
"install": "<dependency><groupId>com.asana</groupId><artifactId>asana</artifactId><version>1.0.0</version></dependency>",
"code": "import com.asana.Client;\n\nClient client = Client.accessToken(\"PERSONAL_ACCESS_TOKEN\");\n\nJsonElement result = client.sections.addTaskForSection(sectionGid)\n .data(\"field\", \"value\")\n .data(\"field\", \"value\")\n .option(\"pretty\", true)\n .execute();"
},
{
"language": "node",
"install": "npm install asana",
"code": "const Asana = require('asana');\n\nlet client = new Asana.ApiClient();\nclient.authentications.token.accessToken = '<YOUR_ACCESS_TOKEN>';\n\nlet sectionsApiInstance = new Asana.SectionsApi(client);\nlet section_gid = \"321654\"; // String | The globally unique identifier for the section.\nlet opts = { \n 'body': {\"data\": {\"<PARAM_1>\": \"<VALUE_1>\", \"<PARAM_2>\": \"<VALUE_2>\",}}\n};\nsectionsApiInstance.addTaskForSection(section_gid, opts).then((result) => {\n console.log('API called successfully. Returned data: ' + JSON.stringify(result.data, null, 2));\n}, (error) => {\n console.error(error.response.body);\n});",
"name": "node-sdk-v3"
},
{
"language": "node",
"install": "npm install asana@1.0.5",
"code": "const asana = require('asana');\n\nconst client = asana.Client.create().useAccessToken('PERSONAL_ACCESS_TOKEN');\n\nclient.sections.addTaskForSection(sectionGid, {field: \"value\", field: \"value\", pretty: true})\n .then((result) => {\n console.log(result);\n });",
"name": "node-sdk-v1"
},
{
"language": "python",
"install": "pip install asana",
"code": "import asana\nfrom asana.rest import ApiException\nfrom pprint import pprint\n\nconfiguration = asana.Configuration()\nconfiguration.access_token = '<YOUR_ACCESS_TOKEN>'\napi_client = asana.ApiClient(configuration)\n\n# create an instance of the API class\nsections_api_instance = asana.SectionsApi(api_client)\nsection_gid = \"321654\" # str | The globally unique identifier for the section.\nopts = {\n 'body': {\"data\": {\"<PARAM_1>\": \"<VALUE_1>\", \"<PARAM_2>\": \"<VALUE_2>\",}}, # dict | The task and optionally the insert location.\n}\n\ntry:\n # Add task to section\n api_response = sections_api_instance.add_task_for_section(section_gid, opts)\n pprint(api_response)\nexcept ApiException as e:\n print(\"Exception when calling SectionsApi->add_task_for_section: %s\\n\" % e)",
"name": "python-sdk-v5"
},
{
"language": "python",
"install": "pip install asana==3.2.3",
"code": "import asana\n\nclient = asana.Client.access_token('PERSONAL_ACCESS_TOKEN')\n\nresult = client.sections.add_task_for_section(section_gid, {'field': 'value', 'field': 'value'}, opt_pretty=True)",
"name": "python-sdk-v3"
},
{
"language": "php",
"install": "composer require asana/asana",
"code": "<?php\nrequire 'vendor/autoload.php';\n\n$client = Asana\\Client::accessToken('PERSONAL_ACCESS_TOKEN');\n\n$result = $client->sections->addTaskForSection($section_gid, array('field' => 'value', 'field' => 'value'), array('opt_pretty' => 'true'))"
},
{
"language": "ruby",
"install": "gem install asana",
"code": "require 'asana'\n\nclient = Asana::Client.new do |c|\n c.authentication :access_token, 'PERSONAL_ACCESS_TOKEN'\nend\n\nresult = client.sections.add_task_for_section(section_gid: 'section_gid', field: \"value\", field: \"value\", options: {pretty: true})"
}
]
},
"x-purple-suite-runtime": "modeled-core",
"x-purple-suite-supported-query": [
"opt_pretty"
],
"x-purple-suite-supported-response-fields": [
"gid",
"resource_type",
"resource_subtype",
"name",
"notes",
"completed",
"completed_at",
"created_at",
"modified_at",
"assignee",
"assignee_status",
"workspace",
"projects",
"memberships",
"parent",
"due_on",
"start_on",
"tags",
"dependencies",
"num_subtasks",
"archived",
"public",
"color",
"default_view",
"team",
"project",
"section",
"text",
"created_by",
"target",
"type",
"email",
"photo",
"is_organization"
]
}
POST /api/1.0/projects/{project_gid}/sections/insert
Move or Insert sections
Move sections relative to each other. One of
`before_section` or `after_section` is required.
Sections cannot be moved between projects.
Returns an empty data block.
This operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.
Authentication
[
{
"personalAccessToken": []
},
{
"oauth2": []
}
]
Path-level parameters and metadata
{
"parameters": [
{
"$ref": "#/components/parameters/project_path_gid"
},
{
"$ref": "#/components/parameters/pretty"
}
]
}
Request, responses and operation details
{
"summary": "Move or Insert sections",
"description": "Move sections relative to each other. One of\n`before_section` or `after_section` is required.\n\nSections cannot be moved between projects.\n\nReturns an empty data block.\n\nThis operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.",
"tags": [
"Sections"
],
"operationId": "insertSectionForProject",
"requestBody": {
"description": "The section's move action.",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"$ref": "#/components/schemas/ProjectSectionInsertRequest"
}
}
}
}
}
},
"responses": {
"200": {
"description": "Successfully moved the specified section.",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"$ref": "#/components/schemas/EmptyResponse"
}
}
}
}
}
},
"400": {
"$ref": "#/components/responses/BadRequest"
},
"401": {
"$ref": "#/components/responses/Unauthorized"
},
"403": {
"$ref": "#/components/responses/Forbidden"
},
"404": {
"$ref": "#/components/responses/NotFound"
},
"500": {
"$ref": "#/components/responses/InternalServerError"
}
},
"security": [
{
"personalAccessToken": []
},
{
"oauth2": []
}
],
"x-readme": {
"code-samples": [
{
"language": "java",
"install": "<dependency><groupId>com.asana</groupId><artifactId>asana</artifactId><version>1.0.0</version></dependency>",
"code": "import com.asana.Client;\n\nClient client = Client.accessToken(\"PERSONAL_ACCESS_TOKEN\");\n\nJsonElement result = client.sections.insertSectionForProject(projectGid)\n .data(\"field\", \"value\")\n .data(\"field\", \"value\")\n .option(\"pretty\", true)\n .execute();"
},
{
"language": "node",
"install": "npm install asana",
"code": "const Asana = require('asana');\n\nlet client = new Asana.ApiClient();\nclient.authentications.token.accessToken = '<YOUR_ACCESS_TOKEN>';\n\nlet sectionsApiInstance = new Asana.SectionsApi(client);\nlet project_gid = \"1331\"; // String | Globally unique identifier for the project.\nlet opts = { \n 'body': {\"data\": {\"<PARAM_1>\": \"<VALUE_1>\", \"<PARAM_2>\": \"<VALUE_2>\",}}\n};\nsectionsApiInstance.insertSectionForProject(project_gid, opts).then((result) => {\n console.log('API called successfully. Returned data: ' + JSON.stringify(result.data, null, 2));\n}, (error) => {\n console.error(error.response.body);\n});",
"name": "node-sdk-v3"
},
{
"language": "node",
"install": "npm install asana@1.0.5",
"code": "const asana = require('asana');\n\nconst client = asana.Client.create().useAccessToken('PERSONAL_ACCESS_TOKEN');\n\nclient.sections.insertSectionForProject(projectGid, {field: \"value\", field: \"value\", pretty: true})\n .then((result) => {\n console.log(result);\n });",
"name": "node-sdk-v1"
},
{
"language": "python",
"install": "pip install asana",
"code": "import asana\nfrom asana.rest import ApiException\nfrom pprint import pprint\n\nconfiguration = asana.Configuration()\nconfiguration.access_token = '<YOUR_ACCESS_TOKEN>'\napi_client = asana.ApiClient(configuration)\n\n# create an instance of the API class\nsections_api_instance = asana.SectionsApi(api_client)\nproject_gid = \"1331\" # str | Globally unique identifier for the project.\nopts = {\n 'body': {\"data\": {\"<PARAM_1>\": \"<VALUE_1>\", \"<PARAM_2>\": \"<VALUE_2>\",}}, # dict | The section's move action.\n}\n\ntry:\n # Move or Insert sections\n api_response = sections_api_instance.insert_section_for_project(project_gid, opts)\n pprint(api_response)\nexcept ApiException as e:\n print(\"Exception when calling SectionsApi->insert_section_for_project: %s\\n\" % e)",
"name": "python-sdk-v5"
},
{
"language": "python",
"install": "pip install asana==3.2.3",
"code": "import asana\n\nclient = asana.Client.access_token('PERSONAL_ACCESS_TOKEN')\n\nresult = client.sections.insert_section_for_project(project_gid, {'field': 'value', 'field': 'value'}, opt_pretty=True)",
"name": "python-sdk-v3"
},
{
"language": "php",
"install": "composer require asana/asana",
"code": "<?php\nrequire 'vendor/autoload.php';\n\n$client = Asana\\Client::accessToken('PERSONAL_ACCESS_TOKEN');\n\n$result = $client->sections->insertSectionForProject($project_gid, array('field' => 'value', 'field' => 'value'), array('opt_pretty' => 'true'))"
},
{
"language": "ruby",
"install": "gem install asana",
"code": "require 'asana'\n\nclient = Asana::Client.new do |c|\n c.authentication :access_token, 'PERSONAL_ACCESS_TOKEN'\nend\n\nresult = client.sections.insert_section_for_project(project_gid: 'project_gid', field: \"value\", field: \"value\", options: {pretty: true})"
}
]
},
"x-purple-suite-runtime": "unavailable"
}
GET /api/1.0/status_updates/{status_update_gid}
Get a status update
Returns the complete record for a single status update.
This operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.
Authentication
[
{
"personalAccessToken": []
},
{
"oauth2": []
}
]
Path-level parameters and metadata
{
"parameters": [
{
"$ref": "#/components/parameters/status_update_path_gid"
},
{
"$ref": "#/components/parameters/pretty"
}
]
}
Request, responses and operation details
{
"summary": "Get a status update",
"description": "Returns the complete record for a single status update.\n\nThis operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.",
"tags": [
"Status updates"
],
"operationId": "getStatus",
"parameters": [
{
"name": "opt_fields",
"in": "query",
"description": "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. Properties can include nested fields. To learn more, see the [input/output options guide](/docs/inputoutput-options#selecting-nested-fields).",
"required": false,
"example": [
"author",
"author.name",
"created_at",
"created_by",
"created_by.name",
"hearted",
"hearts",
"hearts.user",
"hearts.user.name",
"html_text",
"liked",
"likes",
"likes.user",
"likes.user.name",
"modified_at",
"num_hearts",
"num_likes",
"parent",
"parent.name",
"parent.resource_subtype",
"reaction_summary",
"reaction_summary.count",
"reaction_summary.emoji_base",
"reaction_summary.reacted",
"reaction_summary.variant",
"resource_subtype",
"status_type",
"text",
"title"
],
"schema": {
"type": "array",
"items": {
"type": "string",
"enum": [
"author",
"author.name",
"created_at",
"created_by",
"created_by.name",
"hearted",
"hearts",
"hearts.user",
"hearts.user.name",
"html_text",
"liked",
"likes",
"likes.user",
"likes.user.name",
"modified_at",
"num_hearts",
"num_likes",
"parent",
"parent.name",
"parent.resource_subtype",
"reaction_summary",
"reaction_summary.count",
"reaction_summary.emoji_base",
"reaction_summary.reacted",
"reaction_summary.variant",
"resource_subtype",
"status_type",
"text",
"title"
]
}
},
"style": "form",
"explode": false
}
],
"responses": {
"200": {
"description": "Successfully retrieved the specified object's status updates.",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"$ref": "#/components/schemas/StatusUpdateResponse"
}
}
}
}
}
},
"400": {
"$ref": "#/components/responses/BadRequest"
},
"401": {
"$ref": "#/components/responses/Unauthorized"
},
"403": {
"$ref": "#/components/responses/Forbidden"
},
"404": {
"$ref": "#/components/responses/NotFound"
},
"500": {
"$ref": "#/components/responses/InternalServerError"
}
},
"security": [
{
"personalAccessToken": []
},
{
"oauth2": []
}
],
"x-readme": {
"code-samples": [
{
"language": "java",
"install": "<dependency><groupId>com.asana</groupId><artifactId>asana</artifactId><version>1.0.0</version></dependency>",
"code": "import com.asana.Client;\n\nClient client = Client.accessToken(\"PERSONAL_ACCESS_TOKEN\");\n\nJsonElement result = client.statusupdates.getStatus(statusGid)\n .option(\"pretty\", true)\n .execute();"
},
{
"language": "node",
"install": "npm install asana",
"code": "const Asana = require('asana');\n\nlet client = new Asana.ApiClient();\nclient.authentications.token.accessToken = '<YOUR_ACCESS_TOKEN>';\n\nlet statusUpdatesApiInstance = new Asana.StatusUpdatesApi(client);\nlet status_update_gid = \"321654\"; // String | The status update to get.\nlet opts = { \n 'opt_fields': \"author,author.name,created_at,created_by,created_by.name,hearted,hearts,hearts.user,hearts.user.name,html_text,liked,likes,likes.user,likes.user.name,modified_at,num_hearts,num_likes,parent,parent.name,parent.resource_subtype,reaction_summary,reaction_summary.count,reaction_summary.emoji_base,reaction_summary.reacted,reaction_summary.variant,resource_subtype,status_type,text,title\"\n};\nstatusUpdatesApiInstance.getStatus(status_update_gid, opts).then((result) => {\n console.log('API called successfully. Returned data: ' + JSON.stringify(result.data, null, 2));\n}, (error) => {\n console.error(error.response.body);\n});",
"name": "node-sdk-v3"
},
{
"language": "node",
"install": "npm install asana@1.0.5",
"code": "const asana = require('asana');\n\nconst client = asana.Client.create().useAccessToken('PERSONAL_ACCESS_TOKEN');\n\nclient.statusupdates.getStatus(statusUpdateGid, {param: \"value\", param: \"value\", opt_pretty: true})\n .then((result) => {\n console.log(result);\n });",
"name": "node-sdk-v1"
},
{
"language": "python",
"install": "pip install asana",
"code": "import asana\nfrom asana.rest import ApiException\nfrom pprint import pprint\n\nconfiguration = asana.Configuration()\nconfiguration.access_token = '<YOUR_ACCESS_TOKEN>'\napi_client = asana.ApiClient(configuration)\n\n# create an instance of the API class\nstatus_updates_api_instance = asana.StatusUpdatesApi(api_client)\nstatus_update_gid = \"321654\" # str | The status update to get.\nopts = {\n 'opt_fields': \"author,author.name,created_at,created_by,created_by.name,hearted,hearts,hearts.user,hearts.user.name,html_text,liked,likes,likes.user,likes.user.name,modified_at,num_hearts,num_likes,parent,parent.name,parent.resource_subtype,reaction_summary,reaction_summary.count,reaction_summary.emoji_base,reaction_summary.reacted,reaction_summary.variant,resource_subtype,status_type,text,title\", # list[str] | 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.\n}\n\ntry:\n # Get a status update\n api_response = status_updates_api_instance.get_status(status_update_gid, opts)\n pprint(api_response)\nexcept ApiException as e:\n print(\"Exception when calling StatusUpdatesApi->get_status: %s\\n\" % e)",
"name": "python-sdk-v5"
},
{
"language": "python",
"install": "pip install asana==3.2.3",
"code": "import asana\n\nclient = asana.Client.access_token('PERSONAL_ACCESS_TOKEN')\n\nresult = client.status_updates.get_status(status_update_gid, {'param': 'value', 'param': 'value'}, opt_pretty=True)",
"name": "python-sdk-v3"
},
{
"language": "php",
"install": "composer require asana/asana",
"code": "<?php\nrequire 'vendor/autoload.php';\n\n$client = Asana\\Client::accessToken('PERSONAL_ACCESS_TOKEN');\n\n$result = $client->statusupdates->getStatus($status_gid, array('param' => 'value', 'param' => 'value'), array('opt_pretty' => 'true'))"
},
{
"language": "ruby",
"install": "gem install asana",
"code": "require 'asana'\n\nclient = Asana::Client.new do |c|\n c.authentication :access_token, 'PERSONAL_ACCESS_TOKEN'\nend\n\nresult = client.status_updates.get_status(status_gid: 'status_gid', param: \"value\", param: \"value\", options: {pretty: true})"
}
]
},
"x-purple-suite-runtime": "unavailable"
}
DELETE /api/1.0/status_updates/{status_update_gid}
Delete a status update
Deletes a specific, existing status update.
Returns an empty data record.
This operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.
Authentication
[
{
"personalAccessToken": []
},
{
"oauth2": []
}
]
Path-level parameters and metadata
{
"parameters": [
{
"$ref": "#/components/parameters/status_update_path_gid"
},
{
"$ref": "#/components/parameters/pretty"
}
]
}
Request, responses and operation details
{
"summary": "Delete a status update",
"description": "Deletes a specific, existing status update.\n\nReturns an empty data record.\n\nThis operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.",
"tags": [
"Status updates"
],
"operationId": "deleteStatus",
"responses": {
"200": {
"description": "Successfully deleted the specified status.",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"$ref": "#/components/schemas/EmptyResponse"
}
}
}
}
}
},
"400": {
"$ref": "#/components/responses/BadRequest"
},
"401": {
"$ref": "#/components/responses/Unauthorized"
},
"403": {
"$ref": "#/components/responses/Forbidden"
},
"404": {
"$ref": "#/components/responses/NotFound"
},
"500": {
"$ref": "#/components/responses/InternalServerError"
}
},
"security": [
{
"personalAccessToken": []
},
{
"oauth2": []
}
],
"x-readme": {
"code-samples": [
{
"language": "java",
"install": "<dependency><groupId>com.asana</groupId><artifactId>asana</artifactId><version>1.0.0</version></dependency>",
"code": "import com.asana.Client;\n\nClient client = Client.accessToken(\"PERSONAL_ACCESS_TOKEN\");\n\nJsonElement result = client.statusupdates.deleteStatus(statusGid)\n .option(\"pretty\", true)\n .execute();"
},
{
"language": "node",
"install": "npm install asana",
"code": "const Asana = require('asana');\n\nlet client = new Asana.ApiClient();\nclient.authentications.token.accessToken = '<YOUR_ACCESS_TOKEN>';\n\nlet statusUpdatesApiInstance = new Asana.StatusUpdatesApi(client);\nlet status_update_gid = \"321654\"; // String | The status update to get.\n\nstatusUpdatesApiInstance.deleteStatus(status_update_gid).then((result) => {\n console.log('API called successfully. Returned data: ' + JSON.stringify(result.data, null, 2));\n}, (error) => {\n console.error(error.response.body);\n});",
"name": "node-sdk-v3"
},
{
"language": "node",
"install": "npm install asana@1.0.5",
"code": "const asana = require('asana');\n\nconst client = asana.Client.create().useAccessToken('PERSONAL_ACCESS_TOKEN');\n\nclient.statusupdates.deleteStatus(statusUpdateGid)\n .then((result) => {\n console.log(result);\n });",
"name": "node-sdk-v1"
},
{
"language": "python",
"install": "pip install asana",
"code": "import asana\nfrom asana.rest import ApiException\nfrom pprint import pprint\n\nconfiguration = asana.Configuration()\nconfiguration.access_token = '<YOUR_ACCESS_TOKEN>'\napi_client = asana.ApiClient(configuration)\n\n# create an instance of the API class\nstatus_updates_api_instance = asana.StatusUpdatesApi(api_client)\nstatus_update_gid = \"321654\" # str | The status update to get.\n\n\ntry:\n # Delete a status update\n api_response = status_updates_api_instance.delete_status(status_update_gid)\n pprint(api_response)\nexcept ApiException as e:\n print(\"Exception when calling StatusUpdatesApi->delete_status: %s\\n\" % e)",
"name": "python-sdk-v5"
},
{
"language": "python",
"install": "pip install asana==3.2.3",
"code": "import asana\n\nclient = asana.Client.access_token('PERSONAL_ACCESS_TOKEN')\n\nresult = client.status_updates.delete_status(status_update_gid, opt_pretty=True)",
"name": "python-sdk-v3"
},
{
"language": "php",
"install": "composer require asana/asana",
"code": "<?php\nrequire 'vendor/autoload.php';\n\n$client = Asana\\Client::accessToken('PERSONAL_ACCESS_TOKEN');\n\n$result = $client->statusupdates->deleteStatus($status_gid, array('opt_pretty' => 'true'))"
},
{
"language": "ruby",
"install": "gem install asana",
"code": "require 'asana'\n\nclient = Asana::Client.new do |c|\n c.authentication :access_token, 'PERSONAL_ACCESS_TOKEN'\nend\n\nresult = client.status_updates.delete_status(status_gid: 'status_gid', options: {pretty: true})"
}
]
},
"x-purple-suite-runtime": "unavailable"
}
GET /api/1.0/status_updates
Get status updates from an object
Returns the compact status update records for all updates on the object.
This operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.
Authentication
[
{
"personalAccessToken": []
},
{
"oauth2": []
}
]
Path-level parameters and metadata
{
"parameters": [
{
"$ref": "#/components/parameters/pretty"
}
]
}
Request, responses and operation details
{
"summary": "Get status updates from an object",
"description": "Returns the compact status update records for all updates on the object.\n\nThis operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.",
"tags": [
"Status updates"
],
"operationId": "getStatusesForObject",
"parameters": [
{
"$ref": "#/components/parameters/limit"
},
{
"$ref": "#/components/parameters/offset"
},
{
"name": "parent",
"required": true,
"in": "query",
"description": "Globally unique identifier for object to fetch statuses from. Must be a GID for a project, portfolio, or goal.",
"schema": {
"type": "string"
},
"example": "159874"
},
{
"name": "created_since",
"in": "query",
"description": "Only return statuses that have been created since the given time.",
"schema": {
"type": "string",
"format": "date-time"
},
"example": "2012-02-22T02:06:58.158Z"
},
{
"name": "opt_fields",
"in": "query",
"description": "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. Properties can include nested fields. To learn more, see the [input/output options guide](/docs/inputoutput-options#selecting-nested-fields).",
"required": false,
"example": [
"author",
"author.name",
"created_at",
"created_by",
"created_by.name",
"hearted",
"hearts",
"hearts.user",
"hearts.user.name",
"html_text",
"liked",
"likes",
"likes.user",
"likes.user.name",
"modified_at",
"num_hearts",
"num_likes",
"offset",
"parent",
"parent.name",
"parent.resource_subtype",
"path",
"reaction_summary",
"reaction_summary.count",
"reaction_summary.emoji_base",
"reaction_summary.reacted",
"reaction_summary.variant",
"resource_subtype",
"status_type",
"text",
"title",
"uri"
],
"schema": {
"type": "array",
"items": {
"type": "string",
"enum": [
"author",
"author.name",
"created_at",
"created_by",
"created_by.name",
"hearted",
"hearts",
"hearts.user",
"hearts.user.name",
"html_text",
"liked",
"likes",
"likes.user",
"likes.user.name",
"modified_at",
"num_hearts",
"num_likes",
"offset",
"parent",
"parent.name",
"parent.resource_subtype",
"path",
"reaction_summary",
"reaction_summary.count",
"reaction_summary.emoji_base",
"reaction_summary.reacted",
"reaction_summary.variant",
"resource_subtype",
"status_type",
"text",
"title",
"uri"
]
}
},
"style": "form",
"explode": false
}
],
"responses": {
"200": {
"description": "Successfully retrieved the specified object's status updates.",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"type": "array",
"items": {
"$ref": "#/components/schemas/StatusUpdateCompact"
}
},
"next_page": {
"$ref": "#/components/schemas/NextPage"
}
}
}
}
}
},
"400": {
"$ref": "#/components/responses/BadRequest"
},
"401": {
"$ref": "#/components/responses/Unauthorized"
},
"403": {
"$ref": "#/components/responses/Forbidden"
},
"404": {
"$ref": "#/components/responses/NotFound"
},
"500": {
"$ref": "#/components/responses/InternalServerError"
}
},
"security": [
{
"personalAccessToken": []
},
{
"oauth2": []
}
],
"x-readme": {
"code-samples": [
{
"language": "java",
"install": "<dependency><groupId>com.asana</groupId><artifactId>asana</artifactId><version>1.0.0</version></dependency>",
"code": "import com.asana.Client;\n\nClient client = Client.accessToken(\"PERSONAL_ACCESS_TOKEN\");\n\nList<JsonElement> result = client.statusupdates.getStatusesForObject(createdSince, parent)\n .option(\"pretty\", true)\n .execute();"
},
{
"language": "node",
"install": "npm install asana",
"code": "const Asana = require('asana');\n\nlet client = new Asana.ApiClient();\nclient.authentications.token.accessToken = '<YOUR_ACCESS_TOKEN>';\n\nlet statusUpdatesApiInstance = new Asana.StatusUpdatesApi(client);\nlet parent = \"159874\"; // String | Globally unique identifier for object to fetch statuses from. Must be a GID for a project, portfolio, or goal.\nlet opts = { \n 'limit': 50, \n 'offset': \"eyJ0eXAiOJiKV1iQLCJhbGciOiJIUzI1NiJ9\", \n 'created_since': \"2012-02-22T02:06:58.158Z\", \n 'opt_fields': \"author,author.name,created_at,created_by,created_by.name,hearted,hearts,hearts.user,hearts.user.name,html_text,liked,likes,likes.user,likes.user.name,modified_at,num_hearts,num_likes,offset,parent,parent.name,parent.resource_subtype,path,reaction_summary,reaction_summary.count,reaction_summary.emoji_base,reaction_summary.reacted,reaction_summary.variant,resource_subtype,status_type,text,title,uri\"\n};\nstatusUpdatesApiInstance.getStatusesForObject(parent, opts).then((result) => {\n console.log('API called successfully. Returned data: ' + JSON.stringify(result.data, null, 2));\n}, (error) => {\n console.error(error.response.body);\n});",
"name": "node-sdk-v3"
},
{
"language": "node",
"install": "npm install asana@1.0.5",
"code": "const asana = require('asana');\n\nconst client = asana.Client.create().useAccessToken('PERSONAL_ACCESS_TOKEN');\n\nclient.statusupdates.getStatusesForObject({param: \"value\", param: \"value\", opt_pretty: true})\n .then((result) => {\n console.log(result);\n });",
"name": "node-sdk-v1"
},
{
"language": "python",
"install": "pip install asana",
"code": "import asana\nfrom asana.rest import ApiException\nfrom pprint import pprint\n\nconfiguration = asana.Configuration()\nconfiguration.access_token = '<YOUR_ACCESS_TOKEN>'\napi_client = asana.ApiClient(configuration)\n\n# create an instance of the API class\nstatus_updates_api_instance = asana.StatusUpdatesApi(api_client)\nparent = \"159874\" # str | Globally unique identifier for object to fetch statuses from. Must be a GID for a project, portfolio, or goal.\nopts = {\n 'limit': 50, # int | Results per page. The number of objects to return per page. The value must be between 1 and 100.\n 'offset': \"eyJ0eXAiOJiKV1iQLCJhbGciOiJIUzI1NiJ9\", # str | 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.*\n 'created_since': '2012-02-22T02:06:58.158Z', # datetime | Only return statuses that have been created since the given time.\n 'opt_fields': \"author,author.name,created_at,created_by,created_by.name,hearted,hearts,hearts.user,hearts.user.name,html_text,liked,likes,likes.user,likes.user.name,modified_at,num_hearts,num_likes,offset,parent,parent.name,parent.resource_subtype,path,reaction_summary,reaction_summary.count,reaction_summary.emoji_base,reaction_summary.reacted,reaction_summary.variant,resource_subtype,status_type,text,title,uri\", # list[str] | 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.\n}\n\ntry:\n # Get status updates from an object\n api_response = status_updates_api_instance.get_statuses_for_object(parent, opts)\n for data in api_response:\n pprint(data)\nexcept ApiException as e:\n print(\"Exception when calling StatusUpdatesApi->get_statuses_for_object: %s\\n\" % e)",
"name": "python-sdk-v5"
},
{
"language": "python",
"install": "pip install asana==3.2.3",
"code": "import asana\n\nclient = asana.Client.access_token('PERSONAL_ACCESS_TOKEN')\n\nresult = client.status_updates.get_statuses_for_object({'param': 'value', 'param': 'value'}, opt_pretty=True)",
"name": "python-sdk-v3"
},
{
"language": "php",
"install": "composer require asana/asana",
"code": "<?php\nrequire 'vendor/autoload.php';\n\n$client = Asana\\Client::accessToken('PERSONAL_ACCESS_TOKEN');\n\n$result = $client->statusupdates->getStatusesForObject(array('param' => 'value', 'param' => 'value'), array('opt_pretty' => 'true'))"
},
{
"language": "ruby",
"install": "gem install asana",
"code": "require 'asana'\n\nclient = Asana::Client.new do |c|\n c.authentication :access_token, 'PERSONAL_ACCESS_TOKEN'\nend\n\nresult = client.status_updates.get_statuses_for_object(parent: ''parent_example'', param: \"value\", param: \"value\", options: {pretty: true})"
}
]
},
"x-purple-suite-runtime": "unavailable"
}
POST /api/1.0/status_updates
Create a status update
Creates a new status update on an object.
Returns the full record of the newly created status update.
This operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.
Authentication
[
{
"personalAccessToken": []
},
{
"oauth2": []
}
]
Path-level parameters and metadata
{
"parameters": [
{
"$ref": "#/components/parameters/pretty"
}
]
}
Request, responses and operation details
{
"summary": "Create a status update",
"description": "Creates a new status update on an object.\nReturns the full record of the newly created status update.\n\nThis operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.",
"tags": [
"Status updates"
],
"operationId": "createStatusForObject",
"parameters": [
{
"name": "opt_fields",
"in": "query",
"description": "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. Properties can include nested fields. To learn more, see the [input/output options guide](/docs/inputoutput-options#selecting-nested-fields).",
"required": false,
"example": [
"author",
"author.name",
"created_at",
"created_by",
"created_by.name",
"hearted",
"hearts",
"hearts.user",
"hearts.user.name",
"html_text",
"liked",
"likes",
"likes.user",
"likes.user.name",
"modified_at",
"num_hearts",
"num_likes",
"parent",
"parent.name",
"parent.resource_subtype",
"reaction_summary",
"reaction_summary.count",
"reaction_summary.emoji_base",
"reaction_summary.reacted",
"reaction_summary.variant",
"resource_subtype",
"status_type",
"text",
"title"
],
"schema": {
"type": "array",
"items": {
"type": "string",
"enum": [
"author",
"author.name",
"created_at",
"created_by",
"created_by.name",
"hearted",
"hearts",
"hearts.user",
"hearts.user.name",
"html_text",
"liked",
"likes",
"likes.user",
"likes.user.name",
"modified_at",
"num_hearts",
"num_likes",
"parent",
"parent.name",
"parent.resource_subtype",
"reaction_summary",
"reaction_summary.count",
"reaction_summary.emoji_base",
"reaction_summary.reacted",
"reaction_summary.variant",
"resource_subtype",
"status_type",
"text",
"title"
]
}
},
"style": "form",
"explode": false
}
],
"requestBody": {
"description": "The status update to create.",
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"$ref": "#/components/schemas/StatusUpdateRequest"
}
}
}
}
}
},
"responses": {
"201": {
"description": "Successfully created a new status update.",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"$ref": "#/components/schemas/StatusUpdateResponse"
}
}
}
}
}
},
"400": {
"$ref": "#/components/responses/BadRequest"
},
"401": {
"$ref": "#/components/responses/Unauthorized"
},
"403": {
"$ref": "#/components/responses/Forbidden"
},
"404": {
"$ref": "#/components/responses/NotFound"
},
"500": {
"$ref": "#/components/responses/InternalServerError"
}
},
"security": [
{
"personalAccessToken": []
},
{
"oauth2": []
}
],
"x-readme": {
"code-samples": [
{
"language": "java",
"install": "<dependency><groupId>com.asana</groupId><artifactId>asana</artifactId><version>1.0.0</version></dependency>",
"code": "import com.asana.Client;\n\nClient client = Client.accessToken(\"PERSONAL_ACCESS_TOKEN\");\n\nJsonElement result = client.statusupdates.createStatusForObject()\n .data(\"field\", \"value\")\n .data(\"field\", \"value\")\n .option(\"pretty\", true)\n .execute();"
},
{
"language": "node",
"install": "npm install asana",
"code": "const Asana = require('asana');\n\nlet client = new Asana.ApiClient();\nclient.authentications.token.accessToken = '<YOUR_ACCESS_TOKEN>';\n\nlet statusUpdatesApiInstance = new Asana.StatusUpdatesApi(client);\nlet body = {\"data\": {\"<PARAM_1>\": \"<VALUE_1>\", \"<PARAM_2>\": \"<VALUE_2>\",}}; // Object | The status update to create.\nlet opts = { \n 'limit': 50, \n 'offset': \"eyJ0eXAiOJiKV1iQLCJhbGciOiJIUzI1NiJ9\", \n 'opt_fields': \"author,author.name,created_at,created_by,created_by.name,hearted,hearts,hearts.user,hearts.user.name,html_text,liked,likes,likes.user,likes.user.name,modified_at,num_hearts,num_likes,parent,parent.name,parent.resource_subtype,reaction_summary,reaction_summary.count,reaction_summary.emoji_base,reaction_summary.reacted,reaction_summary.variant,resource_subtype,status_type,text,title\"\n};\nstatusUpdatesApiInstance.createStatusForObject(body, opts).then((result) => {\n console.log('API called successfully. Returned data: ' + JSON.stringify(result.data, null, 2));\n}, (error) => {\n console.error(error.response.body);\n});",
"name": "node-sdk-v3"
},
{
"language": "node",
"install": "npm install asana@1.0.5",
"code": "const asana = require('asana');\n\nconst client = asana.Client.create().useAccessToken('PERSONAL_ACCESS_TOKEN');\n\nclient.statusupdates.createStatusForObject({field: \"value\", field: \"value\", pretty: true})\n .then((result) => {\n console.log(result);\n });",
"name": "node-sdk-v1"
},
{
"language": "python",
"install": "pip install asana",
"code": "import asana\nfrom asana.rest import ApiException\nfrom pprint import pprint\n\nconfiguration = asana.Configuration()\nconfiguration.access_token = '<YOUR_ACCESS_TOKEN>'\napi_client = asana.ApiClient(configuration)\n\n# create an instance of the API class\nstatus_updates_api_instance = asana.StatusUpdatesApi(api_client)\nbody = {\"data\": {\"<PARAM_1>\": \"<VALUE_1>\", \"<PARAM_2>\": \"<VALUE_2>\",}} # dict | The status update to create.\nopts = {\n 'limit': 50, # int | Results per page. The number of objects to return per page. The value must be between 1 and 100.\n 'offset': \"eyJ0eXAiOJiKV1iQLCJhbGciOiJIUzI1NiJ9\", # str | 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.*\n 'opt_fields': \"author,author.name,created_at,created_by,created_by.name,hearted,hearts,hearts.user,hearts.user.name,html_text,liked,likes,likes.user,likes.user.name,modified_at,num_hearts,num_likes,parent,parent.name,parent.resource_subtype,reaction_summary,reaction_summary.count,reaction_summary.emoji_base,reaction_summary.reacted,reaction_summary.variant,resource_subtype,status_type,text,title\", # list[str] | 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.\n}\n\ntry:\n # Create a status update\n api_response = status_updates_api_instance.create_status_for_object(body, opts)\n pprint(api_response)\nexcept ApiException as e:\n print(\"Exception when calling StatusUpdatesApi->create_status_for_object: %s\\n\" % e)",
"name": "python-sdk-v5"
},
{
"language": "python",
"install": "pip install asana==3.2.3",
"code": "import asana\n\nclient = asana.Client.access_token('PERSONAL_ACCESS_TOKEN')\n\nresult = client.status_updates.create_status_for_object({'field': 'value', 'field': 'value'}, opt_pretty=True)",
"name": "python-sdk-v3"
},
{
"language": "php",
"install": "composer require asana/asana",
"code": "<?php\nrequire 'vendor/autoload.php';\n\n$client = Asana\\Client::accessToken('PERSONAL_ACCESS_TOKEN');\n\n$result = $client->statusupdates->createStatusForObject(array('field' => 'value', 'field' => 'value'), array('opt_pretty' => 'true'))"
},
{
"language": "ruby",
"install": "gem install asana",
"code": "require 'asana'\n\nclient = Asana::Client.new do |c|\n c.authentication :access_token, 'PERSONAL_ACCESS_TOKEN'\nend\n\nresult = client.status_updates.create_status_for_object(field: \"value\", field: \"value\", options: {pretty: true})"
}
]
},
"x-purple-suite-runtime": "unavailable"
}
GET /api/1.0/stories/{story_gid}
Get a story
<b>Required scope: </b><code>stories:read</code>
<table>
<tr>
<th>Field</th>
<th>Required Scope</th>
</tr>
<tr>
<td><code>previews</code></td>
<td><code>attachments:read</code></td>
</tr>
<tr>
<td><code>attachments</code></td>
<td><code>attachments:read</code></td>
</tr>
</table>
Returns the full record for a single story.
The persistent core model supports the response and query fields named in x-purple-suite-supported-response-fields and x-purple-suite-supported-query. Other fields/options return an explicit 400 errors envelope.
Authentication
[
{
"personalAccessToken": []
},
{
"oauth2": [
"stories:read"
]
}
]
Path-level parameters and metadata
{
"parameters": [
{
"$ref": "#/components/parameters/story_path_gid"
},
{
"$ref": "#/components/parameters/pretty"
}
]
}
Request, responses and operation details
{
"summary": "Get a story",
"description": "<b>Required scope: </b><code>stories:read</code>\n\n<table>\n <tr>\n <th>Field</th>\n <th>Required Scope</th>\n </tr>\n <tr>\n <td><code>previews</code></td>\n <td><code>attachments:read</code></td>\n </tr>\n <tr>\n <td><code>attachments</code></td>\n <td><code>attachments:read</code></td>\n </tr>\n</table>\n\nReturns the full record for a single story.\n\nThe persistent core model supports the response and query fields named in x-purple-suite-supported-response-fields and x-purple-suite-supported-query. Other fields/options return an explicit 400 errors envelope.",
"tags": [
"Stories"
],
"operationId": "getStory",
"parameters": [
{
"name": "opt_fields",
"in": "query",
"description": "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. Properties can include nested fields. To learn more, see the [input/output options guide](/docs/inputoutput-options#selecting-nested-fields).",
"required": false,
"example": [
"assignee",
"assignee.name",
"created_at",
"created_by",
"created_by.name",
"custom_field",
"custom_field.date_value",
"custom_field.date_value.date",
"custom_field.date_value.date_time",
"custom_field.display_value",
"custom_field.enabled",
"custom_field.enum_options",
"custom_field.enum_options.color",
"custom_field.enum_options.enabled",
"custom_field.enum_options.name",
"custom_field.enum_value",
"custom_field.enum_value.color",
"custom_field.enum_value.enabled",
"custom_field.enum_value.name",
"custom_field.id_prefix",
"custom_field.input_restrictions",
"custom_field.is_formula_field",
"custom_field.multi_enum_values",
"custom_field.multi_enum_values.color",
"custom_field.multi_enum_values.enabled",
"custom_field.multi_enum_values.name",
"custom_field.name",
"custom_field.number_value",
"custom_field.representation_type",
"custom_field.text_value",
"custom_field.type",
"dependency",
"dependency.created_by",
"dependency.name",
"dependency.resource_subtype",
"duplicate_of",
"duplicate_of.created_by",
"duplicate_of.name",
"duplicate_of.resource_subtype",
"duplicated_from",
"duplicated_from.created_by",
"duplicated_from.name",
"duplicated_from.resource_subtype",
"follower",
"follower.name",
"hearted",
"hearts",
"hearts.user",
"hearts.user.name",
"html_text",
"is_editable",
"is_edited",
"is_pinned",
"liked",
"likes",
"likes.user",
"likes.user.name",
"new_approval_status",
"new_date_value",
"new_dates",
"new_dates.due_at",
"new_dates.due_on",
"new_dates.start_on",
"new_enum_value",
"new_enum_value.color",
"new_enum_value.enabled",
"new_enum_value.name",
"new_multi_enum_values",
"new_multi_enum_values.color",
"new_multi_enum_values.enabled",
"new_multi_enum_values.name",
"new_name",
"new_number_value",
"new_people_value",
"new_people_value.name",
"new_resource_subtype",
"new_section",
"new_section.name",
"new_text_value",
"num_hearts",
"num_likes",
"old_approval_status",
"old_date_value",
"old_dates",
"old_dates.due_at",
"old_dates.due_on",
"old_dates.start_on",
"old_enum_value",
"old_enum_value.color",
"old_enum_value.enabled",
"old_enum_value.name",
"old_multi_enum_values",
"old_multi_enum_values.color",
"old_multi_enum_values.enabled",
"old_multi_enum_values.name",
"old_name",
"old_number_value",
"old_people_value",
"old_people_value.name",
"old_resource_subtype",
"old_section",
"old_section.name",
"old_text_value",
"previews",
"previews.fallback",
"previews.footer",
"previews.header",
"previews.header_link",
"previews.html_text",
"previews.text",
"previews.title",
"previews.title_link",
"project",
"project.name",
"project.resource_subtype",
"reaction_summary",
"reaction_summary.count",
"reaction_summary.emoji_base",
"reaction_summary.reacted",
"reaction_summary.variant",
"resource_subtype",
"source",
"sticker_name",
"story",
"story.created_at",
"story.created_by",
"story.created_by.name",
"story.resource_subtype",
"story.text",
"tag",
"tag.name",
"target",
"target.created_by",
"target.name",
"target.resource_subtype",
"task",
"task.created_by",
"task.name",
"task.resource_subtype",
"text",
"type"
],
"schema": {
"type": "array",
"items": {
"type": "string",
"enum": [
"assignee",
"assignee.name",
"created_at",
"created_by",
"created_by.name",
"custom_field",
"custom_field.date_value",
"custom_field.date_value.date",
"custom_field.date_value.date_time",
"custom_field.display_value",
"custom_field.enabled",
"custom_field.enum_options",
"custom_field.enum_options.color",
"custom_field.enum_options.enabled",
"custom_field.enum_options.name",
"custom_field.enum_value",
"custom_field.enum_value.color",
"custom_field.enum_value.enabled",
"custom_field.enum_value.name",
"custom_field.id_prefix",
"custom_field.input_restrictions",
"custom_field.is_formula_field",
"custom_field.multi_enum_values",
"custom_field.multi_enum_values.color",
"custom_field.multi_enum_values.enabled",
"custom_field.multi_enum_values.name",
"custom_field.name",
"custom_field.number_value",
"custom_field.representation_type",
"custom_field.text_value",
"custom_field.type",
"dependency",
"dependency.created_by",
"dependency.name",
"dependency.resource_subtype",
"duplicate_of",
"duplicate_of.created_by",
"duplicate_of.name",
"duplicate_of.resource_subtype",
"duplicated_from",
"duplicated_from.created_by",
"duplicated_from.name",
"duplicated_from.resource_subtype",
"follower",
"follower.name",
"hearted",
"hearts",
"hearts.user",
"hearts.user.name",
"html_text",
"is_editable",
"is_edited",
"is_pinned",
"liked",
"likes",
"likes.user",
"likes.user.name",
"new_approval_status",
"new_date_value",
"new_dates",
"new_dates.due_at",
"new_dates.due_on",
"new_dates.start_on",
"new_enum_value",
"new_enum_value.color",
"new_enum_value.enabled",
"new_enum_value.name",
"new_multi_enum_values",
"new_multi_enum_values.color",
"new_multi_enum_values.enabled",
"new_multi_enum_values.name",
"new_name",
"new_number_value",
"new_people_value",
"new_people_value.name",
"new_resource_subtype",
"new_section",
"new_section.name",
"new_text_value",
"num_hearts",
"num_likes",
"old_approval_status",
"old_date_value",
"old_dates",
"old_dates.due_at",
"old_dates.due_on",
"old_dates.start_on",
"old_enum_value",
"old_enum_value.color",
"old_enum_value.enabled",
"old_enum_value.name",
"old_multi_enum_values",
"old_multi_enum_values.color",
"old_multi_enum_values.enabled",
"old_multi_enum_values.name",
"old_name",
"old_number_value",
"old_people_value",
"old_people_value.name",
"old_resource_subtype",
"old_section",
"old_section.name",
"old_text_value",
"previews",
"previews.fallback",
"previews.footer",
"previews.header",
"previews.header_link",
"previews.html_text",
"previews.text",
"previews.title",
"previews.title_link",
"project",
"project.name",
"project.resource_subtype",
"reaction_summary",
"reaction_summary.count",
"reaction_summary.emoji_base",
"reaction_summary.reacted",
"reaction_summary.variant",
"resource_subtype",
"source",
"sticker_name",
"story",
"story.created_at",
"story.created_by",
"story.created_by.name",
"story.resource_subtype",
"story.text",
"tag",
"tag.name",
"target",
"target.created_by",
"target.name",
"target.resource_subtype",
"task",
"task.created_by",
"task.name",
"task.resource_subtype",
"text",
"type"
]
}
},
"style": "form",
"explode": false
}
],
"responses": {
"200": {
"description": "Successfully retrieved the specified story.",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"$ref": "#/components/schemas/StoryResponse"
}
}
}
}
}
},
"400": {
"$ref": "#/components/responses/BadRequest"
},
"401": {
"$ref": "#/components/responses/Unauthorized"
},
"403": {
"$ref": "#/components/responses/Forbidden"
},
"404": {
"$ref": "#/components/responses/NotFound"
},
"500": {
"$ref": "#/components/responses/InternalServerError"
}
},
"security": [
{
"personalAccessToken": []
},
{
"oauth2": [
"stories:read"
]
}
],
"x-readme": {
"code-samples": [
{
"language": "java",
"install": "<dependency><groupId>com.asana</groupId><artifactId>asana</artifactId><version>1.0.0</version></dependency>",
"code": "import com.asana.Client;\n\nClient client = Client.accessToken(\"PERSONAL_ACCESS_TOKEN\");\n\nStory result = client.stories.getStory(storyGid)\n .option(\"pretty\", true)\n .execute();"
},
{
"language": "node",
"install": "npm install asana",
"code": "const Asana = require('asana');\n\nlet client = new Asana.ApiClient();\nclient.authentications.token.accessToken = '<YOUR_ACCESS_TOKEN>';\n\nlet storiesApiInstance = new Asana.StoriesApi(client);\nlet story_gid = \"35678\"; // String | Globally unique identifier for the story.\nlet opts = { \n 'opt_fields': \"assignee,assignee.name,created_at,created_by,created_by.name,custom_field,custom_field.date_value,custom_field.date_value.date,custom_field.date_value.date_time,custom_field.display_value,custom_field.enabled,custom_field.enum_options,custom_field.enum_options.color,custom_field.enum_options.enabled,custom_field.enum_options.name,custom_field.enum_value,custom_field.enum_value.color,custom_field.enum_value.enabled,custom_field.enum_value.name,custom_field.id_prefix,custom_field.input_restrictions,custom_field.is_formula_field,custom_field.multi_enum_values,custom_field.multi_enum_values.color,custom_field.multi_enum_values.enabled,custom_field.multi_enum_values.name,custom_field.name,custom_field.number_value,custom_field.representation_type,custom_field.text_value,custom_field.type,dependency,dependency.created_by,dependency.name,dependency.resource_subtype,duplicate_of,duplicate_of.created_by,duplicate_of.name,duplicate_of.resource_subtype,duplicated_from,duplicated_from.created_by,duplicated_from.name,duplicated_from.resource_subtype,follower,follower.name,hearted,hearts,hearts.user,hearts.user.name,html_text,is_editable,is_edited,is_pinned,liked,likes,likes.user,likes.user.name,new_approval_status,new_date_value,new_dates,new_dates.due_at,new_dates.due_on,new_dates.start_on,new_enum_value,new_enum_value.color,new_enum_value.enabled,new_enum_value.name,new_multi_enum_values,new_multi_enum_values.color,new_multi_enum_values.enabled,new_multi_enum_values.name,new_name,new_number_value,new_people_value,new_people_value.name,new_resource_subtype,new_section,new_section.name,new_text_value,num_hearts,num_likes,old_approval_status,old_date_value,old_dates,old_dates.due_at,old_dates.due_on,old_dates.start_on,old_enum_value,old_enum_value.color,old_enum_value.enabled,old_enum_value.name,old_multi_enum_values,old_multi_enum_values.color,old_multi_enum_values.enabled,old_multi_enum_values.name,old_name,old_number_value,old_people_value,old_people_value.name,old_resource_subtype,old_section,old_section.name,old_text_value,previews,previews.fallback,previews.footer,previews.header,previews.header_link,previews.html_text,previews.text,previews.title,previews.title_link,project,project.name,project.resource_subtype,reaction_summary,reaction_summary.count,reaction_summary.emoji_base,reaction_summary.reacted,reaction_summary.variant,resource_subtype,source,sticker_name,story,story.created_at,story.created_by,story.created_by.name,story.resource_subtype,story.text,tag,tag.name,target,target.created_by,target.name,target.resource_subtype,task,task.created_by,task.name,task.resource_subtype,text,type\"\n};\nstoriesApiInstance.getStory(story_gid, opts).then((result) => {\n console.log('API called successfully. Returned data: ' + JSON.stringify(result.data, null, 2));\n}, (error) => {\n console.error(error.response.body);\n});",
"name": "node-sdk-v3"
},
{
"language": "node",
"install": "npm install asana@1.0.5",
"code": "const asana = require('asana');\n\nconst client = asana.Client.create().useAccessToken('PERSONAL_ACCESS_TOKEN');\n\nclient.stories.getStory(storyGid, {param: \"value\", param: \"value\", opt_pretty: true})\n .then((result) => {\n console.log(result);\n });",
"name": "node-sdk-v1"
},
{
"language": "python",
"install": "pip install asana",
"code": "import asana\nfrom asana.rest import ApiException\nfrom pprint import pprint\n\nconfiguration = asana.Configuration()\nconfiguration.access_token = '<YOUR_ACCESS_TOKEN>'\napi_client = asana.ApiClient(configuration)\n\n# create an instance of the API class\nstories_api_instance = asana.StoriesApi(api_client)\nstory_gid = \"35678\" # str | Globally unique identifier for the story.\nopts = {\n 'opt_fields': \"assignee,assignee.name,created_at,created_by,created_by.name,custom_field,custom_field.date_value,custom_field.date_value.date,custom_field.date_value.date_time,custom_field.display_value,custom_field.enabled,custom_field.enum_options,custom_field.enum_options.color,custom_field.enum_options.enabled,custom_field.enum_options.name,custom_field.enum_value,custom_field.enum_value.color,custom_field.enum_value.enabled,custom_field.enum_value.name,custom_field.id_prefix,custom_field.input_restrictions,custom_field.is_formula_field,custom_field.multi_enum_values,custom_field.multi_enum_values.color,custom_field.multi_enum_values.enabled,custom_field.multi_enum_values.name,custom_field.name,custom_field.number_value,custom_field.representation_type,custom_field.text_value,custom_field.type,dependency,dependency.created_by,dependency.name,dependency.resource_subtype,duplicate_of,duplicate_of.created_by,duplicate_of.name,duplicate_of.resource_subtype,duplicated_from,duplicated_from.created_by,duplicated_from.name,duplicated_from.resource_subtype,follower,follower.name,hearted,hearts,hearts.user,hearts.user.name,html_text,is_editable,is_edited,is_pinned,liked,likes,likes.user,likes.user.name,new_approval_status,new_date_value,new_dates,new_dates.due_at,new_dates.due_on,new_dates.start_on,new_enum_value,new_enum_value.color,new_enum_value.enabled,new_enum_value.name,new_multi_enum_values,new_multi_enum_values.color,new_multi_enum_values.enabled,new_multi_enum_values.name,new_name,new_number_value,new_people_value,new_people_value.name,new_resource_subtype,new_section,new_section.name,new_text_value,num_hearts,num_likes,old_approval_status,old_date_value,old_dates,old_dates.due_at,old_dates.due_on,old_dates.start_on,old_enum_value,old_enum_value.color,old_enum_value.enabled,old_enum_value.name,old_multi_enum_values,old_multi_enum_values.color,old_multi_enum_values.enabled,old_multi_enum_values.name,old_name,old_number_value,old_people_value,old_people_value.name,old_resource_subtype,old_section,old_section.name,old_text_value,previews,previews.fallback,previews.footer,previews.header,previews.header_link,previews.html_text,previews.text,previews.title,previews.title_link,project,project.name,project.resource_subtype,reaction_summary,reaction_summary.count,reaction_summary.emoji_base,reaction_summary.reacted,reaction_summary.variant,resource_subtype,source,sticker_name,story,story.created_at,story.created_by,story.created_by.name,story.resource_subtype,story.text,tag,tag.name,target,target.created_by,target.name,target.resource_subtype,task,task.created_by,task.name,task.resource_subtype,text,type\", # list[str] | 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.\n}\n\ntry:\n # Get a story\n api_response = stories_api_instance.get_story(story_gid, opts)\n pprint(api_response)\nexcept ApiException as e:\n print(\"Exception when calling StoriesApi->get_story: %s\\n\" % e)",
"name": "python-sdk-v5"
},
{
"language": "python",
"install": "pip install asana==3.2.3",
"code": "import asana\n\nclient = asana.Client.access_token('PERSONAL_ACCESS_TOKEN')\n\nresult = client.stories.get_story(story_gid, {'param': 'value', 'param': 'value'}, opt_pretty=True)",
"name": "python-sdk-v3"
},
{
"language": "php",
"install": "composer require asana/asana",
"code": "<?php\nrequire 'vendor/autoload.php';\n\n$client = Asana\\Client::accessToken('PERSONAL_ACCESS_TOKEN');\n\n$result = $client->stories->getStory($story_gid, array('param' => 'value', 'param' => 'value'), array('opt_pretty' => 'true'))"
},
{
"language": "ruby",
"install": "gem install asana",
"code": "require 'asana'\n\nclient = Asana::Client.new do |c|\n c.authentication :access_token, 'PERSONAL_ACCESS_TOKEN'\nend\n\nresult = client.stories.get_story(story_gid: 'story_gid', param: \"value\", param: \"value\", options: {pretty: true})"
}
]
},
"x-purple-suite-runtime": "modeled-core",
"x-purple-suite-supported-query": [
"opt_pretty",
"opt_fields"
],
"x-purple-suite-supported-response-fields": [
"gid",
"resource_type",
"resource_subtype",
"name",
"notes",
"completed",
"completed_at",
"created_at",
"modified_at",
"assignee",
"assignee_status",
"workspace",
"projects",
"memberships",
"parent",
"due_on",
"start_on",
"tags",
"dependencies",
"num_subtasks",
"archived",
"public",
"color",
"default_view",
"team",
"project",
"section",
"text",
"created_by",
"target",
"type",
"email",
"photo",
"is_organization"
]
}
PUT /api/1.0/stories/{story_gid}
Update a story
<b>Required scope: </b><code>stories:write</code>
Updates the story and returns the full record for the updated story. Only comment stories can have their text updated, and only comment stories and attachment stories can be pinned. Only one of `text` and `html_text` can be specified.
The persistent core model supports the response and query fields named in x-purple-suite-supported-response-fields and x-purple-suite-supported-query. Other fields/options return an explicit 400 errors envelope.
Authentication
[
{
"personalAccessToken": []
},
{
"oauth2": [
"stories:write"
]
}
]
Path-level parameters and metadata
{
"parameters": [
{
"$ref": "#/components/parameters/story_path_gid"
},
{
"$ref": "#/components/parameters/pretty"
}
]
}
Request, responses and operation details
{
"summary": "Update a story",
"description": "<b>Required scope: </b><code>stories:write</code>\n\nUpdates the story and returns the full record for the updated story. Only comment stories can have their text updated, and only comment stories and attachment stories can be pinned. Only one of `text` and `html_text` can be specified.\n\nThe persistent core model supports the response and query fields named in x-purple-suite-supported-response-fields and x-purple-suite-supported-query. Other fields/options return an explicit 400 errors envelope.",
"tags": [
"Stories"
],
"operationId": "updateStory",
"parameters": [
{
"name": "opt_fields",
"in": "query",
"description": "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. Properties can include nested fields. To learn more, see the [input/output options guide](/docs/inputoutput-options#selecting-nested-fields).",
"required": false,
"example": [
"assignee",
"assignee.name",
"created_at",
"created_by",
"created_by.name",
"custom_field",
"custom_field.date_value",
"custom_field.date_value.date",
"custom_field.date_value.date_time",
"custom_field.display_value",
"custom_field.enabled",
"custom_field.enum_options",
"custom_field.enum_options.color",
"custom_field.enum_options.enabled",
"custom_field.enum_options.name",
"custom_field.enum_value",
"custom_field.enum_value.color",
"custom_field.enum_value.enabled",
"custom_field.enum_value.name",
"custom_field.id_prefix",
"custom_field.input_restrictions",
"custom_field.is_formula_field",
"custom_field.multi_enum_values",
"custom_field.multi_enum_values.color",
"custom_field.multi_enum_values.enabled",
"custom_field.multi_enum_values.name",
"custom_field.name",
"custom_field.number_value",
"custom_field.representation_type",
"custom_field.text_value",
"custom_field.type",
"dependency",
"dependency.created_by",
"dependency.name",
"dependency.resource_subtype",
"duplicate_of",
"duplicate_of.created_by",
"duplicate_of.name",
"duplicate_of.resource_subtype",
"duplicated_from",
"duplicated_from.created_by",
"duplicated_from.name",
"duplicated_from.resource_subtype",
"follower",
"follower.name",
"hearted",
"hearts",
"hearts.user",
"hearts.user.name",
"html_text",
"is_editable",
"is_edited",
"is_pinned",
"liked",
"likes",
"likes.user",
"likes.user.name",
"new_approval_status",
"new_date_value",
"new_dates",
"new_dates.due_at",
"new_dates.due_on",
"new_dates.start_on",
"new_enum_value",
"new_enum_value.color",
"new_enum_value.enabled",
"new_enum_value.name",
"new_multi_enum_values",
"new_multi_enum_values.color",
"new_multi_enum_values.enabled",
"new_multi_enum_values.name",
"new_name",
"new_number_value",
"new_people_value",
"new_people_value.name",
"new_resource_subtype",
"new_section",
"new_section.name",
"new_text_value",
"num_hearts",
"num_likes",
"old_approval_status",
"old_date_value",
"old_dates",
"old_dates.due_at",
"old_dates.due_on",
"old_dates.start_on",
"old_enum_value",
"old_enum_value.color",
"old_enum_value.enabled",
"old_enum_value.name",
"old_multi_enum_values",
"old_multi_enum_values.color",
"old_multi_enum_values.enabled",
"old_multi_enum_values.name",
"old_name",
"old_number_value",
"old_people_value",
"old_people_value.name",
"old_resource_subtype",
"old_section",
"old_section.name",
"old_text_value",
"previews",
"previews.fallback",
"previews.footer",
"previews.header",
"previews.header_link",
"previews.html_text",
"previews.text",
"previews.title",
"previews.title_link",
"project",
"project.name",
"project.resource_subtype",
"reaction_summary",
"reaction_summary.count",
"reaction_summary.emoji_base",
"reaction_summary.reacted",
"reaction_summary.variant",
"resource_subtype",
"source",
"sticker_name",
"story",
"story.created_at",
"story.created_by",
"story.created_by.name",
"story.resource_subtype",
"story.text",
"tag",
"tag.name",
"target",
"target.created_by",
"target.name",
"target.resource_subtype",
"task",
"task.created_by",
"task.name",
"task.resource_subtype",
"text",
"type"
],
"schema": {
"type": "array",
"items": {
"type": "string",
"enum": [
"assignee",
"assignee.name",
"created_at",
"created_by",
"created_by.name",
"custom_field",
"custom_field.date_value",
"custom_field.date_value.date",
"custom_field.date_value.date_time",
"custom_field.display_value",
"custom_field.enabled",
"custom_field.enum_options",
"custom_field.enum_options.color",
"custom_field.enum_options.enabled",
"custom_field.enum_options.name",
"custom_field.enum_value",
"custom_field.enum_value.color",
"custom_field.enum_value.enabled",
"custom_field.enum_value.name",
"custom_field.id_prefix",
"custom_field.input_restrictions",
"custom_field.is_formula_field",
"custom_field.multi_enum_values",
"custom_field.multi_enum_values.color",
"custom_field.multi_enum_values.enabled",
"custom_field.multi_enum_values.name",
"custom_field.name",
"custom_field.number_value",
"custom_field.representation_type",
"custom_field.text_value",
"custom_field.type",
"dependency",
"dependency.created_by",
"dependency.name",
"dependency.resource_subtype",
"duplicate_of",
"duplicate_of.created_by",
"duplicate_of.name",
"duplicate_of.resource_subtype",
"duplicated_from",
"duplicated_from.created_by",
"duplicated_from.name",
"duplicated_from.resource_subtype",
"follower",
"follower.name",
"hearted",
"hearts",
"hearts.user",
"hearts.user.name",
"html_text",
"is_editable",
"is_edited",
"is_pinned",
"liked",
"likes",
"likes.user",
"likes.user.name",
"new_approval_status",
"new_date_value",
"new_dates",
"new_dates.due_at",
"new_dates.due_on",
"new_dates.start_on",
"new_enum_value",
"new_enum_value.color",
"new_enum_value.enabled",
"new_enum_value.name",
"new_multi_enum_values",
"new_multi_enum_values.color",
"new_multi_enum_values.enabled",
"new_multi_enum_values.name",
"new_name",
"new_number_value",
"new_people_value",
"new_people_value.name",
"new_resource_subtype",
"new_section",
"new_section.name",
"new_text_value",
"num_hearts",
"num_likes",
"old_approval_status",
"old_date_value",
"old_dates",
"old_dates.due_at",
"old_dates.due_on",
"old_dates.start_on",
"old_enum_value",
"old_enum_value.color",
"old_enum_value.enabled",
"old_enum_value.name",
"old_multi_enum_values",
"old_multi_enum_values.color",
"old_multi_enum_values.enabled",
"old_multi_enum_values.name",
"old_name",
"old_number_value",
"old_people_value",
"old_people_value.name",
"old_resource_subtype",
"old_section",
"old_section.name",
"old_text_value",
"previews",
"previews.fallback",
"previews.footer",
"previews.header",
"previews.header_link",
"previews.html_text",
"previews.text",
"previews.title",
"previews.title_link",
"project",
"project.name",
"project.resource_subtype",
"reaction_summary",
"reaction_summary.count",
"reaction_summary.emoji_base",
"reaction_summary.reacted",
"reaction_summary.variant",
"resource_subtype",
"source",
"sticker_name",
"story",
"story.created_at",
"story.created_by",
"story.created_by.name",
"story.resource_subtype",
"story.text",
"tag",
"tag.name",
"target",
"target.created_by",
"target.name",
"target.resource_subtype",
"task",
"task.created_by",
"task.name",
"task.resource_subtype",
"text",
"type"
]
}
},
"style": "form",
"explode": false
}
],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
"data"
],
"additionalProperties": false,
"properties": {
"data": {
"type": "object",
"additionalProperties": false,
"required": [],
"properties": {
"text": {
"type": "string"
}
}
}
}
}
},
"application/x-www-form-urlencoded": {
"schema": {
"type": "object",
"additionalProperties": false,
"required": [],
"properties": {
"text": {
"type": "string"
}
}
}
}
}
},
"responses": {
"200": {
"description": "Successfully retrieved the specified story.",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"$ref": "#/components/schemas/StoryResponse"
}
}
}
}
}
},
"400": {
"$ref": "#/components/responses/BadRequest"
},
"401": {
"$ref": "#/components/responses/Unauthorized"
},
"403": {
"$ref": "#/components/responses/Forbidden"
},
"404": {
"$ref": "#/components/responses/NotFound"
},
"500": {
"$ref": "#/components/responses/InternalServerError"
}
},
"security": [
{
"personalAccessToken": []
},
{
"oauth2": [
"stories:write"
]
}
],
"x-readme": {
"code-samples": [
{
"language": "java",
"install": "<dependency><groupId>com.asana</groupId><artifactId>asana</artifactId><version>1.0.0</version></dependency>",
"code": "import com.asana.Client;\n\nClient client = Client.accessToken(\"PERSONAL_ACCESS_TOKEN\");\n\nStory result = client.stories.updateStory(storyGid)\n .data(\"field\", \"value\")\n .data(\"field\", \"value\")\n .option(\"pretty\", true)\n .execute();"
},
{
"language": "node",
"install": "npm install asana",
"code": "const Asana = require('asana');\n\nlet client = new Asana.ApiClient();\nclient.authentications.token.accessToken = '<YOUR_ACCESS_TOKEN>';\n\nlet storiesApiInstance = new Asana.StoriesApi(client);\nlet body = {\"data\": {\"<PARAM_1>\": \"<VALUE_1>\", \"<PARAM_2>\": \"<VALUE_2>\",}}; // Object | The comment story to update.\nlet story_gid = \"35678\"; // String | Globally unique identifier for the story.\nlet opts = { \n 'opt_fields': \"assignee,assignee.name,created_at,created_by,created_by.name,custom_field,custom_field.date_value,custom_field.date_value.date,custom_field.date_value.date_time,custom_field.display_value,custom_field.enabled,custom_field.enum_options,custom_field.enum_options.color,custom_field.enum_options.enabled,custom_field.enum_options.name,custom_field.enum_value,custom_field.enum_value.color,custom_field.enum_value.enabled,custom_field.enum_value.name,custom_field.id_prefix,custom_field.input_restrictions,custom_field.is_formula_field,custom_field.multi_enum_values,custom_field.multi_enum_values.color,custom_field.multi_enum_values.enabled,custom_field.multi_enum_values.name,custom_field.name,custom_field.number_value,custom_field.representation_type,custom_field.text_value,custom_field.type,dependency,dependency.created_by,dependency.name,dependency.resource_subtype,duplicate_of,duplicate_of.created_by,duplicate_of.name,duplicate_of.resource_subtype,duplicated_from,duplicated_from.created_by,duplicated_from.name,duplicated_from.resource_subtype,follower,follower.name,hearted,hearts,hearts.user,hearts.user.name,html_text,is_editable,is_edited,is_pinned,liked,likes,likes.user,likes.user.name,new_approval_status,new_date_value,new_dates,new_dates.due_at,new_dates.due_on,new_dates.start_on,new_enum_value,new_enum_value.color,new_enum_value.enabled,new_enum_value.name,new_multi_enum_values,new_multi_enum_values.color,new_multi_enum_values.enabled,new_multi_enum_values.name,new_name,new_number_value,new_people_value,new_people_value.name,new_resource_subtype,new_section,new_section.name,new_text_value,num_hearts,num_likes,old_approval_status,old_date_value,old_dates,old_dates.due_at,old_dates.due_on,old_dates.start_on,old_enum_value,old_enum_value.color,old_enum_value.enabled,old_enum_value.name,old_multi_enum_values,old_multi_enum_values.color,old_multi_enum_values.enabled,old_multi_enum_values.name,old_name,old_number_value,old_people_value,old_people_value.name,old_resource_subtype,old_section,old_section.name,old_text_value,previews,previews.fallback,previews.footer,previews.header,previews.header_link,previews.html_text,previews.text,previews.title,previews.title_link,project,project.name,project.resource_subtype,reaction_summary,reaction_summary.count,reaction_summary.emoji_base,reaction_summary.reacted,reaction_summary.variant,resource_subtype,source,sticker_name,story,story.created_at,story.created_by,story.created_by.name,story.resource_subtype,story.text,tag,tag.name,target,target.created_by,target.name,target.resource_subtype,task,task.created_by,task.name,task.resource_subtype,text,type\"\n};\nstoriesApiInstance.updateStory(body, story_gid, opts).then((result) => {\n console.log('API called successfully. Returned data: ' + JSON.stringify(result.data, null, 2));\n}, (error) => {\n console.error(error.response.body);\n});",
"name": "node-sdk-v3"
},
{
"language": "node",
"install": "npm install asana@1.0.5",
"code": "const asana = require('asana');\n\nconst client = asana.Client.create().useAccessToken('PERSONAL_ACCESS_TOKEN');\n\nclient.stories.updateStory(storyGid, {field: \"value\", field: \"value\", pretty: true})\n .then((result) => {\n console.log(result);\n });",
"name": "node-sdk-v1"
},
{
"language": "python",
"install": "pip install asana",
"code": "import asana\nfrom asana.rest import ApiException\nfrom pprint import pprint\n\nconfiguration = asana.Configuration()\nconfiguration.access_token = '<YOUR_ACCESS_TOKEN>'\napi_client = asana.ApiClient(configuration)\n\n# create an instance of the API class\nstories_api_instance = asana.StoriesApi(api_client)\nbody = {\"data\": {\"<PARAM_1>\": \"<VALUE_1>\", \"<PARAM_2>\": \"<VALUE_2>\",}} # dict | The comment story to update.\nstory_gid = \"35678\" # str | Globally unique identifier for the story.\nopts = {\n 'opt_fields': \"assignee,assignee.name,created_at,created_by,created_by.name,custom_field,custom_field.date_value,custom_field.date_value.date,custom_field.date_value.date_time,custom_field.display_value,custom_field.enabled,custom_field.enum_options,custom_field.enum_options.color,custom_field.enum_options.enabled,custom_field.enum_options.name,custom_field.enum_value,custom_field.enum_value.color,custom_field.enum_value.enabled,custom_field.enum_value.name,custom_field.id_prefix,custom_field.input_restrictions,custom_field.is_formula_field,custom_field.multi_enum_values,custom_field.multi_enum_values.color,custom_field.multi_enum_values.enabled,custom_field.multi_enum_values.name,custom_field.name,custom_field.number_value,custom_field.representation_type,custom_field.text_value,custom_field.type,dependency,dependency.created_by,dependency.name,dependency.resource_subtype,duplicate_of,duplicate_of.created_by,duplicate_of.name,duplicate_of.resource_subtype,duplicated_from,duplicated_from.created_by,duplicated_from.name,duplicated_from.resource_subtype,follower,follower.name,hearted,hearts,hearts.user,hearts.user.name,html_text,is_editable,is_edited,is_pinned,liked,likes,likes.user,likes.user.name,new_approval_status,new_date_value,new_dates,new_dates.due_at,new_dates.due_on,new_dates.start_on,new_enum_value,new_enum_value.color,new_enum_value.enabled,new_enum_value.name,new_multi_enum_values,new_multi_enum_values.color,new_multi_enum_values.enabled,new_multi_enum_values.name,new_name,new_number_value,new_people_value,new_people_value.name,new_resource_subtype,new_section,new_section.name,new_text_value,num_hearts,num_likes,old_approval_status,old_date_value,old_dates,old_dates.due_at,old_dates.due_on,old_dates.start_on,old_enum_value,old_enum_value.color,old_enum_value.enabled,old_enum_value.name,old_multi_enum_values,old_multi_enum_values.color,old_multi_enum_values.enabled,old_multi_enum_values.name,old_name,old_number_value,old_people_value,old_people_value.name,old_resource_subtype,old_section,old_section.name,old_text_value,previews,previews.fallback,previews.footer,previews.header,previews.header_link,previews.html_text,previews.text,previews.title,previews.title_link,project,project.name,project.resource_subtype,reaction_summary,reaction_summary.count,reaction_summary.emoji_base,reaction_summary.reacted,reaction_summary.variant,resource_subtype,source,sticker_name,story,story.created_at,story.created_by,story.created_by.name,story.resource_subtype,story.text,tag,tag.name,target,target.created_by,target.name,target.resource_subtype,task,task.created_by,task.name,task.resource_subtype,text,type\", # list[str] | 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.\n}\n\ntry:\n # Update a story\n api_response = stories_api_instance.update_story(body, story_gid, opts)\n pprint(api_response)\nexcept ApiException as e:\n print(\"Exception when calling StoriesApi->update_story: %s\\n\" % e)",
"name": "python-sdk-v5"
},
{
"language": "python",
"install": "pip install asana==3.2.3",
"code": "import asana\n\nclient = asana.Client.access_token('PERSONAL_ACCESS_TOKEN')\n\nresult = client.stories.update_story(story_gid, {'field': 'value', 'field': 'value'}, opt_pretty=True)",
"name": "python-sdk-v3"
},
{
"language": "php",
"install": "composer require asana/asana",
"code": "<?php\nrequire 'vendor/autoload.php';\n\n$client = Asana\\Client::accessToken('PERSONAL_ACCESS_TOKEN');\n\n$result = $client->stories->updateStory($story_gid, array('field' => 'value', 'field' => 'value'), array('opt_pretty' => 'true'))"
},
{
"language": "ruby",
"install": "gem install asana",
"code": "require 'asana'\n\nclient = Asana::Client.new do |c|\n c.authentication :access_token, 'PERSONAL_ACCESS_TOKEN'\nend\n\nresult = client.stories.update_story(story_gid: 'story_gid', field: \"value\", field: \"value\", options: {pretty: true})"
}
]
},
"x-purple-suite-runtime": "modeled-core",
"x-purple-suite-supported-query": [
"opt_pretty",
"opt_fields"
],
"x-purple-suite-supported-response-fields": [
"gid",
"resource_type",
"resource_subtype",
"name",
"notes",
"completed",
"completed_at",
"created_at",
"modified_at",
"assignee",
"assignee_status",
"workspace",
"projects",
"memberships",
"parent",
"due_on",
"start_on",
"tags",
"dependencies",
"num_subtasks",
"archived",
"public",
"color",
"default_view",
"team",
"project",
"section",
"text",
"created_by",
"target",
"type",
"email",
"photo",
"is_organization"
]
}
DELETE /api/1.0/stories/{story_gid}
Delete a story
<b>Required scope: </b><code>stories:delete</code>
Deletes a story. A user can only delete stories they have created.
Returns an empty data record.
The persistent core model supports the response and query fields named in x-purple-suite-supported-response-fields and x-purple-suite-supported-query. Other fields/options return an explicit 400 errors envelope.
Authentication
[
{
"personalAccessToken": []
},
{
"oauth2": [
"stories:delete"
]
}
]
Path-level parameters and metadata
{
"parameters": [
{
"$ref": "#/components/parameters/story_path_gid"
},
{
"$ref": "#/components/parameters/pretty"
}
]
}
Request, responses and operation details
{
"summary": "Delete a story",
"description": "<b>Required scope: </b><code>stories:delete</code>\n\nDeletes a story. A user can only delete stories they have created.\n\nReturns an empty data record.\n\nThe persistent core model supports the response and query fields named in x-purple-suite-supported-response-fields and x-purple-suite-supported-query. Other fields/options return an explicit 400 errors envelope.",
"tags": [
"Stories"
],
"operationId": "deleteStory",
"responses": {
"200": {
"description": "Successfully deleted the specified story.",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"$ref": "#/components/schemas/EmptyResponse"
}
}
}
}
}
},
"400": {
"$ref": "#/components/responses/BadRequest"
},
"401": {
"$ref": "#/components/responses/Unauthorized"
},
"403": {
"$ref": "#/components/responses/Forbidden"
},
"404": {
"$ref": "#/components/responses/NotFound"
},
"500": {
"$ref": "#/components/responses/InternalServerError"
}
},
"security": [
{
"personalAccessToken": []
},
{
"oauth2": [
"stories:delete"
]
}
],
"x-readme": {
"code-samples": [
{
"language": "java",
"install": "<dependency><groupId>com.asana</groupId><artifactId>asana</artifactId><version>1.0.0</version></dependency>",
"code": "import com.asana.Client;\n\nClient client = Client.accessToken(\"PERSONAL_ACCESS_TOKEN\");\n\nJsonElement result = client.stories.deleteStory(storyGid)\n .option(\"pretty\", true)\n .execute();"
},
{
"language": "node",
"install": "npm install asana",
"code": "const Asana = require('asana');\n\nlet client = new Asana.ApiClient();\nclient.authentications.token.accessToken = '<YOUR_ACCESS_TOKEN>';\n\nlet storiesApiInstance = new Asana.StoriesApi(client);\nlet story_gid = \"35678\"; // String | Globally unique identifier for the story.\n\nstoriesApiInstance.deleteStory(story_gid).then((result) => {\n console.log('API called successfully. Returned data: ' + JSON.stringify(result.data, null, 2));\n}, (error) => {\n console.error(error.response.body);\n});",
"name": "node-sdk-v3"
},
{
"language": "node",
"install": "npm install asana@1.0.5",
"code": "const asana = require('asana');\n\nconst client = asana.Client.create().useAccessToken('PERSONAL_ACCESS_TOKEN');\n\nclient.stories.deleteStory(storyGid)\n .then((result) => {\n console.log(result);\n });",
"name": "node-sdk-v1"
},
{
"language": "python",
"install": "pip install asana",
"code": "import asana\nfrom asana.rest import ApiException\nfrom pprint import pprint\n\nconfiguration = asana.Configuration()\nconfiguration.access_token = '<YOUR_ACCESS_TOKEN>'\napi_client = asana.ApiClient(configuration)\n\n# create an instance of the API class\nstories_api_instance = asana.StoriesApi(api_client)\nstory_gid = \"35678\" # str | Globally unique identifier for the story.\n\n\ntry:\n # Delete a story\n api_response = stories_api_instance.delete_story(story_gid)\n pprint(api_response)\nexcept ApiException as e:\n print(\"Exception when calling StoriesApi->delete_story: %s\\n\" % e)",
"name": "python-sdk-v5"
},
{
"language": "python",
"install": "pip install asana==3.2.3",
"code": "import asana\n\nclient = asana.Client.access_token('PERSONAL_ACCESS_TOKEN')\n\nresult = client.stories.delete_story(story_gid, opt_pretty=True)",
"name": "python-sdk-v3"
},
{
"language": "php",
"install": "composer require asana/asana",
"code": "<?php\nrequire 'vendor/autoload.php';\n\n$client = Asana\\Client::accessToken('PERSONAL_ACCESS_TOKEN');\n\n$result = $client->stories->deleteStory($story_gid, array('opt_pretty' => 'true'))"
},
{
"language": "ruby",
"install": "gem install asana",
"code": "require 'asana'\n\nclient = Asana::Client.new do |c|\n c.authentication :access_token, 'PERSONAL_ACCESS_TOKEN'\nend\n\nresult = client.stories.delete_story(story_gid: 'story_gid', options: {pretty: true})"
}
]
},
"x-purple-suite-runtime": "modeled-core",
"x-purple-suite-supported-query": [
"opt_pretty"
],
"x-purple-suite-supported-response-fields": [
"gid",
"resource_type",
"resource_subtype",
"name",
"notes",
"completed",
"completed_at",
"created_at",
"modified_at",
"assignee",
"assignee_status",
"workspace",
"projects",
"memberships",
"parent",
"due_on",
"start_on",
"tags",
"dependencies",
"num_subtasks",
"archived",
"public",
"color",
"default_view",
"team",
"project",
"section",
"text",
"created_by",
"target",
"type",
"email",
"photo",
"is_organization"
]
}
GET /api/1.0/tasks/{task_gid}/stories
Get stories from a task
<b>Required scope: </b><code>stories:read</code>
Returns the compact records for all stories on the task.
The persistent core model supports the response and query fields named in x-purple-suite-supported-response-fields and x-purple-suite-supported-query. Other fields/options return an explicit 400 errors envelope.
Authentication
[
{
"personalAccessToken": []
},
{
"oauth2": [
"stories:read"
]
}
]
Path-level parameters and metadata
{
"parameters": [
{
"$ref": "#/components/parameters/task_path_gid"
},
{
"$ref": "#/components/parameters/pretty"
}
]
}
Request, responses and operation details
{
"summary": "Get stories from a task",
"description": "<b>Required scope: </b><code>stories:read</code>\n\nReturns the compact records for all stories on the task.\n\nThe persistent core model supports the response and query fields named in x-purple-suite-supported-response-fields and x-purple-suite-supported-query. Other fields/options return an explicit 400 errors envelope.",
"tags": [
"Stories"
],
"operationId": "getStoriesForTask",
"parameters": [
{
"$ref": "#/components/parameters/limit"
},
{
"$ref": "#/components/parameters/offset"
},
{
"name": "opt_fields",
"in": "query",
"description": "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. Properties can include nested fields. To learn more, see the [input/output options guide](/docs/inputoutput-options#selecting-nested-fields).",
"required": false,
"example": [
"assignee",
"assignee.name",
"created_at",
"created_by",
"created_by.name",
"custom_field",
"custom_field.date_value",
"custom_field.date_value.date",
"custom_field.date_value.date_time",
"custom_field.display_value",
"custom_field.enabled",
"custom_field.enum_options",
"custom_field.enum_options.color",
"custom_field.enum_options.enabled",
"custom_field.enum_options.name",
"custom_field.enum_value",
"custom_field.enum_value.color",
"custom_field.enum_value.enabled",
"custom_field.enum_value.name",
"custom_field.id_prefix",
"custom_field.input_restrictions",
"custom_field.is_formula_field",
"custom_field.multi_enum_values",
"custom_field.multi_enum_values.color",
"custom_field.multi_enum_values.enabled",
"custom_field.multi_enum_values.name",
"custom_field.name",
"custom_field.number_value",
"custom_field.representation_type",
"custom_field.text_value",
"custom_field.type",
"dependency",
"dependency.created_by",
"dependency.name",
"dependency.resource_subtype",
"duplicate_of",
"duplicate_of.created_by",
"duplicate_of.name",
"duplicate_of.resource_subtype",
"duplicated_from",
"duplicated_from.created_by",
"duplicated_from.name",
"duplicated_from.resource_subtype",
"follower",
"follower.name",
"hearted",
"hearts",
"hearts.user",
"hearts.user.name",
"html_text",
"is_editable",
"is_edited",
"is_pinned",
"liked",
"likes",
"likes.user",
"likes.user.name",
"new_approval_status",
"new_date_value",
"new_dates",
"new_dates.due_at",
"new_dates.due_on",
"new_dates.start_on",
"new_enum_value",
"new_enum_value.color",
"new_enum_value.enabled",
"new_enum_value.name",
"new_multi_enum_values",
"new_multi_enum_values.color",
"new_multi_enum_values.enabled",
"new_multi_enum_values.name",
"new_name",
"new_number_value",
"new_people_value",
"new_people_value.name",
"new_resource_subtype",
"new_section",
"new_section.name",
"new_text_value",
"num_hearts",
"num_likes",
"offset",
"old_approval_status",
"old_date_value",
"old_dates",
"old_dates.due_at",
"old_dates.due_on",
"old_dates.start_on",
"old_enum_value",
"old_enum_value.color",
"old_enum_value.enabled",
"old_enum_value.name",
"old_multi_enum_values",
"old_multi_enum_values.color",
"old_multi_enum_values.enabled",
"old_multi_enum_values.name",
"old_name",
"old_number_value",
"old_people_value",
"old_people_value.name",
"old_resource_subtype",
"old_section",
"old_section.name",
"old_text_value",
"path",
"previews",
"previews.fallback",
"previews.footer",
"previews.header",
"previews.header_link",
"previews.html_text",
"previews.text",
"previews.title",
"previews.title_link",
"project",
"project.name",
"project.resource_subtype",
"reaction_summary",
"reaction_summary.count",
"reaction_summary.emoji_base",
"reaction_summary.reacted",
"reaction_summary.variant",
"resource_subtype",
"source",
"sticker_name",
"story",
"story.created_at",
"story.created_by",
"story.created_by.name",
"story.resource_subtype",
"story.text",
"tag",
"tag.name",
"target",
"target.created_by",
"target.name",
"target.resource_subtype",
"task",
"task.created_by",
"task.name",
"task.resource_subtype",
"text",
"type",
"uri"
],
"schema": {
"type": "array",
"items": {
"type": "string",
"enum": [
"assignee",
"assignee.name",
"created_at",
"created_by",
"created_by.name",
"custom_field",
"custom_field.date_value",
"custom_field.date_value.date",
"custom_field.date_value.date_time",
"custom_field.display_value",
"custom_field.enabled",
"custom_field.enum_options",
"custom_field.enum_options.color",
"custom_field.enum_options.enabled",
"custom_field.enum_options.name",
"custom_field.enum_value",
"custom_field.enum_value.color",
"custom_field.enum_value.enabled",
"custom_field.enum_value.name",
"custom_field.id_prefix",
"custom_field.input_restrictions",
"custom_field.is_formula_field",
"custom_field.multi_enum_values",
"custom_field.multi_enum_values.color",
"custom_field.multi_enum_values.enabled",
"custom_field.multi_enum_values.name",
"custom_field.name",
"custom_field.number_value",
"custom_field.representation_type",
"custom_field.text_value",
"custom_field.type",
"dependency",
"dependency.created_by",
"dependency.name",
"dependency.resource_subtype",
"duplicate_of",
"duplicate_of.created_by",
"duplicate_of.name",
"duplicate_of.resource_subtype",
"duplicated_from",
"duplicated_from.created_by",
"duplicated_from.name",
"duplicated_from.resource_subtype",
"follower",
"follower.name",
"hearted",
"hearts",
"hearts.user",
"hearts.user.name",
"html_text",
"is_editable",
"is_edited",
"is_pinned",
"liked",
"likes",
"likes.user",
"likes.user.name",
"new_approval_status",
"new_date_value",
"new_dates",
"new_dates.due_at",
"new_dates.due_on",
"new_dates.start_on",
"new_enum_value",
"new_enum_value.color",
"new_enum_value.enabled",
"new_enum_value.name",
"new_multi_enum_values",
"new_multi_enum_values.color",
"new_multi_enum_values.enabled",
"new_multi_enum_values.name",
"new_name",
"new_number_value",
"new_people_value",
"new_people_value.name",
"new_resource_subtype",
"new_section",
"new_section.name",
"new_text_value",
"num_hearts",
"num_likes",
"offset",
"old_approval_status",
"old_date_value",
"old_dates",
"old_dates.due_at",
"old_dates.due_on",
"old_dates.start_on",
"old_enum_value",
"old_enum_value.color",
"old_enum_value.enabled",
"old_enum_value.name",
"old_multi_enum_values",
"old_multi_enum_values.color",
"old_multi_enum_values.enabled",
"old_multi_enum_values.name",
"old_name",
"old_number_value",
"old_people_value",
"old_people_value.name",
"old_resource_subtype",
"old_section",
"old_section.name",
"old_text_value",
"path",
"previews",
"previews.fallback",
"previews.footer",
"previews.header",
"previews.header_link",
"previews.html_text",
"previews.text",
"previews.title",
"previews.title_link",
"project",
"project.name",
"project.resource_subtype",
"reaction_summary",
"reaction_summary.count",
"reaction_summary.emoji_base",
"reaction_summary.reacted",
"reaction_summary.variant",
"resource_subtype",
"source",
"sticker_name",
"story",
"story.created_at",
"story.created_by",
"story.created_by.name",
"story.resource_subtype",
"story.text",
"tag",
"tag.name",
"target",
"target.created_by",
"target.name",
"target.resource_subtype",
"task",
"task.created_by",
"task.name",
"task.resource_subtype",
"text",
"type",
"uri"
]
}
},
"style": "form",
"explode": false
}
],
"responses": {
"200": {
"description": "Successfully retrieved the specified task's stories.",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"type": "array",
"items": {
"$ref": "#/components/schemas/StoryCompact"
}
},
"next_page": {
"$ref": "#/components/schemas/NextPage"
}
}
}
}
}
},
"400": {
"$ref": "#/components/responses/BadRequest"
},
"401": {
"$ref": "#/components/responses/Unauthorized"
},
"403": {
"$ref": "#/components/responses/Forbidden"
},
"404": {
"$ref": "#/components/responses/NotFound"
},
"500": {
"$ref": "#/components/responses/InternalServerError"
}
},
"security": [
{
"personalAccessToken": []
},
{
"oauth2": [
"stories:read"
]
}
],
"x-readme": {
"code-samples": [
{
"language": "java",
"install": "<dependency><groupId>com.asana</groupId><artifactId>asana</artifactId><version>1.0.0</version></dependency>",
"code": "import com.asana.Client;\n\nClient client = Client.accessToken(\"PERSONAL_ACCESS_TOKEN\");\n\nList<Story> result = client.stories.getStoriesForTask(taskGid)\n .option(\"pretty\", true)\n .execute();"
},
{
"language": "node",
"install": "npm install asana",
"code": "const Asana = require('asana');\n\nlet client = new Asana.ApiClient();\nclient.authentications.token.accessToken = '<YOUR_ACCESS_TOKEN>';\n\nlet storiesApiInstance = new Asana.StoriesApi(client);\nlet task_gid = \"321654\"; // String | The task to operate on.\nlet opts = { \n 'limit': 50, \n 'offset': \"eyJ0eXAiOJiKV1iQLCJhbGciOiJIUzI1NiJ9\", \n 'opt_fields': \"assignee,assignee.name,created_at,created_by,created_by.name,custom_field,custom_field.date_value,custom_field.date_value.date,custom_field.date_value.date_time,custom_field.display_value,custom_field.enabled,custom_field.enum_options,custom_field.enum_options.color,custom_field.enum_options.enabled,custom_field.enum_options.name,custom_field.enum_value,custom_field.enum_value.color,custom_field.enum_value.enabled,custom_field.enum_value.name,custom_field.id_prefix,custom_field.input_restrictions,custom_field.is_formula_field,custom_field.multi_enum_values,custom_field.multi_enum_values.color,custom_field.multi_enum_values.enabled,custom_field.multi_enum_values.name,custom_field.name,custom_field.number_value,custom_field.representation_type,custom_field.text_value,custom_field.type,dependency,dependency.created_by,dependency.name,dependency.resource_subtype,duplicate_of,duplicate_of.created_by,duplicate_of.name,duplicate_of.resource_subtype,duplicated_from,duplicated_from.created_by,duplicated_from.name,duplicated_from.resource_subtype,follower,follower.name,hearted,hearts,hearts.user,hearts.user.name,html_text,is_editable,is_edited,is_pinned,liked,likes,likes.user,likes.user.name,new_approval_status,new_date_value,new_dates,new_dates.due_at,new_dates.due_on,new_dates.start_on,new_enum_value,new_enum_value.color,new_enum_value.enabled,new_enum_value.name,new_multi_enum_values,new_multi_enum_values.color,new_multi_enum_values.enabled,new_multi_enum_values.name,new_name,new_number_value,new_people_value,new_people_value.name,new_resource_subtype,new_section,new_section.name,new_text_value,num_hearts,num_likes,offset,old_approval_status,old_date_value,old_dates,old_dates.due_at,old_dates.due_on,old_dates.start_on,old_enum_value,old_enum_value.color,old_enum_value.enabled,old_enum_value.name,old_multi_enum_values,old_multi_enum_values.color,old_multi_enum_values.enabled,old_multi_enum_values.name,old_name,old_number_value,old_people_value,old_people_value.name,old_resource_subtype,old_section,old_section.name,old_text_value,path,previews,previews.fallback,previews.footer,previews.header,previews.header_link,previews.html_text,previews.text,previews.title,previews.title_link,project,project.name,project.resource_subtype,reaction_summary,reaction_summary.count,reaction_summary.emoji_base,reaction_summary.reacted,reaction_summary.variant,resource_subtype,source,sticker_name,story,story.created_at,story.created_by,story.created_by.name,story.resource_subtype,story.text,tag,tag.name,target,target.created_by,target.name,target.resource_subtype,task,task.created_by,task.name,task.resource_subtype,text,type,uri\"\n};\nstoriesApiInstance.getStoriesForTask(task_gid, opts).then((result) => {\n console.log('API called successfully. Returned data: ' + JSON.stringify(result.data, null, 2));\n}, (error) => {\n console.error(error.response.body);\n});",
"name": "node-sdk-v3"
},
{
"language": "node",
"install": "npm install asana@1.0.5",
"code": "const asana = require('asana');\n\nconst client = asana.Client.create().useAccessToken('PERSONAL_ACCESS_TOKEN');\n\nclient.stories.getStoriesForTask(taskGid, {param: \"value\", param: \"value\", opt_pretty: true})\n .then((result) => {\n console.log(result);\n });",
"name": "node-sdk-v1"
},
{
"language": "python",
"install": "pip install asana",
"code": "import asana\nfrom asana.rest import ApiException\nfrom pprint import pprint\n\nconfiguration = asana.Configuration()\nconfiguration.access_token = '<YOUR_ACCESS_TOKEN>'\napi_client = asana.ApiClient(configuration)\n\n# create an instance of the API class\nstories_api_instance = asana.StoriesApi(api_client)\ntask_gid = \"321654\" # str | The task to operate on.\nopts = {\n 'limit': 50, # int | Results per page. The number of objects to return per page. The value must be between 1 and 100.\n 'offset': \"eyJ0eXAiOJiKV1iQLCJhbGciOiJIUzI1NiJ9\", # str | 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.*\n 'opt_fields': \"assignee,assignee.name,created_at,created_by,created_by.name,custom_field,custom_field.date_value,custom_field.date_value.date,custom_field.date_value.date_time,custom_field.display_value,custom_field.enabled,custom_field.enum_options,custom_field.enum_options.color,custom_field.enum_options.enabled,custom_field.enum_options.name,custom_field.enum_value,custom_field.enum_value.color,custom_field.enum_value.enabled,custom_field.enum_value.name,custom_field.id_prefix,custom_field.input_restrictions,custom_field.is_formula_field,custom_field.multi_enum_values,custom_field.multi_enum_values.color,custom_field.multi_enum_values.enabled,custom_field.multi_enum_values.name,custom_field.name,custom_field.number_value,custom_field.representation_type,custom_field.text_value,custom_field.type,dependency,dependency.created_by,dependency.name,dependency.resource_subtype,duplicate_of,duplicate_of.created_by,duplicate_of.name,duplicate_of.resource_subtype,duplicated_from,duplicated_from.created_by,duplicated_from.name,duplicated_from.resource_subtype,follower,follower.name,hearted,hearts,hearts.user,hearts.user.name,html_text,is_editable,is_edited,is_pinned,liked,likes,likes.user,likes.user.name,new_approval_status,new_date_value,new_dates,new_dates.due_at,new_dates.due_on,new_dates.start_on,new_enum_value,new_enum_value.color,new_enum_value.enabled,new_enum_value.name,new_multi_enum_values,new_multi_enum_values.color,new_multi_enum_values.enabled,new_multi_enum_values.name,new_name,new_number_value,new_people_value,new_people_value.name,new_resource_subtype,new_section,new_section.name,new_text_value,num_hearts,num_likes,offset,old_approval_status,old_date_value,old_dates,old_dates.due_at,old_dates.due_on,old_dates.start_on,old_enum_value,old_enum_value.color,old_enum_value.enabled,old_enum_value.name,old_multi_enum_values,old_multi_enum_values.color,old_multi_enum_values.enabled,old_multi_enum_values.name,old_name,old_number_value,old_people_value,old_people_value.name,old_resource_subtype,old_section,old_section.name,old_text_value,path,previews,previews.fallback,previews.footer,previews.header,previews.header_link,previews.html_text,previews.text,previews.title,previews.title_link,project,project.name,project.resource_subtype,reaction_summary,reaction_summary.count,reaction_summary.emoji_base,reaction_summary.reacted,reaction_summary.variant,resource_subtype,source,sticker_name,story,story.created_at,story.created_by,story.created_by.name,story.resource_subtype,story.text,tag,tag.name,target,target.created_by,target.name,target.resource_subtype,task,task.created_by,task.name,task.resource_subtype,text,type,uri\", # list[str] | 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.\n}\n\ntry:\n # Get stories from a task\n api_response = stories_api_instance.get_stories_for_task(task_gid, opts)\n for data in api_response:\n pprint(data)\nexcept ApiException as e:\n print(\"Exception when calling StoriesApi->get_stories_for_task: %s\\n\" % e)",
"name": "python-sdk-v5"
},
{
"language": "python",
"install": "pip install asana==3.2.3",
"code": "import asana\n\nclient = asana.Client.access_token('PERSONAL_ACCESS_TOKEN')\n\nresult = client.stories.get_stories_for_task(task_gid, {'param': 'value', 'param': 'value'}, opt_pretty=True)",
"name": "python-sdk-v3"
},
{
"language": "php",
"install": "composer require asana/asana",
"code": "<?php\nrequire 'vendor/autoload.php';\n\n$client = Asana\\Client::accessToken('PERSONAL_ACCESS_TOKEN');\n\n$result = $client->stories->getStoriesForTask($task_gid, array('param' => 'value', 'param' => 'value'), array('opt_pretty' => 'true'))"
},
{
"language": "ruby",
"install": "gem install asana",
"code": "require 'asana'\n\nclient = Asana::Client.new do |c|\n c.authentication :access_token, 'PERSONAL_ACCESS_TOKEN'\nend\n\nresult = client.stories.get_stories_for_task(task_gid: 'task_gid', param: \"value\", param: \"value\", options: {pretty: true})"
}
]
},
"x-purple-suite-runtime": "modeled-core",
"x-purple-suite-supported-query": [
"opt_pretty",
"limit",
"offset",
"opt_fields"
],
"x-purple-suite-supported-response-fields": [
"gid",
"resource_type",
"resource_subtype",
"name",
"notes",
"completed",
"completed_at",
"created_at",
"modified_at",
"assignee",
"assignee_status",
"workspace",
"projects",
"memberships",
"parent",
"due_on",
"start_on",
"tags",
"dependencies",
"num_subtasks",
"archived",
"public",
"color",
"default_view",
"team",
"project",
"section",
"text",
"created_by",
"target",
"type",
"email",
"photo",
"is_organization"
]
}
POST /api/1.0/tasks/{task_gid}/stories
Create a story on a task
<b>Required scope: </b><code>stories:write</code>
Adds a story to a task. This endpoint currently only allows for comment
stories to be created. The comment will be authored by the currently
authenticated user, and timestamped when the server receives the request.
Returns the full record for the new story added to the task.
The persistent core model supports the response and query fields named in x-purple-suite-supported-response-fields and x-purple-suite-supported-query. Other fields/options return an explicit 400 errors envelope.
Authentication
[
{
"personalAccessToken": []
},
{
"oauth2": [
"stories:write"
]
}
]
Path-level parameters and metadata
{
"parameters": [
{
"$ref": "#/components/parameters/task_path_gid"
},
{
"$ref": "#/components/parameters/pretty"
}
]
}
Request, responses and operation details
{
"summary": "Create a story on a task",
"description": "<b>Required scope: </b><code>stories:write</code>\n\nAdds a story to a task. This endpoint currently only allows for comment\nstories to be created. The comment will be authored by the currently\nauthenticated user, and timestamped when the server receives the request.\n\nReturns the full record for the new story added to the task.\n\nThe persistent core model supports the response and query fields named in x-purple-suite-supported-response-fields and x-purple-suite-supported-query. Other fields/options return an explicit 400 errors envelope.",
"tags": [
"Stories"
],
"operationId": "createStoryForTask",
"parameters": [
{
"name": "opt_fields",
"in": "query",
"description": "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. Properties can include nested fields. To learn more, see the [input/output options guide](/docs/inputoutput-options#selecting-nested-fields).",
"required": false,
"example": [
"assignee",
"assignee.name",
"created_at",
"created_by",
"created_by.name",
"custom_field",
"custom_field.date_value",
"custom_field.date_value.date",
"custom_field.date_value.date_time",
"custom_field.display_value",
"custom_field.enabled",
"custom_field.enum_options",
"custom_field.enum_options.color",
"custom_field.enum_options.enabled",
"custom_field.enum_options.name",
"custom_field.enum_value",
"custom_field.enum_value.color",
"custom_field.enum_value.enabled",
"custom_field.enum_value.name",
"custom_field.id_prefix",
"custom_field.input_restrictions",
"custom_field.is_formula_field",
"custom_field.multi_enum_values",
"custom_field.multi_enum_values.color",
"custom_field.multi_enum_values.enabled",
"custom_field.multi_enum_values.name",
"custom_field.name",
"custom_field.number_value",
"custom_field.representation_type",
"custom_field.text_value",
"custom_field.type",
"dependency",
"dependency.created_by",
"dependency.name",
"dependency.resource_subtype",
"duplicate_of",
"duplicate_of.created_by",
"duplicate_of.name",
"duplicate_of.resource_subtype",
"duplicated_from",
"duplicated_from.created_by",
"duplicated_from.name",
"duplicated_from.resource_subtype",
"follower",
"follower.name",
"hearted",
"hearts",
"hearts.user",
"hearts.user.name",
"html_text",
"is_editable",
"is_edited",
"is_pinned",
"liked",
"likes",
"likes.user",
"likes.user.name",
"new_approval_status",
"new_date_value",
"new_dates",
"new_dates.due_at",
"new_dates.due_on",
"new_dates.start_on",
"new_enum_value",
"new_enum_value.color",
"new_enum_value.enabled",
"new_enum_value.name",
"new_multi_enum_values",
"new_multi_enum_values.color",
"new_multi_enum_values.enabled",
"new_multi_enum_values.name",
"new_name",
"new_number_value",
"new_people_value",
"new_people_value.name",
"new_resource_subtype",
"new_section",
"new_section.name",
"new_text_value",
"num_hearts",
"num_likes",
"old_approval_status",
"old_date_value",
"old_dates",
"old_dates.due_at",
"old_dates.due_on",
"old_dates.start_on",
"old_enum_value",
"old_enum_value.color",
"old_enum_value.enabled",
"old_enum_value.name",
"old_multi_enum_values",
"old_multi_enum_values.color",
"old_multi_enum_values.enabled",
"old_multi_enum_values.name",
"old_name",
"old_number_value",
"old_people_value",
"old_people_value.name",
"old_resource_subtype",
"old_section",
"old_section.name",
"old_text_value",
"previews",
"previews.fallback",
"previews.footer",
"previews.header",
"previews.header_link",
"previews.html_text",
"previews.text",
"previews.title",
"previews.title_link",
"project",
"project.name",
"project.resource_subtype",
"reaction_summary",
"reaction_summary.count",
"reaction_summary.emoji_base",
"reaction_summary.reacted",
"reaction_summary.variant",
"resource_subtype",
"source",
"sticker_name",
"story",
"story.created_at",
"story.created_by",
"story.created_by.name",
"story.resource_subtype",
"story.text",
"tag",
"tag.name",
"target",
"target.created_by",
"target.name",
"target.resource_subtype",
"task",
"task.created_by",
"task.name",
"task.resource_subtype",
"text",
"type"
],
"schema": {
"type": "array",
"items": {
"type": "string",
"enum": [
"assignee",
"assignee.name",
"created_at",
"created_by",
"created_by.name",
"custom_field",
"custom_field.date_value",
"custom_field.date_value.date",
"custom_field.date_value.date_time",
"custom_field.display_value",
"custom_field.enabled",
"custom_field.enum_options",
"custom_field.enum_options.color",
"custom_field.enum_options.enabled",
"custom_field.enum_options.name",
"custom_field.enum_value",
"custom_field.enum_value.color",
"custom_field.enum_value.enabled",
"custom_field.enum_value.name",
"custom_field.id_prefix",
"custom_field.input_restrictions",
"custom_field.is_formula_field",
"custom_field.multi_enum_values",
"custom_field.multi_enum_values.color",
"custom_field.multi_enum_values.enabled",
"custom_field.multi_enum_values.name",
"custom_field.name",
"custom_field.number_value",
"custom_field.representation_type",
"custom_field.text_value",
"custom_field.type",
"dependency",
"dependency.created_by",
"dependency.name",
"dependency.resource_subtype",
"duplicate_of",
"duplicate_of.created_by",
"duplicate_of.name",
"duplicate_of.resource_subtype",
"duplicated_from",
"duplicated_from.created_by",
"duplicated_from.name",
"duplicated_from.resource_subtype",
"follower",
"follower.name",
"hearted",
"hearts",
"hearts.user",
"hearts.user.name",
"html_text",
"is_editable",
"is_edited",
"is_pinned",
"liked",
"likes",
"likes.user",
"likes.user.name",
"new_approval_status",
"new_date_value",
"new_dates",
"new_dates.due_at",
"new_dates.due_on",
"new_dates.start_on",
"new_enum_value",
"new_enum_value.color",
"new_enum_value.enabled",
"new_enum_value.name",
"new_multi_enum_values",
"new_multi_enum_values.color",
"new_multi_enum_values.enabled",
"new_multi_enum_values.name",
"new_name",
"new_number_value",
"new_people_value",
"new_people_value.name",
"new_resource_subtype",
"new_section",
"new_section.name",
"new_text_value",
"num_hearts",
"num_likes",
"old_approval_status",
"old_date_value",
"old_dates",
"old_dates.due_at",
"old_dates.due_on",
"old_dates.start_on",
"old_enum_value",
"old_enum_value.color",
"old_enum_value.enabled",
"old_enum_value.name",
"old_multi_enum_values",
"old_multi_enum_values.color",
"old_multi_enum_values.enabled",
"old_multi_enum_values.name",
"old_name",
"old_number_value",
"old_people_value",
"old_people_value.name",
"old_resource_subtype",
"old_section",
"old_section.name",
"old_text_value",
"previews",
"previews.fallback",
"previews.footer",
"previews.header",
"previews.header_link",
"previews.html_text",
"previews.text",
"previews.title",
"previews.title_link",
"project",
"project.name",
"project.resource_subtype",
"reaction_summary",
"reaction_summary.count",
"reaction_summary.emoji_base",
"reaction_summary.reacted",
"reaction_summary.variant",
"resource_subtype",
"source",
"sticker_name",
"story",
"story.created_at",
"story.created_by",
"story.created_by.name",
"story.resource_subtype",
"story.text",
"tag",
"tag.name",
"target",
"target.created_by",
"target.name",
"target.resource_subtype",
"task",
"task.created_by",
"task.name",
"task.resource_subtype",
"text",
"type"
]
}
},
"style": "form",
"explode": false
}
],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
"data"
],
"additionalProperties": false,
"properties": {
"data": {
"type": "object",
"additionalProperties": false,
"required": [
"text"
],
"properties": {
"text": {
"type": "string"
}
}
}
}
}
},
"application/x-www-form-urlencoded": {
"schema": {
"type": "object",
"additionalProperties": false,
"required": [
"text"
],
"properties": {
"text": {
"type": "string"
}
}
}
}
}
},
"responses": {
"201": {
"description": "Successfully created a new story.",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"$ref": "#/components/schemas/StoryResponse"
}
}
}
}
}
},
"400": {
"$ref": "#/components/responses/BadRequest"
},
"401": {
"$ref": "#/components/responses/Unauthorized"
},
"403": {
"$ref": "#/components/responses/Forbidden"
},
"404": {
"$ref": "#/components/responses/NotFound"
},
"500": {
"$ref": "#/components/responses/InternalServerError"
}
},
"security": [
{
"personalAccessToken": []
},
{
"oauth2": [
"stories:write"
]
}
],
"x-readme": {
"code-samples": [
{
"language": "java",
"install": "<dependency><groupId>com.asana</groupId><artifactId>asana</artifactId><version>1.0.0</version></dependency>",
"code": "import com.asana.Client;\n\nClient client = Client.accessToken(\"PERSONAL_ACCESS_TOKEN\");\n\nStory result = client.stories.createStoryForTask(taskGid)\n .data(\"field\", \"value\")\n .data(\"field\", \"value\")\n .option(\"pretty\", true)\n .execute();"
},
{
"language": "node",
"install": "npm install asana",
"code": "const Asana = require('asana');\n\nlet client = new Asana.ApiClient();\nclient.authentications.token.accessToken = '<YOUR_ACCESS_TOKEN>';\n\nlet storiesApiInstance = new Asana.StoriesApi(client);\nlet body = {\"data\": {\"<PARAM_1>\": \"<VALUE_1>\", \"<PARAM_2>\": \"<VALUE_2>\",}}; // Object | The story to create.\nlet task_gid = \"321654\"; // String | The task to operate on.\nlet opts = { \n 'opt_fields': \"assignee,assignee.name,created_at,created_by,created_by.name,custom_field,custom_field.date_value,custom_field.date_value.date,custom_field.date_value.date_time,custom_field.display_value,custom_field.enabled,custom_field.enum_options,custom_field.enum_options.color,custom_field.enum_options.enabled,custom_field.enum_options.name,custom_field.enum_value,custom_field.enum_value.color,custom_field.enum_value.enabled,custom_field.enum_value.name,custom_field.id_prefix,custom_field.input_restrictions,custom_field.is_formula_field,custom_field.multi_enum_values,custom_field.multi_enum_values.color,custom_field.multi_enum_values.enabled,custom_field.multi_enum_values.name,custom_field.name,custom_field.number_value,custom_field.representation_type,custom_field.text_value,custom_field.type,dependency,dependency.created_by,dependency.name,dependency.resource_subtype,duplicate_of,duplicate_of.created_by,duplicate_of.name,duplicate_of.resource_subtype,duplicated_from,duplicated_from.created_by,duplicated_from.name,duplicated_from.resource_subtype,follower,follower.name,hearted,hearts,hearts.user,hearts.user.name,html_text,is_editable,is_edited,is_pinned,liked,likes,likes.user,likes.user.name,new_approval_status,new_date_value,new_dates,new_dates.due_at,new_dates.due_on,new_dates.start_on,new_enum_value,new_enum_value.color,new_enum_value.enabled,new_enum_value.name,new_multi_enum_values,new_multi_enum_values.color,new_multi_enum_values.enabled,new_multi_enum_values.name,new_name,new_number_value,new_people_value,new_people_value.name,new_resource_subtype,new_section,new_section.name,new_text_value,num_hearts,num_likes,old_approval_status,old_date_value,old_dates,old_dates.due_at,old_dates.due_on,old_dates.start_on,old_enum_value,old_enum_value.color,old_enum_value.enabled,old_enum_value.name,old_multi_enum_values,old_multi_enum_values.color,old_multi_enum_values.enabled,old_multi_enum_values.name,old_name,old_number_value,old_people_value,old_people_value.name,old_resource_subtype,old_section,old_section.name,old_text_value,previews,previews.fallback,previews.footer,previews.header,previews.header_link,previews.html_text,previews.text,previews.title,previews.title_link,project,project.name,project.resource_subtype,reaction_summary,reaction_summary.count,reaction_summary.emoji_base,reaction_summary.reacted,reaction_summary.variant,resource_subtype,source,sticker_name,story,story.created_at,story.created_by,story.created_by.name,story.resource_subtype,story.text,tag,tag.name,target,target.created_by,target.name,target.resource_subtype,task,task.created_by,task.name,task.resource_subtype,text,type\"\n};\nstoriesApiInstance.createStoryForTask(body, task_gid, opts).then((result) => {\n console.log('API called successfully. Returned data: ' + JSON.stringify(result.data, null, 2));\n}, (error) => {\n console.error(error.response.body);\n});",
"name": "node-sdk-v3"
},
{
"language": "node",
"install": "npm install asana@1.0.5",
"code": "const asana = require('asana');\n\nconst client = asana.Client.create().useAccessToken('PERSONAL_ACCESS_TOKEN');\n\nclient.stories.createStoryForTask(taskGid, {field: \"value\", field: \"value\", pretty: true})\n .then((result) => {\n console.log(result);\n });",
"name": "node-sdk-v1"
},
{
"language": "python",
"install": "pip install asana",
"code": "import asana\nfrom asana.rest import ApiException\nfrom pprint import pprint\n\nconfiguration = asana.Configuration()\nconfiguration.access_token = '<YOUR_ACCESS_TOKEN>'\napi_client = asana.ApiClient(configuration)\n\n# create an instance of the API class\nstories_api_instance = asana.StoriesApi(api_client)\nbody = {\"data\": {\"<PARAM_1>\": \"<VALUE_1>\", \"<PARAM_2>\": \"<VALUE_2>\",}} # dict | The story to create.\ntask_gid = \"321654\" # str | The task to operate on.\nopts = {\n 'opt_fields': \"assignee,assignee.name,created_at,created_by,created_by.name,custom_field,custom_field.date_value,custom_field.date_value.date,custom_field.date_value.date_time,custom_field.display_value,custom_field.enabled,custom_field.enum_options,custom_field.enum_options.color,custom_field.enum_options.enabled,custom_field.enum_options.name,custom_field.enum_value,custom_field.enum_value.color,custom_field.enum_value.enabled,custom_field.enum_value.name,custom_field.id_prefix,custom_field.input_restrictions,custom_field.is_formula_field,custom_field.multi_enum_values,custom_field.multi_enum_values.color,custom_field.multi_enum_values.enabled,custom_field.multi_enum_values.name,custom_field.name,custom_field.number_value,custom_field.representation_type,custom_field.text_value,custom_field.type,dependency,dependency.created_by,dependency.name,dependency.resource_subtype,duplicate_of,duplicate_of.created_by,duplicate_of.name,duplicate_of.resource_subtype,duplicated_from,duplicated_from.created_by,duplicated_from.name,duplicated_from.resource_subtype,follower,follower.name,hearted,hearts,hearts.user,hearts.user.name,html_text,is_editable,is_edited,is_pinned,liked,likes,likes.user,likes.user.name,new_approval_status,new_date_value,new_dates,new_dates.due_at,new_dates.due_on,new_dates.start_on,new_enum_value,new_enum_value.color,new_enum_value.enabled,new_enum_value.name,new_multi_enum_values,new_multi_enum_values.color,new_multi_enum_values.enabled,new_multi_enum_values.name,new_name,new_number_value,new_people_value,new_people_value.name,new_resource_subtype,new_section,new_section.name,new_text_value,num_hearts,num_likes,old_approval_status,old_date_value,old_dates,old_dates.due_at,old_dates.due_on,old_dates.start_on,old_enum_value,old_enum_value.color,old_enum_value.enabled,old_enum_value.name,old_multi_enum_values,old_multi_enum_values.color,old_multi_enum_values.enabled,old_multi_enum_values.name,old_name,old_number_value,old_people_value,old_people_value.name,old_resource_subtype,old_section,old_section.name,old_text_value,previews,previews.fallback,previews.footer,previews.header,previews.header_link,previews.html_text,previews.text,previews.title,previews.title_link,project,project.name,project.resource_subtype,reaction_summary,reaction_summary.count,reaction_summary.emoji_base,reaction_summary.reacted,reaction_summary.variant,resource_subtype,source,sticker_name,story,story.created_at,story.created_by,story.created_by.name,story.resource_subtype,story.text,tag,tag.name,target,target.created_by,target.name,target.resource_subtype,task,task.created_by,task.name,task.resource_subtype,text,type\", # list[str] | 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.\n}\n\ntry:\n # Create a story on a task\n api_response = stories_api_instance.create_story_for_task(body, task_gid, opts)\n pprint(api_response)\nexcept ApiException as e:\n print(\"Exception when calling StoriesApi->create_story_for_task: %s\\n\" % e)",
"name": "python-sdk-v5"
},
{
"language": "python",
"install": "pip install asana==3.2.3",
"code": "import asana\n\nclient = asana.Client.access_token('PERSONAL_ACCESS_TOKEN')\n\nresult = client.stories.create_story_for_task(task_gid, {'field': 'value', 'field': 'value'}, opt_pretty=True)",
"name": "python-sdk-v3"
},
{
"language": "php",
"install": "composer require asana/asana",
"code": "<?php\nrequire 'vendor/autoload.php';\n\n$client = Asana\\Client::accessToken('PERSONAL_ACCESS_TOKEN');\n\n$result = $client->stories->createStoryForTask($task_gid, array('field' => 'value', 'field' => 'value'), array('opt_pretty' => 'true'))"
},
{
"language": "ruby",
"install": "gem install asana",
"code": "require 'asana'\n\nclient = Asana::Client.new do |c|\n c.authentication :access_token, 'PERSONAL_ACCESS_TOKEN'\nend\n\nresult = client.stories.create_story_for_task(task_gid: 'task_gid', field: \"value\", field: \"value\", options: {pretty: true})"
}
]
},
"x-purple-suite-runtime": "modeled-core",
"x-purple-suite-supported-query": [
"opt_pretty",
"opt_fields"
],
"x-purple-suite-supported-response-fields": [
"gid",
"resource_type",
"resource_subtype",
"name",
"notes",
"completed",
"completed_at",
"created_at",
"modified_at",
"assignee",
"assignee_status",
"workspace",
"projects",
"memberships",
"parent",
"due_on",
"start_on",
"tags",
"dependencies",
"num_subtasks",
"archived",
"public",
"color",
"default_view",
"team",
"project",
"section",
"text",
"created_by",
"target",
"type",
"email",
"photo",
"is_organization"
]
}
GET /api/1.0/goals/{goal_gid}/stories
Get stories from a goal
<b>Required scope: </b><code>stories:read</code>
Returns the compact records for all stories on the goal.
This operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.
Authentication
[
{
"personalAccessToken": []
},
{
"oauth2": [
"stories:read"
]
}
]
Path-level parameters and metadata
{
"parameters": [
{
"$ref": "#/components/parameters/goal_path_gid"
},
{
"$ref": "#/components/parameters/pretty"
}
]
}
Request, responses and operation details
{
"summary": "Get stories from a goal",
"description": "<b>Required scope: </b><code>stories:read</code>\n\nReturns the compact records for all stories on the goal.\n\nThis operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.",
"tags": [
"Stories"
],
"operationId": "getStoriesForGoal",
"parameters": [
{
"$ref": "#/components/parameters/limit"
},
{
"$ref": "#/components/parameters/offset"
},
{
"name": "opt_fields",
"in": "query",
"description": "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. Properties can include nested fields. To learn more, see the [input/output options guide](/docs/inputoutput-options#selecting-nested-fields).",
"required": false,
"example": [
"assignee",
"assignee.name",
"created_at",
"created_by",
"created_by.name",
"custom_field",
"custom_field.date_value",
"custom_field.date_value.date",
"custom_field.date_value.date_time",
"custom_field.display_value",
"custom_field.enabled",
"custom_field.enum_options",
"custom_field.enum_options.color",
"custom_field.enum_options.enabled",
"custom_field.enum_options.name",
"custom_field.enum_value",
"custom_field.enum_value.color",
"custom_field.enum_value.enabled",
"custom_field.enum_value.name",
"custom_field.id_prefix",
"custom_field.input_restrictions",
"custom_field.is_formula_field",
"custom_field.multi_enum_values",
"custom_field.multi_enum_values.color",
"custom_field.multi_enum_values.enabled",
"custom_field.multi_enum_values.name",
"custom_field.name",
"custom_field.number_value",
"custom_field.representation_type",
"custom_field.text_value",
"custom_field.type",
"dependency",
"dependency.created_by",
"dependency.name",
"dependency.resource_subtype",
"duplicate_of",
"duplicate_of.created_by",
"duplicate_of.name",
"duplicate_of.resource_subtype",
"duplicated_from",
"duplicated_from.created_by",
"duplicated_from.name",
"duplicated_from.resource_subtype",
"follower",
"follower.name",
"hearted",
"hearts",
"hearts.user",
"hearts.user.name",
"html_text",
"is_editable",
"is_edited",
"is_pinned",
"liked",
"likes",
"likes.user",
"likes.user.name",
"new_approval_status",
"new_date_value",
"new_dates",
"new_dates.due_at",
"new_dates.due_on",
"new_dates.start_on",
"new_enum_value",
"new_enum_value.color",
"new_enum_value.enabled",
"new_enum_value.name",
"new_multi_enum_values",
"new_multi_enum_values.color",
"new_multi_enum_values.enabled",
"new_multi_enum_values.name",
"new_name",
"new_number_value",
"new_people_value",
"new_people_value.name",
"new_resource_subtype",
"new_section",
"new_section.name",
"new_text_value",
"num_hearts",
"num_likes",
"offset",
"old_approval_status",
"old_date_value",
"old_dates",
"old_dates.due_at",
"old_dates.due_on",
"old_dates.start_on",
"old_enum_value",
"old_enum_value.color",
"old_enum_value.enabled",
"old_enum_value.name",
"old_multi_enum_values",
"old_multi_enum_values.color",
"old_multi_enum_values.enabled",
"old_multi_enum_values.name",
"old_name",
"old_number_value",
"old_people_value",
"old_people_value.name",
"old_resource_subtype",
"old_section",
"old_section.name",
"old_text_value",
"path",
"previews",
"previews.fallback",
"previews.footer",
"previews.header",
"previews.header_link",
"previews.html_text",
"previews.text",
"previews.title",
"previews.title_link",
"project",
"project.name",
"project.resource_subtype",
"reaction_summary",
"reaction_summary.count",
"reaction_summary.emoji_base",
"reaction_summary.reacted",
"reaction_summary.variant",
"resource_subtype",
"source",
"sticker_name",
"story",
"story.created_at",
"story.created_by",
"story.created_by.name",
"story.resource_subtype",
"story.text",
"tag",
"tag.name",
"target",
"target.created_by",
"target.name",
"target.resource_subtype",
"task",
"task.created_by",
"task.name",
"task.resource_subtype",
"text",
"type",
"uri"
],
"schema": {
"type": "array",
"items": {
"type": "string",
"enum": [
"assignee",
"assignee.name",
"created_at",
"created_by",
"created_by.name",
"custom_field",
"custom_field.date_value",
"custom_field.date_value.date",
"custom_field.date_value.date_time",
"custom_field.display_value",
"custom_field.enabled",
"custom_field.enum_options",
"custom_field.enum_options.color",
"custom_field.enum_options.enabled",
"custom_field.enum_options.name",
"custom_field.enum_value",
"custom_field.enum_value.color",
"custom_field.enum_value.enabled",
"custom_field.enum_value.name",
"custom_field.id_prefix",
"custom_field.input_restrictions",
"custom_field.is_formula_field",
"custom_field.multi_enum_values",
"custom_field.multi_enum_values.color",
"custom_field.multi_enum_values.enabled",
"custom_field.multi_enum_values.name",
"custom_field.name",
"custom_field.number_value",
"custom_field.representation_type",
"custom_field.text_value",
"custom_field.type",
"dependency",
"dependency.created_by",
"dependency.name",
"dependency.resource_subtype",
"duplicate_of",
"duplicate_of.created_by",
"duplicate_of.name",
"duplicate_of.resource_subtype",
"duplicated_from",
"duplicated_from.created_by",
"duplicated_from.name",
"duplicated_from.resource_subtype",
"follower",
"follower.name",
"hearted",
"hearts",
"hearts.user",
"hearts.user.name",
"html_text",
"is_editable",
"is_edited",
"is_pinned",
"liked",
"likes",
"likes.user",
"likes.user.name",
"new_approval_status",
"new_date_value",
"new_dates",
"new_dates.due_at",
"new_dates.due_on",
"new_dates.start_on",
"new_enum_value",
"new_enum_value.color",
"new_enum_value.enabled",
"new_enum_value.name",
"new_multi_enum_values",
"new_multi_enum_values.color",
"new_multi_enum_values.enabled",
"new_multi_enum_values.name",
"new_name",
"new_number_value",
"new_people_value",
"new_people_value.name",
"new_resource_subtype",
"new_section",
"new_section.name",
"new_text_value",
"num_hearts",
"num_likes",
"offset",
"old_approval_status",
"old_date_value",
"old_dates",
"old_dates.due_at",
"old_dates.due_on",
"old_dates.start_on",
"old_enum_value",
"old_enum_value.color",
"old_enum_value.enabled",
"old_enum_value.name",
"old_multi_enum_values",
"old_multi_enum_values.color",
"old_multi_enum_values.enabled",
"old_multi_enum_values.name",
"old_name",
"old_number_value",
"old_people_value",
"old_people_value.name",
"old_resource_subtype",
"old_section",
"old_section.name",
"old_text_value",
"path",
"previews",
"previews.fallback",
"previews.footer",
"previews.header",
"previews.header_link",
"previews.html_text",
"previews.text",
"previews.title",
"previews.title_link",
"project",
"project.name",
"project.resource_subtype",
"reaction_summary",
"reaction_summary.count",
"reaction_summary.emoji_base",
"reaction_summary.reacted",
"reaction_summary.variant",
"resource_subtype",
"source",
"sticker_name",
"story",
"story.created_at",
"story.created_by",
"story.created_by.name",
"story.resource_subtype",
"story.text",
"tag",
"tag.name",
"target",
"target.created_by",
"target.name",
"target.resource_subtype",
"task",
"task.created_by",
"task.name",
"task.resource_subtype",
"text",
"type",
"uri"
]
}
},
"style": "form",
"explode": false
}
],
"responses": {
"200": {
"description": "Successfully retrieved the specified goal's stories.",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"type": "array",
"items": {
"$ref": "#/components/schemas/StoryCompact"
}
},
"next_page": {
"$ref": "#/components/schemas/NextPage"
}
}
}
}
}
},
"400": {
"$ref": "#/components/responses/BadRequest"
},
"401": {
"$ref": "#/components/responses/Unauthorized"
},
"403": {
"$ref": "#/components/responses/Forbidden"
},
"404": {
"$ref": "#/components/responses/NotFound"
},
"500": {
"$ref": "#/components/responses/InternalServerError"
}
},
"security": [
{
"personalAccessToken": []
},
{
"oauth2": [
"stories:read"
]
}
],
"x-readme": {
"code-samples": [
{
"language": "node",
"install": "npm install asana",
"code": "const Asana = require('asana');\n\nlet client = new Asana.ApiClient();\nclient.authentications.token.accessToken = '<YOUR_ACCESS_TOKEN>';\n\nlet storiesApiInstance = new Asana.StoriesApi(client);\nlet goal_gid = \"12345\"; // String | Globally unique identifier for the goal.\nlet opts = { \n 'limit': 50, \n 'offset': \"eyJ0eXAiOJiKV1iQLCJhbGciOiJIUzI1NiJ9\", \n 'opt_fields': \"assignee,assignee.name,created_at,created_by,created_by.name,custom_field,custom_field.date_value,custom_field.date_value.date,custom_field.date_value.date_time,custom_field.display_value,custom_field.enabled,custom_field.enum_options,custom_field.enum_options.color,custom_field.enum_options.enabled,custom_field.enum_options.name,custom_field.enum_value,custom_field.enum_value.color,custom_field.enum_value.enabled,custom_field.enum_value.name,custom_field.id_prefix,custom_field.input_restrictions,custom_field.is_formula_field,custom_field.multi_enum_values,custom_field.multi_enum_values.color,custom_field.multi_enum_values.enabled,custom_field.multi_enum_values.name,custom_field.name,custom_field.number_value,custom_field.representation_type,custom_field.text_value,custom_field.type,dependency,dependency.created_by,dependency.name,dependency.resource_subtype,duplicate_of,duplicate_of.created_by,duplicate_of.name,duplicate_of.resource_subtype,duplicated_from,duplicated_from.created_by,duplicated_from.name,duplicated_from.resource_subtype,follower,follower.name,hearted,hearts,hearts.user,hearts.user.name,html_text,is_editable,is_edited,is_pinned,liked,likes,likes.user,likes.user.name,new_approval_status,new_date_value,new_dates,new_dates.due_at,new_dates.due_on,new_dates.start_on,new_enum_value,new_enum_value.color,new_enum_value.enabled,new_enum_value.name,new_multi_enum_values,new_multi_enum_values.color,new_multi_enum_values.enabled,new_multi_enum_values.name,new_name,new_number_value,new_people_value,new_people_value.name,new_resource_subtype,new_section,new_section.name,new_text_value,num_hearts,num_likes,offset,old_approval_status,old_date_value,old_dates,old_dates.due_at,old_dates.due_on,old_dates.start_on,old_enum_value,old_enum_value.color,old_enum_value.enabled,old_enum_value.name,old_multi_enum_values,old_multi_enum_values.color,old_multi_enum_values.enabled,old_multi_enum_values.name,old_name,old_number_value,old_people_value,old_people_value.name,old_resource_subtype,old_section,old_section.name,old_text_value,path,previews,previews.fallback,previews.footer,previews.header,previews.header_link,previews.html_text,previews.text,previews.title,previews.title_link,project,project.name,project.resource_subtype,reaction_summary,reaction_summary.count,reaction_summary.emoji_base,reaction_summary.reacted,reaction_summary.variant,resource_subtype,source,sticker_name,story,story.created_at,story.created_by,story.created_by.name,story.resource_subtype,story.text,tag,tag.name,target,target.created_by,target.name,target.resource_subtype,task,task.created_by,task.name,task.resource_subtype,text,type,uri\"\n};\nstoriesApiInstance.getStoriesForGoal(goal_gid, opts).then((result) => {\n console.log('API called successfully. Returned data: ' + JSON.stringify(result.data, null, 2));\n}, (error) => {\n console.error(error.response.body);\n});",
"name": "node-sdk-v3"
},
{
"language": "python",
"install": "pip install asana",
"code": "import asana\nfrom asana.rest import ApiException\nfrom pprint import pprint\n\nconfiguration = asana.Configuration()\nconfiguration.access_token = '<YOUR_ACCESS_TOKEN>'\napi_client = asana.ApiClient(configuration)\n\n# create an instance of the API class\nstories_api_instance = asana.StoriesApi(api_client)\ngoal_gid = \"12345\" # str | Globally unique identifier for the goal.\nopts = {\n 'limit': 50, # int | Results per page. The number of objects to return per page. The value must be between 1 and 100.\n 'offset': \"eyJ0eXAiOJiKV1iQLCJhbGciOiJIUzI1NiJ9\", # str | 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.*\n 'opt_fields': \"assignee,assignee.name,created_at,created_by,created_by.name,custom_field,custom_field.date_value,custom_field.date_value.date,custom_field.date_value.date_time,custom_field.display_value,custom_field.enabled,custom_field.enum_options,custom_field.enum_options.color,custom_field.enum_options.enabled,custom_field.enum_options.name,custom_field.enum_value,custom_field.enum_value.color,custom_field.enum_value.enabled,custom_field.enum_value.name,custom_field.id_prefix,custom_field.input_restrictions,custom_field.is_formula_field,custom_field.multi_enum_values,custom_field.multi_enum_values.color,custom_field.multi_enum_values.enabled,custom_field.multi_enum_values.name,custom_field.name,custom_field.number_value,custom_field.representation_type,custom_field.text_value,custom_field.type,dependency,dependency.created_by,dependency.name,dependency.resource_subtype,duplicate_of,duplicate_of.created_by,duplicate_of.name,duplicate_of.resource_subtype,duplicated_from,duplicated_from.created_by,duplicated_from.name,duplicated_from.resource_subtype,follower,follower.name,hearted,hearts,hearts.user,hearts.user.name,html_text,is_editable,is_edited,is_pinned,liked,likes,likes.user,likes.user.name,new_approval_status,new_date_value,new_dates,new_dates.due_at,new_dates.due_on,new_dates.start_on,new_enum_value,new_enum_value.color,new_enum_value.enabled,new_enum_value.name,new_multi_enum_values,new_multi_enum_values.color,new_multi_enum_values.enabled,new_multi_enum_values.name,new_name,new_number_value,new_people_value,new_people_value.name,new_resource_subtype,new_section,new_section.name,new_text_value,num_hearts,num_likes,offset,old_approval_status,old_date_value,old_dates,old_dates.due_at,old_dates.due_on,old_dates.start_on,old_enum_value,old_enum_value.color,old_enum_value.enabled,old_enum_value.name,old_multi_enum_values,old_multi_enum_values.color,old_multi_enum_values.enabled,old_multi_enum_values.name,old_name,old_number_value,old_people_value,old_people_value.name,old_resource_subtype,old_section,old_section.name,old_text_value,path,previews,previews.fallback,previews.footer,previews.header,previews.header_link,previews.html_text,previews.text,previews.title,previews.title_link,project,project.name,project.resource_subtype,reaction_summary,reaction_summary.count,reaction_summary.emoji_base,reaction_summary.reacted,reaction_summary.variant,resource_subtype,source,sticker_name,story,story.created_at,story.created_by,story.created_by.name,story.resource_subtype,story.text,tag,tag.name,target,target.created_by,target.name,target.resource_subtype,task,task.created_by,task.name,task.resource_subtype,text,type,uri\", # list[str] | 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.\n}\n\ntry:\n # Get stories from a goal\n api_response = stories_api_instance.get_stories_for_goal(goal_gid, opts)\n for data in api_response:\n pprint(data)\nexcept ApiException as e:\n print(\"Exception when calling StoriesApi->get_stories_for_goal: %s\\n\" % e)",
"name": "python-sdk-v5"
}
]
},
"x-purple-suite-runtime": "unavailable"
}
POST /api/1.0/goals/{goal_gid}/stories
Create a story on a goal
<b>Required scope: </b><code>stories:write</code>
Adds a story to a goal. This endpoint currently only allows for comment
stories to be created. The comment will be authored by the currently
authenticated user, and timestamped when the server receives the request.
Returns the full record for the new story added to the goal.
This operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.
Authentication
[
{
"personalAccessToken": []
},
{
"oauth2": [
"stories:write"
]
}
]
Path-level parameters and metadata
{
"parameters": [
{
"$ref": "#/components/parameters/goal_path_gid"
},
{
"$ref": "#/components/parameters/pretty"
}
]
}
Request, responses and operation details
{
"summary": "Create a story on a goal",
"description": "<b>Required scope: </b><code>stories:write</code>\n\nAdds a story to a goal. This endpoint currently only allows for comment\nstories to be created. The comment will be authored by the currently\nauthenticated user, and timestamped when the server receives the request.\n\nReturns the full record for the new story added to the goal.\n\nThis operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.",
"tags": [
"Stories"
],
"operationId": "createStoryForGoal",
"parameters": [
{
"name": "opt_fields",
"in": "query",
"description": "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. Properties can include nested fields. To learn more, see the [input/output options guide](/docs/inputoutput-options#selecting-nested-fields).",
"required": false,
"example": [
"assignee",
"assignee.name",
"created_at",
"created_by",
"created_by.name",
"custom_field",
"custom_field.date_value",
"custom_field.date_value.date",
"custom_field.date_value.date_time",
"custom_field.display_value",
"custom_field.enabled",
"custom_field.enum_options",
"custom_field.enum_options.color",
"custom_field.enum_options.enabled",
"custom_field.enum_options.name",
"custom_field.enum_value",
"custom_field.enum_value.color",
"custom_field.enum_value.enabled",
"custom_field.enum_value.name",
"custom_field.id_prefix",
"custom_field.input_restrictions",
"custom_field.is_formula_field",
"custom_field.multi_enum_values",
"custom_field.multi_enum_values.color",
"custom_field.multi_enum_values.enabled",
"custom_field.multi_enum_values.name",
"custom_field.name",
"custom_field.number_value",
"custom_field.representation_type",
"custom_field.text_value",
"custom_field.type",
"dependency",
"dependency.created_by",
"dependency.name",
"dependency.resource_subtype",
"duplicate_of",
"duplicate_of.created_by",
"duplicate_of.name",
"duplicate_of.resource_subtype",
"duplicated_from",
"duplicated_from.created_by",
"duplicated_from.name",
"duplicated_from.resource_subtype",
"follower",
"follower.name",
"hearted",
"hearts",
"hearts.user",
"hearts.user.name",
"html_text",
"is_editable",
"is_edited",
"is_pinned",
"liked",
"likes",
"likes.user",
"likes.user.name",
"new_approval_status",
"new_date_value",
"new_dates",
"new_dates.due_at",
"new_dates.due_on",
"new_dates.start_on",
"new_enum_value",
"new_enum_value.color",
"new_enum_value.enabled",
"new_enum_value.name",
"new_multi_enum_values",
"new_multi_enum_values.color",
"new_multi_enum_values.enabled",
"new_multi_enum_values.name",
"new_name",
"new_number_value",
"new_people_value",
"new_people_value.name",
"new_resource_subtype",
"new_section",
"new_section.name",
"new_text_value",
"num_hearts",
"num_likes",
"old_approval_status",
"old_date_value",
"old_dates",
"old_dates.due_at",
"old_dates.due_on",
"old_dates.start_on",
"old_enum_value",
"old_enum_value.color",
"old_enum_value.enabled",
"old_enum_value.name",
"old_multi_enum_values",
"old_multi_enum_values.color",
"old_multi_enum_values.enabled",
"old_multi_enum_values.name",
"old_name",
"old_number_value",
"old_people_value",
"old_people_value.name",
"old_resource_subtype",
"old_section",
"old_section.name",
"old_text_value",
"previews",
"previews.fallback",
"previews.footer",
"previews.header",
"previews.header_link",
"previews.html_text",
"previews.text",
"previews.title",
"previews.title_link",
"project",
"project.name",
"project.resource_subtype",
"reaction_summary",
"reaction_summary.count",
"reaction_summary.emoji_base",
"reaction_summary.reacted",
"reaction_summary.variant",
"resource_subtype",
"source",
"sticker_name",
"story",
"story.created_at",
"story.created_by",
"story.created_by.name",
"story.resource_subtype",
"story.text",
"tag",
"tag.name",
"target",
"target.created_by",
"target.name",
"target.resource_subtype",
"task",
"task.created_by",
"task.name",
"task.resource_subtype",
"text",
"type"
],
"schema": {
"type": "array",
"items": {
"type": "string",
"enum": [
"assignee",
"assignee.name",
"created_at",
"created_by",
"created_by.name",
"custom_field",
"custom_field.date_value",
"custom_field.date_value.date",
"custom_field.date_value.date_time",
"custom_field.display_value",
"custom_field.enabled",
"custom_field.enum_options",
"custom_field.enum_options.color",
"custom_field.enum_options.enabled",
"custom_field.enum_options.name",
"custom_field.enum_value",
"custom_field.enum_value.color",
"custom_field.enum_value.enabled",
"custom_field.enum_value.name",
"custom_field.id_prefix",
"custom_field.input_restrictions",
"custom_field.is_formula_field",
"custom_field.multi_enum_values",
"custom_field.multi_enum_values.color",
"custom_field.multi_enum_values.enabled",
"custom_field.multi_enum_values.name",
"custom_field.name",
"custom_field.number_value",
"custom_field.representation_type",
"custom_field.text_value",
"custom_field.type",
"dependency",
"dependency.created_by",
"dependency.name",
"dependency.resource_subtype",
"duplicate_of",
"duplicate_of.created_by",
"duplicate_of.name",
"duplicate_of.resource_subtype",
"duplicated_from",
"duplicated_from.created_by",
"duplicated_from.name",
"duplicated_from.resource_subtype",
"follower",
"follower.name",
"hearted",
"hearts",
"hearts.user",
"hearts.user.name",
"html_text",
"is_editable",
"is_edited",
"is_pinned",
"liked",
"likes",
"likes.user",
"likes.user.name",
"new_approval_status",
"new_date_value",
"new_dates",
"new_dates.due_at",
"new_dates.due_on",
"new_dates.start_on",
"new_enum_value",
"new_enum_value.color",
"new_enum_value.enabled",
"new_enum_value.name",
"new_multi_enum_values",
"new_multi_enum_values.color",
"new_multi_enum_values.enabled",
"new_multi_enum_values.name",
"new_name",
"new_number_value",
"new_people_value",
"new_people_value.name",
"new_resource_subtype",
"new_section",
"new_section.name",
"new_text_value",
"num_hearts",
"num_likes",
"old_approval_status",
"old_date_value",
"old_dates",
"old_dates.due_at",
"old_dates.due_on",
"old_dates.start_on",
"old_enum_value",
"old_enum_value.color",
"old_enum_value.enabled",
"old_enum_value.name",
"old_multi_enum_values",
"old_multi_enum_values.color",
"old_multi_enum_values.enabled",
"old_multi_enum_values.name",
"old_name",
"old_number_value",
"old_people_value",
"old_people_value.name",
"old_resource_subtype",
"old_section",
"old_section.name",
"old_text_value",
"previews",
"previews.fallback",
"previews.footer",
"previews.header",
"previews.header_link",
"previews.html_text",
"previews.text",
"previews.title",
"previews.title_link",
"project",
"project.name",
"project.resource_subtype",
"reaction_summary",
"reaction_summary.count",
"reaction_summary.emoji_base",
"reaction_summary.reacted",
"reaction_summary.variant",
"resource_subtype",
"source",
"sticker_name",
"story",
"story.created_at",
"story.created_by",
"story.created_by.name",
"story.resource_subtype",
"story.text",
"tag",
"tag.name",
"target",
"target.created_by",
"target.name",
"target.resource_subtype",
"task",
"task.created_by",
"task.name",
"task.resource_subtype",
"text",
"type"
]
}
},
"style": "form",
"explode": false
}
],
"requestBody": {
"description": "The story to create.",
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"$ref": "#/components/schemas/StoryRequest"
}
}
}
}
}
},
"responses": {
"201": {
"description": "Successfully created a new story.",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"$ref": "#/components/schemas/StoryResponse"
}
}
}
}
}
},
"400": {
"$ref": "#/components/responses/BadRequest"
},
"401": {
"$ref": "#/components/responses/Unauthorized"
},
"403": {
"$ref": "#/components/responses/Forbidden"
},
"404": {
"$ref": "#/components/responses/NotFound"
},
"500": {
"$ref": "#/components/responses/InternalServerError"
}
},
"security": [
{
"personalAccessToken": []
},
{
"oauth2": [
"stories:write"
]
}
],
"x-readme": {
"code-samples": [
{
"language": "node",
"install": "npm install asana",
"code": "const Asana = require('asana');\n\nlet client = new Asana.ApiClient();\nclient.authentications.token.accessToken = '<YOUR_ACCESS_TOKEN>';\n\nlet storiesApiInstance = new Asana.StoriesApi(client);\nlet body = {\"data\": {\"<PARAM_1>\": \"<VALUE_1>\", \"<PARAM_2>\": \"<VALUE_2>\",}}; // Object | The story to create.\nlet goal_gid = \"12345\"; // String | Globally unique identifier for the goal.\nlet opts = { \n 'opt_fields': \"assignee,assignee.name,created_at,created_by,created_by.name,custom_field,custom_field.date_value,custom_field.date_value.date,custom_field.date_value.date_time,custom_field.display_value,custom_field.enabled,custom_field.enum_options,custom_field.enum_options.color,custom_field.enum_options.enabled,custom_field.enum_options.name,custom_field.enum_value,custom_field.enum_value.color,custom_field.enum_value.enabled,custom_field.enum_value.name,custom_field.id_prefix,custom_field.input_restrictions,custom_field.is_formula_field,custom_field.multi_enum_values,custom_field.multi_enum_values.color,custom_field.multi_enum_values.enabled,custom_field.multi_enum_values.name,custom_field.name,custom_field.number_value,custom_field.representation_type,custom_field.text_value,custom_field.type,dependency,dependency.created_by,dependency.name,dependency.resource_subtype,duplicate_of,duplicate_of.created_by,duplicate_of.name,duplicate_of.resource_subtype,duplicated_from,duplicated_from.created_by,duplicated_from.name,duplicated_from.resource_subtype,follower,follower.name,hearted,hearts,hearts.user,hearts.user.name,html_text,is_editable,is_edited,is_pinned,liked,likes,likes.user,likes.user.name,new_approval_status,new_date_value,new_dates,new_dates.due_at,new_dates.due_on,new_dates.start_on,new_enum_value,new_enum_value.color,new_enum_value.enabled,new_enum_value.name,new_multi_enum_values,new_multi_enum_values.color,new_multi_enum_values.enabled,new_multi_enum_values.name,new_name,new_number_value,new_people_value,new_people_value.name,new_resource_subtype,new_section,new_section.name,new_text_value,num_hearts,num_likes,old_approval_status,old_date_value,old_dates,old_dates.due_at,old_dates.due_on,old_dates.start_on,old_enum_value,old_enum_value.color,old_enum_value.enabled,old_enum_value.name,old_multi_enum_values,old_multi_enum_values.color,old_multi_enum_values.enabled,old_multi_enum_values.name,old_name,old_number_value,old_people_value,old_people_value.name,old_resource_subtype,old_section,old_section.name,old_text_value,previews,previews.fallback,previews.footer,previews.header,previews.header_link,previews.html_text,previews.text,previews.title,previews.title_link,project,project.name,project.resource_subtype,reaction_summary,reaction_summary.count,reaction_summary.emoji_base,reaction_summary.reacted,reaction_summary.variant,resource_subtype,source,sticker_name,story,story.created_at,story.created_by,story.created_by.name,story.resource_subtype,story.text,tag,tag.name,target,target.created_by,target.name,target.resource_subtype,task,task.created_by,task.name,task.resource_subtype,text,type\"\n};\nstoriesApiInstance.createStoryForGoal(body, goal_gid, opts).then((result) => {\n console.log('API called successfully. Returned data: ' + JSON.stringify(result.data, null, 2));\n}, (error) => {\n console.error(error.response.body);\n});",
"name": "node-sdk-v3"
},
{
"language": "python",
"install": "pip install asana",
"code": "import asana\nfrom asana.rest import ApiException\nfrom pprint import pprint\n\nconfiguration = asana.Configuration()\nconfiguration.access_token = '<YOUR_ACCESS_TOKEN>'\napi_client = asana.ApiClient(configuration)\n\n# create an instance of the API class\nstories_api_instance = asana.StoriesApi(api_client)\nbody = {\"data\": {\"<PARAM_1>\": \"<VALUE_1>\", \"<PARAM_2>\": \"<VALUE_2>\",}} # dict | The story to create.\ngoal_gid = \"12345\" # str | Globally unique identifier for the goal.\nopts = {\n 'opt_fields': \"assignee,assignee.name,created_at,created_by,created_by.name,custom_field,custom_field.date_value,custom_field.date_value.date,custom_field.date_value.date_time,custom_field.display_value,custom_field.enabled,custom_field.enum_options,custom_field.enum_options.color,custom_field.enum_options.enabled,custom_field.enum_options.name,custom_field.enum_value,custom_field.enum_value.color,custom_field.enum_value.enabled,custom_field.enum_value.name,custom_field.id_prefix,custom_field.input_restrictions,custom_field.is_formula_field,custom_field.multi_enum_values,custom_field.multi_enum_values.color,custom_field.multi_enum_values.enabled,custom_field.multi_enum_values.name,custom_field.name,custom_field.number_value,custom_field.representation_type,custom_field.text_value,custom_field.type,dependency,dependency.created_by,dependency.name,dependency.resource_subtype,duplicate_of,duplicate_of.created_by,duplicate_of.name,duplicate_of.resource_subtype,duplicated_from,duplicated_from.created_by,duplicated_from.name,duplicated_from.resource_subtype,follower,follower.name,hearted,hearts,hearts.user,hearts.user.name,html_text,is_editable,is_edited,is_pinned,liked,likes,likes.user,likes.user.name,new_approval_status,new_date_value,new_dates,new_dates.due_at,new_dates.due_on,new_dates.start_on,new_enum_value,new_enum_value.color,new_enum_value.enabled,new_enum_value.name,new_multi_enum_values,new_multi_enum_values.color,new_multi_enum_values.enabled,new_multi_enum_values.name,new_name,new_number_value,new_people_value,new_people_value.name,new_resource_subtype,new_section,new_section.name,new_text_value,num_hearts,num_likes,old_approval_status,old_date_value,old_dates,old_dates.due_at,old_dates.due_on,old_dates.start_on,old_enum_value,old_enum_value.color,old_enum_value.enabled,old_enum_value.name,old_multi_enum_values,old_multi_enum_values.color,old_multi_enum_values.enabled,old_multi_enum_values.name,old_name,old_number_value,old_people_value,old_people_value.name,old_resource_subtype,old_section,old_section.name,old_text_value,previews,previews.fallback,previews.footer,previews.header,previews.header_link,previews.html_text,previews.text,previews.title,previews.title_link,project,project.name,project.resource_subtype,reaction_summary,reaction_summary.count,reaction_summary.emoji_base,reaction_summary.reacted,reaction_summary.variant,resource_subtype,source,sticker_name,story,story.created_at,story.created_by,story.created_by.name,story.resource_subtype,story.text,tag,tag.name,target,target.created_by,target.name,target.resource_subtype,task,task.created_by,task.name,task.resource_subtype,text,type\", # list[str] | 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.\n}\n\ntry:\n # Create a story on a goal\n api_response = stories_api_instance.create_story_for_goal(body, goal_gid, opts)\n pprint(api_response)\nexcept ApiException as e:\n print(\"Exception when calling StoriesApi->create_story_for_goal: %s\\n\" % e)",
"name": "python-sdk-v5"
}
]
},
"x-purple-suite-runtime": "unavailable"
}
GET /api/1.0/tags
Get multiple tags
<b>Required scope: </b><code>tags:read</code>
Returns the compact tag records for some filtered set of tags. Use one or more of the parameters provided to filter the tags returned.
The persistent core model supports the response and query fields named in x-purple-suite-supported-response-fields and x-purple-suite-supported-query. Other fields/options return an explicit 400 errors envelope.
Authentication
[
{
"personalAccessToken": []
},
{
"oauth2": [
"tags:read"
]
}
]
Path-level parameters and metadata
{
"parameters": [
{
"$ref": "#/components/parameters/pretty"
}
]
}
Request, responses and operation details
{
"summary": "Get multiple tags",
"description": "<b>Required scope: </b><code>tags:read</code>\n\nReturns the compact tag records for some filtered set of tags. Use one or more of the parameters provided to filter the tags returned.\n\nThe persistent core model supports the response and query fields named in x-purple-suite-supported-response-fields and x-purple-suite-supported-query. Other fields/options return an explicit 400 errors envelope.",
"tags": [
"Tags"
],
"operationId": "getTags",
"parameters": [
{
"$ref": "#/components/parameters/limit"
},
{
"$ref": "#/components/parameters/offset"
},
{
"name": "workspace",
"in": "query",
"description": "The workspace to filter tags on.",
"schema": {
"type": "string"
},
"example": "1331"
},
{
"name": "opt_fields",
"in": "query",
"description": "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. Properties can include nested fields. To learn more, see the [input/output options guide](/docs/inputoutput-options#selecting-nested-fields).",
"required": false,
"example": [
"color",
"created_at",
"followers",
"followers.name",
"name",
"notes",
"offset",
"path",
"permalink_url",
"uri",
"workspace",
"workspace.name"
],
"schema": {
"type": "array",
"items": {
"type": "string",
"enum": [
"color",
"created_at",
"followers",
"followers.name",
"name",
"notes",
"offset",
"path",
"permalink_url",
"uri",
"workspace",
"workspace.name"
]
}
},
"style": "form",
"explode": false
}
],
"responses": {
"200": {
"description": "Successfully retrieved the specified set of tags.",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"type": "array",
"items": {
"$ref": "#/components/schemas/TagCompact"
}
},
"next_page": {
"$ref": "#/components/schemas/NextPage"
}
}
}
}
}
},
"400": {
"$ref": "#/components/responses/BadRequest"
},
"401": {
"$ref": "#/components/responses/Unauthorized"
},
"403": {
"$ref": "#/components/responses/Forbidden"
},
"404": {
"$ref": "#/components/responses/NotFound"
},
"500": {
"$ref": "#/components/responses/InternalServerError"
}
},
"security": [
{
"personalAccessToken": []
},
{
"oauth2": [
"tags:read"
]
}
],
"x-readme": {
"code-samples": [
{
"language": "java",
"install": "<dependency><groupId>com.asana</groupId><artifactId>asana</artifactId><version>1.0.0</version></dependency>",
"code": "import com.asana.Client;\n\nClient client = Client.accessToken(\"PERSONAL_ACCESS_TOKEN\");\n\nList<Tag> result = client.tags.getTags(workspace)\n .option(\"pretty\", true)\n .execute();"
},
{
"language": "node",
"install": "npm install asana",
"code": "const Asana = require('asana');\n\nlet client = new Asana.ApiClient();\nclient.authentications.token.accessToken = '<YOUR_ACCESS_TOKEN>';\n\nlet tagsApiInstance = new Asana.TagsApi(client);\nlet opts = { \n 'limit': 50, \n 'offset': \"eyJ0eXAiOJiKV1iQLCJhbGciOiJIUzI1NiJ9\", \n 'workspace': \"1331\", \n 'opt_fields': \"color,created_at,followers,followers.name,name,notes,offset,path,permalink_url,uri,workspace,workspace.name\"\n};\ntagsApiInstance.getTags(opts).then((result) => {\n console.log('API called successfully. Returned data: ' + JSON.stringify(result.data, null, 2));\n}, (error) => {\n console.error(error.response.body);\n});",
"name": "node-sdk-v3"
},
{
"language": "node",
"install": "npm install asana@1.0.5",
"code": "const asana = require('asana');\n\nconst client = asana.Client.create().useAccessToken('PERSONAL_ACCESS_TOKEN');\n\nclient.tags.getTags({param: \"value\", param: \"value\", opt_pretty: true})\n .then((result) => {\n console.log(result);\n });",
"name": "node-sdk-v1"
},
{
"language": "python",
"install": "pip install asana",
"code": "import asana\nfrom asana.rest import ApiException\nfrom pprint import pprint\n\nconfiguration = asana.Configuration()\nconfiguration.access_token = '<YOUR_ACCESS_TOKEN>'\napi_client = asana.ApiClient(configuration)\n\n# create an instance of the API class\ntags_api_instance = asana.TagsApi(api_client)\nopts = {\n 'limit': 50, # int | Results per page. The number of objects to return per page. The value must be between 1 and 100.\n 'offset': \"eyJ0eXAiOJiKV1iQLCJhbGciOiJIUzI1NiJ9\", # str | 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.*\n 'workspace': \"1331\", # str | The workspace to filter tags on.\n 'opt_fields': \"color,created_at,followers,followers.name,name,notes,offset,path,permalink_url,uri,workspace,workspace.name\", # list[str] | 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.\n}\n\ntry:\n # Get multiple tags\n api_response = tags_api_instance.get_tags(opts)\n for data in api_response:\n pprint(data)\nexcept ApiException as e:\n print(\"Exception when calling TagsApi->get_tags: %s\\n\" % e)",
"name": "python-sdk-v5"
},
{
"language": "python",
"install": "pip install asana==3.2.3",
"code": "import asana\n\nclient = asana.Client.access_token('PERSONAL_ACCESS_TOKEN')\n\nresult = client.tags.get_tags({'param': 'value', 'param': 'value'}, opt_pretty=True)",
"name": "python-sdk-v3"
},
{
"language": "php",
"install": "composer require asana/asana",
"code": "<?php\nrequire 'vendor/autoload.php';\n\n$client = Asana\\Client::accessToken('PERSONAL_ACCESS_TOKEN');\n\n$result = $client->tags->getTags(array('param' => 'value', 'param' => 'value'), array('opt_pretty' => 'true'))"
},
{
"language": "ruby",
"install": "gem install asana",
"code": "require 'asana'\n\nclient = Asana::Client.new do |c|\n c.authentication :access_token, 'PERSONAL_ACCESS_TOKEN'\nend\n\nresult = client.tags.get_tags(param: \"value\", param: \"value\", options: {pretty: true})"
}
]
},
"x-purple-suite-runtime": "modeled-core",
"x-purple-suite-supported-query": [
"opt_pretty",
"limit",
"offset",
"workspace",
"opt_fields"
],
"x-purple-suite-supported-response-fields": [
"gid",
"resource_type",
"resource_subtype",
"name",
"notes",
"completed",
"completed_at",
"created_at",
"modified_at",
"assignee",
"assignee_status",
"workspace",
"projects",
"memberships",
"parent",
"due_on",
"start_on",
"tags",
"dependencies",
"num_subtasks",
"archived",
"public",
"color",
"default_view",
"team",
"project",
"section",
"text",
"created_by",
"target",
"type",
"email",
"photo",
"is_organization"
]
}
POST /api/1.0/tags
Create a tag
<b>Required scope: </b><code>tags:write</code>
Creates a new tag in a workspace or organization.
Every tag is required to be created in a specific workspace or
organization, and this cannot be changed once set. Note that you can use
the workspace parameter regardless of whether or not it is an
organization.
Returns the full record of the newly created tag.
The persistent core model supports the response and query fields named in x-purple-suite-supported-response-fields and x-purple-suite-supported-query. Other fields/options return an explicit 400 errors envelope.
Authentication
[
{
"personalAccessToken": []
},
{
"oauth2": [
"tags:write"
]
}
]
Path-level parameters and metadata
{
"parameters": [
{
"$ref": "#/components/parameters/pretty"
}
]
}
Request, responses and operation details
{
"summary": "Create a tag",
"description": "<b>Required scope: </b><code>tags:write</code>\n\nCreates a new tag in a workspace or organization.\n\nEvery tag is required to be created in a specific workspace or\norganization, and this cannot be changed once set. Note that you can use\nthe workspace parameter regardless of whether or not it is an\norganization.\n\nReturns the full record of the newly created tag.\n\nThe persistent core model supports the response and query fields named in x-purple-suite-supported-response-fields and x-purple-suite-supported-query. Other fields/options return an explicit 400 errors envelope.",
"tags": [
"Tags"
],
"operationId": "createTag",
"parameters": [
{
"name": "opt_fields",
"in": "query",
"description": "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. Properties can include nested fields. To learn more, see the [input/output options guide](/docs/inputoutput-options#selecting-nested-fields).",
"required": false,
"example": [
"color",
"created_at",
"followers",
"followers.name",
"name",
"notes",
"permalink_url",
"workspace",
"workspace.name"
],
"schema": {
"type": "array",
"items": {
"type": "string",
"enum": [
"color",
"created_at",
"followers",
"followers.name",
"name",
"notes",
"permalink_url",
"workspace",
"workspace.name"
]
}
},
"style": "form",
"explode": false
}
],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
"data"
],
"additionalProperties": false,
"properties": {
"data": {
"type": "object",
"additionalProperties": false,
"required": [
"name"
],
"properties": {
"name": {
"type": "string"
},
"workspace": {
"type": "string"
},
"color": {
"type": "string",
"nullable": true
}
}
}
}
}
},
"application/x-www-form-urlencoded": {
"schema": {
"type": "object",
"additionalProperties": false,
"required": [
"name"
],
"properties": {
"name": {
"type": "string"
},
"workspace": {
"type": "string"
},
"color": {
"type": "string",
"nullable": true
}
}
}
}
}
},
"responses": {
"201": {
"description": "Successfully created the newly specified tag.",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"$ref": "#/components/schemas/TagResponse"
}
}
}
}
}
},
"400": {
"$ref": "#/components/responses/BadRequest"
},
"401": {
"$ref": "#/components/responses/Unauthorized"
},
"403": {
"$ref": "#/components/responses/Forbidden"
},
"404": {
"$ref": "#/components/responses/NotFound"
},
"500": {
"$ref": "#/components/responses/InternalServerError"
}
},
"security": [
{
"personalAccessToken": []
},
{
"oauth2": [
"tags:write"
]
}
],
"x-readme": {
"code-samples": [
{
"language": "java",
"install": "<dependency><groupId>com.asana</groupId><artifactId>asana</artifactId><version>1.0.0</version></dependency>",
"code": "import com.asana.Client;\n\nClient client = Client.accessToken(\"PERSONAL_ACCESS_TOKEN\");\n\nTag result = client.tags.createTag()\n .data(\"field\", \"value\")\n .data(\"field\", \"value\")\n .option(\"pretty\", true)\n .execute();"
},
{
"language": "node",
"install": "npm install asana",
"code": "const Asana = require('asana');\n\nlet client = new Asana.ApiClient();\nclient.authentications.token.accessToken = '<YOUR_ACCESS_TOKEN>';\n\nlet tagsApiInstance = new Asana.TagsApi(client);\nlet body = {\"data\": {\"<PARAM_1>\": \"<VALUE_1>\", \"<PARAM_2>\": \"<VALUE_2>\",}}; // Object | The tag to create.\nlet opts = { \n 'opt_fields': \"color,created_at,followers,followers.name,name,notes,permalink_url,workspace,workspace.name\"\n};\ntagsApiInstance.createTag(body, opts).then((result) => {\n console.log('API called successfully. Returned data: ' + JSON.stringify(result.data, null, 2));\n}, (error) => {\n console.error(error.response.body);\n});",
"name": "node-sdk-v3"
},
{
"language": "node",
"install": "npm install asana@1.0.5",
"code": "const asana = require('asana');\n\nconst client = asana.Client.create().useAccessToken('PERSONAL_ACCESS_TOKEN');\n\nclient.tags.createTag({field: \"value\", field: \"value\", pretty: true})\n .then((result) => {\n console.log(result);\n });",
"name": "node-sdk-v1"
},
{
"language": "python",
"install": "pip install asana",
"code": "import asana\nfrom asana.rest import ApiException\nfrom pprint import pprint\n\nconfiguration = asana.Configuration()\nconfiguration.access_token = '<YOUR_ACCESS_TOKEN>'\napi_client = asana.ApiClient(configuration)\n\n# create an instance of the API class\ntags_api_instance = asana.TagsApi(api_client)\nbody = {\"data\": {\"<PARAM_1>\": \"<VALUE_1>\", \"<PARAM_2>\": \"<VALUE_2>\",}} # dict | The tag to create.\nopts = {\n 'opt_fields': \"color,created_at,followers,followers.name,name,notes,permalink_url,workspace,workspace.name\", # list[str] | 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.\n}\n\ntry:\n # Create a tag\n api_response = tags_api_instance.create_tag(body, opts)\n pprint(api_response)\nexcept ApiException as e:\n print(\"Exception when calling TagsApi->create_tag: %s\\n\" % e)",
"name": "python-sdk-v5"
},
{
"language": "python",
"install": "pip install asana==3.2.3",
"code": "import asana\n\nclient = asana.Client.access_token('PERSONAL_ACCESS_TOKEN')\n\nresult = client.tags.create_tag({'field': 'value', 'field': 'value'}, opt_pretty=True)",
"name": "python-sdk-v3"
},
{
"language": "php",
"install": "composer require asana/asana",
"code": "<?php\nrequire 'vendor/autoload.php';\n\n$client = Asana\\Client::accessToken('PERSONAL_ACCESS_TOKEN');\n\n$result = $client->tags->createTag(array('field' => 'value', 'field' => 'value'), array('opt_pretty' => 'true'))"
},
{
"language": "ruby",
"install": "gem install asana",
"code": "require 'asana'\n\nclient = Asana::Client.new do |c|\n c.authentication :access_token, 'PERSONAL_ACCESS_TOKEN'\nend\n\nresult = client.tags.create_tag(field: \"value\", field: \"value\", options: {pretty: true})"
}
]
},
"x-purple-suite-runtime": "modeled-core",
"x-purple-suite-supported-query": [
"opt_pretty",
"opt_fields"
],
"x-purple-suite-supported-response-fields": [
"gid",
"resource_type",
"resource_subtype",
"name",
"notes",
"completed",
"completed_at",
"created_at",
"modified_at",
"assignee",
"assignee_status",
"workspace",
"projects",
"memberships",
"parent",
"due_on",
"start_on",
"tags",
"dependencies",
"num_subtasks",
"archived",
"public",
"color",
"default_view",
"team",
"project",
"section",
"text",
"created_by",
"target",
"type",
"email",
"photo",
"is_organization"
]
}
GET /api/1.0/tags/{tag_gid}
Get a tag
<b>Required scope: </b><code>tags:read</code>
Returns the complete tag record for a single tag.
The persistent core model supports the response and query fields named in x-purple-suite-supported-response-fields and x-purple-suite-supported-query. Other fields/options return an explicit 400 errors envelope.
Authentication
[
{
"personalAccessToken": []
},
{
"oauth2": [
"tags:read"
]
}
]
Path-level parameters and metadata
{
"parameters": [
{
"$ref": "#/components/parameters/tag_path_gid"
},
{
"$ref": "#/components/parameters/pretty"
}
]
}
Request, responses and operation details
{
"summary": "Get a tag",
"description": "<b>Required scope: </b><code>tags:read</code>\n\nReturns the complete tag record for a single tag.\n\nThe persistent core model supports the response and query fields named in x-purple-suite-supported-response-fields and x-purple-suite-supported-query. Other fields/options return an explicit 400 errors envelope.",
"tags": [
"Tags"
],
"operationId": "getTag",
"parameters": [
{
"name": "opt_fields",
"in": "query",
"description": "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. Properties can include nested fields. To learn more, see the [input/output options guide](/docs/inputoutput-options#selecting-nested-fields).",
"required": false,
"example": [
"color",
"created_at",
"followers",
"followers.name",
"name",
"notes",
"permalink_url",
"workspace",
"workspace.name"
],
"schema": {
"type": "array",
"items": {
"type": "string",
"enum": [
"color",
"created_at",
"followers",
"followers.name",
"name",
"notes",
"permalink_url",
"workspace",
"workspace.name"
]
}
},
"style": "form",
"explode": false
}
],
"responses": {
"200": {
"description": "Successfully retrieved the specified tag.",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"$ref": "#/components/schemas/TagResponse"
}
}
}
}
}
},
"400": {
"$ref": "#/components/responses/BadRequest"
},
"401": {
"$ref": "#/components/responses/Unauthorized"
},
"403": {
"$ref": "#/components/responses/Forbidden"
},
"404": {
"$ref": "#/components/responses/NotFound"
},
"500": {
"$ref": "#/components/responses/InternalServerError"
}
},
"security": [
{
"personalAccessToken": []
},
{
"oauth2": [
"tags:read"
]
}
],
"x-readme": {
"code-samples": [
{
"language": "java",
"install": "<dependency><groupId>com.asana</groupId><artifactId>asana</artifactId><version>1.0.0</version></dependency>",
"code": "import com.asana.Client;\n\nClient client = Client.accessToken(\"PERSONAL_ACCESS_TOKEN\");\n\nTag result = client.tags.getTag(tagGid)\n .option(\"pretty\", true)\n .execute();"
},
{
"language": "node",
"install": "npm install asana",
"code": "const Asana = require('asana');\n\nlet client = new Asana.ApiClient();\nclient.authentications.token.accessToken = '<YOUR_ACCESS_TOKEN>';\n\nlet tagsApiInstance = new Asana.TagsApi(client);\nlet tag_gid = \"11235\"; // String | Globally unique identifier for the tag.\nlet opts = { \n 'opt_fields': \"color,created_at,followers,followers.name,name,notes,permalink_url,workspace,workspace.name\"\n};\ntagsApiInstance.getTag(tag_gid, opts).then((result) => {\n console.log('API called successfully. Returned data: ' + JSON.stringify(result.data, null, 2));\n}, (error) => {\n console.error(error.response.body);\n});",
"name": "node-sdk-v3"
},
{
"language": "node",
"install": "npm install asana@1.0.5",
"code": "const asana = require('asana');\n\nconst client = asana.Client.create().useAccessToken('PERSONAL_ACCESS_TOKEN');\n\nclient.tags.getTag(tagGid, {param: \"value\", param: \"value\", opt_pretty: true})\n .then((result) => {\n console.log(result);\n });",
"name": "node-sdk-v1"
},
{
"language": "python",
"install": "pip install asana",
"code": "import asana\nfrom asana.rest import ApiException\nfrom pprint import pprint\n\nconfiguration = asana.Configuration()\nconfiguration.access_token = '<YOUR_ACCESS_TOKEN>'\napi_client = asana.ApiClient(configuration)\n\n# create an instance of the API class\ntags_api_instance = asana.TagsApi(api_client)\ntag_gid = \"11235\" # str | Globally unique identifier for the tag.\nopts = {\n 'opt_fields': \"color,created_at,followers,followers.name,name,notes,permalink_url,workspace,workspace.name\", # list[str] | 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.\n}\n\ntry:\n # Get a tag\n api_response = tags_api_instance.get_tag(tag_gid, opts)\n pprint(api_response)\nexcept ApiException as e:\n print(\"Exception when calling TagsApi->get_tag: %s\\n\" % e)",
"name": "python-sdk-v5"
},
{
"language": "python",
"install": "pip install asana==3.2.3",
"code": "import asana\n\nclient = asana.Client.access_token('PERSONAL_ACCESS_TOKEN')\n\nresult = client.tags.get_tag(tag_gid, {'param': 'value', 'param': 'value'}, opt_pretty=True)",
"name": "python-sdk-v3"
},
{
"language": "php",
"install": "composer require asana/asana",
"code": "<?php\nrequire 'vendor/autoload.php';\n\n$client = Asana\\Client::accessToken('PERSONAL_ACCESS_TOKEN');\n\n$result = $client->tags->getTag($tag_gid, array('param' => 'value', 'param' => 'value'), array('opt_pretty' => 'true'))"
},
{
"language": "ruby",
"install": "gem install asana",
"code": "require 'asana'\n\nclient = Asana::Client.new do |c|\n c.authentication :access_token, 'PERSONAL_ACCESS_TOKEN'\nend\n\nresult = client.tags.get_tag(tag_gid: 'tag_gid', param: \"value\", param: \"value\", options: {pretty: true})"
}
]
},
"x-purple-suite-runtime": "modeled-core",
"x-purple-suite-supported-query": [
"opt_pretty",
"opt_fields"
],
"x-purple-suite-supported-response-fields": [
"gid",
"resource_type",
"resource_subtype",
"name",
"notes",
"completed",
"completed_at",
"created_at",
"modified_at",
"assignee",
"assignee_status",
"workspace",
"projects",
"memberships",
"parent",
"due_on",
"start_on",
"tags",
"dependencies",
"num_subtasks",
"archived",
"public",
"color",
"default_view",
"team",
"project",
"section",
"text",
"created_by",
"target",
"type",
"email",
"photo",
"is_organization"
]
}
PUT /api/1.0/tags/{tag_gid}
Update a tag
<b>Required scope: </b><code>tags:write</code>
Updates the properties of a tag. Only the fields provided in the `data`
block will be updated; any unspecified fields will remain unchanged.
When using this method, it is best to specify only those fields you wish
to change, or else you may overwrite changes made by another user since
you last retrieved the tag.
Returns the complete updated tag record.
The persistent core model supports the response and query fields named in x-purple-suite-supported-response-fields and x-purple-suite-supported-query. Other fields/options return an explicit 400 errors envelope.
Authentication
[
{
"personalAccessToken": []
},
{
"oauth2": [
"tags:write"
]
}
]
Path-level parameters and metadata
{
"parameters": [
{
"$ref": "#/components/parameters/tag_path_gid"
},
{
"$ref": "#/components/parameters/pretty"
}
]
}
Request, responses and operation details
{
"summary": "Update a tag",
"description": "<b>Required scope: </b><code>tags:write</code>\n\nUpdates the properties of a tag. Only the fields provided in the `data`\nblock will be updated; any unspecified fields will remain unchanged.\n\nWhen using this method, it is best to specify only those fields you wish\nto change, or else you may overwrite changes made by another user since\nyou last retrieved the tag.\n\nReturns the complete updated tag record.\n\nThe persistent core model supports the response and query fields named in x-purple-suite-supported-response-fields and x-purple-suite-supported-query. Other fields/options return an explicit 400 errors envelope.",
"tags": [
"Tags"
],
"operationId": "updateTag",
"parameters": [
{
"name": "opt_fields",
"in": "query",
"description": "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. Properties can include nested fields. To learn more, see the [input/output options guide](/docs/inputoutput-options#selecting-nested-fields).",
"required": false,
"example": [
"color",
"created_at",
"followers",
"followers.name",
"name",
"notes",
"permalink_url",
"workspace",
"workspace.name"
],
"schema": {
"type": "array",
"items": {
"type": "string",
"enum": [
"color",
"created_at",
"followers",
"followers.name",
"name",
"notes",
"permalink_url",
"workspace",
"workspace.name"
]
}
},
"style": "form",
"explode": false
}
],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
"data"
],
"additionalProperties": false,
"properties": {
"data": {
"type": "object",
"additionalProperties": false,
"required": [],
"properties": {
"name": {
"type": "string"
},
"color": {
"type": "string",
"nullable": true
}
}
}
}
}
},
"application/x-www-form-urlencoded": {
"schema": {
"type": "object",
"additionalProperties": false,
"required": [],
"properties": {
"name": {
"type": "string"
},
"color": {
"type": "string",
"nullable": true
}
}
}
}
}
},
"responses": {
"200": {
"description": "Successfully updated the specified tag.",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"$ref": "#/components/schemas/TagResponse"
}
}
}
}
}
},
"400": {
"$ref": "#/components/responses/BadRequest"
},
"401": {
"$ref": "#/components/responses/Unauthorized"
},
"403": {
"$ref": "#/components/responses/Forbidden"
},
"404": {
"$ref": "#/components/responses/NotFound"
},
"500": {
"$ref": "#/components/responses/InternalServerError"
}
},
"security": [
{
"personalAccessToken": []
},
{
"oauth2": [
"tags:write"
]
}
],
"x-readme": {
"code-samples": [
{
"language": "java",
"install": "<dependency><groupId>com.asana</groupId><artifactId>asana</artifactId><version>1.0.0</version></dependency>",
"code": "import com.asana.Client;\n\nClient client = Client.accessToken(\"PERSONAL_ACCESS_TOKEN\");\n\nTag result = client.tags.updateTag(tagGid)\n .data(\"field\", \"value\")\n .data(\"field\", \"value\")\n .option(\"pretty\", true)\n .execute();"
},
{
"language": "node",
"install": "npm install asana",
"code": "const Asana = require('asana');\n\nlet client = new Asana.ApiClient();\nclient.authentications.token.accessToken = '<YOUR_ACCESS_TOKEN>';\n\nlet tagsApiInstance = new Asana.TagsApi(client);\nlet body = {\"data\": {\"<PARAM_1>\": \"<VALUE_1>\", \"<PARAM_2>\": \"<VALUE_2>\",}}; // Object | The tag to update.\nlet tag_gid = \"11235\"; // String | Globally unique identifier for the tag.\nlet opts = { \n 'opt_fields': \"color,created_at,followers,followers.name,name,notes,permalink_url,workspace,workspace.name\"\n};\ntagsApiInstance.updateTag(body, tag_gid, opts).then((result) => {\n console.log('API called successfully. Returned data: ' + JSON.stringify(result.data, null, 2));\n}, (error) => {\n console.error(error.response.body);\n});",
"name": "node-sdk-v3"
},
{
"language": "node",
"install": "npm install asana@1.0.5",
"code": "const asana = require('asana');\n\nconst client = asana.Client.create().useAccessToken('PERSONAL_ACCESS_TOKEN');\n\nclient.tags.updateTag(tagGid, {field: \"value\", field: \"value\", pretty: true})\n .then((result) => {\n console.log(result);\n });",
"name": "node-sdk-v1"
},
{
"language": "python",
"install": "pip install asana",
"code": "import asana\nfrom asana.rest import ApiException\nfrom pprint import pprint\n\nconfiguration = asana.Configuration()\nconfiguration.access_token = '<YOUR_ACCESS_TOKEN>'\napi_client = asana.ApiClient(configuration)\n\n# create an instance of the API class\ntags_api_instance = asana.TagsApi(api_client)\nbody = {\"data\": {\"<PARAM_1>\": \"<VALUE_1>\", \"<PARAM_2>\": \"<VALUE_2>\",}} # dict | The tag to update.\ntag_gid = \"11235\" # str | Globally unique identifier for the tag.\nopts = {\n 'opt_fields': \"color,created_at,followers,followers.name,name,notes,permalink_url,workspace,workspace.name\", # list[str] | 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.\n}\n\ntry:\n # Update a tag\n api_response = tags_api_instance.update_tag(body, tag_gid, opts)\n pprint(api_response)\nexcept ApiException as e:\n print(\"Exception when calling TagsApi->update_tag: %s\\n\" % e)",
"name": "python-sdk-v5"
},
{
"language": "python",
"install": "pip install asana==3.2.3",
"code": "import asana\n\nclient = asana.Client.access_token('PERSONAL_ACCESS_TOKEN')\n\nresult = client.tags.update_tag(tag_gid, {'field': 'value', 'field': 'value'}, opt_pretty=True)",
"name": "python-sdk-v3"
},
{
"language": "php",
"install": "composer require asana/asana",
"code": "<?php\nrequire 'vendor/autoload.php';\n\n$client = Asana\\Client::accessToken('PERSONAL_ACCESS_TOKEN');\n\n$result = $client->tags->updateTag($tag_gid, array('field' => 'value', 'field' => 'value'), array('opt_pretty' => 'true'))"
},
{
"language": "ruby",
"install": "gem install asana",
"code": "require 'asana'\n\nclient = Asana::Client.new do |c|\n c.authentication :access_token, 'PERSONAL_ACCESS_TOKEN'\nend\n\nresult = client.tags.update_tag(tag_gid: 'tag_gid', field: \"value\", field: \"value\", options: {pretty: true})"
}
]
},
"x-purple-suite-runtime": "modeled-core",
"x-purple-suite-supported-query": [
"opt_pretty",
"opt_fields"
],
"x-purple-suite-supported-response-fields": [
"gid",
"resource_type",
"resource_subtype",
"name",
"notes",
"completed",
"completed_at",
"created_at",
"modified_at",
"assignee",
"assignee_status",
"workspace",
"projects",
"memberships",
"parent",
"due_on",
"start_on",
"tags",
"dependencies",
"num_subtasks",
"archived",
"public",
"color",
"default_view",
"team",
"project",
"section",
"text",
"created_by",
"target",
"type",
"email",
"photo",
"is_organization"
]
}
DELETE /api/1.0/tags/{tag_gid}
Delete a tag
A specific, existing tag can be deleted by making a DELETE request on
the URL for that tag.
Returns an empty data record.
The persistent core model supports the response and query fields named in x-purple-suite-supported-response-fields and x-purple-suite-supported-query. Other fields/options return an explicit 400 errors envelope.
Authentication
[
{
"personalAccessToken": []
},
{
"oauth2": []
}
]
Path-level parameters and metadata
{
"parameters": [
{
"$ref": "#/components/parameters/tag_path_gid"
},
{
"$ref": "#/components/parameters/pretty"
}
]
}
Request, responses and operation details
{
"summary": "Delete a tag",
"description": "A specific, existing tag can be deleted by making a DELETE request on\nthe URL for that tag.\n\nReturns an empty data record.\n\nThe persistent core model supports the response and query fields named in x-purple-suite-supported-response-fields and x-purple-suite-supported-query. Other fields/options return an explicit 400 errors envelope.",
"tags": [
"Tags"
],
"operationId": "deleteTag",
"responses": {
"200": {
"description": "Successfully deleted the specified tag.",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"$ref": "#/components/schemas/EmptyResponse"
}
}
}
}
}
},
"400": {
"$ref": "#/components/responses/BadRequest"
},
"401": {
"$ref": "#/components/responses/Unauthorized"
},
"403": {
"$ref": "#/components/responses/Forbidden"
},
"404": {
"$ref": "#/components/responses/NotFound"
},
"500": {
"$ref": "#/components/responses/InternalServerError"
}
},
"security": [
{
"personalAccessToken": []
},
{
"oauth2": []
}
],
"x-readme": {
"code-samples": [
{
"language": "java",
"install": "<dependency><groupId>com.asana</groupId><artifactId>asana</artifactId><version>1.0.0</version></dependency>",
"code": "import com.asana.Client;\n\nClient client = Client.accessToken(\"PERSONAL_ACCESS_TOKEN\");\n\nJsonElement result = client.tags.deleteTag(tagGid)\n .option(\"pretty\", true)\n .execute();"
},
{
"language": "node",
"install": "npm install asana",
"code": "const Asana = require('asana');\n\nlet client = new Asana.ApiClient();\nclient.authentications.token.accessToken = '<YOUR_ACCESS_TOKEN>';\n\nlet tagsApiInstance = new Asana.TagsApi(client);\nlet tag_gid = \"11235\"; // String | Globally unique identifier for the tag.\n\ntagsApiInstance.deleteTag(tag_gid).then((result) => {\n console.log('API called successfully. Returned data: ' + JSON.stringify(result.data, null, 2));\n}, (error) => {\n console.error(error.response.body);\n});",
"name": "node-sdk-v3"
},
{
"language": "node",
"install": "npm install asana@1.0.5",
"code": "const asana = require('asana');\n\nconst client = asana.Client.create().useAccessToken('PERSONAL_ACCESS_TOKEN');\n\nclient.tags.deleteTag(tagGid)\n .then((result) => {\n console.log(result);\n });",
"name": "node-sdk-v1"
},
{
"language": "python",
"install": "pip install asana",
"code": "import asana\nfrom asana.rest import ApiException\nfrom pprint import pprint\n\nconfiguration = asana.Configuration()\nconfiguration.access_token = '<YOUR_ACCESS_TOKEN>'\napi_client = asana.ApiClient(configuration)\n\n# create an instance of the API class\ntags_api_instance = asana.TagsApi(api_client)\ntag_gid = \"11235\" # str | Globally unique identifier for the tag.\n\n\ntry:\n # Delete a tag\n api_response = tags_api_instance.delete_tag(tag_gid)\n pprint(api_response)\nexcept ApiException as e:\n print(\"Exception when calling TagsApi->delete_tag: %s\\n\" % e)",
"name": "python-sdk-v5"
},
{
"language": "python",
"install": "pip install asana==3.2.3",
"code": "import asana\n\nclient = asana.Client.access_token('PERSONAL_ACCESS_TOKEN')\n\nresult = client.tags.delete_tag(tag_gid, opt_pretty=True)",
"name": "python-sdk-v3"
},
{
"language": "php",
"install": "composer require asana/asana",
"code": "<?php\nrequire 'vendor/autoload.php';\n\n$client = Asana\\Client::accessToken('PERSONAL_ACCESS_TOKEN');\n\n$result = $client->tags->deleteTag($tag_gid, array('opt_pretty' => 'true'))"
},
{
"language": "ruby",
"install": "gem install asana",
"code": "require 'asana'\n\nclient = Asana::Client.new do |c|\n c.authentication :access_token, 'PERSONAL_ACCESS_TOKEN'\nend\n\nresult = client.tags.delete_tag(tag_gid: 'tag_gid', options: {pretty: true})"
}
]
},
"x-purple-suite-runtime": "modeled-core",
"x-purple-suite-supported-query": [
"opt_pretty"
],
"x-purple-suite-supported-response-fields": [
"gid",
"resource_type",
"resource_subtype",
"name",
"notes",
"completed",
"completed_at",
"created_at",
"modified_at",
"assignee",
"assignee_status",
"workspace",
"projects",
"memberships",
"parent",
"due_on",
"start_on",
"tags",
"dependencies",
"num_subtasks",
"archived",
"public",
"color",
"default_view",
"team",
"project",
"section",
"text",
"created_by",
"target",
"type",
"email",
"photo",
"is_organization"
]
}
GET /api/1.0/tasks/{task_gid}/tags
Get a task's tags
<b>Required scope: </b><code>tags:read</code>
Get a compact representation of all of the tags the task has.
The persistent core model supports the response and query fields named in x-purple-suite-supported-response-fields and x-purple-suite-supported-query. Other fields/options return an explicit 400 errors envelope.
Authentication
[
{
"personalAccessToken": []
},
{
"oauth2": [
"tags:read"
]
}
]
Path-level parameters and metadata
{
"parameters": [
{
"$ref": "#/components/parameters/task_path_gid"
},
{
"$ref": "#/components/parameters/pretty"
},
{
"$ref": "#/components/parameters/limit"
},
{
"$ref": "#/components/parameters/offset"
}
]
}
Request, responses and operation details
{
"summary": "Get a task's tags",
"description": "<b>Required scope: </b><code>tags:read</code>\n\nGet a compact representation of all of the tags the task has.\n\nThe persistent core model supports the response and query fields named in x-purple-suite-supported-response-fields and x-purple-suite-supported-query. Other fields/options return an explicit 400 errors envelope.",
"tags": [
"Tags"
],
"operationId": "getTagsForTask",
"parameters": [
{
"name": "opt_fields",
"in": "query",
"description": "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. Properties can include nested fields. To learn more, see the [input/output options guide](/docs/inputoutput-options#selecting-nested-fields).",
"required": false,
"example": [
"color",
"created_at",
"followers",
"followers.name",
"name",
"notes",
"offset",
"path",
"permalink_url",
"uri",
"workspace",
"workspace.name"
],
"schema": {
"type": "array",
"items": {
"type": "string",
"enum": [
"color",
"created_at",
"followers",
"followers.name",
"name",
"notes",
"offset",
"path",
"permalink_url",
"uri",
"workspace",
"workspace.name"
]
}
},
"style": "form",
"explode": false
}
],
"responses": {
"200": {
"description": "Successfully retrieved the tags for the given task.",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"type": "array",
"items": {
"$ref": "#/components/schemas/TagCompact"
}
},
"next_page": {
"$ref": "#/components/schemas/NextPage"
}
}
}
}
}
},
"400": {
"$ref": "#/components/responses/BadRequest"
},
"401": {
"$ref": "#/components/responses/Unauthorized"
},
"403": {
"$ref": "#/components/responses/Forbidden"
},
"404": {
"$ref": "#/components/responses/NotFound"
},
"500": {
"$ref": "#/components/responses/InternalServerError"
}
},
"security": [
{
"personalAccessToken": []
},
{
"oauth2": [
"tags:read"
]
}
],
"x-readme": {
"code-samples": [
{
"language": "java",
"install": "<dependency><groupId>com.asana</groupId><artifactId>asana</artifactId><version>1.0.0</version></dependency>",
"code": "import com.asana.Client;\n\nClient client = Client.accessToken(\"PERSONAL_ACCESS_TOKEN\");\n\nList<Tag> result = client.tags.getTagsForTask(taskGid)\n .option(\"pretty\", true)\n .execute();"
},
{
"language": "node",
"install": "npm install asana",
"code": "const Asana = require('asana');\n\nlet client = new Asana.ApiClient();\nclient.authentications.token.accessToken = '<YOUR_ACCESS_TOKEN>';\n\nlet tagsApiInstance = new Asana.TagsApi(client);\nlet task_gid = \"321654\"; // String | The task to operate on.\nlet opts = { \n 'limit': 50, \n 'offset': \"eyJ0eXAiOJiKV1iQLCJhbGciOiJIUzI1NiJ9\", \n 'opt_fields': \"color,created_at,followers,followers.name,name,notes,offset,path,permalink_url,uri,workspace,workspace.name\"\n};\ntagsApiInstance.getTagsForTask(task_gid, opts).then((result) => {\n console.log('API called successfully. Returned data: ' + JSON.stringify(result.data, null, 2));\n}, (error) => {\n console.error(error.response.body);\n});",
"name": "node-sdk-v3"
},
{
"language": "node",
"install": "npm install asana@1.0.5",
"code": "const asana = require('asana');\n\nconst client = asana.Client.create().useAccessToken('PERSONAL_ACCESS_TOKEN');\n\nclient.tags.getTagsForTask(taskGid, {param: \"value\", param: \"value\", opt_pretty: true})\n .then((result) => {\n console.log(result);\n });",
"name": "node-sdk-v1"
},
{
"language": "python",
"install": "pip install asana",
"code": "import asana\nfrom asana.rest import ApiException\nfrom pprint import pprint\n\nconfiguration = asana.Configuration()\nconfiguration.access_token = '<YOUR_ACCESS_TOKEN>'\napi_client = asana.ApiClient(configuration)\n\n# create an instance of the API class\ntags_api_instance = asana.TagsApi(api_client)\ntask_gid = \"321654\" # str | The task to operate on.\nopts = {\n 'limit': 50, # int | Results per page. The number of objects to return per page. The value must be between 1 and 100.\n 'offset': \"eyJ0eXAiOJiKV1iQLCJhbGciOiJIUzI1NiJ9\", # str | 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.*\n 'opt_fields': \"color,created_at,followers,followers.name,name,notes,offset,path,permalink_url,uri,workspace,workspace.name\", # list[str] | 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.\n}\n\ntry:\n # Get a task's tags\n api_response = tags_api_instance.get_tags_for_task(task_gid, opts)\n for data in api_response:\n pprint(data)\nexcept ApiException as e:\n print(\"Exception when calling TagsApi->get_tags_for_task: %s\\n\" % e)",
"name": "python-sdk-v5"
},
{
"language": "python",
"install": "pip install asana==3.2.3",
"code": "import asana\n\nclient = asana.Client.access_token('PERSONAL_ACCESS_TOKEN')\n\nresult = client.tags.get_tags_for_task(task_gid, {'param': 'value', 'param': 'value'}, opt_pretty=True)",
"name": "python-sdk-v3"
},
{
"language": "php",
"install": "composer require asana/asana",
"code": "<?php\nrequire 'vendor/autoload.php';\n\n$client = Asana\\Client::accessToken('PERSONAL_ACCESS_TOKEN');\n\n$result = $client->tags->getTagsForTask($task_gid, array('param' => 'value', 'param' => 'value'), array('opt_pretty' => 'true'))"
},
{
"language": "ruby",
"install": "gem install asana",
"code": "require 'asana'\n\nclient = Asana::Client.new do |c|\n c.authentication :access_token, 'PERSONAL_ACCESS_TOKEN'\nend\n\nresult = client.tags.get_tags_for_task(task_gid: 'task_gid', param: \"value\", param: \"value\", options: {pretty: true})"
}
]
},
"x-purple-suite-runtime": "modeled-core",
"x-purple-suite-supported-query": [
"opt_pretty",
"limit",
"offset",
"opt_fields"
],
"x-purple-suite-supported-response-fields": [
"gid",
"resource_type",
"resource_subtype",
"name",
"notes",
"completed",
"completed_at",
"created_at",
"modified_at",
"assignee",
"assignee_status",
"workspace",
"projects",
"memberships",
"parent",
"due_on",
"start_on",
"tags",
"dependencies",
"num_subtasks",
"archived",
"public",
"color",
"default_view",
"team",
"project",
"section",
"text",
"created_by",
"target",
"type",
"email",
"photo",
"is_organization"
]
}
GET /api/1.0/workspaces/{workspace_gid}/tags
Get tags in a workspace
<b>Required scope: </b><code>tags:read</code>
Returns the compact tag records for some filtered set of tags. Use one or more of the parameters provided to filter the tags returned.
The persistent core model supports the response and query fields named in x-purple-suite-supported-response-fields and x-purple-suite-supported-query. Other fields/options return an explicit 400 errors envelope.
Authentication
[
{
"personalAccessToken": []
},
{
"oauth2": [
"tags:read"
]
}
]
Path-level parameters and metadata
{
"parameters": [
{
"$ref": "#/components/parameters/workspace_path_gid"
},
{
"$ref": "#/components/parameters/pretty"
}
]
}
Request, responses and operation details
{
"summary": "Get tags in a workspace",
"description": "<b>Required scope: </b><code>tags:read</code>\n\nReturns the compact tag records for some filtered set of tags. Use one or more of the parameters provided to filter the tags returned.\n\nThe persistent core model supports the response and query fields named in x-purple-suite-supported-response-fields and x-purple-suite-supported-query. Other fields/options return an explicit 400 errors envelope.",
"tags": [
"Tags"
],
"operationId": "getTagsForWorkspace",
"parameters": [
{
"$ref": "#/components/parameters/limit"
},
{
"$ref": "#/components/parameters/offset"
},
{
"name": "opt_fields",
"in": "query",
"description": "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. Properties can include nested fields. To learn more, see the [input/output options guide](/docs/inputoutput-options#selecting-nested-fields).",
"required": false,
"example": [
"color",
"created_at",
"followers",
"followers.name",
"name",
"notes",
"offset",
"path",
"permalink_url",
"uri",
"workspace",
"workspace.name"
],
"schema": {
"type": "array",
"items": {
"type": "string",
"enum": [
"color",
"created_at",
"followers",
"followers.name",
"name",
"notes",
"offset",
"path",
"permalink_url",
"uri",
"workspace",
"workspace.name"
]
}
},
"style": "form",
"explode": false
}
],
"responses": {
"200": {
"description": "Successfully retrieved the specified set of tags.",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"type": "array",
"items": {
"$ref": "#/components/schemas/TagCompact"
}
},
"next_page": {
"$ref": "#/components/schemas/NextPage"
}
}
}
}
}
},
"400": {
"$ref": "#/components/responses/BadRequest"
},
"401": {
"$ref": "#/components/responses/Unauthorized"
},
"403": {
"$ref": "#/components/responses/Forbidden"
},
"404": {
"$ref": "#/components/responses/NotFound"
},
"500": {
"$ref": "#/components/responses/InternalServerError"
}
},
"security": [
{
"personalAccessToken": []
},
{
"oauth2": [
"tags:read"
]
}
],
"x-readme": {
"code-samples": [
{
"language": "java",
"install": "<dependency><groupId>com.asana</groupId><artifactId>asana</artifactId><version>1.0.0</version></dependency>",
"code": "import com.asana.Client;\n\nClient client = Client.accessToken(\"PERSONAL_ACCESS_TOKEN\");\n\nList<Tag> result = client.tags.getTagsForWorkspace(workspaceGid)\n .option(\"pretty\", true)\n .execute();"
},
{
"language": "node",
"install": "npm install asana",
"code": "const Asana = require('asana');\n\nlet client = new Asana.ApiClient();\nclient.authentications.token.accessToken = '<YOUR_ACCESS_TOKEN>';\n\nlet tagsApiInstance = new Asana.TagsApi(client);\nlet workspace_gid = \"12345\"; // String | Globally unique identifier for the workspace or organization.\nlet opts = { \n 'limit': 50, \n 'offset': \"eyJ0eXAiOJiKV1iQLCJhbGciOiJIUzI1NiJ9\", \n 'opt_fields': \"color,created_at,followers,followers.name,name,notes,offset,path,permalink_url,uri,workspace,workspace.name\"\n};\ntagsApiInstance.getTagsForWorkspace(workspace_gid, opts).then((result) => {\n console.log('API called successfully. Returned data: ' + JSON.stringify(result.data, null, 2));\n}, (error) => {\n console.error(error.response.body);\n});",
"name": "node-sdk-v3"
},
{
"language": "node",
"install": "npm install asana@1.0.5",
"code": "const asana = require('asana');\n\nconst client = asana.Client.create().useAccessToken('PERSONAL_ACCESS_TOKEN');\n\nclient.tags.getTagsForWorkspace(workspaceGid, {param: \"value\", param: \"value\", opt_pretty: true})\n .then((result) => {\n console.log(result);\n });",
"name": "node-sdk-v1"
},
{
"language": "python",
"install": "pip install asana",
"code": "import asana\nfrom asana.rest import ApiException\nfrom pprint import pprint\n\nconfiguration = asana.Configuration()\nconfiguration.access_token = '<YOUR_ACCESS_TOKEN>'\napi_client = asana.ApiClient(configuration)\n\n# create an instance of the API class\ntags_api_instance = asana.TagsApi(api_client)\nworkspace_gid = \"12345\" # str | Globally unique identifier for the workspace or organization.\nopts = {\n 'limit': 50, # int | Results per page. The number of objects to return per page. The value must be between 1 and 100.\n 'offset': \"eyJ0eXAiOJiKV1iQLCJhbGciOiJIUzI1NiJ9\", # str | 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.*\n 'opt_fields': \"color,created_at,followers,followers.name,name,notes,offset,path,permalink_url,uri,workspace,workspace.name\", # list[str] | 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.\n}\n\ntry:\n # Get tags in a workspace\n api_response = tags_api_instance.get_tags_for_workspace(workspace_gid, opts)\n for data in api_response:\n pprint(data)\nexcept ApiException as e:\n print(\"Exception when calling TagsApi->get_tags_for_workspace: %s\\n\" % e)",
"name": "python-sdk-v5"
},
{
"language": "python",
"install": "pip install asana==3.2.3",
"code": "import asana\n\nclient = asana.Client.access_token('PERSONAL_ACCESS_TOKEN')\n\nresult = client.tags.get_tags_for_workspace(workspace_gid, {'param': 'value', 'param': 'value'}, opt_pretty=True)",
"name": "python-sdk-v3"
},
{
"language": "php",
"install": "composer require asana/asana",
"code": "<?php\nrequire 'vendor/autoload.php';\n\n$client = Asana\\Client::accessToken('PERSONAL_ACCESS_TOKEN');\n\n$result = $client->tags->getTagsForWorkspace($workspace_gid, array('param' => 'value', 'param' => 'value'), array('opt_pretty' => 'true'))"
},
{
"language": "ruby",
"install": "gem install asana",
"code": "require 'asana'\n\nclient = Asana::Client.new do |c|\n c.authentication :access_token, 'PERSONAL_ACCESS_TOKEN'\nend\n\nresult = client.tags.get_tags_for_workspace(workspace_gid: 'workspace_gid', param: \"value\", param: \"value\", options: {pretty: true})"
}
]
},
"x-purple-suite-runtime": "modeled-core",
"x-purple-suite-supported-query": [
"opt_pretty",
"limit",
"offset",
"opt_fields"
],
"x-purple-suite-supported-response-fields": [
"gid",
"resource_type",
"resource_subtype",
"name",
"notes",
"completed",
"completed_at",
"created_at",
"modified_at",
"assignee",
"assignee_status",
"workspace",
"projects",
"memberships",
"parent",
"due_on",
"start_on",
"tags",
"dependencies",
"num_subtasks",
"archived",
"public",
"color",
"default_view",
"team",
"project",
"section",
"text",
"created_by",
"target",
"type",
"email",
"photo",
"is_organization"
]
}
POST /api/1.0/workspaces/{workspace_gid}/tags
Create a tag in a workspace
<b>Required scope: </b><code>tags:write</code>
Creates a new tag in a workspace or organization.
Every tag is required to be created in a specific workspace or
organization, and this cannot be changed once set. Note that you can use
the workspace parameter regardless of whether or not it is an
organization.
Returns the full record of the newly created tag.
The persistent core model supports the response and query fields named in x-purple-suite-supported-response-fields and x-purple-suite-supported-query. Other fields/options return an explicit 400 errors envelope.
Authentication
[
{
"personalAccessToken": []
},
{
"oauth2": [
"tags:write"
]
}
]
Path-level parameters and metadata
{
"parameters": [
{
"$ref": "#/components/parameters/workspace_path_gid"
},
{
"$ref": "#/components/parameters/pretty"
}
]
}
Request, responses and operation details
{
"summary": "Create a tag in a workspace",
"description": "<b>Required scope: </b><code>tags:write</code>\n\nCreates a new tag in a workspace or organization.\n\nEvery tag is required to be created in a specific workspace or\norganization, and this cannot be changed once set. Note that you can use\nthe workspace parameter regardless of whether or not it is an\norganization.\n\nReturns the full record of the newly created tag.\n\nThe persistent core model supports the response and query fields named in x-purple-suite-supported-response-fields and x-purple-suite-supported-query. Other fields/options return an explicit 400 errors envelope.",
"tags": [
"Tags"
],
"operationId": "createTagForWorkspace",
"parameters": [
{
"name": "opt_fields",
"in": "query",
"description": "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. Properties can include nested fields. To learn more, see the [input/output options guide](/docs/inputoutput-options#selecting-nested-fields).",
"required": false,
"example": [
"color",
"created_at",
"followers",
"followers.name",
"name",
"notes",
"permalink_url",
"workspace",
"workspace.name"
],
"schema": {
"type": "array",
"items": {
"type": "string",
"enum": [
"color",
"created_at",
"followers",
"followers.name",
"name",
"notes",
"permalink_url",
"workspace",
"workspace.name"
]
}
},
"style": "form",
"explode": false
}
],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
"data"
],
"additionalProperties": false,
"properties": {
"data": {
"type": "object",
"additionalProperties": false,
"required": [
"name"
],
"properties": {
"name": {
"type": "string"
},
"color": {
"type": "string",
"nullable": true
}
}
}
}
}
},
"application/x-www-form-urlencoded": {
"schema": {
"type": "object",
"additionalProperties": false,
"required": [
"name"
],
"properties": {
"name": {
"type": "string"
},
"color": {
"type": "string",
"nullable": true
}
}
}
}
}
},
"responses": {
"201": {
"description": "Successfully created the newly specified tag.",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"$ref": "#/components/schemas/TagResponse"
}
}
}
}
}
},
"400": {
"$ref": "#/components/responses/BadRequest"
},
"401": {
"$ref": "#/components/responses/Unauthorized"
},
"403": {
"$ref": "#/components/responses/Forbidden"
},
"404": {
"$ref": "#/components/responses/NotFound"
},
"500": {
"$ref": "#/components/responses/InternalServerError"
}
},
"security": [
{
"personalAccessToken": []
},
{
"oauth2": [
"tags:write"
]
}
],
"x-readme": {
"code-samples": [
{
"language": "java",
"install": "<dependency><groupId>com.asana</groupId><artifactId>asana</artifactId><version>1.0.0</version></dependency>",
"code": "import com.asana.Client;\n\nClient client = Client.accessToken(\"PERSONAL_ACCESS_TOKEN\");\n\nTag result = client.tags.createTagForWorkspace(workspaceGid)\n .data(\"field\", \"value\")\n .data(\"field\", \"value\")\n .option(\"pretty\", true)\n .execute();"
},
{
"language": "node",
"install": "npm install asana",
"code": "const Asana = require('asana');\n\nlet client = new Asana.ApiClient();\nclient.authentications.token.accessToken = '<YOUR_ACCESS_TOKEN>';\n\nlet tagsApiInstance = new Asana.TagsApi(client);\nlet body = {\"data\": {\"<PARAM_1>\": \"<VALUE_1>\", \"<PARAM_2>\": \"<VALUE_2>\",}}; // Object | The tag to create.\nlet workspace_gid = \"12345\"; // String | Globally unique identifier for the workspace or organization.\nlet opts = { \n 'opt_fields': \"color,created_at,followers,followers.name,name,notes,permalink_url,workspace,workspace.name\"\n};\ntagsApiInstance.createTagForWorkspace(body, workspace_gid, opts).then((result) => {\n console.log('API called successfully. Returned data: ' + JSON.stringify(result.data, null, 2));\n}, (error) => {\n console.error(error.response.body);\n});",
"name": "node-sdk-v3"
},
{
"language": "node",
"install": "npm install asana@1.0.5",
"code": "const asana = require('asana');\n\nconst client = asana.Client.create().useAccessToken('PERSONAL_ACCESS_TOKEN');\n\nclient.tags.createTagForWorkspace(workspaceGid, {field: \"value\", field: \"value\", pretty: true})\n .then((result) => {\n console.log(result);\n });",
"name": "node-sdk-v1"
},
{
"language": "python",
"install": "pip install asana",
"code": "import asana\nfrom asana.rest import ApiException\nfrom pprint import pprint\n\nconfiguration = asana.Configuration()\nconfiguration.access_token = '<YOUR_ACCESS_TOKEN>'\napi_client = asana.ApiClient(configuration)\n\n# create an instance of the API class\ntags_api_instance = asana.TagsApi(api_client)\nbody = {\"data\": {\"<PARAM_1>\": \"<VALUE_1>\", \"<PARAM_2>\": \"<VALUE_2>\",}} # dict | The tag to create.\nworkspace_gid = \"12345\" # str | Globally unique identifier for the workspace or organization.\nopts = {\n 'opt_fields': \"color,created_at,followers,followers.name,name,notes,permalink_url,workspace,workspace.name\", # list[str] | 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.\n}\n\ntry:\n # Create a tag in a workspace\n api_response = tags_api_instance.create_tag_for_workspace(body, workspace_gid, opts)\n pprint(api_response)\nexcept ApiException as e:\n print(\"Exception when calling TagsApi->create_tag_for_workspace: %s\\n\" % e)",
"name": "python-sdk-v5"
},
{
"language": "python",
"install": "pip install asana==3.2.3",
"code": "import asana\n\nclient = asana.Client.access_token('PERSONAL_ACCESS_TOKEN')\n\nresult = client.tags.create_tag_for_workspace(workspace_gid, {'field': 'value', 'field': 'value'}, opt_pretty=True)",
"name": "python-sdk-v3"
},
{
"language": "php",
"install": "composer require asana/asana",
"code": "<?php\nrequire 'vendor/autoload.php';\n\n$client = Asana\\Client::accessToken('PERSONAL_ACCESS_TOKEN');\n\n$result = $client->tags->createTagForWorkspace($workspace_gid, array('field' => 'value', 'field' => 'value'), array('opt_pretty' => 'true'))"
},
{
"language": "ruby",
"install": "gem install asana",
"code": "require 'asana'\n\nclient = Asana::Client.new do |c|\n c.authentication :access_token, 'PERSONAL_ACCESS_TOKEN'\nend\n\nresult = client.tags.create_tag_for_workspace(workspace_gid: 'workspace_gid', field: \"value\", field: \"value\", options: {pretty: true})"
}
]
},
"x-purple-suite-runtime": "modeled-core",
"x-purple-suite-supported-query": [
"opt_pretty",
"opt_fields"
],
"x-purple-suite-supported-response-fields": [
"gid",
"resource_type",
"resource_subtype",
"name",
"notes",
"completed",
"completed_at",
"created_at",
"modified_at",
"assignee",
"assignee_status",
"workspace",
"projects",
"memberships",
"parent",
"due_on",
"start_on",
"tags",
"dependencies",
"num_subtasks",
"archived",
"public",
"color",
"default_view",
"team",
"project",
"section",
"text",
"created_by",
"target",
"type",
"email",
"photo",
"is_organization"
]
}
GET /api/1.0/task_templates
Get multiple task templates
<b>Required scope: </b><code>task_templates:read</code>
Returns the compact task template records for some filtered set of task templates. You must specify a `project`
This operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.
Authentication
[
{
"personalAccessToken": []
},
{
"oauth2": [
"task_templates:read"
]
}
]
Path-level parameters and metadata
{
"parameters": [
{
"$ref": "#/components/parameters/pretty"
}
]
}
Request, responses and operation details
{
"summary": "Get multiple task templates",
"description": "<b>Required scope: </b><code>task_templates:read</code>\n\nReturns the compact task template records for some filtered set of task templates. You must specify a `project`\n\nThis operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.",
"tags": [
"Task templates"
],
"operationId": "getTaskTemplates",
"parameters": [
{
"$ref": "#/components/parameters/limit"
},
{
"$ref": "#/components/parameters/offset"
},
{
"name": "project",
"in": "query",
"description": "The project to filter task templates on.",
"schema": {
"type": "string"
},
"example": "321654",
"x-env-variable": "project"
},
{
"name": "opt_fields",
"in": "query",
"description": "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. Properties can include nested fields. To learn more, see the [input/output options guide](/docs/inputoutput-options#selecting-nested-fields).",
"required": false,
"example": [
"created_at",
"created_by",
"name",
"offset",
"path",
"project",
"template",
"uri"
],
"schema": {
"type": "array",
"items": {
"type": "string",
"enum": [
"created_at",
"created_by",
"name",
"offset",
"path",
"project",
"template",
"uri"
]
}
},
"style": "form",
"explode": false
}
],
"responses": {
"200": {
"description": "Successfully retrieved requested task templates",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"type": "array",
"items": {
"$ref": "#/components/schemas/TaskTemplateCompact"
}
},
"next_page": {
"$ref": "#/components/schemas/NextPage"
}
}
}
}
}
},
"400": {
"$ref": "#/components/responses/BadRequest"
},
"401": {
"$ref": "#/components/responses/Unauthorized"
},
"403": {
"$ref": "#/components/responses/Forbidden"
},
"404": {
"$ref": "#/components/responses/NotFound"
},
"500": {
"$ref": "#/components/responses/InternalServerError"
}
},
"security": [
{
"personalAccessToken": []
},
{
"oauth2": [
"task_templates:read"
]
}
],
"x-readme": {
"code-samples": [
{
"language": "node",
"install": "npm install asana",
"code": "const Asana = require('asana');\n\nlet client = new Asana.ApiClient();\nclient.authentications.token.accessToken = '<YOUR_ACCESS_TOKEN>';\n\nlet taskTemplatesApiInstance = new Asana.TaskTemplatesApi(client);\nlet opts = { \n 'limit': 50, \n 'offset': \"eyJ0eXAiOJiKV1iQLCJhbGciOiJIUzI1NiJ9\", \n 'project': \"321654\", \n 'opt_fields': \"created_at,created_by,name,project,template\"\n};\ntaskTemplatesApiInstance.getTaskTemplates(opts).then((result) => {\n console.log('API called successfully. Returned data: ' + JSON.stringify(result.data, null, 2));\n}, (error) => {\n console.error(error.response.body);\n});",
"name": "node-sdk-v3"
},
{
"language": "node",
"install": "npm install asana@1.0.5",
"code": "const asana = require('asana');\n\nconst client = asana.Client.create().useAccessToken('PERSONAL_ACCESS_TOKEN');\n\nclient.tasktemplates.getTaskTemplates({param: \"value\", param: \"value\", opt_pretty: true})\n .then((result) => {\n console.log(result);\n });",
"name": "node-sdk-v1"
},
{
"language": "python",
"install": "pip install asana",
"code": "import asana\nfrom asana.rest import ApiException\nfrom pprint import pprint\n\nconfiguration = asana.Configuration()\nconfiguration.access_token = '<YOUR_ACCESS_TOKEN>'\napi_client = asana.ApiClient(configuration)\n\n# create an instance of the API class\ntask_templates_api_instance = asana.TaskTemplatesApi(api_client)\nopts = {\n 'limit': 50, # int | Results per page. The number of objects to return per page. The value must be between 1 and 100.\n 'offset': \"eyJ0eXAiOJiKV1iQLCJhbGciOiJIUzI1NiJ9\", # str | 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.*\n 'project': \"321654\", # str | The project to filter task templates on.\n 'opt_fields': \"created_at,created_by,name,project,template\", # list[str] | 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.\n}\n\ntry:\n # Get multiple task templates\n api_response = task_templates_api_instance.get_task_templates(opts)\n for data in api_response:\n pprint(data)\nexcept ApiException as e:\n print(\"Exception when calling TaskTemplatesApi->get_task_templates: %s\\n\" % e)",
"name": "python-sdk-v5"
},
{
"language": "python",
"install": "pip install asana==3.2.3",
"code": "import asana\n\nclient = asana.Client.access_token('PERSONAL_ACCESS_TOKEN')\n\nresult = client.task_templates.get_task_templates({'param': 'value', 'param': 'value'}, opt_pretty=True)",
"name": "python-sdk-v3"
}
]
},
"x-purple-suite-runtime": "unavailable"
}
GET /api/1.0/task_templates/{task_template_gid}
Get a task template
<b>Required scope: </b><code>task_templates:read</code>
Returns the complete task template record for a single task template.
This operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.
Authentication
[
{
"personalAccessToken": []
},
{
"oauth2": [
"task_templates:read"
]
}
]
Path-level parameters and metadata
{
"parameters": [
{
"$ref": "#/components/parameters/task_template_path_gid"
},
{
"$ref": "#/components/parameters/pretty"
}
]
}
Request, responses and operation details
{
"summary": "Get a task template",
"description": "<b>Required scope: </b><code>task_templates:read</code>\n\nReturns the complete task template record for a single task template.\n\nThis operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.",
"tags": [
"Task templates"
],
"operationId": "getTaskTemplate",
"parameters": [
{
"name": "opt_fields",
"in": "query",
"description": "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. Properties can include nested fields. To learn more, see the [input/output options guide](/docs/inputoutput-options#selecting-nested-fields).",
"required": false,
"example": [
"created_at",
"created_by",
"name",
"project",
"template"
],
"schema": {
"type": "array",
"items": {
"type": "string",
"enum": [
"created_at",
"created_by",
"name",
"project",
"template"
]
}
},
"style": "form",
"explode": false
}
],
"responses": {
"200": {
"description": "Successfully retrieved requested task template",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"$ref": "#/components/schemas/TaskTemplateResponse"
}
}
}
}
}
},
"400": {
"$ref": "#/components/responses/BadRequest"
},
"401": {
"$ref": "#/components/responses/Unauthorized"
},
"403": {
"$ref": "#/components/responses/Forbidden"
},
"404": {
"$ref": "#/components/responses/NotFound"
},
"500": {
"$ref": "#/components/responses/InternalServerError"
}
},
"security": [
{
"personalAccessToken": []
},
{
"oauth2": [
"task_templates:read"
]
}
],
"x-readme": {
"code-samples": [
{
"language": "node",
"install": "npm install asana",
"code": "const Asana = require('asana');\n\nlet client = new Asana.ApiClient();\nclient.authentications.token.accessToken = '<YOUR_ACCESS_TOKEN>';\n\nlet taskTemplatesApiInstance = new Asana.TaskTemplatesApi(client);\nlet task_template_gid = \"1331\"; // String | Globally unique identifier for the task template.\nlet opts = { \n 'opt_fields': \"created_at,created_by,name,project,template\"\n};\ntaskTemplatesApiInstance.getTaskTemplate(task_template_gid, opts).then((result) => {\n console.log('API called successfully. Returned data: ' + JSON.stringify(result.data, null, 2));\n}, (error) => {\n console.error(error.response.body);\n});",
"name": "node-sdk-v3"
},
{
"language": "node",
"install": "npm install asana@1.0.5",
"code": "const asana = require('asana');\n\nconst client = asana.Client.create().useAccessToken('PERSONAL_ACCESS_TOKEN');\n\nclient.tasktemplates.getTaskTemplate(taskTemplateGid, {param: \"value\", param: \"value\", opt_pretty: true})\n .then((result) => {\n console.log(result);\n });",
"name": "node-sdk-v1"
},
{
"language": "python",
"install": "pip install asana",
"code": "import asana\nfrom asana.rest import ApiException\nfrom pprint import pprint\n\nconfiguration = asana.Configuration()\nconfiguration.access_token = '<YOUR_ACCESS_TOKEN>'\napi_client = asana.ApiClient(configuration)\n\n# create an instance of the API class\ntask_templates_api_instance = asana.TaskTemplatesApi(api_client)\ntask_template_gid = \"1331\" # str | Globally unique identifier for the task template.\nopts = {\n 'opt_fields': \"created_at,created_by,name,project,template\", # list[str] | 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.\n}\n\ntry:\n # Get a task template\n api_response = task_templates_api_instance.get_task_template(task_template_gid, opts)\n pprint(api_response)\nexcept ApiException as e:\n print(\"Exception when calling TaskTemplatesApi->get_task_template: %s\\n\" % e)",
"name": "python-sdk-v5"
},
{
"language": "python",
"install": "pip install asana==3.2.3",
"code": "import asana\n\nclient = asana.Client.access_token('PERSONAL_ACCESS_TOKEN')\n\nresult = client.task_templates.get_task_template(task_template_gid, {'param': 'value', 'param': 'value'}, opt_pretty=True)",
"name": "python-sdk-v3"
}
]
},
"x-purple-suite-runtime": "unavailable"
}
DELETE /api/1.0/task_templates/{task_template_gid}
Delete a task template
A specific, existing task template can be deleted by making a DELETE request on the URL for that task template. Returns an empty data record.
This operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.
Authentication
[
{
"personalAccessToken": []
},
{
"oauth2": []
}
]
Path-level parameters and metadata
{
"parameters": [
{
"$ref": "#/components/parameters/task_template_path_gid"
},
{
"$ref": "#/components/parameters/pretty"
}
]
}
Request, responses and operation details
{
"summary": "Delete a task template",
"description": "A specific, existing task template can be deleted by making a DELETE request on the URL for that task template. Returns an empty data record.\n\nThis operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.",
"tags": [
"Task templates"
],
"operationId": "deleteTaskTemplate",
"responses": {
"200": {
"description": "Successfully deleted the specified task template.",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"$ref": "#/components/schemas/EmptyResponse"
}
}
}
}
}
},
"400": {
"$ref": "#/components/responses/BadRequest"
},
"401": {
"$ref": "#/components/responses/Unauthorized"
},
"402": {
"$ref": "#/components/responses/PaymentRequired"
},
"403": {
"$ref": "#/components/responses/Forbidden"
},
"404": {
"$ref": "#/components/responses/NotFound"
},
"500": {
"$ref": "#/components/responses/InternalServerError"
}
},
"security": [
{
"personalAccessToken": []
},
{
"oauth2": []
}
],
"x-readme": {
"code-samples": [
{
"language": "node",
"install": "npm install asana",
"code": "const Asana = require('asana');\n\nlet client = new Asana.ApiClient();\nclient.authentications.token.accessToken = '<YOUR_ACCESS_TOKEN>';\n\nlet taskTemplatesApiInstance = new Asana.TaskTemplatesApi(client);\nlet task_template_gid = \"1331\"; // String | Globally unique identifier for the task template.\n\ntaskTemplatesApiInstance.deleteTaskTemplate(task_template_gid).then((result) => {\n console.log('API called successfully. Returned data: ' + JSON.stringify(result.data, null, 2));\n}, (error) => {\n console.error(error.response.body);\n});",
"name": "node-sdk-v3"
},
{
"language": "node",
"install": "npm install asana@1.0.5",
"code": "const asana = require('asana');\n\nconst client = asana.Client.create().useAccessToken('PERSONAL_ACCESS_TOKEN');\n\nclient.tasktemplates.deleteTaskTemplate(taskTemplateGid)\n .then((result) => {\n console.log(result);\n });",
"name": "node-sdk-v1"
},
{
"language": "python",
"install": "pip install asana",
"code": "import asana\nfrom asana.rest import ApiException\nfrom pprint import pprint\n\nconfiguration = asana.Configuration()\nconfiguration.access_token = '<YOUR_ACCESS_TOKEN>'\napi_client = asana.ApiClient(configuration)\n\n# create an instance of the API class\ntask_templates_api_instance = asana.TaskTemplatesApi(api_client)\ntask_template_gid = \"1331\" # str | Globally unique identifier for the task template.\n\n\ntry:\n # Delete a task template\n api_response = task_templates_api_instance.delete_task_template(task_template_gid)\n pprint(api_response)\nexcept ApiException as e:\n print(\"Exception when calling TaskTemplatesApi->delete_task_template: %s\\n\" % e)",
"name": "python-sdk-v5"
},
{
"language": "python",
"install": "pip install asana==3.2.3",
"code": "import asana\n\nclient = asana.Client.access_token('PERSONAL_ACCESS_TOKEN')\n\nresult = client.task_templates.delete_task_template(task_template_gid, opt_pretty=True)",
"name": "python-sdk-v3"
}
]
},
"x-purple-suite-runtime": "unavailable"
}
POST /api/1.0/task_templates/{task_template_gid}/instantiateTask
Instantiate a task from a task template
Creates and returns a job that will asynchronously handle the task instantiation.
This operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.
Authentication
[
{
"personalAccessToken": []
},
{
"oauth2": []
}
]
Path-level parameters and metadata
{
"parameters": [
{
"$ref": "#/components/parameters/task_template_path_gid"
},
{
"$ref": "#/components/parameters/pretty"
}
]
}
Request, responses and operation details
{
"summary": "Instantiate a task from a task template",
"description": "Creates and returns a job that will asynchronously handle the task instantiation.\n\nThis operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.",
"tags": [
"Task templates"
],
"operationId": "instantiateTask",
"parameters": [
{
"name": "opt_fields",
"in": "query",
"description": "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. Properties can include nested fields. To learn more, see the [input/output options guide](/docs/inputoutput-options#selecting-nested-fields).",
"required": false,
"example": [
"new_graph_export",
"new_graph_export.completed_at",
"new_graph_export.created_at",
"new_graph_export.download_url",
"new_portfolio",
"new_portfolio.name",
"new_portfolio.resource_subtype",
"new_project",
"new_project.name",
"new_project.resource_subtype",
"new_project_template",
"new_project_template.name",
"new_resource_export",
"new_resource_export.completed_at",
"new_resource_export.created_at",
"new_resource_export.download_url",
"new_task",
"new_task.created_by",
"new_task.name",
"new_task.resource_subtype",
"resource_subtype",
"status"
],
"schema": {
"type": "array",
"items": {
"type": "string",
"enum": [
"new_graph_export",
"new_graph_export.completed_at",
"new_graph_export.created_at",
"new_graph_export.download_url",
"new_portfolio",
"new_portfolio.name",
"new_portfolio.resource_subtype",
"new_project",
"new_project.name",
"new_project.resource_subtype",
"new_project_template",
"new_project_template.name",
"new_resource_export",
"new_resource_export.completed_at",
"new_resource_export.created_at",
"new_resource_export.download_url",
"new_task",
"new_task.created_by",
"new_task.name",
"new_task.resource_subtype",
"resource_subtype",
"status"
]
}
},
"style": "form",
"explode": false
}
],
"requestBody": {
"description": "Describes the inputs used for instantiating a task - the task's name.",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"$ref": "#/components/schemas/TaskTemplateInstantiateTaskRequest"
}
}
}
}
}
},
"responses": {
"201": {
"description": "Successfully created the job to handle task instantiation.",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"$ref": "#/components/schemas/JobResponse"
}
}
}
}
}
},
"400": {
"$ref": "#/components/responses/BadRequest"
},
"401": {
"$ref": "#/components/responses/Unauthorized"
},
"403": {
"$ref": "#/components/responses/Forbidden"
},
"404": {
"$ref": "#/components/responses/NotFound"
},
"500": {
"$ref": "#/components/responses/InternalServerError"
}
},
"security": [
{
"personalAccessToken": []
},
{
"oauth2": []
}
],
"x-readme": {
"code-samples": [
{
"language": "node",
"install": "npm install asana",
"code": "const Asana = require('asana');\n\nlet client = new Asana.ApiClient();\nclient.authentications.token.accessToken = '<YOUR_ACCESS_TOKEN>';\n\nlet taskTemplatesApiInstance = new Asana.TaskTemplatesApi(client);\nlet task_template_gid = \"1331\"; // String | Globally unique identifier for the task template.\nlet opts = { \n 'body': {\"data\": {\"<PARAM_1>\": \"<VALUE_1>\", \"<PARAM_2>\": \"<VALUE_2>\",}}, \n 'opt_fields': \"new_graph_export,new_graph_export.completed_at,new_graph_export.created_at,new_graph_export.download_url,new_portfolio,new_portfolio.name,new_portfolio.resource_subtype,new_project,new_project.name,new_project.resource_subtype,new_project_template,new_project_template.name,new_resource_export,new_resource_export.completed_at,new_resource_export.created_at,new_resource_export.download_url,new_task,new_task.created_by,new_task.name,new_task.resource_subtype,resource_subtype,status\"\n};\ntaskTemplatesApiInstance.instantiateTask(task_template_gid, opts).then((result) => {\n console.log('API called successfully. Returned data: ' + JSON.stringify(result.data, null, 2));\n}, (error) => {\n console.error(error.response.body);\n});",
"name": "node-sdk-v3"
},
{
"language": "node",
"install": "npm install asana@1.0.5",
"code": "const asana = require('asana');\n\nconst client = asana.Client.create().useAccessToken('PERSONAL_ACCESS_TOKEN');\n\nclient.tasktemplates.instantiateTask(taskTemplateGid, {field: \"value\", field: \"value\", pretty: true})\n .then((result) => {\n console.log(result);\n });",
"name": "node-sdk-v1"
},
{
"language": "python",
"install": "pip install asana",
"code": "import asana\nfrom asana.rest import ApiException\nfrom pprint import pprint\n\nconfiguration = asana.Configuration()\nconfiguration.access_token = '<YOUR_ACCESS_TOKEN>'\napi_client = asana.ApiClient(configuration)\n\n# create an instance of the API class\ntask_templates_api_instance = asana.TaskTemplatesApi(api_client)\ntask_template_gid = \"1331\" # str | Globally unique identifier for the task template.\nopts = {\n 'body': {\"data\": {\"<PARAM_1>\": \"<VALUE_1>\", \"<PARAM_2>\": \"<VALUE_2>\",}}, # dict | Describes the inputs used for instantiating a task - the task's name.\n 'opt_fields': \"new_graph_export,new_graph_export.completed_at,new_graph_export.created_at,new_graph_export.download_url,new_portfolio,new_portfolio.name,new_portfolio.resource_subtype,new_project,new_project.name,new_project.resource_subtype,new_project_template,new_project_template.name,new_resource_export,new_resource_export.completed_at,new_resource_export.created_at,new_resource_export.download_url,new_task,new_task.created_by,new_task.name,new_task.resource_subtype,resource_subtype,status\", # list[str] | 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.\n}\n\ntry:\n # Instantiate a task from a task template\n api_response = task_templates_api_instance.instantiate_task(task_template_gid, opts)\n pprint(api_response)\nexcept ApiException as e:\n print(\"Exception when calling TaskTemplatesApi->instantiate_task: %s\\n\" % e)",
"name": "python-sdk-v5"
},
{
"language": "python",
"install": "pip install asana==3.2.3",
"code": "import asana\n\nclient = asana.Client.access_token('PERSONAL_ACCESS_TOKEN')\n\nresult = client.task_templates.instantiate_task(task_template_gid, {'field': 'value', 'field': 'value'}, opt_pretty=True)",
"name": "python-sdk-v3"
}
]
},
"x-purple-suite-runtime": "unavailable"
}
GET /api/1.0/tasks
Get multiple tasks
<b>Required scope: </b><code>tasks:read</code>
Returns the compact task records for some filtered set of tasks. Use one or more of the parameters provided to filter the tasks returned. You must specify a `project` or `tag` if you do not specify `assignee` and `workspace`.
For more complex task retrieval, use [workspaces/{workspace_gid}/tasks/search](/reference/searchtasksforworkspace).
The persistent core model supports the response and query fields named in x-purple-suite-supported-response-fields and x-purple-suite-supported-query. Other fields/options return an explicit 400 errors envelope.
Authentication
[
{
"personalAccessToken": []
},
{
"oauth2": [
"tasks:read"
]
}
]
Path-level parameters and metadata
{
"parameters": [
{
"$ref": "#/components/parameters/pretty"
}
]
}
Request, responses and operation details
{
"summary": "Get multiple tasks",
"description": "<b>Required scope: </b><code>tasks:read</code>\n\nReturns the compact task records for some filtered set of tasks. Use one or more of the parameters provided to filter the tasks returned. You must specify a `project` or `tag` if you do not specify `assignee` and `workspace`.\n\nFor more complex task retrieval, use [workspaces/{workspace_gid}/tasks/search](/reference/searchtasksforworkspace).\n\nThe persistent core model supports the response and query fields named in x-purple-suite-supported-response-fields and x-purple-suite-supported-query. Other fields/options return an explicit 400 errors envelope.",
"tags": [
"Tasks"
],
"operationId": "getTasks",
"parameters": [
{
"$ref": "#/components/parameters/limit"
},
{
"$ref": "#/components/parameters/offset"
},
{
"name": "assignee",
"in": "query",
"description": "The assignee to filter tasks on. If searching for unassigned tasks, assignee.any = null can be specified.\n*Note: If you specify `assignee`, you must also specify the `workspace` to filter on.*",
"schema": {
"type": "string"
},
"x-env-variable": "assignee",
"example": "14641"
},
{
"name": "project",
"in": "query",
"description": "The project to filter tasks on.",
"schema": {
"type": "string"
},
"example": "321654",
"x-env-variable": "project"
},
{
"name": "section",
"in": "query",
"description": "The section to filter tasks on.",
"schema": {
"type": "string"
},
"example": "321654",
"x-env-variable": "section"
},
{
"name": "workspace",
"in": "query",
"description": "The workspace to filter tasks on.\n*Note: If you specify `workspace`, you must also specify the `assignee` to filter on.*",
"schema": {
"type": "string"
},
"example": "321654",
"x-env-variable": "workspace"
},
{
"name": "completed_since",
"in": "query",
"description": "Only return tasks that are either incomplete or that have been completed since this time.",
"schema": {
"type": "string",
"format": "date-time",
"example": "2012-02-22T02:06:58.158Z"
}
},
{
"name": "modified_since",
"in": "query",
"description": "Only return tasks that have been modified since the given time.\n\n*Note: A task is considered “modified” if any of its properties\nchange, or associations between it and other objects are modified\n(e.g. a task being added to a project). A task is not considered\nmodified just because another object it is associated with (e.g. a\nsubtask) is modified. Actions that count as modifying the task\ninclude assigning, renaming, completing, and adding stories.*",
"schema": {
"type": "string",
"format": "date-time"
},
"example": "2012-02-22T02:06:58.158Z"
},
{
"$ref": "#/components/parameters/custom_type_query_param"
},
{
"name": "opt_fields",
"in": "query",
"description": "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. Properties can include nested fields. To learn more, see the [input/output options guide](/docs/inputoutput-options#selecting-nested-fields).",
"required": false,
"example": [
"actual_time_minutes",
"approval_status",
"assigned_by",
"assigned_by.name",
"assignee",
"assignee.name",
"assignee_section",
"assignee_section.name",
"assignee_status",
"completed",
"completed_at",
"completed_by",
"completed_by.name",
"created_at",
"created_by",
"custom_fields",
"custom_fields.asana_created_field",
"custom_fields.created_by",
"custom_fields.created_by.name",
"custom_fields.currency_code",
"custom_fields.custom_label",
"custom_fields.custom_label_position",
"custom_fields.date_value",
"custom_fields.date_value.date",
"custom_fields.date_value.date_time",
"custom_fields.default_access_level",
"custom_fields.description",
"custom_fields.display_value",
"custom_fields.enabled",
"custom_fields.enum_options",
"custom_fields.enum_options.color",
"custom_fields.enum_options.enabled",
"custom_fields.enum_options.name",
"custom_fields.enum_value",
"custom_fields.enum_value.color",
"custom_fields.enum_value.enabled",
"custom_fields.enum_value.name",
"custom_fields.format",
"custom_fields.has_notifications_enabled",
"custom_fields.html_text_value",
"custom_fields.id_prefix",
"custom_fields.input_restrictions",
"custom_fields.is_formula_field",
"custom_fields.is_global_to_workspace",
"custom_fields.is_value_read_only",
"custom_fields.multi_enum_values",
"custom_fields.multi_enum_values.color",
"custom_fields.multi_enum_values.enabled",
"custom_fields.multi_enum_values.name",
"custom_fields.name",
"custom_fields.number_value",
"custom_fields.people_value",
"custom_fields.people_value.name",
"custom_fields.precision",
"custom_fields.privacy_setting",
"custom_fields.reference_value",
"custom_fields.reference_value.name",
"custom_fields.representation_type",
"custom_fields.resource_subtype",
"custom_fields.text_value",
"custom_fields.type",
"custom_type",
"custom_type.asana_created_type_identifier",
"custom_type.name",
"custom_type_status_option",
"custom_type_status_option.name",
"dependencies",
"dependents",
"due_at",
"due_on",
"effective_memberships",
"external",
"external.data",
"followers",
"followers.name",
"hearted",
"hearts",
"hearts.user",
"hearts.user.name",
"html_notes",
"is_rendered_as_separator",
"liked",
"likes",
"likes.user",
"likes.user.name",
"memberships",
"memberships.project",
"memberships.project.name",
"memberships.project.resource_subtype",
"memberships.section",
"memberships.section.name",
"modified_at",
"name",
"notes",
"num_hearts",
"num_likes",
"num_subtasks",
"offset",
"parent",
"parent.created_by",
"parent.name",
"parent.resource_subtype",
"path",
"permalink_url",
"projects",
"projects.name",
"projects.resource_subtype",
"resource_subtype",
"start_at",
"start_on",
"tags",
"tags.name",
"uri",
"workspace",
"workspace.name"
],
"schema": {
"type": "array",
"items": {
"type": "string",
"enum": [
"actual_time_minutes",
"approval_status",
"assigned_by",
"assigned_by.name",
"assignee",
"assignee.name",
"assignee_section",
"assignee_section.name",
"assignee_status",
"completed",
"completed_at",
"completed_by",
"completed_by.name",
"created_at",
"created_by",
"custom_fields",
"custom_fields.asana_created_field",
"custom_fields.created_by",
"custom_fields.created_by.name",
"custom_fields.currency_code",
"custom_fields.custom_label",
"custom_fields.custom_label_position",
"custom_fields.date_value",
"custom_fields.date_value.date",
"custom_fields.date_value.date_time",
"custom_fields.default_access_level",
"custom_fields.description",
"custom_fields.display_value",
"custom_fields.enabled",
"custom_fields.enum_options",
"custom_fields.enum_options.color",
"custom_fields.enum_options.enabled",
"custom_fields.enum_options.name",
"custom_fields.enum_value",
"custom_fields.enum_value.color",
"custom_fields.enum_value.enabled",
"custom_fields.enum_value.name",
"custom_fields.format",
"custom_fields.has_notifications_enabled",
"custom_fields.html_text_value",
"custom_fields.id_prefix",
"custom_fields.input_restrictions",
"custom_fields.is_formula_field",
"custom_fields.is_global_to_workspace",
"custom_fields.is_value_read_only",
"custom_fields.multi_enum_values",
"custom_fields.multi_enum_values.color",
"custom_fields.multi_enum_values.enabled",
"custom_fields.multi_enum_values.name",
"custom_fields.name",
"custom_fields.number_value",
"custom_fields.people_value",
"custom_fields.people_value.name",
"custom_fields.precision",
"custom_fields.privacy_setting",
"custom_fields.reference_value",
"custom_fields.reference_value.name",
"custom_fields.representation_type",
"custom_fields.resource_subtype",
"custom_fields.text_value",
"custom_fields.type",
"custom_type",
"custom_type.asana_created_type_identifier",
"custom_type.name",
"custom_type_status_option",
"custom_type_status_option.name",
"dependencies",
"dependents",
"due_at",
"due_on",
"effective_memberships",
"external",
"external.data",
"followers",
"followers.name",
"hearted",
"hearts",
"hearts.user",
"hearts.user.name",
"html_notes",
"is_rendered_as_separator",
"liked",
"likes",
"likes.user",
"likes.user.name",
"memberships",
"memberships.project",
"memberships.project.name",
"memberships.project.resource_subtype",
"memberships.section",
"memberships.section.name",
"modified_at",
"name",
"notes",
"num_hearts",
"num_likes",
"num_subtasks",
"offset",
"parent",
"parent.created_by",
"parent.name",
"parent.resource_subtype",
"path",
"permalink_url",
"projects",
"projects.name",
"projects.resource_subtype",
"resource_subtype",
"start_at",
"start_on",
"tags",
"tags.name",
"uri",
"workspace",
"workspace.name"
]
}
},
"style": "form",
"explode": false
}
],
"responses": {
"200": {
"description": "Successfully retrieved requested tasks.",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"type": "array",
"items": {
"$ref": "#/components/schemas/TaskCompact"
}
},
"next_page": {
"$ref": "#/components/schemas/NextPage"
}
}
}
}
}
},
"400": {
"$ref": "#/components/responses/BadRequest"
},
"401": {
"$ref": "#/components/responses/Unauthorized"
},
"403": {
"$ref": "#/components/responses/Forbidden"
},
"404": {
"$ref": "#/components/responses/NotFound"
},
"500": {
"$ref": "#/components/responses/InternalServerError"
}
},
"security": [
{
"personalAccessToken": []
},
{
"oauth2": [
"tasks:read"
]
}
],
"x-readme": {
"code-samples": [
{
"language": "java",
"install": "<dependency><groupId>com.asana</groupId><artifactId>asana</artifactId><version>1.0.0</version></dependency>",
"code": "import com.asana.Client;\n\nClient client = Client.accessToken(\"PERSONAL_ACCESS_TOKEN\");\n\nList<Task> result = client.tasks.getTasks(modifiedSince, completedSince, workspace, section, project, assignee)\n .option(\"pretty\", true)\n .execute();"
},
{
"language": "node",
"install": "npm install asana",
"code": "const Asana = require('asana');\n\nlet client = new Asana.ApiClient();\nclient.authentications.token.accessToken = '<YOUR_ACCESS_TOKEN>';\n\nlet tasksApiInstance = new Asana.TasksApi(client);\nlet opts = { \n 'limit': 50, \n 'offset': \"eyJ0eXAiOJiKV1iQLCJhbGciOiJIUzI1NiJ9\", \n 'assignee': \"14641\", \n 'project': \"321654\", \n 'section': \"321654\", \n 'workspace': \"321654\", \n 'completed_since': \"2012-02-22T02:06:58.158Z\", \n 'modified_since': \"2012-02-22T02:06:58.158Z\", \n 'custom_type': \"12345\", \n 'opt_fields': \"actual_time_minutes,approval_status,assigned_by,assigned_by.name,assignee,assignee.name,assignee_section,assignee_section.name,assignee_status,completed,completed_at,completed_by,completed_by.name,created_at,created_by,custom_fields,custom_fields.asana_created_field,custom_fields.created_by,custom_fields.created_by.name,custom_fields.currency_code,custom_fields.custom_label,custom_fields.custom_label_position,custom_fields.date_value,custom_fields.date_value.date,custom_fields.date_value.date_time,custom_fields.default_access_level,custom_fields.description,custom_fields.display_value,custom_fields.enabled,custom_fields.enum_options,custom_fields.enum_options.color,custom_fields.enum_options.enabled,custom_fields.enum_options.name,custom_fields.enum_value,custom_fields.enum_value.color,custom_fields.enum_value.enabled,custom_fields.enum_value.name,custom_fields.format,custom_fields.has_notifications_enabled,custom_fields.html_text_value,custom_fields.id_prefix,custom_fields.input_restrictions,custom_fields.is_formula_field,custom_fields.is_global_to_workspace,custom_fields.is_value_read_only,custom_fields.multi_enum_values,custom_fields.multi_enum_values.color,custom_fields.multi_enum_values.enabled,custom_fields.multi_enum_values.name,custom_fields.name,custom_fields.number_value,custom_fields.people_value,custom_fields.people_value.name,custom_fields.precision,custom_fields.privacy_setting,custom_fields.reference_value,custom_fields.reference_value.name,custom_fields.representation_type,custom_fields.resource_subtype,custom_fields.text_value,custom_fields.type,custom_type,custom_type.asana_created_type_identifier,custom_type.name,custom_type_status_option,custom_type_status_option.name,dependencies,dependents,due_at,due_on,effective_memberships,external,external.data,followers,followers.name,hearted,hearts,hearts.user,hearts.user.name,html_notes,is_rendered_as_separator,liked,likes,likes.user,likes.user.name,memberships,memberships.project,memberships.project.name,memberships.project.resource_subtype,memberships.section,memberships.section.name,modified_at,name,notes,num_hearts,num_likes,num_subtasks,offset,parent,parent.created_by,parent.name,parent.resource_subtype,path,permalink_url,projects,projects.name,projects.resource_subtype,resource_subtype,start_at,start_on,tags,tags.name,uri,workspace,workspace.name\"\n};\ntasksApiInstance.getTasks(opts).then((result) => {\n console.log('API called successfully. Returned data: ' + JSON.stringify(result.data, null, 2));\n}, (error) => {\n console.error(error.response.body);\n});",
"name": "node-sdk-v3"
},
{
"language": "node",
"install": "npm install asana@1.0.5",
"code": "const asana = require('asana');\n\nconst client = asana.Client.create().useAccessToken('PERSONAL_ACCESS_TOKEN');\n\nclient.tasks.getTasks({param: \"value\", param: \"value\", opt_pretty: true})\n .then((result) => {\n console.log(result);\n });",
"name": "node-sdk-v1"
},
{
"language": "python",
"install": "pip install asana",
"code": "import asana\nfrom asana.rest import ApiException\nfrom pprint import pprint\n\nconfiguration = asana.Configuration()\nconfiguration.access_token = '<YOUR_ACCESS_TOKEN>'\napi_client = asana.ApiClient(configuration)\n\n# create an instance of the API class\ntasks_api_instance = asana.TasksApi(api_client)\nopts = {\n 'limit': 50, # int | Results per page. The number of objects to return per page. The value must be between 1 and 100.\n 'offset': \"eyJ0eXAiOJiKV1iQLCJhbGciOiJIUzI1NiJ9\", # str | 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.*\n 'assignee': \"14641\", # str | The assignee to filter tasks on. If searching for unassigned tasks, assignee.any = null can be specified. *Note: If you specify `assignee`, you must also specify the `workspace` to filter on.*\n 'project': \"321654\", # str | The project to filter tasks on.\n 'section': \"321654\", # str | The section to filter tasks on.\n 'workspace': \"321654\", # str | The workspace to filter tasks on. *Note: If you specify `workspace`, you must also specify the `assignee` to filter on.*\n 'completed_since': '2012-02-22T02:06:58.158Z', # datetime | Only return tasks that are either incomplete or that have been completed since this time.\n 'modified_since': '2012-02-22T02:06:58.158Z', # datetime | Only return tasks that have been modified since the given time. *Note: A task is considered “modified” if any of its properties change, or associations between it and other objects are modified (e.g. a task being added to a project). A task is not considered modified just because another object it is associated with (e.g. a subtask) is modified. Actions that count as modifying the task include assigning, renaming, completing, and adding stories.*\n 'custom_type': \"12345\", # str | Filter results by custom type. Provide a custom type GID to return only objects of that custom type (an unknown GID returns `400`). Provide an empty string to return only objects with no custom type assigned. If this parameter is omitted, results are not filtered by custom type.\n 'opt_fields': \"actual_time_minutes,approval_status,assigned_by,assigned_by.name,assignee,assignee.name,assignee_section,assignee_section.name,assignee_status,completed,completed_at,completed_by,completed_by.name,created_at,created_by,custom_fields,custom_fields.asana_created_field,custom_fields.created_by,custom_fields.created_by.name,custom_fields.currency_code,custom_fields.custom_label,custom_fields.custom_label_position,custom_fields.date_value,custom_fields.date_value.date,custom_fields.date_value.date_time,custom_fields.default_access_level,custom_fields.description,custom_fields.display_value,custom_fields.enabled,custom_fields.enum_options,custom_fields.enum_options.color,custom_fields.enum_options.enabled,custom_fields.enum_options.name,custom_fields.enum_value,custom_fields.enum_value.color,custom_fields.enum_value.enabled,custom_fields.enum_value.name,custom_fields.format,custom_fields.has_notifications_enabled,custom_fields.html_text_value,custom_fields.id_prefix,custom_fields.input_restrictions,custom_fields.is_formula_field,custom_fields.is_global_to_workspace,custom_fields.is_value_read_only,custom_fields.multi_enum_values,custom_fields.multi_enum_values.color,custom_fields.multi_enum_values.enabled,custom_fields.multi_enum_values.name,custom_fields.name,custom_fields.number_value,custom_fields.people_value,custom_fields.people_value.name,custom_fields.precision,custom_fields.privacy_setting,custom_fields.reference_value,custom_fields.reference_value.name,custom_fields.representation_type,custom_fields.resource_subtype,custom_fields.text_value,custom_fields.type,custom_type,custom_type.asana_created_type_identifier,custom_type.name,custom_type_status_option,custom_type_status_option.name,dependencies,dependents,due_at,due_on,effective_memberships,external,external.data,followers,followers.name,hearted,hearts,hearts.user,hearts.user.name,html_notes,is_rendered_as_separator,liked,likes,likes.user,likes.user.name,memberships,memberships.project,memberships.project.name,memberships.project.resource_subtype,memberships.section,memberships.section.name,modified_at,name,notes,num_hearts,num_likes,num_subtasks,offset,parent,parent.created_by,parent.name,parent.resource_subtype,path,permalink_url,projects,projects.name,projects.resource_subtype,resource_subtype,start_at,start_on,tags,tags.name,uri,workspace,workspace.name\", # list[str] | 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.\n}\n\ntry:\n # Get multiple tasks\n api_response = tasks_api_instance.get_tasks(opts)\n for data in api_response:\n pprint(data)\nexcept ApiException as e:\n print(\"Exception when calling TasksApi->get_tasks: %s\\n\" % e)",
"name": "python-sdk-v5"
},
{
"language": "python",
"install": "pip install asana==3.2.3",
"code": "import asana\n\nclient = asana.Client.access_token('PERSONAL_ACCESS_TOKEN')\n\nresult = client.tasks.get_tasks({'param': 'value', 'param': 'value'}, opt_pretty=True)",
"name": "python-sdk-v3"
},
{
"language": "php",
"install": "composer require asana/asana",
"code": "<?php\nrequire 'vendor/autoload.php';\n\n$client = Asana\\Client::accessToken('PERSONAL_ACCESS_TOKEN');\n\n$result = $client->tasks->getTasks(array('param' => 'value', 'param' => 'value'), array('opt_pretty' => 'true'))"
},
{
"language": "ruby",
"install": "gem install asana",
"code": "require 'asana'\n\nclient = Asana::Client.new do |c|\n c.authentication :access_token, 'PERSONAL_ACCESS_TOKEN'\nend\n\nresult = client.tasks.get_tasks(param: \"value\", param: \"value\", options: {pretty: true})"
}
]
},
"x-purple-suite-runtime": "modeled-core",
"x-purple-suite-supported-query": [
"opt_pretty",
"limit",
"offset",
"assignee",
"project",
"section",
"workspace",
"completed_since",
"modified_since",
"opt_fields"
],
"x-purple-suite-supported-response-fields": [
"gid",
"resource_type",
"resource_subtype",
"name",
"notes",
"completed",
"completed_at",
"created_at",
"modified_at",
"assignee",
"assignee_status",
"workspace",
"projects",
"memberships",
"parent",
"due_on",
"start_on",
"tags",
"dependencies",
"num_subtasks",
"archived",
"public",
"color",
"default_view",
"team",
"project",
"section",
"text",
"created_by",
"target",
"type",
"email",
"photo",
"is_organization"
]
}
POST /api/1.0/tasks
Create a task
<b>Required scope: </b><code>tasks:write</code>
Creating a new task is as easy as POSTing to the `/tasks` endpoint with a
data block containing the fields you’d like to set on the task. Any
unspecified fields will take on default values.
Every task is required to be created in a specific workspace, and this
workspace cannot be changed once set. The workspace need not be set
explicitly if you specify `projects` or a `parent` task instead.
The persistent core model supports the response and query fields named in x-purple-suite-supported-response-fields and x-purple-suite-supported-query. Other fields/options return an explicit 400 errors envelope.
Authentication
[
{
"personalAccessToken": []
},
{
"oauth2": [
"tasks:write"
]
}
]
Path-level parameters and metadata
{
"parameters": [
{
"$ref": "#/components/parameters/pretty"
}
]
}
Request, responses and operation details
{
"summary": "Create a task",
"description": "<b>Required scope: </b><code>tasks:write</code>\n\nCreating a new task is as easy as POSTing to the `/tasks` endpoint with a\ndata block containing the fields you’d like to set on the task. Any\nunspecified fields will take on default values.\n\nEvery task is required to be created in a specific workspace, and this\nworkspace cannot be changed once set. The workspace need not be set\nexplicitly if you specify `projects` or a `parent` task instead.\n\nThe persistent core model supports the response and query fields named in x-purple-suite-supported-response-fields and x-purple-suite-supported-query. Other fields/options return an explicit 400 errors envelope.",
"tags": [
"Tasks"
],
"operationId": "createTask",
"parameters": [
{
"name": "opt_fields",
"in": "query",
"description": "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. Properties can include nested fields. To learn more, see the [input/output options guide](/docs/inputoutput-options#selecting-nested-fields).",
"required": false,
"example": [
"actual_time_minutes",
"approval_status",
"assigned_by",
"assigned_by.name",
"assignee",
"assignee.name",
"assignee_section",
"assignee_section.name",
"assignee_status",
"completed",
"completed_at",
"completed_by",
"completed_by.name",
"created_at",
"created_by",
"custom_fields",
"custom_fields.asana_created_field",
"custom_fields.created_by",
"custom_fields.created_by.name",
"custom_fields.currency_code",
"custom_fields.custom_label",
"custom_fields.custom_label_position",
"custom_fields.date_value",
"custom_fields.date_value.date",
"custom_fields.date_value.date_time",
"custom_fields.default_access_level",
"custom_fields.description",
"custom_fields.display_value",
"custom_fields.enabled",
"custom_fields.enum_options",
"custom_fields.enum_options.color",
"custom_fields.enum_options.enabled",
"custom_fields.enum_options.name",
"custom_fields.enum_value",
"custom_fields.enum_value.color",
"custom_fields.enum_value.enabled",
"custom_fields.enum_value.name",
"custom_fields.format",
"custom_fields.has_notifications_enabled",
"custom_fields.html_text_value",
"custom_fields.id_prefix",
"custom_fields.input_restrictions",
"custom_fields.is_formula_field",
"custom_fields.is_global_to_workspace",
"custom_fields.is_value_read_only",
"custom_fields.multi_enum_values",
"custom_fields.multi_enum_values.color",
"custom_fields.multi_enum_values.enabled",
"custom_fields.multi_enum_values.name",
"custom_fields.name",
"custom_fields.number_value",
"custom_fields.people_value",
"custom_fields.people_value.name",
"custom_fields.precision",
"custom_fields.privacy_setting",
"custom_fields.reference_value",
"custom_fields.reference_value.name",
"custom_fields.representation_type",
"custom_fields.resource_subtype",
"custom_fields.text_value",
"custom_fields.type",
"custom_type",
"custom_type.asana_created_type_identifier",
"custom_type.name",
"custom_type_status_option",
"custom_type_status_option.name",
"dependencies",
"dependents",
"due_at",
"due_on",
"effective_memberships",
"external",
"external.data",
"followers",
"followers.name",
"hearted",
"hearts",
"hearts.user",
"hearts.user.name",
"html_notes",
"is_rendered_as_separator",
"liked",
"likes",
"likes.user",
"likes.user.name",
"memberships",
"memberships.project",
"memberships.project.name",
"memberships.project.resource_subtype",
"memberships.section",
"memberships.section.name",
"modified_at",
"name",
"notes",
"num_hearts",
"num_likes",
"num_subtasks",
"parent",
"parent.created_by",
"parent.name",
"parent.resource_subtype",
"permalink_url",
"projects",
"projects.name",
"projects.resource_subtype",
"resource_subtype",
"start_at",
"start_on",
"tags",
"tags.name",
"workspace",
"workspace.name"
],
"schema": {
"type": "array",
"items": {
"type": "string",
"enum": [
"actual_time_minutes",
"approval_status",
"assigned_by",
"assigned_by.name",
"assignee",
"assignee.name",
"assignee_section",
"assignee_section.name",
"assignee_status",
"completed",
"completed_at",
"completed_by",
"completed_by.name",
"created_at",
"created_by",
"custom_fields",
"custom_fields.asana_created_field",
"custom_fields.created_by",
"custom_fields.created_by.name",
"custom_fields.currency_code",
"custom_fields.custom_label",
"custom_fields.custom_label_position",
"custom_fields.date_value",
"custom_fields.date_value.date",
"custom_fields.date_value.date_time",
"custom_fields.default_access_level",
"custom_fields.description",
"custom_fields.display_value",
"custom_fields.enabled",
"custom_fields.enum_options",
"custom_fields.enum_options.color",
"custom_fields.enum_options.enabled",
"custom_fields.enum_options.name",
"custom_fields.enum_value",
"custom_fields.enum_value.color",
"custom_fields.enum_value.enabled",
"custom_fields.enum_value.name",
"custom_fields.format",
"custom_fields.has_notifications_enabled",
"custom_fields.html_text_value",
"custom_fields.id_prefix",
"custom_fields.input_restrictions",
"custom_fields.is_formula_field",
"custom_fields.is_global_to_workspace",
"custom_fields.is_value_read_only",
"custom_fields.multi_enum_values",
"custom_fields.multi_enum_values.color",
"custom_fields.multi_enum_values.enabled",
"custom_fields.multi_enum_values.name",
"custom_fields.name",
"custom_fields.number_value",
"custom_fields.people_value",
"custom_fields.people_value.name",
"custom_fields.precision",
"custom_fields.privacy_setting",
"custom_fields.reference_value",
"custom_fields.reference_value.name",
"custom_fields.representation_type",
"custom_fields.resource_subtype",
"custom_fields.text_value",
"custom_fields.type",
"custom_type",
"custom_type.asana_created_type_identifier",
"custom_type.name",
"custom_type_status_option",
"custom_type_status_option.name",
"dependencies",
"dependents",
"due_at",
"due_on",
"effective_memberships",
"external",
"external.data",
"followers",
"followers.name",
"hearted",
"hearts",
"hearts.user",
"hearts.user.name",
"html_notes",
"is_rendered_as_separator",
"liked",
"likes",
"likes.user",
"likes.user.name",
"memberships",
"memberships.project",
"memberships.project.name",
"memberships.project.resource_subtype",
"memberships.section",
"memberships.section.name",
"modified_at",
"name",
"notes",
"num_hearts",
"num_likes",
"num_subtasks",
"parent",
"parent.created_by",
"parent.name",
"parent.resource_subtype",
"permalink_url",
"projects",
"projects.name",
"projects.resource_subtype",
"resource_subtype",
"start_at",
"start_on",
"tags",
"tags.name",
"workspace",
"workspace.name"
]
}
},
"style": "form",
"explode": false
}
],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
"data"
],
"additionalProperties": false,
"properties": {
"data": {
"type": "object",
"additionalProperties": false,
"required": [
"name"
],
"properties": {
"name": {
"type": "string"
},
"notes": {
"type": "string"
},
"completed": {
"type": "boolean"
},
"assignee": {
"type": "string",
"nullable": true
},
"workspace": {
"type": "string"
},
"projects": {
"type": "array",
"items": {
"type": "string"
}
},
"parent": {
"type": "string",
"nullable": true
},
"due_on": {
"type": "string",
"nullable": true,
"format": "date"
},
"start_on": {
"type": "string",
"nullable": true,
"format": "date"
},
"resource_subtype": {
"enum": [
"default_task",
"milestone"
]
}
}
}
}
}
},
"application/x-www-form-urlencoded": {
"schema": {
"type": "object",
"additionalProperties": false,
"required": [
"name"
],
"properties": {
"name": {
"type": "string"
},
"notes": {
"type": "string"
},
"completed": {
"type": "boolean"
},
"assignee": {
"type": "string",
"nullable": true
},
"workspace": {
"type": "string"
},
"projects": {
"type": "array",
"items": {
"type": "string"
}
},
"parent": {
"type": "string",
"nullable": true
},
"due_on": {
"type": "string",
"nullable": true,
"format": "date"
},
"start_on": {
"type": "string",
"nullable": true,
"format": "date"
},
"resource_subtype": {
"enum": [
"default_task",
"milestone"
]
}
}
}
}
}
},
"responses": {
"201": {
"description": "Successfully created a new task.",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"$ref": "#/components/schemas/TaskResponse"
}
}
}
}
}
},
"400": {
"$ref": "#/components/responses/BadRequest"
},
"401": {
"$ref": "#/components/responses/Unauthorized"
},
"403": {
"$ref": "#/components/responses/Forbidden"
},
"404": {
"$ref": "#/components/responses/NotFound"
},
"500": {
"$ref": "#/components/responses/InternalServerError"
}
},
"security": [
{
"personalAccessToken": []
},
{
"oauth2": [
"tasks:write"
]
}
],
"x-readme": {
"code-samples": [
{
"language": "java",
"install": "<dependency><groupId>com.asana</groupId><artifactId>asana</artifactId><version>1.0.0</version></dependency>",
"code": "import com.asana.Client;\n\nClient client = Client.accessToken(\"PERSONAL_ACCESS_TOKEN\");\n\nTask result = client.tasks.createTask()\n .data(\"field\", \"value\")\n .data(\"field\", \"value\")\n .option(\"pretty\", true)\n .execute();"
},
{
"language": "node",
"install": "npm install asana",
"code": "const Asana = require('asana');\n\nlet client = new Asana.ApiClient();\nclient.authentications.token.accessToken = '<YOUR_ACCESS_TOKEN>';\n\nlet tasksApiInstance = new Asana.TasksApi(client);\nlet body = {\"data\": {\"<PARAM_1>\": \"<VALUE_1>\", \"<PARAM_2>\": \"<VALUE_2>\",}}; // Object | The task to create.\nlet opts = { \n 'opt_fields': \"actual_time_minutes,approval_status,assigned_by,assigned_by.name,assignee,assignee.name,assignee_section,assignee_section.name,assignee_status,completed,completed_at,completed_by,completed_by.name,created_at,created_by,custom_fields,custom_fields.asana_created_field,custom_fields.created_by,custom_fields.created_by.name,custom_fields.currency_code,custom_fields.custom_label,custom_fields.custom_label_position,custom_fields.date_value,custom_fields.date_value.date,custom_fields.date_value.date_time,custom_fields.default_access_level,custom_fields.description,custom_fields.display_value,custom_fields.enabled,custom_fields.enum_options,custom_fields.enum_options.color,custom_fields.enum_options.enabled,custom_fields.enum_options.name,custom_fields.enum_value,custom_fields.enum_value.color,custom_fields.enum_value.enabled,custom_fields.enum_value.name,custom_fields.format,custom_fields.has_notifications_enabled,custom_fields.html_text_value,custom_fields.id_prefix,custom_fields.input_restrictions,custom_fields.is_formula_field,custom_fields.is_global_to_workspace,custom_fields.is_value_read_only,custom_fields.multi_enum_values,custom_fields.multi_enum_values.color,custom_fields.multi_enum_values.enabled,custom_fields.multi_enum_values.name,custom_fields.name,custom_fields.number_value,custom_fields.people_value,custom_fields.people_value.name,custom_fields.precision,custom_fields.privacy_setting,custom_fields.reference_value,custom_fields.reference_value.name,custom_fields.representation_type,custom_fields.resource_subtype,custom_fields.text_value,custom_fields.type,custom_type,custom_type.asana_created_type_identifier,custom_type.name,custom_type_status_option,custom_type_status_option.name,dependencies,dependents,due_at,due_on,effective_memberships,external,external.data,followers,followers.name,hearted,hearts,hearts.user,hearts.user.name,html_notes,is_rendered_as_separator,liked,likes,likes.user,likes.user.name,memberships,memberships.project,memberships.project.name,memberships.project.resource_subtype,memberships.section,memberships.section.name,modified_at,name,notes,num_hearts,num_likes,num_subtasks,parent,parent.created_by,parent.name,parent.resource_subtype,permalink_url,projects,projects.name,projects.resource_subtype,resource_subtype,start_at,start_on,tags,tags.name,workspace,workspace.name\"\n};\ntasksApiInstance.createTask(body, opts).then((result) => {\n console.log('API called successfully. Returned data: ' + JSON.stringify(result.data, null, 2));\n}, (error) => {\n console.error(error.response.body);\n});",
"name": "node-sdk-v3"
},
{
"language": "node",
"install": "npm install asana@1.0.5",
"code": "const asana = require('asana');\n\nconst client = asana.Client.create().useAccessToken('PERSONAL_ACCESS_TOKEN');\n\nclient.tasks.createTask({field: \"value\", field: \"value\", pretty: true})\n .then((result) => {\n console.log(result);\n });",
"name": "node-sdk-v1"
},
{
"language": "python",
"install": "pip install asana",
"code": "import asana\nfrom asana.rest import ApiException\nfrom pprint import pprint\n\nconfiguration = asana.Configuration()\nconfiguration.access_token = '<YOUR_ACCESS_TOKEN>'\napi_client = asana.ApiClient(configuration)\n\n# create an instance of the API class\ntasks_api_instance = asana.TasksApi(api_client)\nbody = {\"data\": {\"<PARAM_1>\": \"<VALUE_1>\", \"<PARAM_2>\": \"<VALUE_2>\",}} # dict | The task to create.\nopts = {\n 'opt_fields': \"actual_time_minutes,approval_status,assigned_by,assigned_by.name,assignee,assignee.name,assignee_section,assignee_section.name,assignee_status,completed,completed_at,completed_by,completed_by.name,created_at,created_by,custom_fields,custom_fields.asana_created_field,custom_fields.created_by,custom_fields.created_by.name,custom_fields.currency_code,custom_fields.custom_label,custom_fields.custom_label_position,custom_fields.date_value,custom_fields.date_value.date,custom_fields.date_value.date_time,custom_fields.default_access_level,custom_fields.description,custom_fields.display_value,custom_fields.enabled,custom_fields.enum_options,custom_fields.enum_options.color,custom_fields.enum_options.enabled,custom_fields.enum_options.name,custom_fields.enum_value,custom_fields.enum_value.color,custom_fields.enum_value.enabled,custom_fields.enum_value.name,custom_fields.format,custom_fields.has_notifications_enabled,custom_fields.html_text_value,custom_fields.id_prefix,custom_fields.input_restrictions,custom_fields.is_formula_field,custom_fields.is_global_to_workspace,custom_fields.is_value_read_only,custom_fields.multi_enum_values,custom_fields.multi_enum_values.color,custom_fields.multi_enum_values.enabled,custom_fields.multi_enum_values.name,custom_fields.name,custom_fields.number_value,custom_fields.people_value,custom_fields.people_value.name,custom_fields.precision,custom_fields.privacy_setting,custom_fields.reference_value,custom_fields.reference_value.name,custom_fields.representation_type,custom_fields.resource_subtype,custom_fields.text_value,custom_fields.type,custom_type,custom_type.asana_created_type_identifier,custom_type.name,custom_type_status_option,custom_type_status_option.name,dependencies,dependents,due_at,due_on,effective_memberships,external,external.data,followers,followers.name,hearted,hearts,hearts.user,hearts.user.name,html_notes,is_rendered_as_separator,liked,likes,likes.user,likes.user.name,memberships,memberships.project,memberships.project.name,memberships.project.resource_subtype,memberships.section,memberships.section.name,modified_at,name,notes,num_hearts,num_likes,num_subtasks,parent,parent.created_by,parent.name,parent.resource_subtype,permalink_url,projects,projects.name,projects.resource_subtype,resource_subtype,start_at,start_on,tags,tags.name,workspace,workspace.name\", # list[str] | 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.\n}\n\ntry:\n # Create a task\n api_response = tasks_api_instance.create_task(body, opts)\n pprint(api_response)\nexcept ApiException as e:\n print(\"Exception when calling TasksApi->create_task: %s\\n\" % e)",
"name": "python-sdk-v5"
},
{
"language": "python",
"install": "pip install asana==3.2.3",
"code": "import asana\n\nclient = asana.Client.access_token('PERSONAL_ACCESS_TOKEN')\n\nresult = client.tasks.create_task({'field': 'value', 'field': 'value'}, opt_pretty=True)",
"name": "python-sdk-v3"
},
{
"language": "php",
"install": "composer require asana/asana",
"code": "<?php\nrequire 'vendor/autoload.php';\n\n$client = Asana\\Client::accessToken('PERSONAL_ACCESS_TOKEN');\n\n$result = $client->tasks->createTask(array('field' => 'value', 'field' => 'value'), array('opt_pretty' => 'true'))"
},
{
"language": "ruby",
"install": "gem install asana",
"code": "require 'asana'\n\nclient = Asana::Client.new do |c|\n c.authentication :access_token, 'PERSONAL_ACCESS_TOKEN'\nend\n\nresult = client.tasks.create_task(field: \"value\", field: \"value\", options: {pretty: true})"
}
]
},
"x-purple-suite-runtime": "modeled-core",
"x-purple-suite-supported-query": [
"opt_pretty",
"opt_fields"
],
"x-purple-suite-supported-response-fields": [
"gid",
"resource_type",
"resource_subtype",
"name",
"notes",
"completed",
"completed_at",
"created_at",
"modified_at",
"assignee",
"assignee_status",
"workspace",
"projects",
"memberships",
"parent",
"due_on",
"start_on",
"tags",
"dependencies",
"num_subtasks",
"archived",
"public",
"color",
"default_view",
"team",
"project",
"section",
"text",
"created_by",
"target",
"type",
"email",
"photo",
"is_organization"
]
}
GET /api/1.0/tasks/{task_gid}
Get a task
<b>Required scope: </b><code>tasks:read</code>
<table>
<tr>
<th>Field</th>
<th>Required Scope</th>
</tr>
<tr>
<td><code>memberships</code></td>
<td><code>projects:read</code>, <code>project_sections:read</code></td>
</tr>
<tr>
<td><code>effective_memberships</code></td>
<td><code>projects:read</code>, <code>project_sections:read</code></td>
</tr>
<tr>
<td><code>custom_type</code></td>
<td><code>custom_types:read</code></td>
</tr>
<tr>
<td><code>custom_type_status_option</code></td>
<td><code>custom_types:read</code></td>
</tr>
<tr>
<td><code>actual_time_minutes</code></td>
<td><code>time_tracking_entries:read</code></td>
</tr>
</table>
Returns the complete task record for a single task.
The persistent core model supports the response and query fields named in x-purple-suite-supported-response-fields and x-purple-suite-supported-query. Other fields/options return an explicit 400 errors envelope.
Authentication
[
{
"personalAccessToken": []
},
{
"oauth2": [
"tasks:read"
]
}
]
Path-level parameters and metadata
{
"parameters": [
{
"$ref": "#/components/parameters/task_path_gid"
},
{
"$ref": "#/components/parameters/pretty"
}
]
}
Request, responses and operation details
{
"summary": "Get a task",
"description": "<b>Required scope: </b><code>tasks:read</code>\n\n<table>\n <tr>\n <th>Field</th>\n <th>Required Scope</th>\n </tr>\n <tr>\n <td><code>memberships</code></td>\n <td><code>projects:read</code>, <code>project_sections:read</code></td>\n </tr>\n <tr>\n <td><code>effective_memberships</code></td>\n <td><code>projects:read</code>, <code>project_sections:read</code></td>\n </tr>\n <tr>\n <td><code>custom_type</code></td>\n <td><code>custom_types:read</code></td>\n </tr>\n <tr>\n <td><code>custom_type_status_option</code></td>\n <td><code>custom_types:read</code></td>\n </tr>\n <tr>\n <td><code>actual_time_minutes</code></td>\n <td><code>time_tracking_entries:read</code></td>\n </tr>\n</table>\n\nReturns the complete task record for a single task.\n\nThe persistent core model supports the response and query fields named in x-purple-suite-supported-response-fields and x-purple-suite-supported-query. Other fields/options return an explicit 400 errors envelope.",
"tags": [
"Tasks"
],
"operationId": "getTask",
"parameters": [
{
"name": "opt_fields",
"in": "query",
"description": "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. Properties can include nested fields. To learn more, see the [input/output options guide](/docs/inputoutput-options#selecting-nested-fields).",
"required": false,
"example": [
"actual_time_minutes",
"approval_status",
"assigned_by",
"assigned_by.name",
"assignee",
"assignee.name",
"assignee_section",
"assignee_section.name",
"assignee_status",
"completed",
"completed_at",
"completed_by",
"completed_by.name",
"created_at",
"created_by",
"custom_fields",
"custom_fields.asana_created_field",
"custom_fields.created_by",
"custom_fields.created_by.name",
"custom_fields.currency_code",
"custom_fields.custom_label",
"custom_fields.custom_label_position",
"custom_fields.date_value",
"custom_fields.date_value.date",
"custom_fields.date_value.date_time",
"custom_fields.default_access_level",
"custom_fields.description",
"custom_fields.display_value",
"custom_fields.enabled",
"custom_fields.enum_options",
"custom_fields.enum_options.color",
"custom_fields.enum_options.enabled",
"custom_fields.enum_options.name",
"custom_fields.enum_value",
"custom_fields.enum_value.color",
"custom_fields.enum_value.enabled",
"custom_fields.enum_value.name",
"custom_fields.format",
"custom_fields.has_notifications_enabled",
"custom_fields.html_text_value",
"custom_fields.id_prefix",
"custom_fields.input_restrictions",
"custom_fields.is_formula_field",
"custom_fields.is_global_to_workspace",
"custom_fields.is_value_read_only",
"custom_fields.multi_enum_values",
"custom_fields.multi_enum_values.color",
"custom_fields.multi_enum_values.enabled",
"custom_fields.multi_enum_values.name",
"custom_fields.name",
"custom_fields.number_value",
"custom_fields.people_value",
"custom_fields.people_value.name",
"custom_fields.precision",
"custom_fields.privacy_setting",
"custom_fields.reference_value",
"custom_fields.reference_value.name",
"custom_fields.representation_type",
"custom_fields.resource_subtype",
"custom_fields.text_value",
"custom_fields.type",
"custom_type",
"custom_type.asana_created_type_identifier",
"custom_type.name",
"custom_type_status_option",
"custom_type_status_option.name",
"dependencies",
"dependents",
"due_at",
"due_on",
"effective_memberships",
"external",
"external.data",
"followers",
"followers.name",
"hearted",
"hearts",
"hearts.user",
"hearts.user.name",
"html_notes",
"is_rendered_as_separator",
"liked",
"likes",
"likes.user",
"likes.user.name",
"memberships",
"memberships.project",
"memberships.project.name",
"memberships.project.resource_subtype",
"memberships.section",
"memberships.section.name",
"modified_at",
"name",
"notes",
"num_hearts",
"num_likes",
"num_subtasks",
"parent",
"parent.created_by",
"parent.name",
"parent.resource_subtype",
"permalink_url",
"projects",
"projects.name",
"projects.resource_subtype",
"resource_subtype",
"start_at",
"start_on",
"tags",
"tags.name",
"workspace",
"workspace.name"
],
"schema": {
"type": "array",
"items": {
"type": "string",
"enum": [
"actual_time_minutes",
"approval_status",
"assigned_by",
"assigned_by.name",
"assignee",
"assignee.name",
"assignee_section",
"assignee_section.name",
"assignee_status",
"completed",
"completed_at",
"completed_by",
"completed_by.name",
"created_at",
"created_by",
"custom_fields",
"custom_fields.asana_created_field",
"custom_fields.created_by",
"custom_fields.created_by.name",
"custom_fields.currency_code",
"custom_fields.custom_label",
"custom_fields.custom_label_position",
"custom_fields.date_value",
"custom_fields.date_value.date",
"custom_fields.date_value.date_time",
"custom_fields.default_access_level",
"custom_fields.description",
"custom_fields.display_value",
"custom_fields.enabled",
"custom_fields.enum_options",
"custom_fields.enum_options.color",
"custom_fields.enum_options.enabled",
"custom_fields.enum_options.name",
"custom_fields.enum_value",
"custom_fields.enum_value.color",
"custom_fields.enum_value.enabled",
"custom_fields.enum_value.name",
"custom_fields.format",
"custom_fields.has_notifications_enabled",
"custom_fields.html_text_value",
"custom_fields.id_prefix",
"custom_fields.input_restrictions",
"custom_fields.is_formula_field",
"custom_fields.is_global_to_workspace",
"custom_fields.is_value_read_only",
"custom_fields.multi_enum_values",
"custom_fields.multi_enum_values.color",
"custom_fields.multi_enum_values.enabled",
"custom_fields.multi_enum_values.name",
"custom_fields.name",
"custom_fields.number_value",
"custom_fields.people_value",
"custom_fields.people_value.name",
"custom_fields.precision",
"custom_fields.privacy_setting",
"custom_fields.reference_value",
"custom_fields.reference_value.name",
"custom_fields.representation_type",
"custom_fields.resource_subtype",
"custom_fields.text_value",
"custom_fields.type",
"custom_type",
"custom_type.asana_created_type_identifier",
"custom_type.name",
"custom_type_status_option",
"custom_type_status_option.name",
"dependencies",
"dependents",
"due_at",
"due_on",
"effective_memberships",
"external",
"external.data",
"followers",
"followers.name",
"hearted",
"hearts",
"hearts.user",
"hearts.user.name",
"html_notes",
"is_rendered_as_separator",
"liked",
"likes",
"likes.user",
"likes.user.name",
"memberships",
"memberships.project",
"memberships.project.name",
"memberships.project.resource_subtype",
"memberships.section",
"memberships.section.name",
"modified_at",
"name",
"notes",
"num_hearts",
"num_likes",
"num_subtasks",
"parent",
"parent.created_by",
"parent.name",
"parent.resource_subtype",
"permalink_url",
"projects",
"projects.name",
"projects.resource_subtype",
"resource_subtype",
"start_at",
"start_on",
"tags",
"tags.name",
"workspace",
"workspace.name"
]
}
},
"style": "form",
"explode": false
}
],
"responses": {
"200": {
"description": "Successfully retrieved the specified task.",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"$ref": "#/components/schemas/TaskResponse"
}
}
}
}
}
},
"400": {
"$ref": "#/components/responses/BadRequest"
},
"401": {
"$ref": "#/components/responses/Unauthorized"
},
"403": {
"$ref": "#/components/responses/Forbidden"
},
"404": {
"$ref": "#/components/responses/NotFound"
},
"500": {
"$ref": "#/components/responses/InternalServerError"
}
},
"security": [
{
"personalAccessToken": []
},
{
"oauth2": [
"tasks:read"
]
}
],
"x-readme": {
"code-samples": [
{
"language": "java",
"install": "<dependency><groupId>com.asana</groupId><artifactId>asana</artifactId><version>1.0.0</version></dependency>",
"code": "import com.asana.Client;\n\nClient client = Client.accessToken(\"PERSONAL_ACCESS_TOKEN\");\n\nTask result = client.tasks.getTask(taskGid)\n .option(\"pretty\", true)\n .execute();"
},
{
"language": "node",
"install": "npm install asana",
"code": "const Asana = require('asana');\n\nlet client = new Asana.ApiClient();\nclient.authentications.token.accessToken = '<YOUR_ACCESS_TOKEN>';\n\nlet tasksApiInstance = new Asana.TasksApi(client);\nlet task_gid = \"321654\"; // String | The task to operate on.\nlet opts = { \n 'opt_fields': \"actual_time_minutes,approval_status,assigned_by,assigned_by.name,assignee,assignee.name,assignee_section,assignee_section.name,assignee_status,completed,completed_at,completed_by,completed_by.name,created_at,created_by,custom_fields,custom_fields.asana_created_field,custom_fields.created_by,custom_fields.created_by.name,custom_fields.currency_code,custom_fields.custom_label,custom_fields.custom_label_position,custom_fields.date_value,custom_fields.date_value.date,custom_fields.date_value.date_time,custom_fields.default_access_level,custom_fields.description,custom_fields.display_value,custom_fields.enabled,custom_fields.enum_options,custom_fields.enum_options.color,custom_fields.enum_options.enabled,custom_fields.enum_options.name,custom_fields.enum_value,custom_fields.enum_value.color,custom_fields.enum_value.enabled,custom_fields.enum_value.name,custom_fields.format,custom_fields.has_notifications_enabled,custom_fields.html_text_value,custom_fields.id_prefix,custom_fields.input_restrictions,custom_fields.is_formula_field,custom_fields.is_global_to_workspace,custom_fields.is_value_read_only,custom_fields.multi_enum_values,custom_fields.multi_enum_values.color,custom_fields.multi_enum_values.enabled,custom_fields.multi_enum_values.name,custom_fields.name,custom_fields.number_value,custom_fields.people_value,custom_fields.people_value.name,custom_fields.precision,custom_fields.privacy_setting,custom_fields.reference_value,custom_fields.reference_value.name,custom_fields.representation_type,custom_fields.resource_subtype,custom_fields.text_value,custom_fields.type,custom_type,custom_type.asana_created_type_identifier,custom_type.name,custom_type_status_option,custom_type_status_option.name,dependencies,dependents,due_at,due_on,effective_memberships,external,external.data,followers,followers.name,hearted,hearts,hearts.user,hearts.user.name,html_notes,is_rendered_as_separator,liked,likes,likes.user,likes.user.name,memberships,memberships.project,memberships.project.name,memberships.project.resource_subtype,memberships.section,memberships.section.name,modified_at,name,notes,num_hearts,num_likes,num_subtasks,parent,parent.created_by,parent.name,parent.resource_subtype,permalink_url,projects,projects.name,projects.resource_subtype,resource_subtype,start_at,start_on,tags,tags.name,workspace,workspace.name\"\n};\ntasksApiInstance.getTask(task_gid, opts).then((result) => {\n console.log('API called successfully. Returned data: ' + JSON.stringify(result.data, null, 2));\n}, (error) => {\n console.error(error.response.body);\n});",
"name": "node-sdk-v3"
},
{
"language": "node",
"install": "npm install asana@1.0.5",
"code": "const asana = require('asana');\n\nconst client = asana.Client.create().useAccessToken('PERSONAL_ACCESS_TOKEN');\n\nclient.tasks.getTask(taskGid, {param: \"value\", param: \"value\", opt_pretty: true})\n .then((result) => {\n console.log(result);\n });",
"name": "node-sdk-v1"
},
{
"language": "python",
"install": "pip install asana",
"code": "import asana\nfrom asana.rest import ApiException\nfrom pprint import pprint\n\nconfiguration = asana.Configuration()\nconfiguration.access_token = '<YOUR_ACCESS_TOKEN>'\napi_client = asana.ApiClient(configuration)\n\n# create an instance of the API class\ntasks_api_instance = asana.TasksApi(api_client)\ntask_gid = \"321654\" # str | The task to operate on.\nopts = {\n 'opt_fields': \"actual_time_minutes,approval_status,assigned_by,assigned_by.name,assignee,assignee.name,assignee_section,assignee_section.name,assignee_status,completed,completed_at,completed_by,completed_by.name,created_at,created_by,custom_fields,custom_fields.asana_created_field,custom_fields.created_by,custom_fields.created_by.name,custom_fields.currency_code,custom_fields.custom_label,custom_fields.custom_label_position,custom_fields.date_value,custom_fields.date_value.date,custom_fields.date_value.date_time,custom_fields.default_access_level,custom_fields.description,custom_fields.display_value,custom_fields.enabled,custom_fields.enum_options,custom_fields.enum_options.color,custom_fields.enum_options.enabled,custom_fields.enum_options.name,custom_fields.enum_value,custom_fields.enum_value.color,custom_fields.enum_value.enabled,custom_fields.enum_value.name,custom_fields.format,custom_fields.has_notifications_enabled,custom_fields.html_text_value,custom_fields.id_prefix,custom_fields.input_restrictions,custom_fields.is_formula_field,custom_fields.is_global_to_workspace,custom_fields.is_value_read_only,custom_fields.multi_enum_values,custom_fields.multi_enum_values.color,custom_fields.multi_enum_values.enabled,custom_fields.multi_enum_values.name,custom_fields.name,custom_fields.number_value,custom_fields.people_value,custom_fields.people_value.name,custom_fields.precision,custom_fields.privacy_setting,custom_fields.reference_value,custom_fields.reference_value.name,custom_fields.representation_type,custom_fields.resource_subtype,custom_fields.text_value,custom_fields.type,custom_type,custom_type.asana_created_type_identifier,custom_type.name,custom_type_status_option,custom_type_status_option.name,dependencies,dependents,due_at,due_on,effective_memberships,external,external.data,followers,followers.name,hearted,hearts,hearts.user,hearts.user.name,html_notes,is_rendered_as_separator,liked,likes,likes.user,likes.user.name,memberships,memberships.project,memberships.project.name,memberships.project.resource_subtype,memberships.section,memberships.section.name,modified_at,name,notes,num_hearts,num_likes,num_subtasks,parent,parent.created_by,parent.name,parent.resource_subtype,permalink_url,projects,projects.name,projects.resource_subtype,resource_subtype,start_at,start_on,tags,tags.name,workspace,workspace.name\", # list[str] | 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.\n}\n\ntry:\n # Get a task\n api_response = tasks_api_instance.get_task(task_gid, opts)\n pprint(api_response)\nexcept ApiException as e:\n print(\"Exception when calling TasksApi->get_task: %s\\n\" % e)",
"name": "python-sdk-v5"
},
{
"language": "python",
"install": "pip install asana==3.2.3",
"code": "import asana\n\nclient = asana.Client.access_token('PERSONAL_ACCESS_TOKEN')\n\nresult = client.tasks.get_task(task_gid, {'param': 'value', 'param': 'value'}, opt_pretty=True)",
"name": "python-sdk-v3"
},
{
"language": "php",
"install": "composer require asana/asana",
"code": "<?php\nrequire 'vendor/autoload.php';\n\n$client = Asana\\Client::accessToken('PERSONAL_ACCESS_TOKEN');\n\n$result = $client->tasks->getTask($task_gid, array('param' => 'value', 'param' => 'value'), array('opt_pretty' => 'true'))"
},
{
"language": "ruby",
"install": "gem install asana",
"code": "require 'asana'\n\nclient = Asana::Client.new do |c|\n c.authentication :access_token, 'PERSONAL_ACCESS_TOKEN'\nend\n\nresult = client.tasks.get_task(task_gid: 'task_gid', param: \"value\", param: \"value\", options: {pretty: true})"
}
]
},
"x-purple-suite-runtime": "modeled-core",
"x-purple-suite-supported-query": [
"opt_pretty",
"opt_fields"
],
"x-purple-suite-supported-response-fields": [
"gid",
"resource_type",
"resource_subtype",
"name",
"notes",
"completed",
"completed_at",
"created_at",
"modified_at",
"assignee",
"assignee_status",
"workspace",
"projects",
"memberships",
"parent",
"due_on",
"start_on",
"tags",
"dependencies",
"num_subtasks",
"archived",
"public",
"color",
"default_view",
"team",
"project",
"section",
"text",
"created_by",
"target",
"type",
"email",
"photo",
"is_organization"
]
}
PUT /api/1.0/tasks/{task_gid}
Update a task
<b>Required scope: </b><code>tasks:write</code>
A specific, existing task can be updated by making a PUT request on the
URL for that task. Only the fields provided in the `data` block will be
updated; any unspecified fields will remain unchanged.
When using this method, it is best to specify only those fields you wish
to change, or else you may overwrite changes made by another user since
you last retrieved the task.
Returns the complete updated task record.
The persistent core model supports the response and query fields named in x-purple-suite-supported-response-fields and x-purple-suite-supported-query. Other fields/options return an explicit 400 errors envelope.
Authentication
[
{
"personalAccessToken": []
},
{
"oauth2": [
"tasks:write"
]
}
]
Path-level parameters and metadata
{
"parameters": [
{
"$ref": "#/components/parameters/task_path_gid"
},
{
"$ref": "#/components/parameters/pretty"
}
]
}
Request, responses and operation details
{
"summary": "Update a task",
"description": "<b>Required scope: </b><code>tasks:write</code>\n\nA specific, existing task can be updated by making a PUT request on the\nURL for that task. Only the fields provided in the `data` block will be\nupdated; any unspecified fields will remain unchanged.\n\nWhen using this method, it is best to specify only those fields you wish\nto change, or else you may overwrite changes made by another user since\nyou last retrieved the task.\n\nReturns the complete updated task record.\n\nThe persistent core model supports the response and query fields named in x-purple-suite-supported-response-fields and x-purple-suite-supported-query. Other fields/options return an explicit 400 errors envelope.",
"tags": [
"Tasks"
],
"operationId": "updateTask",
"parameters": [
{
"name": "opt_fields",
"in": "query",
"description": "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. Properties can include nested fields. To learn more, see the [input/output options guide](/docs/inputoutput-options#selecting-nested-fields).",
"required": false,
"example": [
"actual_time_minutes",
"approval_status",
"assigned_by",
"assigned_by.name",
"assignee",
"assignee.name",
"assignee_section",
"assignee_section.name",
"assignee_status",
"completed",
"completed_at",
"completed_by",
"completed_by.name",
"created_at",
"created_by",
"custom_fields",
"custom_fields.asana_created_field",
"custom_fields.created_by",
"custom_fields.created_by.name",
"custom_fields.currency_code",
"custom_fields.custom_label",
"custom_fields.custom_label_position",
"custom_fields.date_value",
"custom_fields.date_value.date",
"custom_fields.date_value.date_time",
"custom_fields.default_access_level",
"custom_fields.description",
"custom_fields.display_value",
"custom_fields.enabled",
"custom_fields.enum_options",
"custom_fields.enum_options.color",
"custom_fields.enum_options.enabled",
"custom_fields.enum_options.name",
"custom_fields.enum_value",
"custom_fields.enum_value.color",
"custom_fields.enum_value.enabled",
"custom_fields.enum_value.name",
"custom_fields.format",
"custom_fields.has_notifications_enabled",
"custom_fields.html_text_value",
"custom_fields.id_prefix",
"custom_fields.input_restrictions",
"custom_fields.is_formula_field",
"custom_fields.is_global_to_workspace",
"custom_fields.is_value_read_only",
"custom_fields.multi_enum_values",
"custom_fields.multi_enum_values.color",
"custom_fields.multi_enum_values.enabled",
"custom_fields.multi_enum_values.name",
"custom_fields.name",
"custom_fields.number_value",
"custom_fields.people_value",
"custom_fields.people_value.name",
"custom_fields.precision",
"custom_fields.privacy_setting",
"custom_fields.reference_value",
"custom_fields.reference_value.name",
"custom_fields.representation_type",
"custom_fields.resource_subtype",
"custom_fields.text_value",
"custom_fields.type",
"custom_type",
"custom_type.asana_created_type_identifier",
"custom_type.name",
"custom_type_status_option",
"custom_type_status_option.name",
"dependencies",
"dependents",
"due_at",
"due_on",
"effective_memberships",
"external",
"external.data",
"followers",
"followers.name",
"hearted",
"hearts",
"hearts.user",
"hearts.user.name",
"html_notes",
"is_rendered_as_separator",
"liked",
"likes",
"likes.user",
"likes.user.name",
"memberships",
"memberships.project",
"memberships.project.name",
"memberships.project.resource_subtype",
"memberships.section",
"memberships.section.name",
"modified_at",
"name",
"notes",
"num_hearts",
"num_likes",
"num_subtasks",
"parent",
"parent.created_by",
"parent.name",
"parent.resource_subtype",
"permalink_url",
"projects",
"projects.name",
"projects.resource_subtype",
"resource_subtype",
"start_at",
"start_on",
"tags",
"tags.name",
"workspace",
"workspace.name"
],
"schema": {
"type": "array",
"items": {
"type": "string",
"enum": [
"actual_time_minutes",
"approval_status",
"assigned_by",
"assigned_by.name",
"assignee",
"assignee.name",
"assignee_section",
"assignee_section.name",
"assignee_status",
"completed",
"completed_at",
"completed_by",
"completed_by.name",
"created_at",
"created_by",
"custom_fields",
"custom_fields.asana_created_field",
"custom_fields.created_by",
"custom_fields.created_by.name",
"custom_fields.currency_code",
"custom_fields.custom_label",
"custom_fields.custom_label_position",
"custom_fields.date_value",
"custom_fields.date_value.date",
"custom_fields.date_value.date_time",
"custom_fields.default_access_level",
"custom_fields.description",
"custom_fields.display_value",
"custom_fields.enabled",
"custom_fields.enum_options",
"custom_fields.enum_options.color",
"custom_fields.enum_options.enabled",
"custom_fields.enum_options.name",
"custom_fields.enum_value",
"custom_fields.enum_value.color",
"custom_fields.enum_value.enabled",
"custom_fields.enum_value.name",
"custom_fields.format",
"custom_fields.has_notifications_enabled",
"custom_fields.html_text_value",
"custom_fields.id_prefix",
"custom_fields.input_restrictions",
"custom_fields.is_formula_field",
"custom_fields.is_global_to_workspace",
"custom_fields.is_value_read_only",
"custom_fields.multi_enum_values",
"custom_fields.multi_enum_values.color",
"custom_fields.multi_enum_values.enabled",
"custom_fields.multi_enum_values.name",
"custom_fields.name",
"custom_fields.number_value",
"custom_fields.people_value",
"custom_fields.people_value.name",
"custom_fields.precision",
"custom_fields.privacy_setting",
"custom_fields.reference_value",
"custom_fields.reference_value.name",
"custom_fields.representation_type",
"custom_fields.resource_subtype",
"custom_fields.text_value",
"custom_fields.type",
"custom_type",
"custom_type.asana_created_type_identifier",
"custom_type.name",
"custom_type_status_option",
"custom_type_status_option.name",
"dependencies",
"dependents",
"due_at",
"due_on",
"effective_memberships",
"external",
"external.data",
"followers",
"followers.name",
"hearted",
"hearts",
"hearts.user",
"hearts.user.name",
"html_notes",
"is_rendered_as_separator",
"liked",
"likes",
"likes.user",
"likes.user.name",
"memberships",
"memberships.project",
"memberships.project.name",
"memberships.project.resource_subtype",
"memberships.section",
"memberships.section.name",
"modified_at",
"name",
"notes",
"num_hearts",
"num_likes",
"num_subtasks",
"parent",
"parent.created_by",
"parent.name",
"parent.resource_subtype",
"permalink_url",
"projects",
"projects.name",
"projects.resource_subtype",
"resource_subtype",
"start_at",
"start_on",
"tags",
"tags.name",
"workspace",
"workspace.name"
]
}
},
"style": "form",
"explode": false
}
],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
"data"
],
"additionalProperties": false,
"properties": {
"data": {
"type": "object",
"additionalProperties": false,
"required": [],
"properties": {
"name": {
"type": "string"
},
"notes": {
"type": "string"
},
"completed": {
"type": "boolean"
},
"assignee": {
"type": "string",
"nullable": true
},
"parent": {
"type": "string",
"nullable": true
},
"due_on": {
"type": "string",
"nullable": true,
"format": "date"
},
"start_on": {
"type": "string",
"nullable": true,
"format": "date"
},
"resource_subtype": {
"enum": [
"default_task",
"milestone"
]
}
}
}
}
}
},
"application/x-www-form-urlencoded": {
"schema": {
"type": "object",
"additionalProperties": false,
"required": [],
"properties": {
"name": {
"type": "string"
},
"notes": {
"type": "string"
},
"completed": {
"type": "boolean"
},
"assignee": {
"type": "string",
"nullable": true
},
"parent": {
"type": "string",
"nullable": true
},
"due_on": {
"type": "string",
"nullable": true,
"format": "date"
},
"start_on": {
"type": "string",
"nullable": true,
"format": "date"
},
"resource_subtype": {
"enum": [
"default_task",
"milestone"
]
}
}
}
}
}
},
"responses": {
"200": {
"description": "Successfully updated the specified task.",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"$ref": "#/components/schemas/TaskResponse"
}
}
}
}
}
},
"400": {
"$ref": "#/components/responses/BadRequest"
},
"401": {
"$ref": "#/components/responses/Unauthorized"
},
"403": {
"$ref": "#/components/responses/Forbidden"
},
"404": {
"$ref": "#/components/responses/NotFound"
},
"500": {
"$ref": "#/components/responses/InternalServerError"
}
},
"security": [
{
"personalAccessToken": []
},
{
"oauth2": [
"tasks:write"
]
}
],
"x-readme": {
"code-samples": [
{
"language": "java",
"install": "<dependency><groupId>com.asana</groupId><artifactId>asana</artifactId><version>1.0.0</version></dependency>",
"code": "import com.asana.Client;\n\nClient client = Client.accessToken(\"PERSONAL_ACCESS_TOKEN\");\n\nTask result = client.tasks.updateTask(taskGid)\n .data(\"field\", \"value\")\n .data(\"field\", \"value\")\n .option(\"pretty\", true)\n .execute();"
},
{
"language": "node",
"install": "npm install asana",
"code": "const Asana = require('asana');\n\nlet client = new Asana.ApiClient();\nclient.authentications.token.accessToken = '<YOUR_ACCESS_TOKEN>';\n\nlet tasksApiInstance = new Asana.TasksApi(client);\nlet body = {\"data\": {\"<PARAM_1>\": \"<VALUE_1>\", \"<PARAM_2>\": \"<VALUE_2>\",}}; // Object | The task to update.\nlet task_gid = \"321654\"; // String | The task to operate on.\nlet opts = { \n 'opt_fields': \"actual_time_minutes,approval_status,assigned_by,assigned_by.name,assignee,assignee.name,assignee_section,assignee_section.name,assignee_status,completed,completed_at,completed_by,completed_by.name,created_at,created_by,custom_fields,custom_fields.asana_created_field,custom_fields.created_by,custom_fields.created_by.name,custom_fields.currency_code,custom_fields.custom_label,custom_fields.custom_label_position,custom_fields.date_value,custom_fields.date_value.date,custom_fields.date_value.date_time,custom_fields.default_access_level,custom_fields.description,custom_fields.display_value,custom_fields.enabled,custom_fields.enum_options,custom_fields.enum_options.color,custom_fields.enum_options.enabled,custom_fields.enum_options.name,custom_fields.enum_value,custom_fields.enum_value.color,custom_fields.enum_value.enabled,custom_fields.enum_value.name,custom_fields.format,custom_fields.has_notifications_enabled,custom_fields.html_text_value,custom_fields.id_prefix,custom_fields.input_restrictions,custom_fields.is_formula_field,custom_fields.is_global_to_workspace,custom_fields.is_value_read_only,custom_fields.multi_enum_values,custom_fields.multi_enum_values.color,custom_fields.multi_enum_values.enabled,custom_fields.multi_enum_values.name,custom_fields.name,custom_fields.number_value,custom_fields.people_value,custom_fields.people_value.name,custom_fields.precision,custom_fields.privacy_setting,custom_fields.reference_value,custom_fields.reference_value.name,custom_fields.representation_type,custom_fields.resource_subtype,custom_fields.text_value,custom_fields.type,custom_type,custom_type.asana_created_type_identifier,custom_type.name,custom_type_status_option,custom_type_status_option.name,dependencies,dependents,due_at,due_on,effective_memberships,external,external.data,followers,followers.name,hearted,hearts,hearts.user,hearts.user.name,html_notes,is_rendered_as_separator,liked,likes,likes.user,likes.user.name,memberships,memberships.project,memberships.project.name,memberships.project.resource_subtype,memberships.section,memberships.section.name,modified_at,name,notes,num_hearts,num_likes,num_subtasks,parent,parent.created_by,parent.name,parent.resource_subtype,permalink_url,projects,projects.name,projects.resource_subtype,resource_subtype,start_at,start_on,tags,tags.name,workspace,workspace.name\"\n};\ntasksApiInstance.updateTask(body, task_gid, opts).then((result) => {\n console.log('API called successfully. Returned data: ' + JSON.stringify(result.data, null, 2));\n}, (error) => {\n console.error(error.response.body);\n});",
"name": "node-sdk-v3"
},
{
"language": "node",
"install": "npm install asana@1.0.5",
"code": "const asana = require('asana');\n\nconst client = asana.Client.create().useAccessToken('PERSONAL_ACCESS_TOKEN');\n\nclient.tasks.updateTask(taskGid, {field: \"value\", field: \"value\", pretty: true})\n .then((result) => {\n console.log(result);\n });",
"name": "node-sdk-v1"
},
{
"language": "python",
"install": "pip install asana",
"code": "import asana\nfrom asana.rest import ApiException\nfrom pprint import pprint\n\nconfiguration = asana.Configuration()\nconfiguration.access_token = '<YOUR_ACCESS_TOKEN>'\napi_client = asana.ApiClient(configuration)\n\n# create an instance of the API class\ntasks_api_instance = asana.TasksApi(api_client)\nbody = {\"data\": {\"<PARAM_1>\": \"<VALUE_1>\", \"<PARAM_2>\": \"<VALUE_2>\",}} # dict | The task to update.\ntask_gid = \"321654\" # str | The task to operate on.\nopts = {\n 'opt_fields': \"actual_time_minutes,approval_status,assigned_by,assigned_by.name,assignee,assignee.name,assignee_section,assignee_section.name,assignee_status,completed,completed_at,completed_by,completed_by.name,created_at,created_by,custom_fields,custom_fields.asana_created_field,custom_fields.created_by,custom_fields.created_by.name,custom_fields.currency_code,custom_fields.custom_label,custom_fields.custom_label_position,custom_fields.date_value,custom_fields.date_value.date,custom_fields.date_value.date_time,custom_fields.default_access_level,custom_fields.description,custom_fields.display_value,custom_fields.enabled,custom_fields.enum_options,custom_fields.enum_options.color,custom_fields.enum_options.enabled,custom_fields.enum_options.name,custom_fields.enum_value,custom_fields.enum_value.color,custom_fields.enum_value.enabled,custom_fields.enum_value.name,custom_fields.format,custom_fields.has_notifications_enabled,custom_fields.html_text_value,custom_fields.id_prefix,custom_fields.input_restrictions,custom_fields.is_formula_field,custom_fields.is_global_to_workspace,custom_fields.is_value_read_only,custom_fields.multi_enum_values,custom_fields.multi_enum_values.color,custom_fields.multi_enum_values.enabled,custom_fields.multi_enum_values.name,custom_fields.name,custom_fields.number_value,custom_fields.people_value,custom_fields.people_value.name,custom_fields.precision,custom_fields.privacy_setting,custom_fields.reference_value,custom_fields.reference_value.name,custom_fields.representation_type,custom_fields.resource_subtype,custom_fields.text_value,custom_fields.type,custom_type,custom_type.asana_created_type_identifier,custom_type.name,custom_type_status_option,custom_type_status_option.name,dependencies,dependents,due_at,due_on,effective_memberships,external,external.data,followers,followers.name,hearted,hearts,hearts.user,hearts.user.name,html_notes,is_rendered_as_separator,liked,likes,likes.user,likes.user.name,memberships,memberships.project,memberships.project.name,memberships.project.resource_subtype,memberships.section,memberships.section.name,modified_at,name,notes,num_hearts,num_likes,num_subtasks,parent,parent.created_by,parent.name,parent.resource_subtype,permalink_url,projects,projects.name,projects.resource_subtype,resource_subtype,start_at,start_on,tags,tags.name,workspace,workspace.name\", # list[str] | 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.\n}\n\ntry:\n # Update a task\n api_response = tasks_api_instance.update_task(body, task_gid, opts)\n pprint(api_response)\nexcept ApiException as e:\n print(\"Exception when calling TasksApi->update_task: %s\\n\" % e)",
"name": "python-sdk-v5"
},
{
"language": "python",
"install": "pip install asana==3.2.3",
"code": "import asana\n\nclient = asana.Client.access_token('PERSONAL_ACCESS_TOKEN')\n\nresult = client.tasks.update_task(task_gid, {'field': 'value', 'field': 'value'}, opt_pretty=True)",
"name": "python-sdk-v3"
},
{
"language": "php",
"install": "composer require asana/asana",
"code": "<?php\nrequire 'vendor/autoload.php';\n\n$client = Asana\\Client::accessToken('PERSONAL_ACCESS_TOKEN');\n\n$result = $client->tasks->updateTask($task_gid, array('field' => 'value', 'field' => 'value'), array('opt_pretty' => 'true'))"
},
{
"language": "ruby",
"install": "gem install asana",
"code": "require 'asana'\n\nclient = Asana::Client.new do |c|\n c.authentication :access_token, 'PERSONAL_ACCESS_TOKEN'\nend\n\nresult = client.tasks.update_task(task_gid: 'task_gid', field: \"value\", field: \"value\", options: {pretty: true})"
}
]
},
"x-purple-suite-runtime": "modeled-core",
"x-purple-suite-supported-query": [
"opt_pretty",
"opt_fields"
],
"x-purple-suite-supported-response-fields": [
"gid",
"resource_type",
"resource_subtype",
"name",
"notes",
"completed",
"completed_at",
"created_at",
"modified_at",
"assignee",
"assignee_status",
"workspace",
"projects",
"memberships",
"parent",
"due_on",
"start_on",
"tags",
"dependencies",
"num_subtasks",
"archived",
"public",
"color",
"default_view",
"team",
"project",
"section",
"text",
"created_by",
"target",
"type",
"email",
"photo",
"is_organization"
]
}
DELETE /api/1.0/tasks/{task_gid}
Delete a task
<b>Required scope: </b><code>tasks:delete</code>
A specific, existing task can be deleted by making a DELETE request on
the URL for that task. Deleted tasks go into the “trash” of the user
making the delete request. Tasks can be recovered from the trash within a
period of 30 days; afterward they are completely removed from the system.
Returns an empty data record.
The persistent core model supports the response and query fields named in x-purple-suite-supported-response-fields and x-purple-suite-supported-query. Other fields/options return an explicit 400 errors envelope.
Authentication
[
{
"personalAccessToken": []
},
{
"oauth2": [
"tasks:delete"
]
}
]
Path-level parameters and metadata
{
"parameters": [
{
"$ref": "#/components/parameters/task_path_gid"
},
{
"$ref": "#/components/parameters/pretty"
}
]
}
Request, responses and operation details
{
"summary": "Delete a task",
"description": "<b>Required scope: </b><code>tasks:delete</code>\n\nA specific, existing task can be deleted by making a DELETE request on\nthe URL for that task. Deleted tasks go into the “trash” of the user\nmaking the delete request. Tasks can be recovered from the trash within a\nperiod of 30 days; afterward they are completely removed from the system.\n\nReturns an empty data record.\n\nThe persistent core model supports the response and query fields named in x-purple-suite-supported-response-fields and x-purple-suite-supported-query. Other fields/options return an explicit 400 errors envelope.",
"tags": [
"Tasks"
],
"operationId": "deleteTask",
"responses": {
"200": {
"description": "Successfully deleted the specified task.",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"$ref": "#/components/schemas/EmptyResponse"
}
}
}
}
}
},
"400": {
"$ref": "#/components/responses/BadRequest"
},
"401": {
"$ref": "#/components/responses/Unauthorized"
},
"403": {
"$ref": "#/components/responses/Forbidden"
},
"404": {
"$ref": "#/components/responses/NotFound"
},
"500": {
"$ref": "#/components/responses/InternalServerError"
}
},
"security": [
{
"personalAccessToken": []
},
{
"oauth2": [
"tasks:delete"
]
}
],
"x-readme": {
"code-samples": [
{
"language": "java",
"install": "<dependency><groupId>com.asana</groupId><artifactId>asana</artifactId><version>1.0.0</version></dependency>",
"code": "import com.asana.Client;\n\nClient client = Client.accessToken(\"PERSONAL_ACCESS_TOKEN\");\n\nJsonElement result = client.tasks.deleteTask(taskGid)\n .option(\"pretty\", true)\n .execute();"
},
{
"language": "node",
"install": "npm install asana",
"code": "const Asana = require('asana');\n\nlet client = new Asana.ApiClient();\nclient.authentications.token.accessToken = '<YOUR_ACCESS_TOKEN>';\n\nlet tasksApiInstance = new Asana.TasksApi(client);\nlet task_gid = \"321654\"; // String | The task to operate on.\n\ntasksApiInstance.deleteTask(task_gid).then((result) => {\n console.log('API called successfully. Returned data: ' + JSON.stringify(result.data, null, 2));\n}, (error) => {\n console.error(error.response.body);\n});",
"name": "node-sdk-v3"
},
{
"language": "node",
"install": "npm install asana@1.0.5",
"code": "const asana = require('asana');\n\nconst client = asana.Client.create().useAccessToken('PERSONAL_ACCESS_TOKEN');\n\nclient.tasks.deleteTask(taskGid)\n .then((result) => {\n console.log(result);\n });",
"name": "node-sdk-v1"
},
{
"language": "python",
"install": "pip install asana",
"code": "import asana\nfrom asana.rest import ApiException\nfrom pprint import pprint\n\nconfiguration = asana.Configuration()\nconfiguration.access_token = '<YOUR_ACCESS_TOKEN>'\napi_client = asana.ApiClient(configuration)\n\n# create an instance of the API class\ntasks_api_instance = asana.TasksApi(api_client)\ntask_gid = \"321654\" # str | The task to operate on.\n\n\ntry:\n # Delete a task\n api_response = tasks_api_instance.delete_task(task_gid)\n pprint(api_response)\nexcept ApiException as e:\n print(\"Exception when calling TasksApi->delete_task: %s\\n\" % e)",
"name": "python-sdk-v5"
},
{
"language": "python",
"install": "pip install asana==3.2.3",
"code": "import asana\n\nclient = asana.Client.access_token('PERSONAL_ACCESS_TOKEN')\n\nresult = client.tasks.delete_task(task_gid, opt_pretty=True)",
"name": "python-sdk-v3"
},
{
"language": "php",
"install": "composer require asana/asana",
"code": "<?php\nrequire 'vendor/autoload.php';\n\n$client = Asana\\Client::accessToken('PERSONAL_ACCESS_TOKEN');\n\n$result = $client->tasks->deleteTask($task_gid, array('opt_pretty' => 'true'))"
},
{
"language": "ruby",
"install": "gem install asana",
"code": "require 'asana'\n\nclient = Asana::Client.new do |c|\n c.authentication :access_token, 'PERSONAL_ACCESS_TOKEN'\nend\n\nresult = client.tasks.delete_task(task_gid: 'task_gid', options: {pretty: true})"
}
]
},
"x-purple-suite-runtime": "modeled-core",
"x-purple-suite-supported-query": [
"opt_pretty"
],
"x-purple-suite-supported-response-fields": [
"gid",
"resource_type",
"resource_subtype",
"name",
"notes",
"completed",
"completed_at",
"created_at",
"modified_at",
"assignee",
"assignee_status",
"workspace",
"projects",
"memberships",
"parent",
"due_on",
"start_on",
"tags",
"dependencies",
"num_subtasks",
"archived",
"public",
"color",
"default_view",
"team",
"project",
"section",
"text",
"created_by",
"target",
"type",
"email",
"photo",
"is_organization"
]
}
POST /api/1.0/tasks/{task_gid}/duplicate
Duplicate a task
<b>Required scope: </b><code>tasks:write</code>
Creates and returns a job that will asynchronously handle the duplication.
This operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.
Authentication
[
{
"personalAccessToken": []
},
{
"oauth2": [
"tasks:write"
]
}
]
Path-level parameters and metadata
{
"parameters": [
{
"$ref": "#/components/parameters/task_path_gid"
},
{
"$ref": "#/components/parameters/pretty"
}
]
}
Request, responses and operation details
{
"summary": "Duplicate a task",
"description": "<b>Required scope: </b><code>tasks:write</code>\n\nCreates and returns a job that will asynchronously handle the duplication.\n\nThis operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.",
"tags": [
"Tasks"
],
"operationId": "duplicateTask",
"parameters": [
{
"name": "opt_fields",
"in": "query",
"description": "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. Properties can include nested fields. To learn more, see the [input/output options guide](/docs/inputoutput-options#selecting-nested-fields).",
"required": false,
"example": [
"new_graph_export",
"new_graph_export.completed_at",
"new_graph_export.created_at",
"new_graph_export.download_url",
"new_portfolio",
"new_portfolio.name",
"new_portfolio.resource_subtype",
"new_project",
"new_project.name",
"new_project.resource_subtype",
"new_project_template",
"new_project_template.name",
"new_resource_export",
"new_resource_export.completed_at",
"new_resource_export.created_at",
"new_resource_export.download_url",
"new_task",
"new_task.created_by",
"new_task.name",
"new_task.resource_subtype",
"resource_subtype",
"status"
],
"schema": {
"type": "array",
"items": {
"type": "string",
"enum": [
"new_graph_export",
"new_graph_export.completed_at",
"new_graph_export.created_at",
"new_graph_export.download_url",
"new_portfolio",
"new_portfolio.name",
"new_portfolio.resource_subtype",
"new_project",
"new_project.name",
"new_project.resource_subtype",
"new_project_template",
"new_project_template.name",
"new_resource_export",
"new_resource_export.completed_at",
"new_resource_export.created_at",
"new_resource_export.download_url",
"new_task",
"new_task.created_by",
"new_task.name",
"new_task.resource_subtype",
"resource_subtype",
"status"
]
}
},
"style": "form",
"explode": false
}
],
"requestBody": {
"description": "Describes the duplicate's name and the fields that will be duplicated.",
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"$ref": "#/components/schemas/TaskDuplicateRequest"
}
}
}
}
}
},
"responses": {
"201": {
"description": "Successfully created the job to handle duplication.",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"$ref": "#/components/schemas/JobResponse"
}
}
}
}
}
},
"400": {
"$ref": "#/components/responses/BadRequest"
},
"401": {
"$ref": "#/components/responses/Unauthorized"
},
"403": {
"$ref": "#/components/responses/Forbidden"
},
"404": {
"$ref": "#/components/responses/NotFound"
},
"500": {
"$ref": "#/components/responses/InternalServerError"
}
},
"security": [
{
"personalAccessToken": []
},
{
"oauth2": [
"tasks:write"
]
}
],
"x-readme": {
"code-samples": [
{
"language": "java",
"install": "<dependency><groupId>com.asana</groupId><artifactId>asana</artifactId><version>1.0.0</version></dependency>",
"code": "import com.asana.Client;\n\nClient client = Client.accessToken(\"PERSONAL_ACCESS_TOKEN\");\n\nJob result = client.tasks.duplicateTask(taskGid)\n .data(\"field\", \"value\")\n .data(\"field\", \"value\")\n .option(\"pretty\", true)\n .execute();"
},
{
"language": "node",
"install": "npm install asana",
"code": "const Asana = require('asana');\n\nlet client = new Asana.ApiClient();\nclient.authentications.token.accessToken = '<YOUR_ACCESS_TOKEN>';\n\nlet tasksApiInstance = new Asana.TasksApi(client);\nlet body = {\"data\": {\"<PARAM_1>\": \"<VALUE_1>\", \"<PARAM_2>\": \"<VALUE_2>\",}}; // Object | Describes the duplicate's name and the fields that will be duplicated.\nlet task_gid = \"321654\"; // String | The task to operate on.\nlet opts = { \n 'opt_fields': \"new_graph_export,new_graph_export.completed_at,new_graph_export.created_at,new_graph_export.download_url,new_portfolio,new_portfolio.name,new_portfolio.resource_subtype,new_project,new_project.name,new_project.resource_subtype,new_project_template,new_project_template.name,new_resource_export,new_resource_export.completed_at,new_resource_export.created_at,new_resource_export.download_url,new_task,new_task.created_by,new_task.name,new_task.resource_subtype,resource_subtype,status\"\n};\ntasksApiInstance.duplicateTask(body, task_gid, opts).then((result) => {\n console.log('API called successfully. Returned data: ' + JSON.stringify(result.data, null, 2));\n}, (error) => {\n console.error(error.response.body);\n});",
"name": "node-sdk-v3"
},
{
"language": "node",
"install": "npm install asana@1.0.5",
"code": "const asana = require('asana');\n\nconst client = asana.Client.create().useAccessToken('PERSONAL_ACCESS_TOKEN');\n\nclient.tasks.duplicateTask(taskGid, {field: \"value\", field: \"value\", pretty: true})\n .then((result) => {\n console.log(result);\n });",
"name": "node-sdk-v1"
},
{
"language": "python",
"install": "pip install asana",
"code": "import asana\nfrom asana.rest import ApiException\nfrom pprint import pprint\n\nconfiguration = asana.Configuration()\nconfiguration.access_token = '<YOUR_ACCESS_TOKEN>'\napi_client = asana.ApiClient(configuration)\n\n# create an instance of the API class\ntasks_api_instance = asana.TasksApi(api_client)\nbody = {\"data\": {\"<PARAM_1>\": \"<VALUE_1>\", \"<PARAM_2>\": \"<VALUE_2>\",}} # dict | Describes the duplicate's name and the fields that will be duplicated.\ntask_gid = \"321654\" # str | The task to operate on.\nopts = {\n 'opt_fields': \"new_graph_export,new_graph_export.completed_at,new_graph_export.created_at,new_graph_export.download_url,new_portfolio,new_portfolio.name,new_portfolio.resource_subtype,new_project,new_project.name,new_project.resource_subtype,new_project_template,new_project_template.name,new_resource_export,new_resource_export.completed_at,new_resource_export.created_at,new_resource_export.download_url,new_task,new_task.created_by,new_task.name,new_task.resource_subtype,resource_subtype,status\", # list[str] | 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.\n}\n\ntry:\n # Duplicate a task\n api_response = tasks_api_instance.duplicate_task(body, task_gid, opts)\n pprint(api_response)\nexcept ApiException as e:\n print(\"Exception when calling TasksApi->duplicate_task: %s\\n\" % e)",
"name": "python-sdk-v5"
},
{
"language": "python",
"install": "pip install asana==3.2.3",
"code": "import asana\n\nclient = asana.Client.access_token('PERSONAL_ACCESS_TOKEN')\n\nresult = client.tasks.duplicate_task(task_gid, {'field': 'value', 'field': 'value'}, opt_pretty=True)",
"name": "python-sdk-v3"
},
{
"language": "php",
"install": "composer require asana/asana",
"code": "<?php\nrequire 'vendor/autoload.php';\n\n$client = Asana\\Client::accessToken('PERSONAL_ACCESS_TOKEN');\n\n$result = $client->tasks->duplicateTask($task_gid, array('field' => 'value', 'field' => 'value'), array('opt_pretty' => 'true'))"
},
{
"language": "ruby",
"install": "gem install asana",
"code": "require 'asana'\n\nclient = Asana::Client.new do |c|\n c.authentication :access_token, 'PERSONAL_ACCESS_TOKEN'\nend\n\nresult = client.tasks.duplicate_task(task_gid: 'task_gid', field: \"value\", field: \"value\", options: {pretty: true})"
}
]
},
"x-purple-suite-runtime": "unavailable"
}
GET /api/1.0/projects/{project_gid}/tasks
Get tasks from a project
<b>Required scope: </b><code>tasks:read</code>
Returns the compact task records for all tasks within the given project, ordered by their priority within the project. Tasks can exist in more than one project at a time.
The persistent core model supports the response and query fields named in x-purple-suite-supported-response-fields and x-purple-suite-supported-query. Other fields/options return an explicit 400 errors envelope.
Authentication
[
{
"personalAccessToken": []
},
{
"oauth2": [
"tasks:read"
]
}
]
Path-level parameters and metadata
{
"parameters": [
{
"$ref": "#/components/parameters/completed_since"
},
{
"$ref": "#/components/parameters/project_path_gid"
},
{
"$ref": "#/components/parameters/pretty"
},
{
"$ref": "#/components/parameters/limit"
},
{
"$ref": "#/components/parameters/offset"
}
]
}
Request, responses and operation details
{
"summary": "Get tasks from a project",
"description": "<b>Required scope: </b><code>tasks:read</code>\n\nReturns the compact task records for all tasks within the given project, ordered by their priority within the project. Tasks can exist in more than one project at a time.\n\nThe persistent core model supports the response and query fields named in x-purple-suite-supported-response-fields and x-purple-suite-supported-query. Other fields/options return an explicit 400 errors envelope.",
"tags": [
"Tasks"
],
"operationId": "getTasksForProject",
"parameters": [
{
"name": "opt_fields",
"in": "query",
"description": "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. Properties can include nested fields. To learn more, see the [input/output options guide](/docs/inputoutput-options#selecting-nested-fields).",
"required": false,
"example": [
"actual_time_minutes",
"approval_status",
"assigned_by",
"assigned_by.name",
"assignee",
"assignee.name",
"assignee_section",
"assignee_section.name",
"assignee_status",
"completed",
"completed_at",
"completed_by",
"completed_by.name",
"created_at",
"created_by",
"custom_fields",
"custom_fields.asana_created_field",
"custom_fields.created_by",
"custom_fields.created_by.name",
"custom_fields.currency_code",
"custom_fields.custom_label",
"custom_fields.custom_label_position",
"custom_fields.date_value",
"custom_fields.date_value.date",
"custom_fields.date_value.date_time",
"custom_fields.default_access_level",
"custom_fields.description",
"custom_fields.display_value",
"custom_fields.enabled",
"custom_fields.enum_options",
"custom_fields.enum_options.color",
"custom_fields.enum_options.enabled",
"custom_fields.enum_options.name",
"custom_fields.enum_value",
"custom_fields.enum_value.color",
"custom_fields.enum_value.enabled",
"custom_fields.enum_value.name",
"custom_fields.format",
"custom_fields.has_notifications_enabled",
"custom_fields.html_text_value",
"custom_fields.id_prefix",
"custom_fields.input_restrictions",
"custom_fields.is_formula_field",
"custom_fields.is_global_to_workspace",
"custom_fields.is_value_read_only",
"custom_fields.multi_enum_values",
"custom_fields.multi_enum_values.color",
"custom_fields.multi_enum_values.enabled",
"custom_fields.multi_enum_values.name",
"custom_fields.name",
"custom_fields.number_value",
"custom_fields.people_value",
"custom_fields.people_value.name",
"custom_fields.precision",
"custom_fields.privacy_setting",
"custom_fields.reference_value",
"custom_fields.reference_value.name",
"custom_fields.representation_type",
"custom_fields.resource_subtype",
"custom_fields.text_value",
"custom_fields.type",
"custom_type",
"custom_type.asana_created_type_identifier",
"custom_type.name",
"custom_type_status_option",
"custom_type_status_option.name",
"dependencies",
"dependents",
"due_at",
"due_on",
"effective_memberships",
"external",
"external.data",
"followers",
"followers.name",
"hearted",
"hearts",
"hearts.user",
"hearts.user.name",
"html_notes",
"is_rendered_as_separator",
"liked",
"likes",
"likes.user",
"likes.user.name",
"memberships",
"memberships.project",
"memberships.project.name",
"memberships.project.resource_subtype",
"memberships.section",
"memberships.section.name",
"modified_at",
"name",
"notes",
"num_hearts",
"num_likes",
"num_subtasks",
"offset",
"parent",
"parent.created_by",
"parent.name",
"parent.resource_subtype",
"path",
"permalink_url",
"projects",
"projects.name",
"projects.resource_subtype",
"resource_subtype",
"start_at",
"start_on",
"tags",
"tags.name",
"uri",
"workspace",
"workspace.name"
],
"schema": {
"type": "array",
"items": {
"type": "string",
"enum": [
"actual_time_minutes",
"approval_status",
"assigned_by",
"assigned_by.name",
"assignee",
"assignee.name",
"assignee_section",
"assignee_section.name",
"assignee_status",
"completed",
"completed_at",
"completed_by",
"completed_by.name",
"created_at",
"created_by",
"custom_fields",
"custom_fields.asana_created_field",
"custom_fields.created_by",
"custom_fields.created_by.name",
"custom_fields.currency_code",
"custom_fields.custom_label",
"custom_fields.custom_label_position",
"custom_fields.date_value",
"custom_fields.date_value.date",
"custom_fields.date_value.date_time",
"custom_fields.default_access_level",
"custom_fields.description",
"custom_fields.display_value",
"custom_fields.enabled",
"custom_fields.enum_options",
"custom_fields.enum_options.color",
"custom_fields.enum_options.enabled",
"custom_fields.enum_options.name",
"custom_fields.enum_value",
"custom_fields.enum_value.color",
"custom_fields.enum_value.enabled",
"custom_fields.enum_value.name",
"custom_fields.format",
"custom_fields.has_notifications_enabled",
"custom_fields.html_text_value",
"custom_fields.id_prefix",
"custom_fields.input_restrictions",
"custom_fields.is_formula_field",
"custom_fields.is_global_to_workspace",
"custom_fields.is_value_read_only",
"custom_fields.multi_enum_values",
"custom_fields.multi_enum_values.color",
"custom_fields.multi_enum_values.enabled",
"custom_fields.multi_enum_values.name",
"custom_fields.name",
"custom_fields.number_value",
"custom_fields.people_value",
"custom_fields.people_value.name",
"custom_fields.precision",
"custom_fields.privacy_setting",
"custom_fields.reference_value",
"custom_fields.reference_value.name",
"custom_fields.representation_type",
"custom_fields.resource_subtype",
"custom_fields.text_value",
"custom_fields.type",
"custom_type",
"custom_type.asana_created_type_identifier",
"custom_type.name",
"custom_type_status_option",
"custom_type_status_option.name",
"dependencies",
"dependents",
"due_at",
"due_on",
"effective_memberships",
"external",
"external.data",
"followers",
"followers.name",
"hearted",
"hearts",
"hearts.user",
"hearts.user.name",
"html_notes",
"is_rendered_as_separator",
"liked",
"likes",
"likes.user",
"likes.user.name",
"memberships",
"memberships.project",
"memberships.project.name",
"memberships.project.resource_subtype",
"memberships.section",
"memberships.section.name",
"modified_at",
"name",
"notes",
"num_hearts",
"num_likes",
"num_subtasks",
"offset",
"parent",
"parent.created_by",
"parent.name",
"parent.resource_subtype",
"path",
"permalink_url",
"projects",
"projects.name",
"projects.resource_subtype",
"resource_subtype",
"start_at",
"start_on",
"tags",
"tags.name",
"uri",
"workspace",
"workspace.name"
]
}
},
"style": "form",
"explode": false
}
],
"responses": {
"200": {
"description": "Successfully retrieved the requested project's tasks.",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"type": "array",
"items": {
"$ref": "#/components/schemas/TaskCompact"
}
},
"next_page": {
"$ref": "#/components/schemas/NextPage"
}
}
}
}
}
},
"400": {
"$ref": "#/components/responses/BadRequest"
},
"401": {
"$ref": "#/components/responses/Unauthorized"
},
"403": {
"$ref": "#/components/responses/Forbidden"
},
"404": {
"$ref": "#/components/responses/NotFound"
},
"500": {
"$ref": "#/components/responses/InternalServerError"
}
},
"security": [
{
"personalAccessToken": []
},
{
"oauth2": [
"tasks:read"
]
}
],
"x-readme": {
"code-samples": [
{
"language": "java",
"install": "<dependency><groupId>com.asana</groupId><artifactId>asana</artifactId><version>1.0.0</version></dependency>",
"code": "import com.asana.Client;\n\nClient client = Client.accessToken(\"PERSONAL_ACCESS_TOKEN\");\n\nList<Task> result = client.tasks.getTasksForProject(projectGid, completedSince)\n .option(\"pretty\", true)\n .execute();"
},
{
"language": "node",
"install": "npm install asana",
"code": "const Asana = require('asana');\n\nlet client = new Asana.ApiClient();\nclient.authentications.token.accessToken = '<YOUR_ACCESS_TOKEN>';\n\nlet tasksApiInstance = new Asana.TasksApi(client);\nlet project_gid = \"1331\"; // String | Globally unique identifier for the project.\nlet opts = { \n 'completed_since': \"2012-02-22T02:06:58.158Z\", \n 'limit': 50, \n 'offset': \"eyJ0eXAiOJiKV1iQLCJhbGciOiJIUzI1NiJ9\", \n 'opt_fields': \"actual_time_minutes,approval_status,assigned_by,assigned_by.name,assignee,assignee.name,assignee_section,assignee_section.name,assignee_status,completed,completed_at,completed_by,completed_by.name,created_at,created_by,custom_fields,custom_fields.asana_created_field,custom_fields.created_by,custom_fields.created_by.name,custom_fields.currency_code,custom_fields.custom_label,custom_fields.custom_label_position,custom_fields.date_value,custom_fields.date_value.date,custom_fields.date_value.date_time,custom_fields.default_access_level,custom_fields.description,custom_fields.display_value,custom_fields.enabled,custom_fields.enum_options,custom_fields.enum_options.color,custom_fields.enum_options.enabled,custom_fields.enum_options.name,custom_fields.enum_value,custom_fields.enum_value.color,custom_fields.enum_value.enabled,custom_fields.enum_value.name,custom_fields.format,custom_fields.has_notifications_enabled,custom_fields.html_text_value,custom_fields.id_prefix,custom_fields.input_restrictions,custom_fields.is_formula_field,custom_fields.is_global_to_workspace,custom_fields.is_value_read_only,custom_fields.multi_enum_values,custom_fields.multi_enum_values.color,custom_fields.multi_enum_values.enabled,custom_fields.multi_enum_values.name,custom_fields.name,custom_fields.number_value,custom_fields.people_value,custom_fields.people_value.name,custom_fields.precision,custom_fields.privacy_setting,custom_fields.reference_value,custom_fields.reference_value.name,custom_fields.representation_type,custom_fields.resource_subtype,custom_fields.text_value,custom_fields.type,custom_type,custom_type.asana_created_type_identifier,custom_type.name,custom_type_status_option,custom_type_status_option.name,dependencies,dependents,due_at,due_on,effective_memberships,external,external.data,followers,followers.name,hearted,hearts,hearts.user,hearts.user.name,html_notes,is_rendered_as_separator,liked,likes,likes.user,likes.user.name,memberships,memberships.project,memberships.project.name,memberships.project.resource_subtype,memberships.section,memberships.section.name,modified_at,name,notes,num_hearts,num_likes,num_subtasks,offset,parent,parent.created_by,parent.name,parent.resource_subtype,path,permalink_url,projects,projects.name,projects.resource_subtype,resource_subtype,start_at,start_on,tags,tags.name,uri,workspace,workspace.name\"\n};\ntasksApiInstance.getTasksForProject(project_gid, opts).then((result) => {\n console.log('API called successfully. Returned data: ' + JSON.stringify(result.data, null, 2));\n}, (error) => {\n console.error(error.response.body);\n});",
"name": "node-sdk-v3"
},
{
"language": "node",
"install": "npm install asana@1.0.5",
"code": "const asana = require('asana');\n\nconst client = asana.Client.create().useAccessToken('PERSONAL_ACCESS_TOKEN');\n\nclient.tasks.getTasksForProject(projectGid, {param: \"value\", param: \"value\", opt_pretty: true})\n .then((result) => {\n console.log(result);\n });",
"name": "node-sdk-v1"
},
{
"language": "python",
"install": "pip install asana",
"code": "import asana\nfrom asana.rest import ApiException\nfrom pprint import pprint\n\nconfiguration = asana.Configuration()\nconfiguration.access_token = '<YOUR_ACCESS_TOKEN>'\napi_client = asana.ApiClient(configuration)\n\n# create an instance of the API class\ntasks_api_instance = asana.TasksApi(api_client)\nproject_gid = \"1331\" # str | Globally unique identifier for the project.\nopts = {\n 'completed_since': \"2012-02-22T02:06:58.158Z\", # str | Only return tasks that are either incomplete or that have been completed since this time. Accepts a date-time string or the keyword *now*. \n 'limit': 50, # int | Results per page. The number of objects to return per page. The value must be between 1 and 100.\n 'offset': \"eyJ0eXAiOJiKV1iQLCJhbGciOiJIUzI1NiJ9\", # str | 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.*\n 'opt_fields': \"actual_time_minutes,approval_status,assigned_by,assigned_by.name,assignee,assignee.name,assignee_section,assignee_section.name,assignee_status,completed,completed_at,completed_by,completed_by.name,created_at,created_by,custom_fields,custom_fields.asana_created_field,custom_fields.created_by,custom_fields.created_by.name,custom_fields.currency_code,custom_fields.custom_label,custom_fields.custom_label_position,custom_fields.date_value,custom_fields.date_value.date,custom_fields.date_value.date_time,custom_fields.default_access_level,custom_fields.description,custom_fields.display_value,custom_fields.enabled,custom_fields.enum_options,custom_fields.enum_options.color,custom_fields.enum_options.enabled,custom_fields.enum_options.name,custom_fields.enum_value,custom_fields.enum_value.color,custom_fields.enum_value.enabled,custom_fields.enum_value.name,custom_fields.format,custom_fields.has_notifications_enabled,custom_fields.html_text_value,custom_fields.id_prefix,custom_fields.input_restrictions,custom_fields.is_formula_field,custom_fields.is_global_to_workspace,custom_fields.is_value_read_only,custom_fields.multi_enum_values,custom_fields.multi_enum_values.color,custom_fields.multi_enum_values.enabled,custom_fields.multi_enum_values.name,custom_fields.name,custom_fields.number_value,custom_fields.people_value,custom_fields.people_value.name,custom_fields.precision,custom_fields.privacy_setting,custom_fields.reference_value,custom_fields.reference_value.name,custom_fields.representation_type,custom_fields.resource_subtype,custom_fields.text_value,custom_fields.type,custom_type,custom_type.asana_created_type_identifier,custom_type.name,custom_type_status_option,custom_type_status_option.name,dependencies,dependents,due_at,due_on,effective_memberships,external,external.data,followers,followers.name,hearted,hearts,hearts.user,hearts.user.name,html_notes,is_rendered_as_separator,liked,likes,likes.user,likes.user.name,memberships,memberships.project,memberships.project.name,memberships.project.resource_subtype,memberships.section,memberships.section.name,modified_at,name,notes,num_hearts,num_likes,num_subtasks,offset,parent,parent.created_by,parent.name,parent.resource_subtype,path,permalink_url,projects,projects.name,projects.resource_subtype,resource_subtype,start_at,start_on,tags,tags.name,uri,workspace,workspace.name\", # list[str] | 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.\n}\n\ntry:\n # Get tasks from a project\n api_response = tasks_api_instance.get_tasks_for_project(project_gid, opts)\n for data in api_response:\n pprint(data)\nexcept ApiException as e:\n print(\"Exception when calling TasksApi->get_tasks_for_project: %s\\n\" % e)",
"name": "python-sdk-v5"
},
{
"language": "python",
"install": "pip install asana==3.2.3",
"code": "import asana\n\nclient = asana.Client.access_token('PERSONAL_ACCESS_TOKEN')\n\nresult = client.tasks.get_tasks_for_project(project_gid, {'param': 'value', 'param': 'value'}, opt_pretty=True)",
"name": "python-sdk-v3"
},
{
"language": "php",
"install": "composer require asana/asana",
"code": "<?php\nrequire 'vendor/autoload.php';\n\n$client = Asana\\Client::accessToken('PERSONAL_ACCESS_TOKEN');\n\n$result = $client->tasks->getTasksForProject($project_gid, array('param' => 'value', 'param' => 'value'), array('opt_pretty' => 'true'))"
},
{
"language": "ruby",
"install": "gem install asana",
"code": "require 'asana'\n\nclient = Asana::Client.new do |c|\n c.authentication :access_token, 'PERSONAL_ACCESS_TOKEN'\nend\n\nresult = client.tasks.get_tasks_for_project(project_gid: 'project_gid', param: \"value\", param: \"value\", options: {pretty: true})"
}
]
},
"x-purple-suite-runtime": "modeled-core",
"x-purple-suite-supported-query": [
"completed_since",
"opt_pretty",
"limit",
"offset",
"opt_fields"
],
"x-purple-suite-supported-response-fields": [
"gid",
"resource_type",
"resource_subtype",
"name",
"notes",
"completed",
"completed_at",
"created_at",
"modified_at",
"assignee",
"assignee_status",
"workspace",
"projects",
"memberships",
"parent",
"due_on",
"start_on",
"tags",
"dependencies",
"num_subtasks",
"archived",
"public",
"color",
"default_view",
"team",
"project",
"section",
"text",
"created_by",
"target",
"type",
"email",
"photo",
"is_organization"
]
}
GET /api/1.0/sections/{section_gid}/tasks
Get tasks from a section
<b>Required scope: </b><code>tasks:read</code>
*Board view only*: Returns the compact section records for all tasks within the given section.
The persistent core model supports the response and query fields named in x-purple-suite-supported-response-fields and x-purple-suite-supported-query. Other fields/options return an explicit 400 errors envelope.
Authentication
[
{
"personalAccessToken": []
},
{
"oauth2": [
"tasks:read"
]
}
]
Path-level parameters and metadata
{
"parameters": [
{
"$ref": "#/components/parameters/section_path_gid"
},
{
"$ref": "#/components/parameters/pretty"
},
{
"$ref": "#/components/parameters/limit"
},
{
"$ref": "#/components/parameters/offset"
},
{
"$ref": "#/components/parameters/completed_since"
}
]
}
Request, responses and operation details
{
"summary": "Get tasks from a section",
"description": "<b>Required scope: </b><code>tasks:read</code>\n\n*Board view only*: Returns the compact section records for all tasks within the given section.\n\nThe persistent core model supports the response and query fields named in x-purple-suite-supported-response-fields and x-purple-suite-supported-query. Other fields/options return an explicit 400 errors envelope.",
"tags": [
"Tasks"
],
"operationId": "getTasksForSection",
"parameters": [
{
"name": "opt_fields",
"in": "query",
"description": "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. Properties can include nested fields. To learn more, see the [input/output options guide](/docs/inputoutput-options#selecting-nested-fields).",
"required": false,
"example": [
"actual_time_minutes",
"approval_status",
"assigned_by",
"assigned_by.name",
"assignee",
"assignee.name",
"assignee_section",
"assignee_section.name",
"assignee_status",
"completed",
"completed_at",
"completed_by",
"completed_by.name",
"created_at",
"created_by",
"custom_fields",
"custom_fields.asana_created_field",
"custom_fields.created_by",
"custom_fields.created_by.name",
"custom_fields.currency_code",
"custom_fields.custom_label",
"custom_fields.custom_label_position",
"custom_fields.date_value",
"custom_fields.date_value.date",
"custom_fields.date_value.date_time",
"custom_fields.default_access_level",
"custom_fields.description",
"custom_fields.display_value",
"custom_fields.enabled",
"custom_fields.enum_options",
"custom_fields.enum_options.color",
"custom_fields.enum_options.enabled",
"custom_fields.enum_options.name",
"custom_fields.enum_value",
"custom_fields.enum_value.color",
"custom_fields.enum_value.enabled",
"custom_fields.enum_value.name",
"custom_fields.format",
"custom_fields.has_notifications_enabled",
"custom_fields.html_text_value",
"custom_fields.id_prefix",
"custom_fields.input_restrictions",
"custom_fields.is_formula_field",
"custom_fields.is_global_to_workspace",
"custom_fields.is_value_read_only",
"custom_fields.multi_enum_values",
"custom_fields.multi_enum_values.color",
"custom_fields.multi_enum_values.enabled",
"custom_fields.multi_enum_values.name",
"custom_fields.name",
"custom_fields.number_value",
"custom_fields.people_value",
"custom_fields.people_value.name",
"custom_fields.precision",
"custom_fields.privacy_setting",
"custom_fields.reference_value",
"custom_fields.reference_value.name",
"custom_fields.representation_type",
"custom_fields.resource_subtype",
"custom_fields.text_value",
"custom_fields.type",
"custom_type",
"custom_type.asana_created_type_identifier",
"custom_type.name",
"custom_type_status_option",
"custom_type_status_option.name",
"dependencies",
"dependents",
"due_at",
"due_on",
"effective_memberships",
"external",
"external.data",
"followers",
"followers.name",
"hearted",
"hearts",
"hearts.user",
"hearts.user.name",
"html_notes",
"is_rendered_as_separator",
"liked",
"likes",
"likes.user",
"likes.user.name",
"memberships",
"memberships.project",
"memberships.project.name",
"memberships.project.resource_subtype",
"memberships.section",
"memberships.section.name",
"modified_at",
"name",
"notes",
"num_hearts",
"num_likes",
"num_subtasks",
"offset",
"parent",
"parent.created_by",
"parent.name",
"parent.resource_subtype",
"path",
"permalink_url",
"projects",
"projects.name",
"projects.resource_subtype",
"resource_subtype",
"start_at",
"start_on",
"tags",
"tags.name",
"uri",
"workspace",
"workspace.name"
],
"schema": {
"type": "array",
"items": {
"type": "string",
"enum": [
"actual_time_minutes",
"approval_status",
"assigned_by",
"assigned_by.name",
"assignee",
"assignee.name",
"assignee_section",
"assignee_section.name",
"assignee_status",
"completed",
"completed_at",
"completed_by",
"completed_by.name",
"created_at",
"created_by",
"custom_fields",
"custom_fields.asana_created_field",
"custom_fields.created_by",
"custom_fields.created_by.name",
"custom_fields.currency_code",
"custom_fields.custom_label",
"custom_fields.custom_label_position",
"custom_fields.date_value",
"custom_fields.date_value.date",
"custom_fields.date_value.date_time",
"custom_fields.default_access_level",
"custom_fields.description",
"custom_fields.display_value",
"custom_fields.enabled",
"custom_fields.enum_options",
"custom_fields.enum_options.color",
"custom_fields.enum_options.enabled",
"custom_fields.enum_options.name",
"custom_fields.enum_value",
"custom_fields.enum_value.color",
"custom_fields.enum_value.enabled",
"custom_fields.enum_value.name",
"custom_fields.format",
"custom_fields.has_notifications_enabled",
"custom_fields.html_text_value",
"custom_fields.id_prefix",
"custom_fields.input_restrictions",
"custom_fields.is_formula_field",
"custom_fields.is_global_to_workspace",
"custom_fields.is_value_read_only",
"custom_fields.multi_enum_values",
"custom_fields.multi_enum_values.color",
"custom_fields.multi_enum_values.enabled",
"custom_fields.multi_enum_values.name",
"custom_fields.name",
"custom_fields.number_value",
"custom_fields.people_value",
"custom_fields.people_value.name",
"custom_fields.precision",
"custom_fields.privacy_setting",
"custom_fields.reference_value",
"custom_fields.reference_value.name",
"custom_fields.representation_type",
"custom_fields.resource_subtype",
"custom_fields.text_value",
"custom_fields.type",
"custom_type",
"custom_type.asana_created_type_identifier",
"custom_type.name",
"custom_type_status_option",
"custom_type_status_option.name",
"dependencies",
"dependents",
"due_at",
"due_on",
"effective_memberships",
"external",
"external.data",
"followers",
"followers.name",
"hearted",
"hearts",
"hearts.user",
"hearts.user.name",
"html_notes",
"is_rendered_as_separator",
"liked",
"likes",
"likes.user",
"likes.user.name",
"memberships",
"memberships.project",
"memberships.project.name",
"memberships.project.resource_subtype",
"memberships.section",
"memberships.section.name",
"modified_at",
"name",
"notes",
"num_hearts",
"num_likes",
"num_subtasks",
"offset",
"parent",
"parent.created_by",
"parent.name",
"parent.resource_subtype",
"path",
"permalink_url",
"projects",
"projects.name",
"projects.resource_subtype",
"resource_subtype",
"start_at",
"start_on",
"tags",
"tags.name",
"uri",
"workspace",
"workspace.name"
]
}
},
"style": "form",
"explode": false
}
],
"responses": {
"200": {
"description": "Successfully retrieved the section's tasks.",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"type": "array",
"items": {
"$ref": "#/components/schemas/TaskCompact"
}
},
"next_page": {
"$ref": "#/components/schemas/NextPage"
}
}
}
}
}
},
"400": {
"$ref": "#/components/responses/BadRequest"
},
"401": {
"$ref": "#/components/responses/Unauthorized"
},
"403": {
"$ref": "#/components/responses/Forbidden"
},
"404": {
"$ref": "#/components/responses/NotFound"
},
"500": {
"$ref": "#/components/responses/InternalServerError"
}
},
"security": [
{
"personalAccessToken": []
},
{
"oauth2": [
"tasks:read"
]
}
],
"x-readme": {
"code-samples": [
{
"language": "java",
"install": "<dependency><groupId>com.asana</groupId><artifactId>asana</artifactId><version>1.0.0</version></dependency>",
"code": "import com.asana.Client;\n\nClient client = Client.accessToken(\"PERSONAL_ACCESS_TOKEN\");\n\nList<Task> result = client.tasks.getTasksForSection(sectionGid)\n .option(\"pretty\", true)\n .execute();"
},
{
"language": "node",
"install": "npm install asana",
"code": "const Asana = require('asana');\n\nlet client = new Asana.ApiClient();\nclient.authentications.token.accessToken = '<YOUR_ACCESS_TOKEN>';\n\nlet tasksApiInstance = new Asana.TasksApi(client);\nlet section_gid = \"321654\"; // String | The globally unique identifier for the section.\nlet opts = { \n 'limit': 50, \n 'offset': \"eyJ0eXAiOJiKV1iQLCJhbGciOiJIUzI1NiJ9\", \n 'completed_since': \"2012-02-22T02:06:58.158Z\", \n 'opt_fields': \"actual_time_minutes,approval_status,assigned_by,assigned_by.name,assignee,assignee.name,assignee_section,assignee_section.name,assignee_status,completed,completed_at,completed_by,completed_by.name,created_at,created_by,custom_fields,custom_fields.asana_created_field,custom_fields.created_by,custom_fields.created_by.name,custom_fields.currency_code,custom_fields.custom_label,custom_fields.custom_label_position,custom_fields.date_value,custom_fields.date_value.date,custom_fields.date_value.date_time,custom_fields.default_access_level,custom_fields.description,custom_fields.display_value,custom_fields.enabled,custom_fields.enum_options,custom_fields.enum_options.color,custom_fields.enum_options.enabled,custom_fields.enum_options.name,custom_fields.enum_value,custom_fields.enum_value.color,custom_fields.enum_value.enabled,custom_fields.enum_value.name,custom_fields.format,custom_fields.has_notifications_enabled,custom_fields.html_text_value,custom_fields.id_prefix,custom_fields.input_restrictions,custom_fields.is_formula_field,custom_fields.is_global_to_workspace,custom_fields.is_value_read_only,custom_fields.multi_enum_values,custom_fields.multi_enum_values.color,custom_fields.multi_enum_values.enabled,custom_fields.multi_enum_values.name,custom_fields.name,custom_fields.number_value,custom_fields.people_value,custom_fields.people_value.name,custom_fields.precision,custom_fields.privacy_setting,custom_fields.reference_value,custom_fields.reference_value.name,custom_fields.representation_type,custom_fields.resource_subtype,custom_fields.text_value,custom_fields.type,custom_type,custom_type.asana_created_type_identifier,custom_type.name,custom_type_status_option,custom_type_status_option.name,dependencies,dependents,due_at,due_on,effective_memberships,external,external.data,followers,followers.name,hearted,hearts,hearts.user,hearts.user.name,html_notes,is_rendered_as_separator,liked,likes,likes.user,likes.user.name,memberships,memberships.project,memberships.project.name,memberships.project.resource_subtype,memberships.section,memberships.section.name,modified_at,name,notes,num_hearts,num_likes,num_subtasks,offset,parent,parent.created_by,parent.name,parent.resource_subtype,path,permalink_url,projects,projects.name,projects.resource_subtype,resource_subtype,start_at,start_on,tags,tags.name,uri,workspace,workspace.name\"\n};\ntasksApiInstance.getTasksForSection(section_gid, opts).then((result) => {\n console.log('API called successfully. Returned data: ' + JSON.stringify(result.data, null, 2));\n}, (error) => {\n console.error(error.response.body);\n});",
"name": "node-sdk-v3"
},
{
"language": "node",
"install": "npm install asana@1.0.5",
"code": "const asana = require('asana');\n\nconst client = asana.Client.create().useAccessToken('PERSONAL_ACCESS_TOKEN');\n\nclient.tasks.getTasksForSection(sectionGid, {param: \"value\", param: \"value\", opt_pretty: true})\n .then((result) => {\n console.log(result);\n });",
"name": "node-sdk-v1"
},
{
"language": "python",
"install": "pip install asana",
"code": "import asana\nfrom asana.rest import ApiException\nfrom pprint import pprint\n\nconfiguration = asana.Configuration()\nconfiguration.access_token = '<YOUR_ACCESS_TOKEN>'\napi_client = asana.ApiClient(configuration)\n\n# create an instance of the API class\ntasks_api_instance = asana.TasksApi(api_client)\nsection_gid = \"321654\" # str | The globally unique identifier for the section.\nopts = {\n 'limit': 50, # int | Results per page. The number of objects to return per page. The value must be between 1 and 100.\n 'offset': \"eyJ0eXAiOJiKV1iQLCJhbGciOiJIUzI1NiJ9\", # str | 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.*\n 'completed_since': \"2012-02-22T02:06:58.158Z\", # str | Only return tasks that are either incomplete or that have been completed since this time. Accepts a date-time string or the keyword *now*. \n 'opt_fields': \"actual_time_minutes,approval_status,assigned_by,assigned_by.name,assignee,assignee.name,assignee_section,assignee_section.name,assignee_status,completed,completed_at,completed_by,completed_by.name,created_at,created_by,custom_fields,custom_fields.asana_created_field,custom_fields.created_by,custom_fields.created_by.name,custom_fields.currency_code,custom_fields.custom_label,custom_fields.custom_label_position,custom_fields.date_value,custom_fields.date_value.date,custom_fields.date_value.date_time,custom_fields.default_access_level,custom_fields.description,custom_fields.display_value,custom_fields.enabled,custom_fields.enum_options,custom_fields.enum_options.color,custom_fields.enum_options.enabled,custom_fields.enum_options.name,custom_fields.enum_value,custom_fields.enum_value.color,custom_fields.enum_value.enabled,custom_fields.enum_value.name,custom_fields.format,custom_fields.has_notifications_enabled,custom_fields.html_text_value,custom_fields.id_prefix,custom_fields.input_restrictions,custom_fields.is_formula_field,custom_fields.is_global_to_workspace,custom_fields.is_value_read_only,custom_fields.multi_enum_values,custom_fields.multi_enum_values.color,custom_fields.multi_enum_values.enabled,custom_fields.multi_enum_values.name,custom_fields.name,custom_fields.number_value,custom_fields.people_value,custom_fields.people_value.name,custom_fields.precision,custom_fields.privacy_setting,custom_fields.reference_value,custom_fields.reference_value.name,custom_fields.representation_type,custom_fields.resource_subtype,custom_fields.text_value,custom_fields.type,custom_type,custom_type.asana_created_type_identifier,custom_type.name,custom_type_status_option,custom_type_status_option.name,dependencies,dependents,due_at,due_on,effective_memberships,external,external.data,followers,followers.name,hearted,hearts,hearts.user,hearts.user.name,html_notes,is_rendered_as_separator,liked,likes,likes.user,likes.user.name,memberships,memberships.project,memberships.project.name,memberships.project.resource_subtype,memberships.section,memberships.section.name,modified_at,name,notes,num_hearts,num_likes,num_subtasks,offset,parent,parent.created_by,parent.name,parent.resource_subtype,path,permalink_url,projects,projects.name,projects.resource_subtype,resource_subtype,start_at,start_on,tags,tags.name,uri,workspace,workspace.name\", # list[str] | 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.\n}\n\ntry:\n # Get tasks from a section\n api_response = tasks_api_instance.get_tasks_for_section(section_gid, opts)\n for data in api_response:\n pprint(data)\nexcept ApiException as e:\n print(\"Exception when calling TasksApi->get_tasks_for_section: %s\\n\" % e)",
"name": "python-sdk-v5"
},
{
"language": "python",
"install": "pip install asana==3.2.3",
"code": "import asana\n\nclient = asana.Client.access_token('PERSONAL_ACCESS_TOKEN')\n\nresult = client.tasks.get_tasks_for_section(section_gid, {'param': 'value', 'param': 'value'}, opt_pretty=True)",
"name": "python-sdk-v3"
},
{
"language": "php",
"install": "composer require asana/asana",
"code": "<?php\nrequire 'vendor/autoload.php';\n\n$client = Asana\\Client::accessToken('PERSONAL_ACCESS_TOKEN');\n\n$result = $client->tasks->getTasksForSection($section_gid, array('param' => 'value', 'param' => 'value'), array('opt_pretty' => 'true'))"
},
{
"language": "ruby",
"install": "gem install asana",
"code": "require 'asana'\n\nclient = Asana::Client.new do |c|\n c.authentication :access_token, 'PERSONAL_ACCESS_TOKEN'\nend\n\nresult = client.tasks.get_tasks_for_section(section_gid: 'section_gid', param: \"value\", param: \"value\", options: {pretty: true})"
}
]
},
"x-purple-suite-runtime": "modeled-core",
"x-purple-suite-supported-query": [
"opt_pretty",
"limit",
"offset",
"completed_since",
"opt_fields"
],
"x-purple-suite-supported-response-fields": [
"gid",
"resource_type",
"resource_subtype",
"name",
"notes",
"completed",
"completed_at",
"created_at",
"modified_at",
"assignee",
"assignee_status",
"workspace",
"projects",
"memberships",
"parent",
"due_on",
"start_on",
"tags",
"dependencies",
"num_subtasks",
"archived",
"public",
"color",
"default_view",
"team",
"project",
"section",
"text",
"created_by",
"target",
"type",
"email",
"photo",
"is_organization"
]
}
GET /api/1.0/tags/{tag_gid}/tasks
Get tasks from a tag
<b>Required scope: </b><code>tasks:read</code>
Returns the compact task records for all tasks with the given tag. Tasks can have more than one tag at a time.
The persistent core model supports the response and query fields named in x-purple-suite-supported-response-fields and x-purple-suite-supported-query. Other fields/options return an explicit 400 errors envelope.
Authentication
[
{
"personalAccessToken": []
},
{
"oauth2": [
"tasks:read"
]
}
]
Path-level parameters and metadata
{
"parameters": [
{
"$ref": "#/components/parameters/tag_path_gid"
},
{
"$ref": "#/components/parameters/pretty"
},
{
"$ref": "#/components/parameters/limit"
},
{
"$ref": "#/components/parameters/offset"
}
]
}
Request, responses and operation details
{
"summary": "Get tasks from a tag",
"description": "<b>Required scope: </b><code>tasks:read</code>\n\nReturns the compact task records for all tasks with the given tag. Tasks can have more than one tag at a time.\n\nThe persistent core model supports the response and query fields named in x-purple-suite-supported-response-fields and x-purple-suite-supported-query. Other fields/options return an explicit 400 errors envelope.",
"tags": [
"Tasks"
],
"operationId": "getTasksForTag",
"parameters": [
{
"name": "opt_fields",
"in": "query",
"description": "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. Properties can include nested fields. To learn more, see the [input/output options guide](/docs/inputoutput-options#selecting-nested-fields).",
"required": false,
"example": [
"actual_time_minutes",
"approval_status",
"assigned_by",
"assigned_by.name",
"assignee",
"assignee.name",
"assignee_section",
"assignee_section.name",
"assignee_status",
"completed",
"completed_at",
"completed_by",
"completed_by.name",
"created_at",
"created_by",
"custom_fields",
"custom_fields.asana_created_field",
"custom_fields.created_by",
"custom_fields.created_by.name",
"custom_fields.currency_code",
"custom_fields.custom_label",
"custom_fields.custom_label_position",
"custom_fields.date_value",
"custom_fields.date_value.date",
"custom_fields.date_value.date_time",
"custom_fields.default_access_level",
"custom_fields.description",
"custom_fields.display_value",
"custom_fields.enabled",
"custom_fields.enum_options",
"custom_fields.enum_options.color",
"custom_fields.enum_options.enabled",
"custom_fields.enum_options.name",
"custom_fields.enum_value",
"custom_fields.enum_value.color",
"custom_fields.enum_value.enabled",
"custom_fields.enum_value.name",
"custom_fields.format",
"custom_fields.has_notifications_enabled",
"custom_fields.html_text_value",
"custom_fields.id_prefix",
"custom_fields.input_restrictions",
"custom_fields.is_formula_field",
"custom_fields.is_global_to_workspace",
"custom_fields.is_value_read_only",
"custom_fields.multi_enum_values",
"custom_fields.multi_enum_values.color",
"custom_fields.multi_enum_values.enabled",
"custom_fields.multi_enum_values.name",
"custom_fields.name",
"custom_fields.number_value",
"custom_fields.people_value",
"custom_fields.people_value.name",
"custom_fields.precision",
"custom_fields.privacy_setting",
"custom_fields.reference_value",
"custom_fields.reference_value.name",
"custom_fields.representation_type",
"custom_fields.resource_subtype",
"custom_fields.text_value",
"custom_fields.type",
"custom_type",
"custom_type.asana_created_type_identifier",
"custom_type.name",
"custom_type_status_option",
"custom_type_status_option.name",
"dependencies",
"dependents",
"due_at",
"due_on",
"effective_memberships",
"external",
"external.data",
"followers",
"followers.name",
"hearted",
"hearts",
"hearts.user",
"hearts.user.name",
"html_notes",
"is_rendered_as_separator",
"liked",
"likes",
"likes.user",
"likes.user.name",
"memberships",
"memberships.project",
"memberships.project.name",
"memberships.project.resource_subtype",
"memberships.section",
"memberships.section.name",
"modified_at",
"name",
"notes",
"num_hearts",
"num_likes",
"num_subtasks",
"offset",
"parent",
"parent.created_by",
"parent.name",
"parent.resource_subtype",
"path",
"permalink_url",
"projects",
"projects.name",
"projects.resource_subtype",
"resource_subtype",
"start_at",
"start_on",
"tags",
"tags.name",
"uri",
"workspace",
"workspace.name"
],
"schema": {
"type": "array",
"items": {
"type": "string",
"enum": [
"actual_time_minutes",
"approval_status",
"assigned_by",
"assigned_by.name",
"assignee",
"assignee.name",
"assignee_section",
"assignee_section.name",
"assignee_status",
"completed",
"completed_at",
"completed_by",
"completed_by.name",
"created_at",
"created_by",
"custom_fields",
"custom_fields.asana_created_field",
"custom_fields.created_by",
"custom_fields.created_by.name",
"custom_fields.currency_code",
"custom_fields.custom_label",
"custom_fields.custom_label_position",
"custom_fields.date_value",
"custom_fields.date_value.date",
"custom_fields.date_value.date_time",
"custom_fields.default_access_level",
"custom_fields.description",
"custom_fields.display_value",
"custom_fields.enabled",
"custom_fields.enum_options",
"custom_fields.enum_options.color",
"custom_fields.enum_options.enabled",
"custom_fields.enum_options.name",
"custom_fields.enum_value",
"custom_fields.enum_value.color",
"custom_fields.enum_value.enabled",
"custom_fields.enum_value.name",
"custom_fields.format",
"custom_fields.has_notifications_enabled",
"custom_fields.html_text_value",
"custom_fields.id_prefix",
"custom_fields.input_restrictions",
"custom_fields.is_formula_field",
"custom_fields.is_global_to_workspace",
"custom_fields.is_value_read_only",
"custom_fields.multi_enum_values",
"custom_fields.multi_enum_values.color",
"custom_fields.multi_enum_values.enabled",
"custom_fields.multi_enum_values.name",
"custom_fields.name",
"custom_fields.number_value",
"custom_fields.people_value",
"custom_fields.people_value.name",
"custom_fields.precision",
"custom_fields.privacy_setting",
"custom_fields.reference_value",
"custom_fields.reference_value.name",
"custom_fields.representation_type",
"custom_fields.resource_subtype",
"custom_fields.text_value",
"custom_fields.type",
"custom_type",
"custom_type.asana_created_type_identifier",
"custom_type.name",
"custom_type_status_option",
"custom_type_status_option.name",
"dependencies",
"dependents",
"due_at",
"due_on",
"effective_memberships",
"external",
"external.data",
"followers",
"followers.name",
"hearted",
"hearts",
"hearts.user",
"hearts.user.name",
"html_notes",
"is_rendered_as_separator",
"liked",
"likes",
"likes.user",
"likes.user.name",
"memberships",
"memberships.project",
"memberships.project.name",
"memberships.project.resource_subtype",
"memberships.section",
"memberships.section.name",
"modified_at",
"name",
"notes",
"num_hearts",
"num_likes",
"num_subtasks",
"offset",
"parent",
"parent.created_by",
"parent.name",
"parent.resource_subtype",
"path",
"permalink_url",
"projects",
"projects.name",
"projects.resource_subtype",
"resource_subtype",
"start_at",
"start_on",
"tags",
"tags.name",
"uri",
"workspace",
"workspace.name"
]
}
},
"style": "form",
"explode": false
}
],
"responses": {
"200": {
"description": "Successfully retrieved the tasks associated with the specified tag.",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"type": "array",
"items": {
"$ref": "#/components/schemas/TaskCompact"
}
},
"next_page": {
"$ref": "#/components/schemas/NextPage"
}
}
}
}
}
},
"400": {
"$ref": "#/components/responses/BadRequest"
},
"401": {
"$ref": "#/components/responses/Unauthorized"
},
"403": {
"$ref": "#/components/responses/Forbidden"
},
"404": {
"$ref": "#/components/responses/NotFound"
},
"500": {
"$ref": "#/components/responses/InternalServerError"
}
},
"security": [
{
"personalAccessToken": []
},
{
"oauth2": [
"tasks:read"
]
}
],
"x-readme": {
"code-samples": [
{
"language": "java",
"install": "<dependency><groupId>com.asana</groupId><artifactId>asana</artifactId><version>1.0.0</version></dependency>",
"code": "import com.asana.Client;\n\nClient client = Client.accessToken(\"PERSONAL_ACCESS_TOKEN\");\n\nList<Task> result = client.tasks.getTasksForTag(tagGid)\n .option(\"pretty\", true)\n .execute();"
},
{
"language": "node",
"install": "npm install asana",
"code": "const Asana = require('asana');\n\nlet client = new Asana.ApiClient();\nclient.authentications.token.accessToken = '<YOUR_ACCESS_TOKEN>';\n\nlet tasksApiInstance = new Asana.TasksApi(client);\nlet tag_gid = \"11235\"; // String | Globally unique identifier for the tag.\nlet opts = { \n 'limit': 50, \n 'offset': \"eyJ0eXAiOJiKV1iQLCJhbGciOiJIUzI1NiJ9\", \n 'opt_fields': \"actual_time_minutes,approval_status,assigned_by,assigned_by.name,assignee,assignee.name,assignee_section,assignee_section.name,assignee_status,completed,completed_at,completed_by,completed_by.name,created_at,created_by,custom_fields,custom_fields.asana_created_field,custom_fields.created_by,custom_fields.created_by.name,custom_fields.currency_code,custom_fields.custom_label,custom_fields.custom_label_position,custom_fields.date_value,custom_fields.date_value.date,custom_fields.date_value.date_time,custom_fields.default_access_level,custom_fields.description,custom_fields.display_value,custom_fields.enabled,custom_fields.enum_options,custom_fields.enum_options.color,custom_fields.enum_options.enabled,custom_fields.enum_options.name,custom_fields.enum_value,custom_fields.enum_value.color,custom_fields.enum_value.enabled,custom_fields.enum_value.name,custom_fields.format,custom_fields.has_notifications_enabled,custom_fields.html_text_value,custom_fields.id_prefix,custom_fields.input_restrictions,custom_fields.is_formula_field,custom_fields.is_global_to_workspace,custom_fields.is_value_read_only,custom_fields.multi_enum_values,custom_fields.multi_enum_values.color,custom_fields.multi_enum_values.enabled,custom_fields.multi_enum_values.name,custom_fields.name,custom_fields.number_value,custom_fields.people_value,custom_fields.people_value.name,custom_fields.precision,custom_fields.privacy_setting,custom_fields.reference_value,custom_fields.reference_value.name,custom_fields.representation_type,custom_fields.resource_subtype,custom_fields.text_value,custom_fields.type,custom_type,custom_type.asana_created_type_identifier,custom_type.name,custom_type_status_option,custom_type_status_option.name,dependencies,dependents,due_at,due_on,effective_memberships,external,external.data,followers,followers.name,hearted,hearts,hearts.user,hearts.user.name,html_notes,is_rendered_as_separator,liked,likes,likes.user,likes.user.name,memberships,memberships.project,memberships.project.name,memberships.project.resource_subtype,memberships.section,memberships.section.name,modified_at,name,notes,num_hearts,num_likes,num_subtasks,offset,parent,parent.created_by,parent.name,parent.resource_subtype,path,permalink_url,projects,projects.name,projects.resource_subtype,resource_subtype,start_at,start_on,tags,tags.name,uri,workspace,workspace.name\"\n};\ntasksApiInstance.getTasksForTag(tag_gid, opts).then((result) => {\n console.log('API called successfully. Returned data: ' + JSON.stringify(result.data, null, 2));\n}, (error) => {\n console.error(error.response.body);\n});",
"name": "node-sdk-v3"
},
{
"language": "node",
"install": "npm install asana@1.0.5",
"code": "const asana = require('asana');\n\nconst client = asana.Client.create().useAccessToken('PERSONAL_ACCESS_TOKEN');\n\nclient.tasks.getTasksForTag(tagGid, {param: \"value\", param: \"value\", opt_pretty: true})\n .then((result) => {\n console.log(result);\n });",
"name": "node-sdk-v1"
},
{
"language": "python",
"install": "pip install asana",
"code": "import asana\nfrom asana.rest import ApiException\nfrom pprint import pprint\n\nconfiguration = asana.Configuration()\nconfiguration.access_token = '<YOUR_ACCESS_TOKEN>'\napi_client = asana.ApiClient(configuration)\n\n# create an instance of the API class\ntasks_api_instance = asana.TasksApi(api_client)\ntag_gid = \"11235\" # str | Globally unique identifier for the tag.\nopts = {\n 'limit': 50, # int | Results per page. The number of objects to return per page. The value must be between 1 and 100.\n 'offset': \"eyJ0eXAiOJiKV1iQLCJhbGciOiJIUzI1NiJ9\", # str | 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.*\n 'opt_fields': \"actual_time_minutes,approval_status,assigned_by,assigned_by.name,assignee,assignee.name,assignee_section,assignee_section.name,assignee_status,completed,completed_at,completed_by,completed_by.name,created_at,created_by,custom_fields,custom_fields.asana_created_field,custom_fields.created_by,custom_fields.created_by.name,custom_fields.currency_code,custom_fields.custom_label,custom_fields.custom_label_position,custom_fields.date_value,custom_fields.date_value.date,custom_fields.date_value.date_time,custom_fields.default_access_level,custom_fields.description,custom_fields.display_value,custom_fields.enabled,custom_fields.enum_options,custom_fields.enum_options.color,custom_fields.enum_options.enabled,custom_fields.enum_options.name,custom_fields.enum_value,custom_fields.enum_value.color,custom_fields.enum_value.enabled,custom_fields.enum_value.name,custom_fields.format,custom_fields.has_notifications_enabled,custom_fields.html_text_value,custom_fields.id_prefix,custom_fields.input_restrictions,custom_fields.is_formula_field,custom_fields.is_global_to_workspace,custom_fields.is_value_read_only,custom_fields.multi_enum_values,custom_fields.multi_enum_values.color,custom_fields.multi_enum_values.enabled,custom_fields.multi_enum_values.name,custom_fields.name,custom_fields.number_value,custom_fields.people_value,custom_fields.people_value.name,custom_fields.precision,custom_fields.privacy_setting,custom_fields.reference_value,custom_fields.reference_value.name,custom_fields.representation_type,custom_fields.resource_subtype,custom_fields.text_value,custom_fields.type,custom_type,custom_type.asana_created_type_identifier,custom_type.name,custom_type_status_option,custom_type_status_option.name,dependencies,dependents,due_at,due_on,effective_memberships,external,external.data,followers,followers.name,hearted,hearts,hearts.user,hearts.user.name,html_notes,is_rendered_as_separator,liked,likes,likes.user,likes.user.name,memberships,memberships.project,memberships.project.name,memberships.project.resource_subtype,memberships.section,memberships.section.name,modified_at,name,notes,num_hearts,num_likes,num_subtasks,offset,parent,parent.created_by,parent.name,parent.resource_subtype,path,permalink_url,projects,projects.name,projects.resource_subtype,resource_subtype,start_at,start_on,tags,tags.name,uri,workspace,workspace.name\", # list[str] | 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.\n}\n\ntry:\n # Get tasks from a tag\n api_response = tasks_api_instance.get_tasks_for_tag(tag_gid, opts)\n for data in api_response:\n pprint(data)\nexcept ApiException as e:\n print(\"Exception when calling TasksApi->get_tasks_for_tag: %s\\n\" % e)",
"name": "python-sdk-v5"
},
{
"language": "python",
"install": "pip install asana==3.2.3",
"code": "import asana\n\nclient = asana.Client.access_token('PERSONAL_ACCESS_TOKEN')\n\nresult = client.tasks.get_tasks_for_tag(tag_gid, {'param': 'value', 'param': 'value'}, opt_pretty=True)",
"name": "python-sdk-v3"
},
{
"language": "php",
"install": "composer require asana/asana",
"code": "<?php\nrequire 'vendor/autoload.php';\n\n$client = Asana\\Client::accessToken('PERSONAL_ACCESS_TOKEN');\n\n$result = $client->tasks->getTasksForTag($tag_gid, array('param' => 'value', 'param' => 'value'), array('opt_pretty' => 'true'))"
},
{
"language": "ruby",
"install": "gem install asana",
"code": "require 'asana'\n\nclient = Asana::Client.new do |c|\n c.authentication :access_token, 'PERSONAL_ACCESS_TOKEN'\nend\n\nresult = client.tasks.get_tasks_for_tag(tag_gid: 'tag_gid', param: \"value\", param: \"value\", options: {pretty: true})"
}
]
},
"x-purple-suite-runtime": "modeled-core",
"x-purple-suite-supported-query": [
"opt_pretty",
"limit",
"offset",
"opt_fields"
],
"x-purple-suite-supported-response-fields": [
"gid",
"resource_type",
"resource_subtype",
"name",
"notes",
"completed",
"completed_at",
"created_at",
"modified_at",
"assignee",
"assignee_status",
"workspace",
"projects",
"memberships",
"parent",
"due_on",
"start_on",
"tags",
"dependencies",
"num_subtasks",
"archived",
"public",
"color",
"default_view",
"team",
"project",
"section",
"text",
"created_by",
"target",
"type",
"email",
"photo",
"is_organization"
]
}
GET /api/1.0/user_task_lists/{user_task_list_gid}/tasks
Get tasks from a user task list
<b>Required scope: </b><code>tasks:read</code>
Returns the compact list of tasks in a user’s My Tasks list.
*Note: Access control is enforced for this endpoint as with all Asana API endpoints, meaning a user’s private tasks will be filtered out if the API-authenticated user does not have access to them.*
*Note: Both complete and incomplete tasks are returned by default unless they are filtered out (for example, setting `completed_since=now` will return only incomplete tasks, which is the default view for “My Tasks” in Asana.)*
This operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.
Authentication
[
{
"personalAccessToken": []
},
{
"oauth2": [
"tasks:read"
]
}
]
Path-level parameters and metadata
{
"parameters": [
{
"$ref": "#/components/parameters/completed_since"
},
{
"$ref": "#/components/parameters/user_task_list_path_gid"
},
{
"$ref": "#/components/parameters/pretty"
},
{
"$ref": "#/components/parameters/limit"
},
{
"$ref": "#/components/parameters/offset"
}
]
}
Request, responses and operation details
{
"summary": "Get tasks from a user task list",
"description": "<b>Required scope: </b><code>tasks:read</code>\n\nReturns the compact list of tasks in a user’s My Tasks list.\n*Note: Access control is enforced for this endpoint as with all Asana API endpoints, meaning a user’s private tasks will be filtered out if the API-authenticated user does not have access to them.*\n*Note: Both complete and incomplete tasks are returned by default unless they are filtered out (for example, setting `completed_since=now` will return only incomplete tasks, which is the default view for “My Tasks” in Asana.)*\n\nThis operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.",
"tags": [
"Tasks"
],
"operationId": "getTasksForUserTaskList",
"parameters": [
{
"name": "opt_fields",
"in": "query",
"description": "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. Properties can include nested fields. To learn more, see the [input/output options guide](/docs/inputoutput-options#selecting-nested-fields).",
"required": false,
"example": [
"actual_time_minutes",
"approval_status",
"assigned_by",
"assigned_by.name",
"assignee",
"assignee.name",
"assignee_section",
"assignee_section.name",
"assignee_status",
"completed",
"completed_at",
"completed_by",
"completed_by.name",
"created_at",
"created_by",
"custom_fields",
"custom_fields.asana_created_field",
"custom_fields.created_by",
"custom_fields.created_by.name",
"custom_fields.currency_code",
"custom_fields.custom_label",
"custom_fields.custom_label_position",
"custom_fields.date_value",
"custom_fields.date_value.date",
"custom_fields.date_value.date_time",
"custom_fields.default_access_level",
"custom_fields.description",
"custom_fields.display_value",
"custom_fields.enabled",
"custom_fields.enum_options",
"custom_fields.enum_options.color",
"custom_fields.enum_options.enabled",
"custom_fields.enum_options.name",
"custom_fields.enum_value",
"custom_fields.enum_value.color",
"custom_fields.enum_value.enabled",
"custom_fields.enum_value.name",
"custom_fields.format",
"custom_fields.has_notifications_enabled",
"custom_fields.html_text_value",
"custom_fields.id_prefix",
"custom_fields.input_restrictions",
"custom_fields.is_formula_field",
"custom_fields.is_global_to_workspace",
"custom_fields.is_value_read_only",
"custom_fields.multi_enum_values",
"custom_fields.multi_enum_values.color",
"custom_fields.multi_enum_values.enabled",
"custom_fields.multi_enum_values.name",
"custom_fields.name",
"custom_fields.number_value",
"custom_fields.people_value",
"custom_fields.people_value.name",
"custom_fields.precision",
"custom_fields.privacy_setting",
"custom_fields.reference_value",
"custom_fields.reference_value.name",
"custom_fields.representation_type",
"custom_fields.resource_subtype",
"custom_fields.text_value",
"custom_fields.type",
"custom_type",
"custom_type.asana_created_type_identifier",
"custom_type.name",
"custom_type_status_option",
"custom_type_status_option.name",
"dependencies",
"dependents",
"due_at",
"due_on",
"effective_memberships",
"external",
"external.data",
"followers",
"followers.name",
"hearted",
"hearts",
"hearts.user",
"hearts.user.name",
"html_notes",
"is_rendered_as_separator",
"liked",
"likes",
"likes.user",
"likes.user.name",
"memberships",
"memberships.project",
"memberships.project.name",
"memberships.project.resource_subtype",
"memberships.section",
"memberships.section.name",
"modified_at",
"name",
"notes",
"num_hearts",
"num_likes",
"num_subtasks",
"offset",
"parent",
"parent.created_by",
"parent.name",
"parent.resource_subtype",
"path",
"permalink_url",
"projects",
"projects.name",
"projects.resource_subtype",
"resource_subtype",
"start_at",
"start_on",
"tags",
"tags.name",
"uri",
"workspace",
"workspace.name"
],
"schema": {
"type": "array",
"items": {
"type": "string",
"enum": [
"actual_time_minutes",
"approval_status",
"assigned_by",
"assigned_by.name",
"assignee",
"assignee.name",
"assignee_section",
"assignee_section.name",
"assignee_status",
"completed",
"completed_at",
"completed_by",
"completed_by.name",
"created_at",
"created_by",
"custom_fields",
"custom_fields.asana_created_field",
"custom_fields.created_by",
"custom_fields.created_by.name",
"custom_fields.currency_code",
"custom_fields.custom_label",
"custom_fields.custom_label_position",
"custom_fields.date_value",
"custom_fields.date_value.date",
"custom_fields.date_value.date_time",
"custom_fields.default_access_level",
"custom_fields.description",
"custom_fields.display_value",
"custom_fields.enabled",
"custom_fields.enum_options",
"custom_fields.enum_options.color",
"custom_fields.enum_options.enabled",
"custom_fields.enum_options.name",
"custom_fields.enum_value",
"custom_fields.enum_value.color",
"custom_fields.enum_value.enabled",
"custom_fields.enum_value.name",
"custom_fields.format",
"custom_fields.has_notifications_enabled",
"custom_fields.html_text_value",
"custom_fields.id_prefix",
"custom_fields.input_restrictions",
"custom_fields.is_formula_field",
"custom_fields.is_global_to_workspace",
"custom_fields.is_value_read_only",
"custom_fields.multi_enum_values",
"custom_fields.multi_enum_values.color",
"custom_fields.multi_enum_values.enabled",
"custom_fields.multi_enum_values.name",
"custom_fields.name",
"custom_fields.number_value",
"custom_fields.people_value",
"custom_fields.people_value.name",
"custom_fields.precision",
"custom_fields.privacy_setting",
"custom_fields.reference_value",
"custom_fields.reference_value.name",
"custom_fields.representation_type",
"custom_fields.resource_subtype",
"custom_fields.text_value",
"custom_fields.type",
"custom_type",
"custom_type.asana_created_type_identifier",
"custom_type.name",
"custom_type_status_option",
"custom_type_status_option.name",
"dependencies",
"dependents",
"due_at",
"due_on",
"effective_memberships",
"external",
"external.data",
"followers",
"followers.name",
"hearted",
"hearts",
"hearts.user",
"hearts.user.name",
"html_notes",
"is_rendered_as_separator",
"liked",
"likes",
"likes.user",
"likes.user.name",
"memberships",
"memberships.project",
"memberships.project.name",
"memberships.project.resource_subtype",
"memberships.section",
"memberships.section.name",
"modified_at",
"name",
"notes",
"num_hearts",
"num_likes",
"num_subtasks",
"offset",
"parent",
"parent.created_by",
"parent.name",
"parent.resource_subtype",
"path",
"permalink_url",
"projects",
"projects.name",
"projects.resource_subtype",
"resource_subtype",
"start_at",
"start_on",
"tags",
"tags.name",
"uri",
"workspace",
"workspace.name"
]
}
},
"style": "form",
"explode": false
}
],
"responses": {
"200": {
"description": "Successfully retrieved the user task list's tasks.",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"type": "array",
"items": {
"$ref": "#/components/schemas/TaskCompact"
}
},
"next_page": {
"$ref": "#/components/schemas/NextPage"
}
}
}
}
}
},
"400": {
"$ref": "#/components/responses/BadRequest"
},
"401": {
"$ref": "#/components/responses/Unauthorized"
},
"403": {
"$ref": "#/components/responses/Forbidden"
},
"404": {
"$ref": "#/components/responses/NotFound"
},
"500": {
"$ref": "#/components/responses/InternalServerError"
}
},
"security": [
{
"personalAccessToken": []
},
{
"oauth2": [
"tasks:read"
]
}
],
"x-readme": {
"code-samples": [
{
"language": "java",
"install": "<dependency><groupId>com.asana</groupId><artifactId>asana</artifactId><version>1.0.0</version></dependency>",
"code": "import com.asana.Client;\n\nClient client = Client.accessToken(\"PERSONAL_ACCESS_TOKEN\");\n\nList<Task> result = client.tasks.getTasksForUserTaskList(userTaskListGid, completedSince)\n .option(\"pretty\", true)\n .execute();"
},
{
"language": "node",
"install": "npm install asana",
"code": "const Asana = require('asana');\n\nlet client = new Asana.ApiClient();\nclient.authentications.token.accessToken = '<YOUR_ACCESS_TOKEN>';\n\nlet tasksApiInstance = new Asana.TasksApi(client);\nlet user_task_list_gid = \"12345\"; // String | Globally unique identifier for the user task list.\nlet opts = { \n 'completed_since': \"2012-02-22T02:06:58.158Z\", \n 'limit': 50, \n 'offset': \"eyJ0eXAiOJiKV1iQLCJhbGciOiJIUzI1NiJ9\", \n 'opt_fields': \"actual_time_minutes,approval_status,assigned_by,assigned_by.name,assignee,assignee.name,assignee_section,assignee_section.name,assignee_status,completed,completed_at,completed_by,completed_by.name,created_at,created_by,custom_fields,custom_fields.asana_created_field,custom_fields.created_by,custom_fields.created_by.name,custom_fields.currency_code,custom_fields.custom_label,custom_fields.custom_label_position,custom_fields.date_value,custom_fields.date_value.date,custom_fields.date_value.date_time,custom_fields.default_access_level,custom_fields.description,custom_fields.display_value,custom_fields.enabled,custom_fields.enum_options,custom_fields.enum_options.color,custom_fields.enum_options.enabled,custom_fields.enum_options.name,custom_fields.enum_value,custom_fields.enum_value.color,custom_fields.enum_value.enabled,custom_fields.enum_value.name,custom_fields.format,custom_fields.has_notifications_enabled,custom_fields.html_text_value,custom_fields.id_prefix,custom_fields.input_restrictions,custom_fields.is_formula_field,custom_fields.is_global_to_workspace,custom_fields.is_value_read_only,custom_fields.multi_enum_values,custom_fields.multi_enum_values.color,custom_fields.multi_enum_values.enabled,custom_fields.multi_enum_values.name,custom_fields.name,custom_fields.number_value,custom_fields.people_value,custom_fields.people_value.name,custom_fields.precision,custom_fields.privacy_setting,custom_fields.reference_value,custom_fields.reference_value.name,custom_fields.representation_type,custom_fields.resource_subtype,custom_fields.text_value,custom_fields.type,custom_type,custom_type.asana_created_type_identifier,custom_type.name,custom_type_status_option,custom_type_status_option.name,dependencies,dependents,due_at,due_on,effective_memberships,external,external.data,followers,followers.name,hearted,hearts,hearts.user,hearts.user.name,html_notes,is_rendered_as_separator,liked,likes,likes.user,likes.user.name,memberships,memberships.project,memberships.project.name,memberships.project.resource_subtype,memberships.section,memberships.section.name,modified_at,name,notes,num_hearts,num_likes,num_subtasks,offset,parent,parent.created_by,parent.name,parent.resource_subtype,path,permalink_url,projects,projects.name,projects.resource_subtype,resource_subtype,start_at,start_on,tags,tags.name,uri,workspace,workspace.name\"\n};\ntasksApiInstance.getTasksForUserTaskList(user_task_list_gid, opts).then((result) => {\n console.log('API called successfully. Returned data: ' + JSON.stringify(result.data, null, 2));\n}, (error) => {\n console.error(error.response.body);\n});",
"name": "node-sdk-v3"
},
{
"language": "node",
"install": "npm install asana@1.0.5",
"code": "const asana = require('asana');\n\nconst client = asana.Client.create().useAccessToken('PERSONAL_ACCESS_TOKEN');\n\nclient.tasks.getTasksForUserTaskList(userTaskListGid, {param: \"value\", param: \"value\", opt_pretty: true})\n .then((result) => {\n console.log(result);\n });",
"name": "node-sdk-v1"
},
{
"language": "python",
"install": "pip install asana",
"code": "import asana\nfrom asana.rest import ApiException\nfrom pprint import pprint\n\nconfiguration = asana.Configuration()\nconfiguration.access_token = '<YOUR_ACCESS_TOKEN>'\napi_client = asana.ApiClient(configuration)\n\n# create an instance of the API class\ntasks_api_instance = asana.TasksApi(api_client)\nuser_task_list_gid = \"12345\" # str | Globally unique identifier for the user task list.\nopts = {\n 'completed_since': \"2012-02-22T02:06:58.158Z\", # str | Only return tasks that are either incomplete or that have been completed since this time. Accepts a date-time string or the keyword *now*. \n 'limit': 50, # int | Results per page. The number of objects to return per page. The value must be between 1 and 100.\n 'offset': \"eyJ0eXAiOJiKV1iQLCJhbGciOiJIUzI1NiJ9\", # str | 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.*\n 'opt_fields': \"actual_time_minutes,approval_status,assigned_by,assigned_by.name,assignee,assignee.name,assignee_section,assignee_section.name,assignee_status,completed,completed_at,completed_by,completed_by.name,created_at,created_by,custom_fields,custom_fields.asana_created_field,custom_fields.created_by,custom_fields.created_by.name,custom_fields.currency_code,custom_fields.custom_label,custom_fields.custom_label_position,custom_fields.date_value,custom_fields.date_value.date,custom_fields.date_value.date_time,custom_fields.default_access_level,custom_fields.description,custom_fields.display_value,custom_fields.enabled,custom_fields.enum_options,custom_fields.enum_options.color,custom_fields.enum_options.enabled,custom_fields.enum_options.name,custom_fields.enum_value,custom_fields.enum_value.color,custom_fields.enum_value.enabled,custom_fields.enum_value.name,custom_fields.format,custom_fields.has_notifications_enabled,custom_fields.html_text_value,custom_fields.id_prefix,custom_fields.input_restrictions,custom_fields.is_formula_field,custom_fields.is_global_to_workspace,custom_fields.is_value_read_only,custom_fields.multi_enum_values,custom_fields.multi_enum_values.color,custom_fields.multi_enum_values.enabled,custom_fields.multi_enum_values.name,custom_fields.name,custom_fields.number_value,custom_fields.people_value,custom_fields.people_value.name,custom_fields.precision,custom_fields.privacy_setting,custom_fields.reference_value,custom_fields.reference_value.name,custom_fields.representation_type,custom_fields.resource_subtype,custom_fields.text_value,custom_fields.type,custom_type,custom_type.asana_created_type_identifier,custom_type.name,custom_type_status_option,custom_type_status_option.name,dependencies,dependents,due_at,due_on,effective_memberships,external,external.data,followers,followers.name,hearted,hearts,hearts.user,hearts.user.name,html_notes,is_rendered_as_separator,liked,likes,likes.user,likes.user.name,memberships,memberships.project,memberships.project.name,memberships.project.resource_subtype,memberships.section,memberships.section.name,modified_at,name,notes,num_hearts,num_likes,num_subtasks,offset,parent,parent.created_by,parent.name,parent.resource_subtype,path,permalink_url,projects,projects.name,projects.resource_subtype,resource_subtype,start_at,start_on,tags,tags.name,uri,workspace,workspace.name\", # list[str] | 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.\n}\n\ntry:\n # Get tasks from a user task list\n api_response = tasks_api_instance.get_tasks_for_user_task_list(user_task_list_gid, opts)\n for data in api_response:\n pprint(data)\nexcept ApiException as e:\n print(\"Exception when calling TasksApi->get_tasks_for_user_task_list: %s\\n\" % e)",
"name": "python-sdk-v5"
},
{
"language": "python",
"install": "pip install asana==3.2.3",
"code": "import asana\n\nclient = asana.Client.access_token('PERSONAL_ACCESS_TOKEN')\n\nresult = client.tasks.get_tasks_for_user_task_list(user_task_list_gid, {'param': 'value', 'param': 'value'}, opt_pretty=True)",
"name": "python-sdk-v3"
},
{
"language": "php",
"install": "composer require asana/asana",
"code": "<?php\nrequire 'vendor/autoload.php';\n\n$client = Asana\\Client::accessToken('PERSONAL_ACCESS_TOKEN');\n\n$result = $client->tasks->getTasksForUserTaskList($user_task_list_gid, array('param' => 'value', 'param' => 'value'), array('opt_pretty' => 'true'))"
},
{
"language": "ruby",
"install": "gem install asana",
"code": "require 'asana'\n\nclient = Asana::Client.new do |c|\n c.authentication :access_token, 'PERSONAL_ACCESS_TOKEN'\nend\n\nresult = client.tasks.get_tasks_for_user_task_list(user_task_list_gid: 'user_task_list_gid', param: \"value\", param: \"value\", options: {pretty: true})"
}
]
},
"x-purple-suite-runtime": "unavailable"
}
GET /api/1.0/tasks/{task_gid}/subtasks
Get subtasks from a task
<b>Required scope: </b><code>tasks:read</code>
Returns a compact representation of all of the subtasks of a task.
The persistent core model supports the response and query fields named in x-purple-suite-supported-response-fields and x-purple-suite-supported-query. Other fields/options return an explicit 400 errors envelope.
Authentication
[
{
"personalAccessToken": []
},
{
"oauth2": [
"tasks:read"
]
}
]
Path-level parameters and metadata
{
"parameters": [
{
"$ref": "#/components/parameters/task_path_gid"
},
{
"$ref": "#/components/parameters/pretty"
}
]
}
Request, responses and operation details
{
"summary": "Get subtasks from a task",
"description": "<b>Required scope: </b><code>tasks:read</code>\n\nReturns a compact representation of all of the subtasks of a task.\n\nThe persistent core model supports the response and query fields named in x-purple-suite-supported-response-fields and x-purple-suite-supported-query. Other fields/options return an explicit 400 errors envelope.",
"tags": [
"Tasks"
],
"operationId": "getSubtasksForTask",
"parameters": [
{
"$ref": "#/components/parameters/limit"
},
{
"$ref": "#/components/parameters/offset"
},
{
"name": "opt_fields",
"in": "query",
"description": "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. Properties can include nested fields. To learn more, see the [input/output options guide](/docs/inputoutput-options#selecting-nested-fields).",
"required": false,
"example": [
"actual_time_minutes",
"approval_status",
"assigned_by",
"assigned_by.name",
"assignee",
"assignee.name",
"assignee_section",
"assignee_section.name",
"assignee_status",
"completed",
"completed_at",
"completed_by",
"completed_by.name",
"created_at",
"created_by",
"custom_fields",
"custom_fields.asana_created_field",
"custom_fields.created_by",
"custom_fields.created_by.name",
"custom_fields.currency_code",
"custom_fields.custom_label",
"custom_fields.custom_label_position",
"custom_fields.date_value",
"custom_fields.date_value.date",
"custom_fields.date_value.date_time",
"custom_fields.default_access_level",
"custom_fields.description",
"custom_fields.display_value",
"custom_fields.enabled",
"custom_fields.enum_options",
"custom_fields.enum_options.color",
"custom_fields.enum_options.enabled",
"custom_fields.enum_options.name",
"custom_fields.enum_value",
"custom_fields.enum_value.color",
"custom_fields.enum_value.enabled",
"custom_fields.enum_value.name",
"custom_fields.format",
"custom_fields.has_notifications_enabled",
"custom_fields.html_text_value",
"custom_fields.id_prefix",
"custom_fields.input_restrictions",
"custom_fields.is_formula_field",
"custom_fields.is_global_to_workspace",
"custom_fields.is_value_read_only",
"custom_fields.multi_enum_values",
"custom_fields.multi_enum_values.color",
"custom_fields.multi_enum_values.enabled",
"custom_fields.multi_enum_values.name",
"custom_fields.name",
"custom_fields.number_value",
"custom_fields.people_value",
"custom_fields.people_value.name",
"custom_fields.precision",
"custom_fields.privacy_setting",
"custom_fields.reference_value",
"custom_fields.reference_value.name",
"custom_fields.representation_type",
"custom_fields.resource_subtype",
"custom_fields.text_value",
"custom_fields.type",
"custom_type",
"custom_type.asana_created_type_identifier",
"custom_type.name",
"custom_type_status_option",
"custom_type_status_option.name",
"dependencies",
"dependents",
"due_at",
"due_on",
"effective_memberships",
"external",
"external.data",
"followers",
"followers.name",
"hearted",
"hearts",
"hearts.user",
"hearts.user.name",
"html_notes",
"is_rendered_as_separator",
"liked",
"likes",
"likes.user",
"likes.user.name",
"memberships",
"memberships.project",
"memberships.project.name",
"memberships.project.resource_subtype",
"memberships.section",
"memberships.section.name",
"modified_at",
"name",
"notes",
"num_hearts",
"num_likes",
"num_subtasks",
"offset",
"parent",
"parent.created_by",
"parent.name",
"parent.resource_subtype",
"path",
"permalink_url",
"projects",
"projects.name",
"projects.resource_subtype",
"resource_subtype",
"start_at",
"start_on",
"tags",
"tags.name",
"uri",
"workspace",
"workspace.name"
],
"schema": {
"type": "array",
"items": {
"type": "string",
"enum": [
"actual_time_minutes",
"approval_status",
"assigned_by",
"assigned_by.name",
"assignee",
"assignee.name",
"assignee_section",
"assignee_section.name",
"assignee_status",
"completed",
"completed_at",
"completed_by",
"completed_by.name",
"created_at",
"created_by",
"custom_fields",
"custom_fields.asana_created_field",
"custom_fields.created_by",
"custom_fields.created_by.name",
"custom_fields.currency_code",
"custom_fields.custom_label",
"custom_fields.custom_label_position",
"custom_fields.date_value",
"custom_fields.date_value.date",
"custom_fields.date_value.date_time",
"custom_fields.default_access_level",
"custom_fields.description",
"custom_fields.display_value",
"custom_fields.enabled",
"custom_fields.enum_options",
"custom_fields.enum_options.color",
"custom_fields.enum_options.enabled",
"custom_fields.enum_options.name",
"custom_fields.enum_value",
"custom_fields.enum_value.color",
"custom_fields.enum_value.enabled",
"custom_fields.enum_value.name",
"custom_fields.format",
"custom_fields.has_notifications_enabled",
"custom_fields.html_text_value",
"custom_fields.id_prefix",
"custom_fields.input_restrictions",
"custom_fields.is_formula_field",
"custom_fields.is_global_to_workspace",
"custom_fields.is_value_read_only",
"custom_fields.multi_enum_values",
"custom_fields.multi_enum_values.color",
"custom_fields.multi_enum_values.enabled",
"custom_fields.multi_enum_values.name",
"custom_fields.name",
"custom_fields.number_value",
"custom_fields.people_value",
"custom_fields.people_value.name",
"custom_fields.precision",
"custom_fields.privacy_setting",
"custom_fields.reference_value",
"custom_fields.reference_value.name",
"custom_fields.representation_type",
"custom_fields.resource_subtype",
"custom_fields.text_value",
"custom_fields.type",
"custom_type",
"custom_type.asana_created_type_identifier",
"custom_type.name",
"custom_type_status_option",
"custom_type_status_option.name",
"dependencies",
"dependents",
"due_at",
"due_on",
"effective_memberships",
"external",
"external.data",
"followers",
"followers.name",
"hearted",
"hearts",
"hearts.user",
"hearts.user.name",
"html_notes",
"is_rendered_as_separator",
"liked",
"likes",
"likes.user",
"likes.user.name",
"memberships",
"memberships.project",
"memberships.project.name",
"memberships.project.resource_subtype",
"memberships.section",
"memberships.section.name",
"modified_at",
"name",
"notes",
"num_hearts",
"num_likes",
"num_subtasks",
"offset",
"parent",
"parent.created_by",
"parent.name",
"parent.resource_subtype",
"path",
"permalink_url",
"projects",
"projects.name",
"projects.resource_subtype",
"resource_subtype",
"start_at",
"start_on",
"tags",
"tags.name",
"uri",
"workspace",
"workspace.name"
]
}
},
"style": "form",
"explode": false
}
],
"responses": {
"200": {
"description": "Successfully retrieved the specified task's subtasks.",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"type": "array",
"items": {
"$ref": "#/components/schemas/TaskCompact"
}
},
"next_page": {
"$ref": "#/components/schemas/NextPage"
}
}
}
}
}
},
"400": {
"$ref": "#/components/responses/BadRequest"
},
"401": {
"$ref": "#/components/responses/Unauthorized"
},
"403": {
"$ref": "#/components/responses/Forbidden"
},
"404": {
"$ref": "#/components/responses/NotFound"
},
"500": {
"$ref": "#/components/responses/InternalServerError"
}
},
"security": [
{
"personalAccessToken": []
},
{
"oauth2": [
"tasks:read"
]
}
],
"x-readme": {
"code-samples": [
{
"language": "java",
"install": "<dependency><groupId>com.asana</groupId><artifactId>asana</artifactId><version>1.0.0</version></dependency>",
"code": "import com.asana.Client;\n\nClient client = Client.accessToken(\"PERSONAL_ACCESS_TOKEN\");\n\nList<Task> result = client.tasks.getSubtasksForTask(taskGid)\n .option(\"pretty\", true)\n .execute();"
},
{
"language": "node",
"install": "npm install asana",
"code": "const Asana = require('asana');\n\nlet client = new Asana.ApiClient();\nclient.authentications.token.accessToken = '<YOUR_ACCESS_TOKEN>';\n\nlet tasksApiInstance = new Asana.TasksApi(client);\nlet task_gid = \"321654\"; // String | The task to operate on.\nlet opts = { \n 'limit': 50, \n 'offset': \"eyJ0eXAiOJiKV1iQLCJhbGciOiJIUzI1NiJ9\", \n 'opt_fields': \"actual_time_minutes,approval_status,assigned_by,assigned_by.name,assignee,assignee.name,assignee_section,assignee_section.name,assignee_status,completed,completed_at,completed_by,completed_by.name,created_at,created_by,custom_fields,custom_fields.asana_created_field,custom_fields.created_by,custom_fields.created_by.name,custom_fields.currency_code,custom_fields.custom_label,custom_fields.custom_label_position,custom_fields.date_value,custom_fields.date_value.date,custom_fields.date_value.date_time,custom_fields.default_access_level,custom_fields.description,custom_fields.display_value,custom_fields.enabled,custom_fields.enum_options,custom_fields.enum_options.color,custom_fields.enum_options.enabled,custom_fields.enum_options.name,custom_fields.enum_value,custom_fields.enum_value.color,custom_fields.enum_value.enabled,custom_fields.enum_value.name,custom_fields.format,custom_fields.has_notifications_enabled,custom_fields.html_text_value,custom_fields.id_prefix,custom_fields.input_restrictions,custom_fields.is_formula_field,custom_fields.is_global_to_workspace,custom_fields.is_value_read_only,custom_fields.multi_enum_values,custom_fields.multi_enum_values.color,custom_fields.multi_enum_values.enabled,custom_fields.multi_enum_values.name,custom_fields.name,custom_fields.number_value,custom_fields.people_value,custom_fields.people_value.name,custom_fields.precision,custom_fields.privacy_setting,custom_fields.reference_value,custom_fields.reference_value.name,custom_fields.representation_type,custom_fields.resource_subtype,custom_fields.text_value,custom_fields.type,custom_type,custom_type.asana_created_type_identifier,custom_type.name,custom_type_status_option,custom_type_status_option.name,dependencies,dependents,due_at,due_on,effective_memberships,external,external.data,followers,followers.name,hearted,hearts,hearts.user,hearts.user.name,html_notes,is_rendered_as_separator,liked,likes,likes.user,likes.user.name,memberships,memberships.project,memberships.project.name,memberships.project.resource_subtype,memberships.section,memberships.section.name,modified_at,name,notes,num_hearts,num_likes,num_subtasks,offset,parent,parent.created_by,parent.name,parent.resource_subtype,path,permalink_url,projects,projects.name,projects.resource_subtype,resource_subtype,start_at,start_on,tags,tags.name,uri,workspace,workspace.name\"\n};\ntasksApiInstance.getSubtasksForTask(task_gid, opts).then((result) => {\n console.log('API called successfully. Returned data: ' + JSON.stringify(result.data, null, 2));\n}, (error) => {\n console.error(error.response.body);\n});",
"name": "node-sdk-v3"
},
{
"language": "node",
"install": "npm install asana@1.0.5",
"code": "const asana = require('asana');\n\nconst client = asana.Client.create().useAccessToken('PERSONAL_ACCESS_TOKEN');\n\nclient.tasks.getSubtasksForTask(taskGid, {param: \"value\", param: \"value\", opt_pretty: true})\n .then((result) => {\n console.log(result);\n });",
"name": "node-sdk-v1"
},
{
"language": "python",
"install": "pip install asana",
"code": "import asana\nfrom asana.rest import ApiException\nfrom pprint import pprint\n\nconfiguration = asana.Configuration()\nconfiguration.access_token = '<YOUR_ACCESS_TOKEN>'\napi_client = asana.ApiClient(configuration)\n\n# create an instance of the API class\ntasks_api_instance = asana.TasksApi(api_client)\ntask_gid = \"321654\" # str | The task to operate on.\nopts = {\n 'limit': 50, # int | Results per page. The number of objects to return per page. The value must be between 1 and 100.\n 'offset': \"eyJ0eXAiOJiKV1iQLCJhbGciOiJIUzI1NiJ9\", # str | 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.*\n 'opt_fields': \"actual_time_minutes,approval_status,assigned_by,assigned_by.name,assignee,assignee.name,assignee_section,assignee_section.name,assignee_status,completed,completed_at,completed_by,completed_by.name,created_at,created_by,custom_fields,custom_fields.asana_created_field,custom_fields.created_by,custom_fields.created_by.name,custom_fields.currency_code,custom_fields.custom_label,custom_fields.custom_label_position,custom_fields.date_value,custom_fields.date_value.date,custom_fields.date_value.date_time,custom_fields.default_access_level,custom_fields.description,custom_fields.display_value,custom_fields.enabled,custom_fields.enum_options,custom_fields.enum_options.color,custom_fields.enum_options.enabled,custom_fields.enum_options.name,custom_fields.enum_value,custom_fields.enum_value.color,custom_fields.enum_value.enabled,custom_fields.enum_value.name,custom_fields.format,custom_fields.has_notifications_enabled,custom_fields.html_text_value,custom_fields.id_prefix,custom_fields.input_restrictions,custom_fields.is_formula_field,custom_fields.is_global_to_workspace,custom_fields.is_value_read_only,custom_fields.multi_enum_values,custom_fields.multi_enum_values.color,custom_fields.multi_enum_values.enabled,custom_fields.multi_enum_values.name,custom_fields.name,custom_fields.number_value,custom_fields.people_value,custom_fields.people_value.name,custom_fields.precision,custom_fields.privacy_setting,custom_fields.reference_value,custom_fields.reference_value.name,custom_fields.representation_type,custom_fields.resource_subtype,custom_fields.text_value,custom_fields.type,custom_type,custom_type.asana_created_type_identifier,custom_type.name,custom_type_status_option,custom_type_status_option.name,dependencies,dependents,due_at,due_on,effective_memberships,external,external.data,followers,followers.name,hearted,hearts,hearts.user,hearts.user.name,html_notes,is_rendered_as_separator,liked,likes,likes.user,likes.user.name,memberships,memberships.project,memberships.project.name,memberships.project.resource_subtype,memberships.section,memberships.section.name,modified_at,name,notes,num_hearts,num_likes,num_subtasks,offset,parent,parent.created_by,parent.name,parent.resource_subtype,path,permalink_url,projects,projects.name,projects.resource_subtype,resource_subtype,start_at,start_on,tags,tags.name,uri,workspace,workspace.name\", # list[str] | 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.\n}\n\ntry:\n # Get subtasks from a task\n api_response = tasks_api_instance.get_subtasks_for_task(task_gid, opts)\n for data in api_response:\n pprint(data)\nexcept ApiException as e:\n print(\"Exception when calling TasksApi->get_subtasks_for_task: %s\\n\" % e)",
"name": "python-sdk-v5"
},
{
"language": "python",
"install": "pip install asana==3.2.3",
"code": "import asana\n\nclient = asana.Client.access_token('PERSONAL_ACCESS_TOKEN')\n\nresult = client.tasks.get_subtasks_for_task(task_gid, {'param': 'value', 'param': 'value'}, opt_pretty=True)",
"name": "python-sdk-v3"
},
{
"language": "php",
"install": "composer require asana/asana",
"code": "<?php\nrequire 'vendor/autoload.php';\n\n$client = Asana\\Client::accessToken('PERSONAL_ACCESS_TOKEN');\n\n$result = $client->tasks->getSubtasksForTask($task_gid, array('param' => 'value', 'param' => 'value'), array('opt_pretty' => 'true'))"
},
{
"language": "ruby",
"install": "gem install asana",
"code": "require 'asana'\n\nclient = Asana::Client.new do |c|\n c.authentication :access_token, 'PERSONAL_ACCESS_TOKEN'\nend\n\nresult = client.tasks.get_subtasks_for_task(task_gid: 'task_gid', param: \"value\", param: \"value\", options: {pretty: true})"
}
]
},
"x-purple-suite-runtime": "modeled-core",
"x-purple-suite-supported-query": [
"opt_pretty",
"limit",
"offset",
"opt_fields"
],
"x-purple-suite-supported-response-fields": [
"gid",
"resource_type",
"resource_subtype",
"name",
"notes",
"completed",
"completed_at",
"created_at",
"modified_at",
"assignee",
"assignee_status",
"workspace",
"projects",
"memberships",
"parent",
"due_on",
"start_on",
"tags",
"dependencies",
"num_subtasks",
"archived",
"public",
"color",
"default_view",
"team",
"project",
"section",
"text",
"created_by",
"target",
"type",
"email",
"photo",
"is_organization"
]
}
POST /api/1.0/tasks/{task_gid}/subtasks
Create a subtask
<b>Required scope: </b><code>tasks:write</code>
Creates a new subtask and adds it to the parent task. Returns the full record for the newly created subtask.
The persistent core model supports the response and query fields named in x-purple-suite-supported-response-fields and x-purple-suite-supported-query. Other fields/options return an explicit 400 errors envelope.
Authentication
[
{
"personalAccessToken": []
},
{
"oauth2": [
"tasks:write"
]
}
]
Path-level parameters and metadata
{
"parameters": [
{
"$ref": "#/components/parameters/task_path_gid"
},
{
"$ref": "#/components/parameters/pretty"
}
]
}
Request, responses and operation details
{
"summary": "Create a subtask",
"description": "<b>Required scope: </b><code>tasks:write</code>\n\nCreates a new subtask and adds it to the parent task. Returns the full record for the newly created subtask.\n\nThe persistent core model supports the response and query fields named in x-purple-suite-supported-response-fields and x-purple-suite-supported-query. Other fields/options return an explicit 400 errors envelope.",
"tags": [
"Tasks"
],
"operationId": "createSubtaskForTask",
"parameters": [
{
"name": "opt_fields",
"in": "query",
"description": "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. Properties can include nested fields. To learn more, see the [input/output options guide](/docs/inputoutput-options#selecting-nested-fields).",
"required": false,
"example": [
"actual_time_minutes",
"approval_status",
"assigned_by",
"assigned_by.name",
"assignee",
"assignee.name",
"assignee_section",
"assignee_section.name",
"assignee_status",
"completed",
"completed_at",
"completed_by",
"completed_by.name",
"created_at",
"created_by",
"custom_fields",
"custom_fields.asana_created_field",
"custom_fields.created_by",
"custom_fields.created_by.name",
"custom_fields.currency_code",
"custom_fields.custom_label",
"custom_fields.custom_label_position",
"custom_fields.date_value",
"custom_fields.date_value.date",
"custom_fields.date_value.date_time",
"custom_fields.default_access_level",
"custom_fields.description",
"custom_fields.display_value",
"custom_fields.enabled",
"custom_fields.enum_options",
"custom_fields.enum_options.color",
"custom_fields.enum_options.enabled",
"custom_fields.enum_options.name",
"custom_fields.enum_value",
"custom_fields.enum_value.color",
"custom_fields.enum_value.enabled",
"custom_fields.enum_value.name",
"custom_fields.format",
"custom_fields.has_notifications_enabled",
"custom_fields.html_text_value",
"custom_fields.id_prefix",
"custom_fields.input_restrictions",
"custom_fields.is_formula_field",
"custom_fields.is_global_to_workspace",
"custom_fields.is_value_read_only",
"custom_fields.multi_enum_values",
"custom_fields.multi_enum_values.color",
"custom_fields.multi_enum_values.enabled",
"custom_fields.multi_enum_values.name",
"custom_fields.name",
"custom_fields.number_value",
"custom_fields.people_value",
"custom_fields.people_value.name",
"custom_fields.precision",
"custom_fields.privacy_setting",
"custom_fields.reference_value",
"custom_fields.reference_value.name",
"custom_fields.representation_type",
"custom_fields.resource_subtype",
"custom_fields.text_value",
"custom_fields.type",
"custom_type",
"custom_type.asana_created_type_identifier",
"custom_type.name",
"custom_type_status_option",
"custom_type_status_option.name",
"dependencies",
"dependents",
"due_at",
"due_on",
"effective_memberships",
"external",
"external.data",
"followers",
"followers.name",
"hearted",
"hearts",
"hearts.user",
"hearts.user.name",
"html_notes",
"is_rendered_as_separator",
"liked",
"likes",
"likes.user",
"likes.user.name",
"memberships",
"memberships.project",
"memberships.project.name",
"memberships.project.resource_subtype",
"memberships.section",
"memberships.section.name",
"modified_at",
"name",
"notes",
"num_hearts",
"num_likes",
"num_subtasks",
"parent",
"parent.created_by",
"parent.name",
"parent.resource_subtype",
"permalink_url",
"projects",
"projects.name",
"projects.resource_subtype",
"resource_subtype",
"start_at",
"start_on",
"tags",
"tags.name",
"workspace",
"workspace.name"
],
"schema": {
"type": "array",
"items": {
"type": "string",
"enum": [
"actual_time_minutes",
"approval_status",
"assigned_by",
"assigned_by.name",
"assignee",
"assignee.name",
"assignee_section",
"assignee_section.name",
"assignee_status",
"completed",
"completed_at",
"completed_by",
"completed_by.name",
"created_at",
"created_by",
"custom_fields",
"custom_fields.asana_created_field",
"custom_fields.created_by",
"custom_fields.created_by.name",
"custom_fields.currency_code",
"custom_fields.custom_label",
"custom_fields.custom_label_position",
"custom_fields.date_value",
"custom_fields.date_value.date",
"custom_fields.date_value.date_time",
"custom_fields.default_access_level",
"custom_fields.description",
"custom_fields.display_value",
"custom_fields.enabled",
"custom_fields.enum_options",
"custom_fields.enum_options.color",
"custom_fields.enum_options.enabled",
"custom_fields.enum_options.name",
"custom_fields.enum_value",
"custom_fields.enum_value.color",
"custom_fields.enum_value.enabled",
"custom_fields.enum_value.name",
"custom_fields.format",
"custom_fields.has_notifications_enabled",
"custom_fields.html_text_value",
"custom_fields.id_prefix",
"custom_fields.input_restrictions",
"custom_fields.is_formula_field",
"custom_fields.is_global_to_workspace",
"custom_fields.is_value_read_only",
"custom_fields.multi_enum_values",
"custom_fields.multi_enum_values.color",
"custom_fields.multi_enum_values.enabled",
"custom_fields.multi_enum_values.name",
"custom_fields.name",
"custom_fields.number_value",
"custom_fields.people_value",
"custom_fields.people_value.name",
"custom_fields.precision",
"custom_fields.privacy_setting",
"custom_fields.reference_value",
"custom_fields.reference_value.name",
"custom_fields.representation_type",
"custom_fields.resource_subtype",
"custom_fields.text_value",
"custom_fields.type",
"custom_type",
"custom_type.asana_created_type_identifier",
"custom_type.name",
"custom_type_status_option",
"custom_type_status_option.name",
"dependencies",
"dependents",
"due_at",
"due_on",
"effective_memberships",
"external",
"external.data",
"followers",
"followers.name",
"hearted",
"hearts",
"hearts.user",
"hearts.user.name",
"html_notes",
"is_rendered_as_separator",
"liked",
"likes",
"likes.user",
"likes.user.name",
"memberships",
"memberships.project",
"memberships.project.name",
"memberships.project.resource_subtype",
"memberships.section",
"memberships.section.name",
"modified_at",
"name",
"notes",
"num_hearts",
"num_likes",
"num_subtasks",
"parent",
"parent.created_by",
"parent.name",
"parent.resource_subtype",
"permalink_url",
"projects",
"projects.name",
"projects.resource_subtype",
"resource_subtype",
"start_at",
"start_on",
"tags",
"tags.name",
"workspace",
"workspace.name"
]
}
},
"style": "form",
"explode": false
}
],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
"data"
],
"additionalProperties": false,
"properties": {
"data": {
"type": "object",
"additionalProperties": false,
"required": [
"name"
],
"properties": {
"name": {
"type": "string"
},
"notes": {
"type": "string"
},
"completed": {
"type": "boolean"
},
"assignee": {
"type": "string",
"nullable": true
},
"workspace": {
"type": "string"
},
"projects": {
"type": "array",
"items": {
"type": "string"
}
},
"parent": {
"type": "string",
"nullable": true
},
"due_on": {
"type": "string",
"nullable": true,
"format": "date"
},
"start_on": {
"type": "string",
"nullable": true,
"format": "date"
},
"resource_subtype": {
"enum": [
"default_task",
"milestone"
]
}
}
}
}
}
},
"application/x-www-form-urlencoded": {
"schema": {
"type": "object",
"additionalProperties": false,
"required": [
"name"
],
"properties": {
"name": {
"type": "string"
},
"notes": {
"type": "string"
},
"completed": {
"type": "boolean"
},
"assignee": {
"type": "string",
"nullable": true
},
"workspace": {
"type": "string"
},
"projects": {
"type": "array",
"items": {
"type": "string"
}
},
"parent": {
"type": "string",
"nullable": true
},
"due_on": {
"type": "string",
"nullable": true,
"format": "date"
},
"start_on": {
"type": "string",
"nullable": true,
"format": "date"
},
"resource_subtype": {
"enum": [
"default_task",
"milestone"
]
}
}
}
}
}
},
"responses": {
"201": {
"description": "Successfully created the specified subtask.",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"$ref": "#/components/schemas/TaskResponse"
}
}
}
}
}
},
"400": {
"$ref": "#/components/responses/BadRequest"
},
"401": {
"$ref": "#/components/responses/Unauthorized"
},
"403": {
"$ref": "#/components/responses/Forbidden"
},
"404": {
"$ref": "#/components/responses/NotFound"
},
"500": {
"$ref": "#/components/responses/InternalServerError"
}
},
"security": [
{
"personalAccessToken": []
},
{
"oauth2": [
"tasks:write"
]
}
],
"x-readme": {
"code-samples": [
{
"language": "java",
"install": "<dependency><groupId>com.asana</groupId><artifactId>asana</artifactId><version>1.0.0</version></dependency>",
"code": "import com.asana.Client;\n\nClient client = Client.accessToken(\"PERSONAL_ACCESS_TOKEN\");\n\nTask result = client.tasks.createSubtaskForTask(taskGid)\n .data(\"field\", \"value\")\n .data(\"field\", \"value\")\n .option(\"pretty\", true)\n .execute();"
},
{
"language": "node",
"install": "npm install asana",
"code": "const Asana = require('asana');\n\nlet client = new Asana.ApiClient();\nclient.authentications.token.accessToken = '<YOUR_ACCESS_TOKEN>';\n\nlet tasksApiInstance = new Asana.TasksApi(client);\nlet body = {\"data\": {\"<PARAM_1>\": \"<VALUE_1>\", \"<PARAM_2>\": \"<VALUE_2>\",}}; // Object | The new subtask to create.\nlet task_gid = \"321654\"; // String | The task to operate on.\nlet opts = { \n 'opt_fields': \"actual_time_minutes,approval_status,assigned_by,assigned_by.name,assignee,assignee.name,assignee_section,assignee_section.name,assignee_status,completed,completed_at,completed_by,completed_by.name,created_at,created_by,custom_fields,custom_fields.asana_created_field,custom_fields.created_by,custom_fields.created_by.name,custom_fields.currency_code,custom_fields.custom_label,custom_fields.custom_label_position,custom_fields.date_value,custom_fields.date_value.date,custom_fields.date_value.date_time,custom_fields.default_access_level,custom_fields.description,custom_fields.display_value,custom_fields.enabled,custom_fields.enum_options,custom_fields.enum_options.color,custom_fields.enum_options.enabled,custom_fields.enum_options.name,custom_fields.enum_value,custom_fields.enum_value.color,custom_fields.enum_value.enabled,custom_fields.enum_value.name,custom_fields.format,custom_fields.has_notifications_enabled,custom_fields.html_text_value,custom_fields.id_prefix,custom_fields.input_restrictions,custom_fields.is_formula_field,custom_fields.is_global_to_workspace,custom_fields.is_value_read_only,custom_fields.multi_enum_values,custom_fields.multi_enum_values.color,custom_fields.multi_enum_values.enabled,custom_fields.multi_enum_values.name,custom_fields.name,custom_fields.number_value,custom_fields.people_value,custom_fields.people_value.name,custom_fields.precision,custom_fields.privacy_setting,custom_fields.reference_value,custom_fields.reference_value.name,custom_fields.representation_type,custom_fields.resource_subtype,custom_fields.text_value,custom_fields.type,custom_type,custom_type.asana_created_type_identifier,custom_type.name,custom_type_status_option,custom_type_status_option.name,dependencies,dependents,due_at,due_on,effective_memberships,external,external.data,followers,followers.name,hearted,hearts,hearts.user,hearts.user.name,html_notes,is_rendered_as_separator,liked,likes,likes.user,likes.user.name,memberships,memberships.project,memberships.project.name,memberships.project.resource_subtype,memberships.section,memberships.section.name,modified_at,name,notes,num_hearts,num_likes,num_subtasks,parent,parent.created_by,parent.name,parent.resource_subtype,permalink_url,projects,projects.name,projects.resource_subtype,resource_subtype,start_at,start_on,tags,tags.name,workspace,workspace.name\"\n};\ntasksApiInstance.createSubtaskForTask(body, task_gid, opts).then((result) => {\n console.log('API called successfully. Returned data: ' + JSON.stringify(result.data, null, 2));\n}, (error) => {\n console.error(error.response.body);\n});",
"name": "node-sdk-v3"
},
{
"language": "node",
"install": "npm install asana@1.0.5",
"code": "const asana = require('asana');\n\nconst client = asana.Client.create().useAccessToken('PERSONAL_ACCESS_TOKEN');\n\nclient.tasks.createSubtaskForTask(taskGid, {field: \"value\", field: \"value\", pretty: true})\n .then((result) => {\n console.log(result);\n });",
"name": "node-sdk-v1"
},
{
"language": "python",
"install": "pip install asana",
"code": "import asana\nfrom asana.rest import ApiException\nfrom pprint import pprint\n\nconfiguration = asana.Configuration()\nconfiguration.access_token = '<YOUR_ACCESS_TOKEN>'\napi_client = asana.ApiClient(configuration)\n\n# create an instance of the API class\ntasks_api_instance = asana.TasksApi(api_client)\nbody = {\"data\": {\"<PARAM_1>\": \"<VALUE_1>\", \"<PARAM_2>\": \"<VALUE_2>\",}} # dict | The new subtask to create.\ntask_gid = \"321654\" # str | The task to operate on.\nopts = {\n 'opt_fields': \"actual_time_minutes,approval_status,assigned_by,assigned_by.name,assignee,assignee.name,assignee_section,assignee_section.name,assignee_status,completed,completed_at,completed_by,completed_by.name,created_at,created_by,custom_fields,custom_fields.asana_created_field,custom_fields.created_by,custom_fields.created_by.name,custom_fields.currency_code,custom_fields.custom_label,custom_fields.custom_label_position,custom_fields.date_value,custom_fields.date_value.date,custom_fields.date_value.date_time,custom_fields.default_access_level,custom_fields.description,custom_fields.display_value,custom_fields.enabled,custom_fields.enum_options,custom_fields.enum_options.color,custom_fields.enum_options.enabled,custom_fields.enum_options.name,custom_fields.enum_value,custom_fields.enum_value.color,custom_fields.enum_value.enabled,custom_fields.enum_value.name,custom_fields.format,custom_fields.has_notifications_enabled,custom_fields.html_text_value,custom_fields.id_prefix,custom_fields.input_restrictions,custom_fields.is_formula_field,custom_fields.is_global_to_workspace,custom_fields.is_value_read_only,custom_fields.multi_enum_values,custom_fields.multi_enum_values.color,custom_fields.multi_enum_values.enabled,custom_fields.multi_enum_values.name,custom_fields.name,custom_fields.number_value,custom_fields.people_value,custom_fields.people_value.name,custom_fields.precision,custom_fields.privacy_setting,custom_fields.reference_value,custom_fields.reference_value.name,custom_fields.representation_type,custom_fields.resource_subtype,custom_fields.text_value,custom_fields.type,custom_type,custom_type.asana_created_type_identifier,custom_type.name,custom_type_status_option,custom_type_status_option.name,dependencies,dependents,due_at,due_on,effective_memberships,external,external.data,followers,followers.name,hearted,hearts,hearts.user,hearts.user.name,html_notes,is_rendered_as_separator,liked,likes,likes.user,likes.user.name,memberships,memberships.project,memberships.project.name,memberships.project.resource_subtype,memberships.section,memberships.section.name,modified_at,name,notes,num_hearts,num_likes,num_subtasks,parent,parent.created_by,parent.name,parent.resource_subtype,permalink_url,projects,projects.name,projects.resource_subtype,resource_subtype,start_at,start_on,tags,tags.name,workspace,workspace.name\", # list[str] | 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.\n}\n\ntry:\n # Create a subtask\n api_response = tasks_api_instance.create_subtask_for_task(body, task_gid, opts)\n pprint(api_response)\nexcept ApiException as e:\n print(\"Exception when calling TasksApi->create_subtask_for_task: %s\\n\" % e)",
"name": "python-sdk-v5"
},
{
"language": "python",
"install": "pip install asana==3.2.3",
"code": "import asana\n\nclient = asana.Client.access_token('PERSONAL_ACCESS_TOKEN')\n\nresult = client.tasks.create_subtask_for_task(task_gid, {'field': 'value', 'field': 'value'}, opt_pretty=True)",
"name": "python-sdk-v3"
},
{
"language": "php",
"install": "composer require asana/asana",
"code": "<?php\nrequire 'vendor/autoload.php';\n\n$client = Asana\\Client::accessToken('PERSONAL_ACCESS_TOKEN');\n\n$result = $client->tasks->createSubtaskForTask($task_gid, array('field' => 'value', 'field' => 'value'), array('opt_pretty' => 'true'))"
},
{
"language": "ruby",
"install": "gem install asana",
"code": "require 'asana'\n\nclient = Asana::Client.new do |c|\n c.authentication :access_token, 'PERSONAL_ACCESS_TOKEN'\nend\n\nresult = client.tasks.create_subtask_for_task(task_gid: 'task_gid', field: \"value\", field: \"value\", options: {pretty: true})"
}
]
},
"x-purple-suite-runtime": "modeled-core",
"x-purple-suite-supported-query": [
"opt_pretty",
"opt_fields"
],
"x-purple-suite-supported-response-fields": [
"gid",
"resource_type",
"resource_subtype",
"name",
"notes",
"completed",
"completed_at",
"created_at",
"modified_at",
"assignee",
"assignee_status",
"workspace",
"projects",
"memberships",
"parent",
"due_on",
"start_on",
"tags",
"dependencies",
"num_subtasks",
"archived",
"public",
"color",
"default_view",
"team",
"project",
"section",
"text",
"created_by",
"target",
"type",
"email",
"photo",
"is_organization"
]
}
POST /api/1.0/tasks/{task_gid}/setParent
Set the parent of a task
<b>Required scope: </b><code>tasks:write</code>
Updates the parent of a given task. This endpoint can be used to make a task a subtask of another task, or to remove its existing parent.
When using `insert_before` and `insert_after`, at most one of those two options can be specified, and they must already be subtasks of the parent.
Returns the complete, updated record of the affected [task](/reference/tasks#/task).
The persistent core model supports the response and query fields named in x-purple-suite-supported-response-fields and x-purple-suite-supported-query. Other fields/options return an explicit 400 errors envelope.
Authentication
[
{
"personalAccessToken": []
},
{
"oauth2": [
"tasks:write"
]
}
]
Path-level parameters and metadata
{
"parameters": [
{
"$ref": "#/components/parameters/task_path_gid"
},
{
"$ref": "#/components/parameters/pretty"
}
]
}
Request, responses and operation details
{
"summary": "Set the parent of a task",
"description": "<b>Required scope: </b><code>tasks:write</code>\n\nUpdates the parent of a given task. This endpoint can be used to make a task a subtask of another task, or to remove its existing parent.\nWhen using `insert_before` and `insert_after`, at most one of those two options can be specified, and they must already be subtasks of the parent.\nReturns the complete, updated record of the affected [task](/reference/tasks#/task).\n\nThe persistent core model supports the response and query fields named in x-purple-suite-supported-response-fields and x-purple-suite-supported-query. Other fields/options return an explicit 400 errors envelope.",
"tags": [
"Tasks"
],
"operationId": "setParentForTask",
"parameters": [
{
"name": "opt_fields",
"in": "query",
"description": "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. Properties can include nested fields. To learn more, see the [input/output options guide](/docs/inputoutput-options#selecting-nested-fields).",
"required": false,
"example": [
"actual_time_minutes",
"approval_status",
"assigned_by",
"assigned_by.name",
"assignee",
"assignee.name",
"assignee_section",
"assignee_section.name",
"assignee_status",
"completed",
"completed_at",
"completed_by",
"completed_by.name",
"created_at",
"created_by",
"custom_fields",
"custom_fields.asana_created_field",
"custom_fields.created_by",
"custom_fields.created_by.name",
"custom_fields.currency_code",
"custom_fields.custom_label",
"custom_fields.custom_label_position",
"custom_fields.date_value",
"custom_fields.date_value.date",
"custom_fields.date_value.date_time",
"custom_fields.default_access_level",
"custom_fields.description",
"custom_fields.display_value",
"custom_fields.enabled",
"custom_fields.enum_options",
"custom_fields.enum_options.color",
"custom_fields.enum_options.enabled",
"custom_fields.enum_options.name",
"custom_fields.enum_value",
"custom_fields.enum_value.color",
"custom_fields.enum_value.enabled",
"custom_fields.enum_value.name",
"custom_fields.format",
"custom_fields.has_notifications_enabled",
"custom_fields.html_text_value",
"custom_fields.id_prefix",
"custom_fields.input_restrictions",
"custom_fields.is_formula_field",
"custom_fields.is_global_to_workspace",
"custom_fields.is_value_read_only",
"custom_fields.multi_enum_values",
"custom_fields.multi_enum_values.color",
"custom_fields.multi_enum_values.enabled",
"custom_fields.multi_enum_values.name",
"custom_fields.name",
"custom_fields.number_value",
"custom_fields.people_value",
"custom_fields.people_value.name",
"custom_fields.precision",
"custom_fields.privacy_setting",
"custom_fields.reference_value",
"custom_fields.reference_value.name",
"custom_fields.representation_type",
"custom_fields.resource_subtype",
"custom_fields.text_value",
"custom_fields.type",
"custom_type",
"custom_type.asana_created_type_identifier",
"custom_type.name",
"custom_type_status_option",
"custom_type_status_option.name",
"dependencies",
"dependents",
"due_at",
"due_on",
"effective_memberships",
"external",
"external.data",
"followers",
"followers.name",
"hearted",
"hearts",
"hearts.user",
"hearts.user.name",
"html_notes",
"is_rendered_as_separator",
"liked",
"likes",
"likes.user",
"likes.user.name",
"memberships",
"memberships.project",
"memberships.project.name",
"memberships.project.resource_subtype",
"memberships.section",
"memberships.section.name",
"modified_at",
"name",
"notes",
"num_hearts",
"num_likes",
"num_subtasks",
"parent",
"parent.created_by",
"parent.name",
"parent.resource_subtype",
"permalink_url",
"projects",
"projects.name",
"projects.resource_subtype",
"resource_subtype",
"start_at",
"start_on",
"tags",
"tags.name",
"workspace",
"workspace.name"
],
"schema": {
"type": "array",
"items": {
"type": "string",
"enum": [
"actual_time_minutes",
"approval_status",
"assigned_by",
"assigned_by.name",
"assignee",
"assignee.name",
"assignee_section",
"assignee_section.name",
"assignee_status",
"completed",
"completed_at",
"completed_by",
"completed_by.name",
"created_at",
"created_by",
"custom_fields",
"custom_fields.asana_created_field",
"custom_fields.created_by",
"custom_fields.created_by.name",
"custom_fields.currency_code",
"custom_fields.custom_label",
"custom_fields.custom_label_position",
"custom_fields.date_value",
"custom_fields.date_value.date",
"custom_fields.date_value.date_time",
"custom_fields.default_access_level",
"custom_fields.description",
"custom_fields.display_value",
"custom_fields.enabled",
"custom_fields.enum_options",
"custom_fields.enum_options.color",
"custom_fields.enum_options.enabled",
"custom_fields.enum_options.name",
"custom_fields.enum_value",
"custom_fields.enum_value.color",
"custom_fields.enum_value.enabled",
"custom_fields.enum_value.name",
"custom_fields.format",
"custom_fields.has_notifications_enabled",
"custom_fields.html_text_value",
"custom_fields.id_prefix",
"custom_fields.input_restrictions",
"custom_fields.is_formula_field",
"custom_fields.is_global_to_workspace",
"custom_fields.is_value_read_only",
"custom_fields.multi_enum_values",
"custom_fields.multi_enum_values.color",
"custom_fields.multi_enum_values.enabled",
"custom_fields.multi_enum_values.name",
"custom_fields.name",
"custom_fields.number_value",
"custom_fields.people_value",
"custom_fields.people_value.name",
"custom_fields.precision",
"custom_fields.privacy_setting",
"custom_fields.reference_value",
"custom_fields.reference_value.name",
"custom_fields.representation_type",
"custom_fields.resource_subtype",
"custom_fields.text_value",
"custom_fields.type",
"custom_type",
"custom_type.asana_created_type_identifier",
"custom_type.name",
"custom_type_status_option",
"custom_type_status_option.name",
"dependencies",
"dependents",
"due_at",
"due_on",
"effective_memberships",
"external",
"external.data",
"followers",
"followers.name",
"hearted",
"hearts",
"hearts.user",
"hearts.user.name",
"html_notes",
"is_rendered_as_separator",
"liked",
"likes",
"likes.user",
"likes.user.name",
"memberships",
"memberships.project",
"memberships.project.name",
"memberships.project.resource_subtype",
"memberships.section",
"memberships.section.name",
"modified_at",
"name",
"notes",
"num_hearts",
"num_likes",
"num_subtasks",
"parent",
"parent.created_by",
"parent.name",
"parent.resource_subtype",
"permalink_url",
"projects",
"projects.name",
"projects.resource_subtype",
"resource_subtype",
"start_at",
"start_on",
"tags",
"tags.name",
"workspace",
"workspace.name"
]
}
},
"style": "form",
"explode": false
}
],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
"data"
],
"additionalProperties": false,
"properties": {
"data": {
"type": "object",
"additionalProperties": false,
"required": [
"parent"
],
"properties": {
"parent": {
"type": "string",
"nullable": true
}
}
}
}
}
},
"application/x-www-form-urlencoded": {
"schema": {
"type": "object",
"additionalProperties": false,
"required": [
"parent"
],
"properties": {
"parent": {
"type": "string",
"nullable": true
}
}
}
}
}
},
"responses": {
"200": {
"description": "Successfully changed the parent of the specified subtask.",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"$ref": "#/components/schemas/TaskResponse"
}
}
}
}
}
},
"400": {
"$ref": "#/components/responses/BadRequest"
},
"401": {
"$ref": "#/components/responses/Unauthorized"
},
"403": {
"$ref": "#/components/responses/Forbidden"
},
"404": {
"$ref": "#/components/responses/NotFound"
},
"500": {
"$ref": "#/components/responses/InternalServerError"
}
},
"security": [
{
"personalAccessToken": []
},
{
"oauth2": [
"tasks:write"
]
}
],
"x-readme": {
"code-samples": [
{
"language": "java",
"install": "<dependency><groupId>com.asana</groupId><artifactId>asana</artifactId><version>1.0.0</version></dependency>",
"code": "import com.asana.Client;\n\nClient client = Client.accessToken(\"PERSONAL_ACCESS_TOKEN\");\n\nTask result = client.tasks.setParentForTask(taskGid)\n .data(\"field\", \"value\")\n .data(\"field\", \"value\")\n .option(\"pretty\", true)\n .execute();"
},
{
"language": "node",
"install": "npm install asana",
"code": "const Asana = require('asana');\n\nlet client = new Asana.ApiClient();\nclient.authentications.token.accessToken = '<YOUR_ACCESS_TOKEN>';\n\nlet tasksApiInstance = new Asana.TasksApi(client);\nlet body = {\"data\": {\"<PARAM_1>\": \"<VALUE_1>\", \"<PARAM_2>\": \"<VALUE_2>\",}}; // Object | The new parent of the subtask.\nlet task_gid = \"321654\"; // String | The task to operate on.\nlet opts = { \n 'opt_fields': \"actual_time_minutes,approval_status,assigned_by,assigned_by.name,assignee,assignee.name,assignee_section,assignee_section.name,assignee_status,completed,completed_at,completed_by,completed_by.name,created_at,created_by,custom_fields,custom_fields.asana_created_field,custom_fields.created_by,custom_fields.created_by.name,custom_fields.currency_code,custom_fields.custom_label,custom_fields.custom_label_position,custom_fields.date_value,custom_fields.date_value.date,custom_fields.date_value.date_time,custom_fields.default_access_level,custom_fields.description,custom_fields.display_value,custom_fields.enabled,custom_fields.enum_options,custom_fields.enum_options.color,custom_fields.enum_options.enabled,custom_fields.enum_options.name,custom_fields.enum_value,custom_fields.enum_value.color,custom_fields.enum_value.enabled,custom_fields.enum_value.name,custom_fields.format,custom_fields.has_notifications_enabled,custom_fields.html_text_value,custom_fields.id_prefix,custom_fields.input_restrictions,custom_fields.is_formula_field,custom_fields.is_global_to_workspace,custom_fields.is_value_read_only,custom_fields.multi_enum_values,custom_fields.multi_enum_values.color,custom_fields.multi_enum_values.enabled,custom_fields.multi_enum_values.name,custom_fields.name,custom_fields.number_value,custom_fields.people_value,custom_fields.people_value.name,custom_fields.precision,custom_fields.privacy_setting,custom_fields.reference_value,custom_fields.reference_value.name,custom_fields.representation_type,custom_fields.resource_subtype,custom_fields.text_value,custom_fields.type,custom_type,custom_type.asana_created_type_identifier,custom_type.name,custom_type_status_option,custom_type_status_option.name,dependencies,dependents,due_at,due_on,effective_memberships,external,external.data,followers,followers.name,hearted,hearts,hearts.user,hearts.user.name,html_notes,is_rendered_as_separator,liked,likes,likes.user,likes.user.name,memberships,memberships.project,memberships.project.name,memberships.project.resource_subtype,memberships.section,memberships.section.name,modified_at,name,notes,num_hearts,num_likes,num_subtasks,parent,parent.created_by,parent.name,parent.resource_subtype,permalink_url,projects,projects.name,projects.resource_subtype,resource_subtype,start_at,start_on,tags,tags.name,workspace,workspace.name\"\n};\ntasksApiInstance.setParentForTask(body, task_gid, opts).then((result) => {\n console.log('API called successfully. Returned data: ' + JSON.stringify(result.data, null, 2));\n}, (error) => {\n console.error(error.response.body);\n});",
"name": "node-sdk-v3"
},
{
"language": "node",
"install": "npm install asana@1.0.5",
"code": "const asana = require('asana');\n\nconst client = asana.Client.create().useAccessToken('PERSONAL_ACCESS_TOKEN');\n\nclient.tasks.setParentForTask(taskGid, {field: \"value\", field: \"value\", pretty: true})\n .then((result) => {\n console.log(result);\n });",
"name": "node-sdk-v1"
},
{
"language": "python",
"install": "pip install asana",
"code": "import asana\nfrom asana.rest import ApiException\nfrom pprint import pprint\n\nconfiguration = asana.Configuration()\nconfiguration.access_token = '<YOUR_ACCESS_TOKEN>'\napi_client = asana.ApiClient(configuration)\n\n# create an instance of the API class\ntasks_api_instance = asana.TasksApi(api_client)\nbody = {\"data\": {\"<PARAM_1>\": \"<VALUE_1>\", \"<PARAM_2>\": \"<VALUE_2>\",}} # dict | The new parent of the subtask.\ntask_gid = \"321654\" # str | The task to operate on.\nopts = {\n 'opt_fields': \"actual_time_minutes,approval_status,assigned_by,assigned_by.name,assignee,assignee.name,assignee_section,assignee_section.name,assignee_status,completed,completed_at,completed_by,completed_by.name,created_at,created_by,custom_fields,custom_fields.asana_created_field,custom_fields.created_by,custom_fields.created_by.name,custom_fields.currency_code,custom_fields.custom_label,custom_fields.custom_label_position,custom_fields.date_value,custom_fields.date_value.date,custom_fields.date_value.date_time,custom_fields.default_access_level,custom_fields.description,custom_fields.display_value,custom_fields.enabled,custom_fields.enum_options,custom_fields.enum_options.color,custom_fields.enum_options.enabled,custom_fields.enum_options.name,custom_fields.enum_value,custom_fields.enum_value.color,custom_fields.enum_value.enabled,custom_fields.enum_value.name,custom_fields.format,custom_fields.has_notifications_enabled,custom_fields.html_text_value,custom_fields.id_prefix,custom_fields.input_restrictions,custom_fields.is_formula_field,custom_fields.is_global_to_workspace,custom_fields.is_value_read_only,custom_fields.multi_enum_values,custom_fields.multi_enum_values.color,custom_fields.multi_enum_values.enabled,custom_fields.multi_enum_values.name,custom_fields.name,custom_fields.number_value,custom_fields.people_value,custom_fields.people_value.name,custom_fields.precision,custom_fields.privacy_setting,custom_fields.reference_value,custom_fields.reference_value.name,custom_fields.representation_type,custom_fields.resource_subtype,custom_fields.text_value,custom_fields.type,custom_type,custom_type.asana_created_type_identifier,custom_type.name,custom_type_status_option,custom_type_status_option.name,dependencies,dependents,due_at,due_on,effective_memberships,external,external.data,followers,followers.name,hearted,hearts,hearts.user,hearts.user.name,html_notes,is_rendered_as_separator,liked,likes,likes.user,likes.user.name,memberships,memberships.project,memberships.project.name,memberships.project.resource_subtype,memberships.section,memberships.section.name,modified_at,name,notes,num_hearts,num_likes,num_subtasks,parent,parent.created_by,parent.name,parent.resource_subtype,permalink_url,projects,projects.name,projects.resource_subtype,resource_subtype,start_at,start_on,tags,tags.name,workspace,workspace.name\", # list[str] | 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.\n}\n\ntry:\n # Set the parent of a task\n api_response = tasks_api_instance.set_parent_for_task(body, task_gid, opts)\n pprint(api_response)\nexcept ApiException as e:\n print(\"Exception when calling TasksApi->set_parent_for_task: %s\\n\" % e)",
"name": "python-sdk-v5"
},
{
"language": "python",
"install": "pip install asana==3.2.3",
"code": "import asana\n\nclient = asana.Client.access_token('PERSONAL_ACCESS_TOKEN')\n\nresult = client.tasks.set_parent_for_task(task_gid, {'field': 'value', 'field': 'value'}, opt_pretty=True)",
"name": "python-sdk-v3"
},
{
"language": "php",
"install": "composer require asana/asana",
"code": "<?php\nrequire 'vendor/autoload.php';\n\n$client = Asana\\Client::accessToken('PERSONAL_ACCESS_TOKEN');\n\n$result = $client->tasks->setParentForTask($task_gid, array('field' => 'value', 'field' => 'value'), array('opt_pretty' => 'true'))"
},
{
"language": "ruby",
"install": "gem install asana",
"code": "require 'asana'\n\nclient = Asana::Client.new do |c|\n c.authentication :access_token, 'PERSONAL_ACCESS_TOKEN'\nend\n\nresult = client.tasks.set_parent_for_task(task_gid: 'task_gid', field: \"value\", field: \"value\", options: {pretty: true})"
}
]
},
"x-purple-suite-runtime": "modeled-core",
"x-purple-suite-supported-query": [
"opt_pretty",
"opt_fields"
],
"x-purple-suite-supported-response-fields": [
"gid",
"resource_type",
"resource_subtype",
"name",
"notes",
"completed",
"completed_at",
"created_at",
"modified_at",
"assignee",
"assignee_status",
"workspace",
"projects",
"memberships",
"parent",
"due_on",
"start_on",
"tags",
"dependencies",
"num_subtasks",
"archived",
"public",
"color",
"default_view",
"team",
"project",
"section",
"text",
"created_by",
"target",
"type",
"email",
"photo",
"is_organization"
]
}
GET /api/1.0/tasks/{task_gid}/dependencies
Get dependencies from a task
<b>Required scope: </b><code>tasks:read</code>
Returns the compact representations of all of the dependencies of a task.
The persistent core model supports the response and query fields named in x-purple-suite-supported-response-fields and x-purple-suite-supported-query. Other fields/options return an explicit 400 errors envelope.
Authentication
[
{
"personalAccessToken": []
},
{
"oauth2": [
"tasks:read"
]
}
]
Path-level parameters and metadata
{
"parameters": [
{
"$ref": "#/components/parameters/task_path_gid"
},
{
"$ref": "#/components/parameters/pretty"
},
{
"$ref": "#/components/parameters/limit"
},
{
"$ref": "#/components/parameters/offset"
}
]
}
Request, responses and operation details
{
"summary": "Get dependencies from a task",
"description": "<b>Required scope: </b><code>tasks:read</code>\n\nReturns the compact representations of all of the dependencies of a task.\n\nThe persistent core model supports the response and query fields named in x-purple-suite-supported-response-fields and x-purple-suite-supported-query. Other fields/options return an explicit 400 errors envelope.",
"tags": [
"Tasks"
],
"operationId": "getDependenciesForTask",
"parameters": [
{
"name": "opt_fields",
"in": "query",
"description": "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. Properties can include nested fields. To learn more, see the [input/output options guide](/docs/inputoutput-options#selecting-nested-fields).",
"required": false,
"example": [
"actual_time_minutes",
"approval_status",
"assigned_by",
"assigned_by.name",
"assignee",
"assignee.name",
"assignee_section",
"assignee_section.name",
"assignee_status",
"completed",
"completed_at",
"completed_by",
"completed_by.name",
"created_at",
"created_by",
"custom_fields",
"custom_fields.asana_created_field",
"custom_fields.created_by",
"custom_fields.created_by.name",
"custom_fields.currency_code",
"custom_fields.custom_label",
"custom_fields.custom_label_position",
"custom_fields.date_value",
"custom_fields.date_value.date",
"custom_fields.date_value.date_time",
"custom_fields.default_access_level",
"custom_fields.description",
"custom_fields.display_value",
"custom_fields.enabled",
"custom_fields.enum_options",
"custom_fields.enum_options.color",
"custom_fields.enum_options.enabled",
"custom_fields.enum_options.name",
"custom_fields.enum_value",
"custom_fields.enum_value.color",
"custom_fields.enum_value.enabled",
"custom_fields.enum_value.name",
"custom_fields.format",
"custom_fields.has_notifications_enabled",
"custom_fields.html_text_value",
"custom_fields.id_prefix",
"custom_fields.input_restrictions",
"custom_fields.is_formula_field",
"custom_fields.is_global_to_workspace",
"custom_fields.is_value_read_only",
"custom_fields.multi_enum_values",
"custom_fields.multi_enum_values.color",
"custom_fields.multi_enum_values.enabled",
"custom_fields.multi_enum_values.name",
"custom_fields.name",
"custom_fields.number_value",
"custom_fields.people_value",
"custom_fields.people_value.name",
"custom_fields.precision",
"custom_fields.privacy_setting",
"custom_fields.reference_value",
"custom_fields.reference_value.name",
"custom_fields.representation_type",
"custom_fields.resource_subtype",
"custom_fields.text_value",
"custom_fields.type",
"custom_type",
"custom_type.asana_created_type_identifier",
"custom_type.name",
"custom_type_status_option",
"custom_type_status_option.name",
"dependencies",
"dependents",
"due_at",
"due_on",
"effective_memberships",
"external",
"external.data",
"followers",
"followers.name",
"hearted",
"hearts",
"hearts.user",
"hearts.user.name",
"html_notes",
"is_rendered_as_separator",
"liked",
"likes",
"likes.user",
"likes.user.name",
"memberships",
"memberships.project",
"memberships.project.name",
"memberships.project.resource_subtype",
"memberships.section",
"memberships.section.name",
"modified_at",
"name",
"notes",
"num_hearts",
"num_likes",
"num_subtasks",
"offset",
"parent",
"parent.created_by",
"parent.name",
"parent.resource_subtype",
"path",
"permalink_url",
"projects",
"projects.name",
"projects.resource_subtype",
"resource_subtype",
"start_at",
"start_on",
"tags",
"tags.name",
"uri",
"workspace",
"workspace.name"
],
"schema": {
"type": "array",
"items": {
"type": "string",
"enum": [
"actual_time_minutes",
"approval_status",
"assigned_by",
"assigned_by.name",
"assignee",
"assignee.name",
"assignee_section",
"assignee_section.name",
"assignee_status",
"completed",
"completed_at",
"completed_by",
"completed_by.name",
"created_at",
"created_by",
"custom_fields",
"custom_fields.asana_created_field",
"custom_fields.created_by",
"custom_fields.created_by.name",
"custom_fields.currency_code",
"custom_fields.custom_label",
"custom_fields.custom_label_position",
"custom_fields.date_value",
"custom_fields.date_value.date",
"custom_fields.date_value.date_time",
"custom_fields.default_access_level",
"custom_fields.description",
"custom_fields.display_value",
"custom_fields.enabled",
"custom_fields.enum_options",
"custom_fields.enum_options.color",
"custom_fields.enum_options.enabled",
"custom_fields.enum_options.name",
"custom_fields.enum_value",
"custom_fields.enum_value.color",
"custom_fields.enum_value.enabled",
"custom_fields.enum_value.name",
"custom_fields.format",
"custom_fields.has_notifications_enabled",
"custom_fields.html_text_value",
"custom_fields.id_prefix",
"custom_fields.input_restrictions",
"custom_fields.is_formula_field",
"custom_fields.is_global_to_workspace",
"custom_fields.is_value_read_only",
"custom_fields.multi_enum_values",
"custom_fields.multi_enum_values.color",
"custom_fields.multi_enum_values.enabled",
"custom_fields.multi_enum_values.name",
"custom_fields.name",
"custom_fields.number_value",
"custom_fields.people_value",
"custom_fields.people_value.name",
"custom_fields.precision",
"custom_fields.privacy_setting",
"custom_fields.reference_value",
"custom_fields.reference_value.name",
"custom_fields.representation_type",
"custom_fields.resource_subtype",
"custom_fields.text_value",
"custom_fields.type",
"custom_type",
"custom_type.asana_created_type_identifier",
"custom_type.name",
"custom_type_status_option",
"custom_type_status_option.name",
"dependencies",
"dependents",
"due_at",
"due_on",
"effective_memberships",
"external",
"external.data",
"followers",
"followers.name",
"hearted",
"hearts",
"hearts.user",
"hearts.user.name",
"html_notes",
"is_rendered_as_separator",
"liked",
"likes",
"likes.user",
"likes.user.name",
"memberships",
"memberships.project",
"memberships.project.name",
"memberships.project.resource_subtype",
"memberships.section",
"memberships.section.name",
"modified_at",
"name",
"notes",
"num_hearts",
"num_likes",
"num_subtasks",
"offset",
"parent",
"parent.created_by",
"parent.name",
"parent.resource_subtype",
"path",
"permalink_url",
"projects",
"projects.name",
"projects.resource_subtype",
"resource_subtype",
"start_at",
"start_on",
"tags",
"tags.name",
"uri",
"workspace",
"workspace.name"
]
}
},
"style": "form",
"explode": false
}
],
"responses": {
"200": {
"description": "Successfully retrieved the specified task's dependencies.",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"type": "array",
"items": {
"$ref": "#/components/schemas/TaskCompact"
}
},
"next_page": {
"$ref": "#/components/schemas/NextPage"
}
}
}
}
}
},
"400": {
"$ref": "#/components/responses/BadRequest"
},
"401": {
"$ref": "#/components/responses/Unauthorized"
},
"402": {
"$ref": "#/components/responses/PaymentRequired"
},
"403": {
"$ref": "#/components/responses/Forbidden"
},
"404": {
"$ref": "#/components/responses/NotFound"
},
"500": {
"$ref": "#/components/responses/InternalServerError"
}
},
"security": [
{
"personalAccessToken": []
},
{
"oauth2": [
"tasks:read"
]
}
],
"x-readme": {
"code-samples": [
{
"language": "java",
"install": "<dependency><groupId>com.asana</groupId><artifactId>asana</artifactId><version>1.0.0</version></dependency>",
"code": "import com.asana.Client;\n\nClient client = Client.accessToken(\"PERSONAL_ACCESS_TOKEN\");\n\nList<Task> result = client.tasks.getDependenciesForTask(taskGid)\n .option(\"pretty\", true)\n .execute();"
},
{
"language": "node",
"install": "npm install asana",
"code": "const Asana = require('asana');\n\nlet client = new Asana.ApiClient();\nclient.authentications.token.accessToken = '<YOUR_ACCESS_TOKEN>';\n\nlet tasksApiInstance = new Asana.TasksApi(client);\nlet task_gid = \"321654\"; // String | The task to operate on.\nlet opts = { \n 'limit': 50, \n 'offset': \"eyJ0eXAiOJiKV1iQLCJhbGciOiJIUzI1NiJ9\", \n 'opt_fields': \"actual_time_minutes,approval_status,assigned_by,assigned_by.name,assignee,assignee.name,assignee_section,assignee_section.name,assignee_status,completed,completed_at,completed_by,completed_by.name,created_at,created_by,custom_fields,custom_fields.asana_created_field,custom_fields.created_by,custom_fields.created_by.name,custom_fields.currency_code,custom_fields.custom_label,custom_fields.custom_label_position,custom_fields.date_value,custom_fields.date_value.date,custom_fields.date_value.date_time,custom_fields.default_access_level,custom_fields.description,custom_fields.display_value,custom_fields.enabled,custom_fields.enum_options,custom_fields.enum_options.color,custom_fields.enum_options.enabled,custom_fields.enum_options.name,custom_fields.enum_value,custom_fields.enum_value.color,custom_fields.enum_value.enabled,custom_fields.enum_value.name,custom_fields.format,custom_fields.has_notifications_enabled,custom_fields.html_text_value,custom_fields.id_prefix,custom_fields.input_restrictions,custom_fields.is_formula_field,custom_fields.is_global_to_workspace,custom_fields.is_value_read_only,custom_fields.multi_enum_values,custom_fields.multi_enum_values.color,custom_fields.multi_enum_values.enabled,custom_fields.multi_enum_values.name,custom_fields.name,custom_fields.number_value,custom_fields.people_value,custom_fields.people_value.name,custom_fields.precision,custom_fields.privacy_setting,custom_fields.reference_value,custom_fields.reference_value.name,custom_fields.representation_type,custom_fields.resource_subtype,custom_fields.text_value,custom_fields.type,custom_type,custom_type.asana_created_type_identifier,custom_type.name,custom_type_status_option,custom_type_status_option.name,dependencies,dependents,due_at,due_on,effective_memberships,external,external.data,followers,followers.name,hearted,hearts,hearts.user,hearts.user.name,html_notes,is_rendered_as_separator,liked,likes,likes.user,likes.user.name,memberships,memberships.project,memberships.project.name,memberships.project.resource_subtype,memberships.section,memberships.section.name,modified_at,name,notes,num_hearts,num_likes,num_subtasks,offset,parent,parent.created_by,parent.name,parent.resource_subtype,path,permalink_url,projects,projects.name,projects.resource_subtype,resource_subtype,start_at,start_on,tags,tags.name,uri,workspace,workspace.name\"\n};\ntasksApiInstance.getDependenciesForTask(task_gid, opts).then((result) => {\n console.log('API called successfully. Returned data: ' + JSON.stringify(result.data, null, 2));\n}, (error) => {\n console.error(error.response.body);\n});",
"name": "node-sdk-v3"
},
{
"language": "node",
"install": "npm install asana@1.0.5",
"code": "const asana = require('asana');\n\nconst client = asana.Client.create().useAccessToken('PERSONAL_ACCESS_TOKEN');\n\nclient.tasks.getDependenciesForTask(taskGid, {param: \"value\", param: \"value\", opt_pretty: true})\n .then((result) => {\n console.log(result);\n });",
"name": "node-sdk-v1"
},
{
"language": "python",
"install": "pip install asana",
"code": "import asana\nfrom asana.rest import ApiException\nfrom pprint import pprint\n\nconfiguration = asana.Configuration()\nconfiguration.access_token = '<YOUR_ACCESS_TOKEN>'\napi_client = asana.ApiClient(configuration)\n\n# create an instance of the API class\ntasks_api_instance = asana.TasksApi(api_client)\ntask_gid = \"321654\" # str | The task to operate on.\nopts = {\n 'limit': 50, # int | Results per page. The number of objects to return per page. The value must be between 1 and 100.\n 'offset': \"eyJ0eXAiOJiKV1iQLCJhbGciOiJIUzI1NiJ9\", # str | 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.*\n 'opt_fields': \"actual_time_minutes,approval_status,assigned_by,assigned_by.name,assignee,assignee.name,assignee_section,assignee_section.name,assignee_status,completed,completed_at,completed_by,completed_by.name,created_at,created_by,custom_fields,custom_fields.asana_created_field,custom_fields.created_by,custom_fields.created_by.name,custom_fields.currency_code,custom_fields.custom_label,custom_fields.custom_label_position,custom_fields.date_value,custom_fields.date_value.date,custom_fields.date_value.date_time,custom_fields.default_access_level,custom_fields.description,custom_fields.display_value,custom_fields.enabled,custom_fields.enum_options,custom_fields.enum_options.color,custom_fields.enum_options.enabled,custom_fields.enum_options.name,custom_fields.enum_value,custom_fields.enum_value.color,custom_fields.enum_value.enabled,custom_fields.enum_value.name,custom_fields.format,custom_fields.has_notifications_enabled,custom_fields.html_text_value,custom_fields.id_prefix,custom_fields.input_restrictions,custom_fields.is_formula_field,custom_fields.is_global_to_workspace,custom_fields.is_value_read_only,custom_fields.multi_enum_values,custom_fields.multi_enum_values.color,custom_fields.multi_enum_values.enabled,custom_fields.multi_enum_values.name,custom_fields.name,custom_fields.number_value,custom_fields.people_value,custom_fields.people_value.name,custom_fields.precision,custom_fields.privacy_setting,custom_fields.reference_value,custom_fields.reference_value.name,custom_fields.representation_type,custom_fields.resource_subtype,custom_fields.text_value,custom_fields.type,custom_type,custom_type.asana_created_type_identifier,custom_type.name,custom_type_status_option,custom_type_status_option.name,dependencies,dependents,due_at,due_on,effective_memberships,external,external.data,followers,followers.name,hearted,hearts,hearts.user,hearts.user.name,html_notes,is_rendered_as_separator,liked,likes,likes.user,likes.user.name,memberships,memberships.project,memberships.project.name,memberships.project.resource_subtype,memberships.section,memberships.section.name,modified_at,name,notes,num_hearts,num_likes,num_subtasks,offset,parent,parent.created_by,parent.name,parent.resource_subtype,path,permalink_url,projects,projects.name,projects.resource_subtype,resource_subtype,start_at,start_on,tags,tags.name,uri,workspace,workspace.name\", # list[str] | 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.\n}\n\ntry:\n # Get dependencies from a task\n api_response = tasks_api_instance.get_dependencies_for_task(task_gid, opts)\n for data in api_response:\n pprint(data)\nexcept ApiException as e:\n print(\"Exception when calling TasksApi->get_dependencies_for_task: %s\\n\" % e)",
"name": "python-sdk-v5"
},
{
"language": "python",
"install": "pip install asana==3.2.3",
"code": "import asana\n\nclient = asana.Client.access_token('PERSONAL_ACCESS_TOKEN')\n\nresult = client.tasks.get_dependencies_for_task(task_gid, {'param': 'value', 'param': 'value'}, opt_pretty=True)",
"name": "python-sdk-v3"
},
{
"language": "php",
"install": "composer require asana/asana",
"code": "<?php\nrequire 'vendor/autoload.php';\n\n$client = Asana\\Client::accessToken('PERSONAL_ACCESS_TOKEN');\n\n$result = $client->tasks->getDependenciesForTask($task_gid, array('param' => 'value', 'param' => 'value'), array('opt_pretty' => 'true'))"
},
{
"language": "ruby",
"install": "gem install asana",
"code": "require 'asana'\n\nclient = Asana::Client.new do |c|\n c.authentication :access_token, 'PERSONAL_ACCESS_TOKEN'\nend\n\nresult = client.tasks.get_dependencies_for_task(task_gid: 'task_gid', param: \"value\", param: \"value\", options: {pretty: true})"
}
]
},
"x-purple-suite-runtime": "modeled-core",
"x-purple-suite-supported-query": [
"opt_pretty",
"limit",
"offset",
"opt_fields"
],
"x-purple-suite-supported-response-fields": [
"gid",
"resource_type",
"resource_subtype",
"name",
"notes",
"completed",
"completed_at",
"created_at",
"modified_at",
"assignee",
"assignee_status",
"workspace",
"projects",
"memberships",
"parent",
"due_on",
"start_on",
"tags",
"dependencies",
"num_subtasks",
"archived",
"public",
"color",
"default_view",
"team",
"project",
"section",
"text",
"created_by",
"target",
"type",
"email",
"photo",
"is_organization"
]
}
POST /api/1.0/tasks/{task_gid}/addDependencies
Set dependencies for a task
<b>Required scope: </b><code>tasks:write</code>
Marks a set of tasks as dependencies of this task, if they are not already dependencies. *A task can have at most 30 dependents and dependencies combined*.
The persistent core model supports the response and query fields named in x-purple-suite-supported-response-fields and x-purple-suite-supported-query. Other fields/options return an explicit 400 errors envelope.
Authentication
[
{
"personalAccessToken": []
},
{
"oauth2": [
"tasks:write"
]
}
]
Path-level parameters and metadata
{
"parameters": [
{
"$ref": "#/components/parameters/task_path_gid"
},
{
"$ref": "#/components/parameters/pretty"
}
]
}
Request, responses and operation details
{
"summary": "Set dependencies for a task",
"description": "<b>Required scope: </b><code>tasks:write</code>\n\nMarks a set of tasks as dependencies of this task, if they are not already dependencies. *A task can have at most 30 dependents and dependencies combined*.\n\nThe persistent core model supports the response and query fields named in x-purple-suite-supported-response-fields and x-purple-suite-supported-query. Other fields/options return an explicit 400 errors envelope.",
"tags": [
"Tasks"
],
"operationId": "addDependenciesForTask",
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
"data"
],
"additionalProperties": false,
"properties": {
"data": {
"type": "object",
"additionalProperties": false,
"required": [
"dependencies"
],
"properties": {
"dependencies": {
"type": "array",
"items": {
"type": "string"
},
"minItems": 1
}
}
}
}
}
},
"application/x-www-form-urlencoded": {
"schema": {
"type": "object",
"additionalProperties": false,
"required": [
"dependencies"
],
"properties": {
"dependencies": {
"type": "array",
"items": {
"type": "string"
},
"minItems": 1
}
}
}
}
}
},
"responses": {
"200": {
"description": "Successfully set the specified dependencies on the task.",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"$ref": "#/components/schemas/EmptyResponse"
}
}
}
}
}
},
"400": {
"$ref": "#/components/responses/BadRequest"
},
"401": {
"$ref": "#/components/responses/Unauthorized"
},
"402": {
"$ref": "#/components/responses/PaymentRequired"
},
"403": {
"$ref": "#/components/responses/Forbidden"
},
"404": {
"$ref": "#/components/responses/NotFound"
},
"500": {
"$ref": "#/components/responses/InternalServerError"
}
},
"security": [
{
"personalAccessToken": []
},
{
"oauth2": [
"tasks:write"
]
}
],
"x-readme": {
"code-samples": [
{
"language": "java",
"install": "<dependency><groupId>com.asana</groupId><artifactId>asana</artifactId><version>1.0.0</version></dependency>",
"code": "import com.asana.Client;\n\nClient client = Client.accessToken(\"PERSONAL_ACCESS_TOKEN\");\n\nJsonElement result = client.tasks.addDependenciesForTask(taskGid)\n .data(\"field\", \"value\")\n .data(\"field\", \"value\")\n .option(\"pretty\", true)\n .execute();"
},
{
"language": "node",
"install": "npm install asana",
"code": "const Asana = require('asana');\n\nlet client = new Asana.ApiClient();\nclient.authentications.token.accessToken = '<YOUR_ACCESS_TOKEN>';\n\nlet tasksApiInstance = new Asana.TasksApi(client);\nlet body = {\"data\": {\"<PARAM_1>\": \"<VALUE_1>\", \"<PARAM_2>\": \"<VALUE_2>\",}}; // Object | The list of tasks to set as dependencies.\nlet task_gid = \"321654\"; // String | The task to operate on.\n\ntasksApiInstance.addDependenciesForTask(body, task_gid).then((result) => {\n console.log('API called successfully. Returned data: ' + JSON.stringify(result.data, null, 2));\n}, (error) => {\n console.error(error.response.body);\n});",
"name": "node-sdk-v3"
},
{
"language": "node",
"install": "npm install asana@1.0.5",
"code": "const asana = require('asana');\n\nconst client = asana.Client.create().useAccessToken('PERSONAL_ACCESS_TOKEN');\n\nclient.tasks.addDependenciesForTask(taskGid, {field: \"value\", field: \"value\", pretty: true})\n .then((result) => {\n console.log(result);\n });",
"name": "node-sdk-v1"
},
{
"language": "python",
"install": "pip install asana",
"code": "import asana\nfrom asana.rest import ApiException\nfrom pprint import pprint\n\nconfiguration = asana.Configuration()\nconfiguration.access_token = '<YOUR_ACCESS_TOKEN>'\napi_client = asana.ApiClient(configuration)\n\n# create an instance of the API class\ntasks_api_instance = asana.TasksApi(api_client)\nbody = {\"data\": {\"<PARAM_1>\": \"<VALUE_1>\", \"<PARAM_2>\": \"<VALUE_2>\",}} # dict | The list of tasks to set as dependencies.\ntask_gid = \"321654\" # str | The task to operate on.\n\n\ntry:\n # Set dependencies for a task\n api_response = tasks_api_instance.add_dependencies_for_task(body, task_gid)\n pprint(api_response)\nexcept ApiException as e:\n print(\"Exception when calling TasksApi->add_dependencies_for_task: %s\\n\" % e)",
"name": "python-sdk-v5"
},
{
"language": "python",
"install": "pip install asana==3.2.3",
"code": "import asana\n\nclient = asana.Client.access_token('PERSONAL_ACCESS_TOKEN')\n\nresult = client.tasks.add_dependencies_for_task(task_gid, {'field': 'value', 'field': 'value'}, opt_pretty=True)",
"name": "python-sdk-v3"
},
{
"language": "php",
"install": "composer require asana/asana",
"code": "<?php\nrequire 'vendor/autoload.php';\n\n$client = Asana\\Client::accessToken('PERSONAL_ACCESS_TOKEN');\n\n$result = $client->tasks->addDependenciesForTask($task_gid, array('field' => 'value', 'field' => 'value'), array('opt_pretty' => 'true'))"
},
{
"language": "ruby",
"install": "gem install asana",
"code": "require 'asana'\n\nclient = Asana::Client.new do |c|\n c.authentication :access_token, 'PERSONAL_ACCESS_TOKEN'\nend\n\nresult = client.tasks.add_dependencies_for_task(task_gid: 'task_gid', field: \"value\", field: \"value\", options: {pretty: true})"
}
]
},
"x-purple-suite-runtime": "modeled-core",
"x-purple-suite-supported-query": [
"opt_pretty"
],
"x-purple-suite-supported-response-fields": [
"gid",
"resource_type",
"resource_subtype",
"name",
"notes",
"completed",
"completed_at",
"created_at",
"modified_at",
"assignee",
"assignee_status",
"workspace",
"projects",
"memberships",
"parent",
"due_on",
"start_on",
"tags",
"dependencies",
"num_subtasks",
"archived",
"public",
"color",
"default_view",
"team",
"project",
"section",
"text",
"created_by",
"target",
"type",
"email",
"photo",
"is_organization"
]
}
POST /api/1.0/tasks/{task_gid}/removeDependencies
Unlink dependencies from a task
<b>Required scope: </b><code>tasks:write</code>
Unlinks a set of dependencies from this task.
The persistent core model supports the response and query fields named in x-purple-suite-supported-response-fields and x-purple-suite-supported-query. Other fields/options return an explicit 400 errors envelope.
Authentication
[
{
"personalAccessToken": []
},
{
"oauth2": [
"tasks:write"
]
}
]
Path-level parameters and metadata
{
"parameters": [
{
"$ref": "#/components/parameters/task_path_gid"
},
{
"$ref": "#/components/parameters/pretty"
}
]
}
Request, responses and operation details
{
"summary": "Unlink dependencies from a task",
"description": "<b>Required scope: </b><code>tasks:write</code>\n\nUnlinks a set of dependencies from this task.\n\nThe persistent core model supports the response and query fields named in x-purple-suite-supported-response-fields and x-purple-suite-supported-query. Other fields/options return an explicit 400 errors envelope.",
"tags": [
"Tasks"
],
"operationId": "removeDependenciesForTask",
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
"data"
],
"additionalProperties": false,
"properties": {
"data": {
"type": "object",
"additionalProperties": false,
"required": [
"dependencies"
],
"properties": {
"dependencies": {
"type": "array",
"items": {
"type": "string"
},
"minItems": 1
}
}
}
}
}
},
"application/x-www-form-urlencoded": {
"schema": {
"type": "object",
"additionalProperties": false,
"required": [
"dependencies"
],
"properties": {
"dependencies": {
"type": "array",
"items": {
"type": "string"
},
"minItems": 1
}
}
}
}
}
},
"responses": {
"200": {
"description": "Successfully unlinked the dependencies from the specified task.",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"$ref": "#/components/schemas/EmptyResponse"
}
}
}
}
}
},
"400": {
"$ref": "#/components/responses/BadRequest"
},
"401": {
"$ref": "#/components/responses/Unauthorized"
},
"402": {
"$ref": "#/components/responses/PaymentRequired"
},
"403": {
"$ref": "#/components/responses/Forbidden"
},
"404": {
"$ref": "#/components/responses/NotFound"
},
"500": {
"$ref": "#/components/responses/InternalServerError"
}
},
"security": [
{
"personalAccessToken": []
},
{
"oauth2": [
"tasks:write"
]
}
],
"x-readme": {
"code-samples": [
{
"language": "java",
"install": "<dependency><groupId>com.asana</groupId><artifactId>asana</artifactId><version>1.0.0</version></dependency>",
"code": "import com.asana.Client;\n\nClient client = Client.accessToken(\"PERSONAL_ACCESS_TOKEN\");\n\nJsonElement result = client.tasks.removeDependenciesForTask(taskGid)\n .data(\"field\", \"value\")\n .data(\"field\", \"value\")\n .option(\"pretty\", true)\n .execute();"
},
{
"language": "node",
"install": "npm install asana",
"code": "const Asana = require('asana');\n\nlet client = new Asana.ApiClient();\nclient.authentications.token.accessToken = '<YOUR_ACCESS_TOKEN>';\n\nlet tasksApiInstance = new Asana.TasksApi(client);\nlet body = {\"data\": {\"<PARAM_1>\": \"<VALUE_1>\", \"<PARAM_2>\": \"<VALUE_2>\",}}; // Object | The list of tasks to unlink as dependencies.\nlet task_gid = \"321654\"; // String | The task to operate on.\n\ntasksApiInstance.removeDependenciesForTask(body, task_gid).then((result) => {\n console.log('API called successfully. Returned data: ' + JSON.stringify(result.data, null, 2));\n}, (error) => {\n console.error(error.response.body);\n});",
"name": "node-sdk-v3"
},
{
"language": "node",
"install": "npm install asana@1.0.5",
"code": "const asana = require('asana');\n\nconst client = asana.Client.create().useAccessToken('PERSONAL_ACCESS_TOKEN');\n\nclient.tasks.removeDependenciesForTask(taskGid, {field: \"value\", field: \"value\", pretty: true})\n .then((result) => {\n console.log(result);\n });",
"name": "node-sdk-v1"
},
{
"language": "python",
"install": "pip install asana",
"code": "import asana\nfrom asana.rest import ApiException\nfrom pprint import pprint\n\nconfiguration = asana.Configuration()\nconfiguration.access_token = '<YOUR_ACCESS_TOKEN>'\napi_client = asana.ApiClient(configuration)\n\n# create an instance of the API class\ntasks_api_instance = asana.TasksApi(api_client)\nbody = {\"data\": {\"<PARAM_1>\": \"<VALUE_1>\", \"<PARAM_2>\": \"<VALUE_2>\",}} # dict | The list of tasks to unlink as dependencies.\ntask_gid = \"321654\" # str | The task to operate on.\n\n\ntry:\n # Unlink dependencies from a task\n api_response = tasks_api_instance.remove_dependencies_for_task(body, task_gid)\n pprint(api_response)\nexcept ApiException as e:\n print(\"Exception when calling TasksApi->remove_dependencies_for_task: %s\\n\" % e)",
"name": "python-sdk-v5"
},
{
"language": "python",
"install": "pip install asana==3.2.3",
"code": "import asana\n\nclient = asana.Client.access_token('PERSONAL_ACCESS_TOKEN')\n\nresult = client.tasks.remove_dependencies_for_task(task_gid, {'field': 'value', 'field': 'value'}, opt_pretty=True)",
"name": "python-sdk-v3"
},
{
"language": "php",
"install": "composer require asana/asana",
"code": "<?php\nrequire 'vendor/autoload.php';\n\n$client = Asana\\Client::accessToken('PERSONAL_ACCESS_TOKEN');\n\n$result = $client->tasks->removeDependenciesForTask($task_gid, array('field' => 'value', 'field' => 'value'), array('opt_pretty' => 'true'))"
},
{
"language": "ruby",
"install": "gem install asana",
"code": "require 'asana'\n\nclient = Asana::Client.new do |c|\n c.authentication :access_token, 'PERSONAL_ACCESS_TOKEN'\nend\n\nresult = client.tasks.remove_dependencies_for_task(task_gid: 'task_gid', field: \"value\", field: \"value\", options: {pretty: true})"
}
]
},
"x-purple-suite-runtime": "modeled-core",
"x-purple-suite-supported-query": [
"opt_pretty"
],
"x-purple-suite-supported-response-fields": [
"gid",
"resource_type",
"resource_subtype",
"name",
"notes",
"completed",
"completed_at",
"created_at",
"modified_at",
"assignee",
"assignee_status",
"workspace",
"projects",
"memberships",
"parent",
"due_on",
"start_on",
"tags",
"dependencies",
"num_subtasks",
"archived",
"public",
"color",
"default_view",
"team",
"project",
"section",
"text",
"created_by",
"target",
"type",
"email",
"photo",
"is_organization"
]
}
GET /api/1.0/tasks/{task_gid}/dependents
Get dependents from a task
<b>Required scope: </b><code>tasks:read</code>
Returns the compact representations of all of the dependents of a task.
The persistent core model supports the response and query fields named in x-purple-suite-supported-response-fields and x-purple-suite-supported-query. Other fields/options return an explicit 400 errors envelope.
Authentication
[
{
"personalAccessToken": []
},
{
"oauth2": [
"tasks:read"
]
}
]
Path-level parameters and metadata
{
"parameters": [
{
"$ref": "#/components/parameters/task_path_gid"
},
{
"$ref": "#/components/parameters/pretty"
},
{
"$ref": "#/components/parameters/limit"
},
{
"$ref": "#/components/parameters/offset"
}
]
}
Request, responses and operation details
{
"summary": "Get dependents from a task",
"description": "<b>Required scope: </b><code>tasks:read</code>\n\nReturns the compact representations of all of the dependents of a task.\n\nThe persistent core model supports the response and query fields named in x-purple-suite-supported-response-fields and x-purple-suite-supported-query. Other fields/options return an explicit 400 errors envelope.",
"tags": [
"Tasks"
],
"operationId": "getDependentsForTask",
"parameters": [
{
"name": "opt_fields",
"in": "query",
"description": "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. Properties can include nested fields. To learn more, see the [input/output options guide](/docs/inputoutput-options#selecting-nested-fields).",
"required": false,
"example": [
"actual_time_minutes",
"approval_status",
"assigned_by",
"assigned_by.name",
"assignee",
"assignee.name",
"assignee_section",
"assignee_section.name",
"assignee_status",
"completed",
"completed_at",
"completed_by",
"completed_by.name",
"created_at",
"created_by",
"custom_fields",
"custom_fields.asana_created_field",
"custom_fields.created_by",
"custom_fields.created_by.name",
"custom_fields.currency_code",
"custom_fields.custom_label",
"custom_fields.custom_label_position",
"custom_fields.date_value",
"custom_fields.date_value.date",
"custom_fields.date_value.date_time",
"custom_fields.default_access_level",
"custom_fields.description",
"custom_fields.display_value",
"custom_fields.enabled",
"custom_fields.enum_options",
"custom_fields.enum_options.color",
"custom_fields.enum_options.enabled",
"custom_fields.enum_options.name",
"custom_fields.enum_value",
"custom_fields.enum_value.color",
"custom_fields.enum_value.enabled",
"custom_fields.enum_value.name",
"custom_fields.format",
"custom_fields.has_notifications_enabled",
"custom_fields.html_text_value",
"custom_fields.id_prefix",
"custom_fields.input_restrictions",
"custom_fields.is_formula_field",
"custom_fields.is_global_to_workspace",
"custom_fields.is_value_read_only",
"custom_fields.multi_enum_values",
"custom_fields.multi_enum_values.color",
"custom_fields.multi_enum_values.enabled",
"custom_fields.multi_enum_values.name",
"custom_fields.name",
"custom_fields.number_value",
"custom_fields.people_value",
"custom_fields.people_value.name",
"custom_fields.precision",
"custom_fields.privacy_setting",
"custom_fields.reference_value",
"custom_fields.reference_value.name",
"custom_fields.representation_type",
"custom_fields.resource_subtype",
"custom_fields.text_value",
"custom_fields.type",
"custom_type",
"custom_type.asana_created_type_identifier",
"custom_type.name",
"custom_type_status_option",
"custom_type_status_option.name",
"dependencies",
"dependents",
"due_at",
"due_on",
"effective_memberships",
"external",
"external.data",
"followers",
"followers.name",
"hearted",
"hearts",
"hearts.user",
"hearts.user.name",
"html_notes",
"is_rendered_as_separator",
"liked",
"likes",
"likes.user",
"likes.user.name",
"memberships",
"memberships.project",
"memberships.project.name",
"memberships.project.resource_subtype",
"memberships.section",
"memberships.section.name",
"modified_at",
"name",
"notes",
"num_hearts",
"num_likes",
"num_subtasks",
"offset",
"parent",
"parent.created_by",
"parent.name",
"parent.resource_subtype",
"path",
"permalink_url",
"projects",
"projects.name",
"projects.resource_subtype",
"resource_subtype",
"start_at",
"start_on",
"tags",
"tags.name",
"uri",
"workspace",
"workspace.name"
],
"schema": {
"type": "array",
"items": {
"type": "string",
"enum": [
"actual_time_minutes",
"approval_status",
"assigned_by",
"assigned_by.name",
"assignee",
"assignee.name",
"assignee_section",
"assignee_section.name",
"assignee_status",
"completed",
"completed_at",
"completed_by",
"completed_by.name",
"created_at",
"created_by",
"custom_fields",
"custom_fields.asana_created_field",
"custom_fields.created_by",
"custom_fields.created_by.name",
"custom_fields.currency_code",
"custom_fields.custom_label",
"custom_fields.custom_label_position",
"custom_fields.date_value",
"custom_fields.date_value.date",
"custom_fields.date_value.date_time",
"custom_fields.default_access_level",
"custom_fields.description",
"custom_fields.display_value",
"custom_fields.enabled",
"custom_fields.enum_options",
"custom_fields.enum_options.color",
"custom_fields.enum_options.enabled",
"custom_fields.enum_options.name",
"custom_fields.enum_value",
"custom_fields.enum_value.color",
"custom_fields.enum_value.enabled",
"custom_fields.enum_value.name",
"custom_fields.format",
"custom_fields.has_notifications_enabled",
"custom_fields.html_text_value",
"custom_fields.id_prefix",
"custom_fields.input_restrictions",
"custom_fields.is_formula_field",
"custom_fields.is_global_to_workspace",
"custom_fields.is_value_read_only",
"custom_fields.multi_enum_values",
"custom_fields.multi_enum_values.color",
"custom_fields.multi_enum_values.enabled",
"custom_fields.multi_enum_values.name",
"custom_fields.name",
"custom_fields.number_value",
"custom_fields.people_value",
"custom_fields.people_value.name",
"custom_fields.precision",
"custom_fields.privacy_setting",
"custom_fields.reference_value",
"custom_fields.reference_value.name",
"custom_fields.representation_type",
"custom_fields.resource_subtype",
"custom_fields.text_value",
"custom_fields.type",
"custom_type",
"custom_type.asana_created_type_identifier",
"custom_type.name",
"custom_type_status_option",
"custom_type_status_option.name",
"dependencies",
"dependents",
"due_at",
"due_on",
"effective_memberships",
"external",
"external.data",
"followers",
"followers.name",
"hearted",
"hearts",
"hearts.user",
"hearts.user.name",
"html_notes",
"is_rendered_as_separator",
"liked",
"likes",
"likes.user",
"likes.user.name",
"memberships",
"memberships.project",
"memberships.project.name",
"memberships.project.resource_subtype",
"memberships.section",
"memberships.section.name",
"modified_at",
"name",
"notes",
"num_hearts",
"num_likes",
"num_subtasks",
"offset",
"parent",
"parent.created_by",
"parent.name",
"parent.resource_subtype",
"path",
"permalink_url",
"projects",
"projects.name",
"projects.resource_subtype",
"resource_subtype",
"start_at",
"start_on",
"tags",
"tags.name",
"uri",
"workspace",
"workspace.name"
]
}
},
"style": "form",
"explode": false
}
],
"responses": {
"200": {
"description": "Successfully retrieved the specified dependents of the task.",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"type": "array",
"items": {
"$ref": "#/components/schemas/TaskCompact"
}
},
"next_page": {
"$ref": "#/components/schemas/NextPage"
}
}
}
}
}
},
"400": {
"$ref": "#/components/responses/BadRequest"
},
"401": {
"$ref": "#/components/responses/Unauthorized"
},
"402": {
"$ref": "#/components/responses/PaymentRequired"
},
"403": {
"$ref": "#/components/responses/Forbidden"
},
"404": {
"$ref": "#/components/responses/NotFound"
},
"500": {
"$ref": "#/components/responses/InternalServerError"
}
},
"security": [
{
"personalAccessToken": []
},
{
"oauth2": [
"tasks:read"
]
}
],
"x-readme": {
"code-samples": [
{
"language": "java",
"install": "<dependency><groupId>com.asana</groupId><artifactId>asana</artifactId><version>1.0.0</version></dependency>",
"code": "import com.asana.Client;\n\nClient client = Client.accessToken(\"PERSONAL_ACCESS_TOKEN\");\n\nList<Task> result = client.tasks.getDependentsForTask(taskGid)\n .option(\"pretty\", true)\n .execute();"
},
{
"language": "node",
"install": "npm install asana",
"code": "const Asana = require('asana');\n\nlet client = new Asana.ApiClient();\nclient.authentications.token.accessToken = '<YOUR_ACCESS_TOKEN>';\n\nlet tasksApiInstance = new Asana.TasksApi(client);\nlet task_gid = \"321654\"; // String | The task to operate on.\nlet opts = { \n 'limit': 50, \n 'offset': \"eyJ0eXAiOJiKV1iQLCJhbGciOiJIUzI1NiJ9\", \n 'opt_fields': \"actual_time_minutes,approval_status,assigned_by,assigned_by.name,assignee,assignee.name,assignee_section,assignee_section.name,assignee_status,completed,completed_at,completed_by,completed_by.name,created_at,created_by,custom_fields,custom_fields.asana_created_field,custom_fields.created_by,custom_fields.created_by.name,custom_fields.currency_code,custom_fields.custom_label,custom_fields.custom_label_position,custom_fields.date_value,custom_fields.date_value.date,custom_fields.date_value.date_time,custom_fields.default_access_level,custom_fields.description,custom_fields.display_value,custom_fields.enabled,custom_fields.enum_options,custom_fields.enum_options.color,custom_fields.enum_options.enabled,custom_fields.enum_options.name,custom_fields.enum_value,custom_fields.enum_value.color,custom_fields.enum_value.enabled,custom_fields.enum_value.name,custom_fields.format,custom_fields.has_notifications_enabled,custom_fields.html_text_value,custom_fields.id_prefix,custom_fields.input_restrictions,custom_fields.is_formula_field,custom_fields.is_global_to_workspace,custom_fields.is_value_read_only,custom_fields.multi_enum_values,custom_fields.multi_enum_values.color,custom_fields.multi_enum_values.enabled,custom_fields.multi_enum_values.name,custom_fields.name,custom_fields.number_value,custom_fields.people_value,custom_fields.people_value.name,custom_fields.precision,custom_fields.privacy_setting,custom_fields.reference_value,custom_fields.reference_value.name,custom_fields.representation_type,custom_fields.resource_subtype,custom_fields.text_value,custom_fields.type,custom_type,custom_type.asana_created_type_identifier,custom_type.name,custom_type_status_option,custom_type_status_option.name,dependencies,dependents,due_at,due_on,effective_memberships,external,external.data,followers,followers.name,hearted,hearts,hearts.user,hearts.user.name,html_notes,is_rendered_as_separator,liked,likes,likes.user,likes.user.name,memberships,memberships.project,memberships.project.name,memberships.project.resource_subtype,memberships.section,memberships.section.name,modified_at,name,notes,num_hearts,num_likes,num_subtasks,offset,parent,parent.created_by,parent.name,parent.resource_subtype,path,permalink_url,projects,projects.name,projects.resource_subtype,resource_subtype,start_at,start_on,tags,tags.name,uri,workspace,workspace.name\"\n};\ntasksApiInstance.getDependentsForTask(task_gid, opts).then((result) => {\n console.log('API called successfully. Returned data: ' + JSON.stringify(result.data, null, 2));\n}, (error) => {\n console.error(error.response.body);\n});",
"name": "node-sdk-v3"
},
{
"language": "node",
"install": "npm install asana@1.0.5",
"code": "const asana = require('asana');\n\nconst client = asana.Client.create().useAccessToken('PERSONAL_ACCESS_TOKEN');\n\nclient.tasks.getDependentsForTask(taskGid, {param: \"value\", param: \"value\", opt_pretty: true})\n .then((result) => {\n console.log(result);\n });",
"name": "node-sdk-v1"
},
{
"language": "python",
"install": "pip install asana",
"code": "import asana\nfrom asana.rest import ApiException\nfrom pprint import pprint\n\nconfiguration = asana.Configuration()\nconfiguration.access_token = '<YOUR_ACCESS_TOKEN>'\napi_client = asana.ApiClient(configuration)\n\n# create an instance of the API class\ntasks_api_instance = asana.TasksApi(api_client)\ntask_gid = \"321654\" # str | The task to operate on.\nopts = {\n 'limit': 50, # int | Results per page. The number of objects to return per page. The value must be between 1 and 100.\n 'offset': \"eyJ0eXAiOJiKV1iQLCJhbGciOiJIUzI1NiJ9\", # str | 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.*\n 'opt_fields': \"actual_time_minutes,approval_status,assigned_by,assigned_by.name,assignee,assignee.name,assignee_section,assignee_section.name,assignee_status,completed,completed_at,completed_by,completed_by.name,created_at,created_by,custom_fields,custom_fields.asana_created_field,custom_fields.created_by,custom_fields.created_by.name,custom_fields.currency_code,custom_fields.custom_label,custom_fields.custom_label_position,custom_fields.date_value,custom_fields.date_value.date,custom_fields.date_value.date_time,custom_fields.default_access_level,custom_fields.description,custom_fields.display_value,custom_fields.enabled,custom_fields.enum_options,custom_fields.enum_options.color,custom_fields.enum_options.enabled,custom_fields.enum_options.name,custom_fields.enum_value,custom_fields.enum_value.color,custom_fields.enum_value.enabled,custom_fields.enum_value.name,custom_fields.format,custom_fields.has_notifications_enabled,custom_fields.html_text_value,custom_fields.id_prefix,custom_fields.input_restrictions,custom_fields.is_formula_field,custom_fields.is_global_to_workspace,custom_fields.is_value_read_only,custom_fields.multi_enum_values,custom_fields.multi_enum_values.color,custom_fields.multi_enum_values.enabled,custom_fields.multi_enum_values.name,custom_fields.name,custom_fields.number_value,custom_fields.people_value,custom_fields.people_value.name,custom_fields.precision,custom_fields.privacy_setting,custom_fields.reference_value,custom_fields.reference_value.name,custom_fields.representation_type,custom_fields.resource_subtype,custom_fields.text_value,custom_fields.type,custom_type,custom_type.asana_created_type_identifier,custom_type.name,custom_type_status_option,custom_type_status_option.name,dependencies,dependents,due_at,due_on,effective_memberships,external,external.data,followers,followers.name,hearted,hearts,hearts.user,hearts.user.name,html_notes,is_rendered_as_separator,liked,likes,likes.user,likes.user.name,memberships,memberships.project,memberships.project.name,memberships.project.resource_subtype,memberships.section,memberships.section.name,modified_at,name,notes,num_hearts,num_likes,num_subtasks,offset,parent,parent.created_by,parent.name,parent.resource_subtype,path,permalink_url,projects,projects.name,projects.resource_subtype,resource_subtype,start_at,start_on,tags,tags.name,uri,workspace,workspace.name\", # list[str] | 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.\n}\n\ntry:\n # Get dependents from a task\n api_response = tasks_api_instance.get_dependents_for_task(task_gid, opts)\n for data in api_response:\n pprint(data)\nexcept ApiException as e:\n print(\"Exception when calling TasksApi->get_dependents_for_task: %s\\n\" % e)",
"name": "python-sdk-v5"
},
{
"language": "python",
"install": "pip install asana==3.2.3",
"code": "import asana\n\nclient = asana.Client.access_token('PERSONAL_ACCESS_TOKEN')\n\nresult = client.tasks.get_dependents_for_task(task_gid, {'param': 'value', 'param': 'value'}, opt_pretty=True)",
"name": "python-sdk-v3"
},
{
"language": "php",
"install": "composer require asana/asana",
"code": "<?php\nrequire 'vendor/autoload.php';\n\n$client = Asana\\Client::accessToken('PERSONAL_ACCESS_TOKEN');\n\n$result = $client->tasks->getDependentsForTask($task_gid, array('param' => 'value', 'param' => 'value'), array('opt_pretty' => 'true'))"
},
{
"language": "ruby",
"install": "gem install asana",
"code": "require 'asana'\n\nclient = Asana::Client.new do |c|\n c.authentication :access_token, 'PERSONAL_ACCESS_TOKEN'\nend\n\nresult = client.tasks.get_dependents_for_task(task_gid: 'task_gid', param: \"value\", param: \"value\", options: {pretty: true})"
}
]
},
"x-purple-suite-runtime": "modeled-core",
"x-purple-suite-supported-query": [
"opt_pretty",
"limit",
"offset",
"opt_fields"
],
"x-purple-suite-supported-response-fields": [
"gid",
"resource_type",
"resource_subtype",
"name",
"notes",
"completed",
"completed_at",
"created_at",
"modified_at",
"assignee",
"assignee_status",
"workspace",
"projects",
"memberships",
"parent",
"due_on",
"start_on",
"tags",
"dependencies",
"num_subtasks",
"archived",
"public",
"color",
"default_view",
"team",
"project",
"section",
"text",
"created_by",
"target",
"type",
"email",
"photo",
"is_organization"
]
}
POST /api/1.0/tasks/{task_gid}/addDependents
Set dependents for a task
<b>Required scope: </b><code>tasks:write</code>
Marks a set of tasks as dependents of this task, if they are not already dependents. *A task can have at most 30 dependents and dependencies combined*.
The persistent core model supports the response and query fields named in x-purple-suite-supported-response-fields and x-purple-suite-supported-query. Other fields/options return an explicit 400 errors envelope.
Authentication
[
{
"personalAccessToken": []
},
{
"oauth2": [
"tasks:write"
]
}
]
Path-level parameters and metadata
{
"parameters": [
{
"$ref": "#/components/parameters/task_path_gid"
},
{
"$ref": "#/components/parameters/pretty"
}
]
}
Request, responses and operation details
{
"summary": "Set dependents for a task",
"description": "<b>Required scope: </b><code>tasks:write</code>\n\nMarks a set of tasks as dependents of this task, if they are not already dependents. *A task can have at most 30 dependents and dependencies combined*.\n\nThe persistent core model supports the response and query fields named in x-purple-suite-supported-response-fields and x-purple-suite-supported-query. Other fields/options return an explicit 400 errors envelope.",
"tags": [
"Tasks"
],
"operationId": "addDependentsForTask",
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
"data"
],
"additionalProperties": false,
"properties": {
"data": {
"type": "object",
"additionalProperties": false,
"required": [
"dependents"
],
"properties": {
"dependents": {
"type": "array",
"items": {
"type": "string"
},
"minItems": 1
}
}
}
}
}
},
"application/x-www-form-urlencoded": {
"schema": {
"type": "object",
"additionalProperties": false,
"required": [
"dependents"
],
"properties": {
"dependents": {
"type": "array",
"items": {
"type": "string"
},
"minItems": 1
}
}
}
}
}
},
"responses": {
"200": {
"description": "Successfully set the specified dependents on the given task.",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"$ref": "#/components/schemas/EmptyResponse"
}
}
}
}
}
},
"400": {
"$ref": "#/components/responses/BadRequest"
},
"401": {
"$ref": "#/components/responses/Unauthorized"
},
"402": {
"$ref": "#/components/responses/PaymentRequired"
},
"403": {
"$ref": "#/components/responses/Forbidden"
},
"404": {
"$ref": "#/components/responses/NotFound"
},
"500": {
"$ref": "#/components/responses/InternalServerError"
}
},
"security": [
{
"personalAccessToken": []
},
{
"oauth2": [
"tasks:write"
]
}
],
"x-readme": {
"code-samples": [
{
"language": "java",
"install": "<dependency><groupId>com.asana</groupId><artifactId>asana</artifactId><version>1.0.0</version></dependency>",
"code": "import com.asana.Client;\n\nClient client = Client.accessToken(\"PERSONAL_ACCESS_TOKEN\");\n\nJsonElement result = client.tasks.addDependentsForTask(taskGid)\n .data(\"field\", \"value\")\n .data(\"field\", \"value\")\n .option(\"pretty\", true)\n .execute();"
},
{
"language": "node",
"install": "npm install asana",
"code": "const Asana = require('asana');\n\nlet client = new Asana.ApiClient();\nclient.authentications.token.accessToken = '<YOUR_ACCESS_TOKEN>';\n\nlet tasksApiInstance = new Asana.TasksApi(client);\nlet body = {\"data\": {\"<PARAM_1>\": \"<VALUE_1>\", \"<PARAM_2>\": \"<VALUE_2>\",}}; // Object | The list of tasks to add as dependents.\nlet task_gid = \"321654\"; // String | The task to operate on.\n\ntasksApiInstance.addDependentsForTask(body, task_gid).then((result) => {\n console.log('API called successfully. Returned data: ' + JSON.stringify(result.data, null, 2));\n}, (error) => {\n console.error(error.response.body);\n});",
"name": "node-sdk-v3"
},
{
"language": "node",
"install": "npm install asana@1.0.5",
"code": "const asana = require('asana');\n\nconst client = asana.Client.create().useAccessToken('PERSONAL_ACCESS_TOKEN');\n\nclient.tasks.addDependentsForTask(taskGid, {field: \"value\", field: \"value\", pretty: true})\n .then((result) => {\n console.log(result);\n });",
"name": "node-sdk-v1"
},
{
"language": "python",
"install": "pip install asana",
"code": "import asana\nfrom asana.rest import ApiException\nfrom pprint import pprint\n\nconfiguration = asana.Configuration()\nconfiguration.access_token = '<YOUR_ACCESS_TOKEN>'\napi_client = asana.ApiClient(configuration)\n\n# create an instance of the API class\ntasks_api_instance = asana.TasksApi(api_client)\nbody = {\"data\": {\"<PARAM_1>\": \"<VALUE_1>\", \"<PARAM_2>\": \"<VALUE_2>\",}} # dict | The list of tasks to add as dependents.\ntask_gid = \"321654\" # str | The task to operate on.\n\n\ntry:\n # Set dependents for a task\n api_response = tasks_api_instance.add_dependents_for_task(body, task_gid)\n pprint(api_response)\nexcept ApiException as e:\n print(\"Exception when calling TasksApi->add_dependents_for_task: %s\\n\" % e)",
"name": "python-sdk-v5"
},
{
"language": "python",
"install": "pip install asana==3.2.3",
"code": "import asana\n\nclient = asana.Client.access_token('PERSONAL_ACCESS_TOKEN')\n\nresult = client.tasks.add_dependents_for_task(task_gid, {'field': 'value', 'field': 'value'}, opt_pretty=True)",
"name": "python-sdk-v3"
},
{
"language": "php",
"install": "composer require asana/asana",
"code": "<?php\nrequire 'vendor/autoload.php';\n\n$client = Asana\\Client::accessToken('PERSONAL_ACCESS_TOKEN');\n\n$result = $client->tasks->addDependentsForTask($task_gid, array('field' => 'value', 'field' => 'value'), array('opt_pretty' => 'true'))"
},
{
"language": "ruby",
"install": "gem install asana",
"code": "require 'asana'\n\nclient = Asana::Client.new do |c|\n c.authentication :access_token, 'PERSONAL_ACCESS_TOKEN'\nend\n\nresult = client.tasks.add_dependents_for_task(task_gid: 'task_gid', field: \"value\", field: \"value\", options: {pretty: true})"
}
]
},
"x-purple-suite-runtime": "modeled-core",
"x-purple-suite-supported-query": [
"opt_pretty"
],
"x-purple-suite-supported-response-fields": [
"gid",
"resource_type",
"resource_subtype",
"name",
"notes",
"completed",
"completed_at",
"created_at",
"modified_at",
"assignee",
"assignee_status",
"workspace",
"projects",
"memberships",
"parent",
"due_on",
"start_on",
"tags",
"dependencies",
"num_subtasks",
"archived",
"public",
"color",
"default_view",
"team",
"project",
"section",
"text",
"created_by",
"target",
"type",
"email",
"photo",
"is_organization"
]
}
POST /api/1.0/tasks/{task_gid}/removeDependents
Unlink dependents from a task
<b>Required scope: </b><code>tasks:write</code>
Unlinks a set of dependents from this task.
The persistent core model supports the response and query fields named in x-purple-suite-supported-response-fields and x-purple-suite-supported-query. Other fields/options return an explicit 400 errors envelope.
Authentication
[
{
"personalAccessToken": []
},
{
"oauth2": [
"tasks:write"
]
}
]
Path-level parameters and metadata
{
"parameters": [
{
"$ref": "#/components/parameters/task_path_gid"
},
{
"$ref": "#/components/parameters/pretty"
}
]
}
Request, responses and operation details
{
"summary": "Unlink dependents from a task",
"description": "<b>Required scope: </b><code>tasks:write</code>\n\nUnlinks a set of dependents from this task.\n\nThe persistent core model supports the response and query fields named in x-purple-suite-supported-response-fields and x-purple-suite-supported-query. Other fields/options return an explicit 400 errors envelope.",
"tags": [
"Tasks"
],
"operationId": "removeDependentsForTask",
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
"data"
],
"additionalProperties": false,
"properties": {
"data": {
"type": "object",
"additionalProperties": false,
"required": [
"dependents"
],
"properties": {
"dependents": {
"type": "array",
"items": {
"type": "string"
},
"minItems": 1
}
}
}
}
}
},
"application/x-www-form-urlencoded": {
"schema": {
"type": "object",
"additionalProperties": false,
"required": [
"dependents"
],
"properties": {
"dependents": {
"type": "array",
"items": {
"type": "string"
},
"minItems": 1
}
}
}
}
}
},
"responses": {
"200": {
"description": "Successfully unlinked the specified tasks as dependents.",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"$ref": "#/components/schemas/EmptyResponse"
}
}
}
}
}
},
"400": {
"$ref": "#/components/responses/BadRequest"
},
"401": {
"$ref": "#/components/responses/Unauthorized"
},
"402": {
"$ref": "#/components/responses/PaymentRequired"
},
"403": {
"$ref": "#/components/responses/Forbidden"
},
"404": {
"$ref": "#/components/responses/NotFound"
},
"500": {
"$ref": "#/components/responses/InternalServerError"
}
},
"security": [
{
"personalAccessToken": []
},
{
"oauth2": [
"tasks:write"
]
}
],
"x-readme": {
"code-samples": [
{
"language": "java",
"install": "<dependency><groupId>com.asana</groupId><artifactId>asana</artifactId><version>1.0.0</version></dependency>",
"code": "import com.asana.Client;\n\nClient client = Client.accessToken(\"PERSONAL_ACCESS_TOKEN\");\n\nJsonElement result = client.tasks.removeDependentsForTask(taskGid)\n .data(\"field\", \"value\")\n .data(\"field\", \"value\")\n .option(\"pretty\", true)\n .execute();"
},
{
"language": "node",
"install": "npm install asana",
"code": "const Asana = require('asana');\n\nlet client = new Asana.ApiClient();\nclient.authentications.token.accessToken = '<YOUR_ACCESS_TOKEN>';\n\nlet tasksApiInstance = new Asana.TasksApi(client);\nlet body = {\"data\": {\"<PARAM_1>\": \"<VALUE_1>\", \"<PARAM_2>\": \"<VALUE_2>\",}}; // Object | The list of tasks to remove as dependents.\nlet task_gid = \"321654\"; // String | The task to operate on.\n\ntasksApiInstance.removeDependentsForTask(body, task_gid).then((result) => {\n console.log('API called successfully. Returned data: ' + JSON.stringify(result.data, null, 2));\n}, (error) => {\n console.error(error.response.body);\n});",
"name": "node-sdk-v3"
},
{
"language": "node",
"install": "npm install asana@1.0.5",
"code": "const asana = require('asana');\n\nconst client = asana.Client.create().useAccessToken('PERSONAL_ACCESS_TOKEN');\n\nclient.tasks.removeDependentsForTask(taskGid, {field: \"value\", field: \"value\", pretty: true})\n .then((result) => {\n console.log(result);\n });",
"name": "node-sdk-v1"
},
{
"language": "python",
"install": "pip install asana",
"code": "import asana\nfrom asana.rest import ApiException\nfrom pprint import pprint\n\nconfiguration = asana.Configuration()\nconfiguration.access_token = '<YOUR_ACCESS_TOKEN>'\napi_client = asana.ApiClient(configuration)\n\n# create an instance of the API class\ntasks_api_instance = asana.TasksApi(api_client)\nbody = {\"data\": {\"<PARAM_1>\": \"<VALUE_1>\", \"<PARAM_2>\": \"<VALUE_2>\",}} # dict | The list of tasks to remove as dependents.\ntask_gid = \"321654\" # str | The task to operate on.\n\n\ntry:\n # Unlink dependents from a task\n api_response = tasks_api_instance.remove_dependents_for_task(body, task_gid)\n pprint(api_response)\nexcept ApiException as e:\n print(\"Exception when calling TasksApi->remove_dependents_for_task: %s\\n\" % e)",
"name": "python-sdk-v5"
},
{
"language": "python",
"install": "pip install asana==3.2.3",
"code": "import asana\n\nclient = asana.Client.access_token('PERSONAL_ACCESS_TOKEN')\n\nresult = client.tasks.remove_dependents_for_task(task_gid, {'field': 'value', 'field': 'value'}, opt_pretty=True)",
"name": "python-sdk-v3"
},
{
"language": "php",
"install": "composer require asana/asana",
"code": "<?php\nrequire 'vendor/autoload.php';\n\n$client = Asana\\Client::accessToken('PERSONAL_ACCESS_TOKEN');\n\n$result = $client->tasks->removeDependentsForTask($task_gid, array('field' => 'value', 'field' => 'value'), array('opt_pretty' => 'true'))"
},
{
"language": "ruby",
"install": "gem install asana",
"code": "require 'asana'\n\nclient = Asana::Client.new do |c|\n c.authentication :access_token, 'PERSONAL_ACCESS_TOKEN'\nend\n\nresult = client.tasks.remove_dependents_for_task(task_gid: 'task_gid', field: \"value\", field: \"value\", options: {pretty: true})"
}
]
},
"x-purple-suite-runtime": "modeled-core",
"x-purple-suite-supported-query": [
"opt_pretty"
],
"x-purple-suite-supported-response-fields": [
"gid",
"resource_type",
"resource_subtype",
"name",
"notes",
"completed",
"completed_at",
"created_at",
"modified_at",
"assignee",
"assignee_status",
"workspace",
"projects",
"memberships",
"parent",
"due_on",
"start_on",
"tags",
"dependencies",
"num_subtasks",
"archived",
"public",
"color",
"default_view",
"team",
"project",
"section",
"text",
"created_by",
"target",
"type",
"email",
"photo",
"is_organization"
]
}
POST /api/1.0/tasks/{task_gid}/addProject
Add a project to a task
<b>Required scope: </b><code>tasks:write</code>
Adds the task to the specified project, in the optional location
specified. If no location arguments are given, the task will be added to
the end of the project.
`addProject` can also be used to reorder a task within a project or
section that already contains it.
**Positioning the task:**
- Use `insert_before` or `insert_after` with a task ID to position relative to another task
- Use `section` alone to add the task to the end of a section
- Use `section` with `insert_after: null` to add to the **beginning** of a section
- Use `section` with `insert_before: null` to add to the **end** of a section
- Use `section` with `insert_before` or `insert_after` (non-null) to position relative to a task within that section. The anchor task must be in the specified section.
At most one of `insert_before` or `insert_after` should be specified (both cannot be used together).
A task can have at most 20 projects multi-homed to it.
Returns an empty data block.
The persistent core model supports the response and query fields named in x-purple-suite-supported-response-fields and x-purple-suite-supported-query. Other fields/options return an explicit 400 errors envelope.
Authentication
[
{
"personalAccessToken": []
},
{
"oauth2": [
"tasks:write"
]
}
]
Path-level parameters and metadata
{
"parameters": [
{
"$ref": "#/components/parameters/task_path_gid"
},
{
"$ref": "#/components/parameters/pretty"
}
]
}
Request, responses and operation details
{
"summary": "Add a project to a task",
"description": "<b>Required scope: </b><code>tasks:write</code>\n\nAdds the task to the specified project, in the optional location\nspecified. If no location arguments are given, the task will be added to\nthe end of the project.\n\n`addProject` can also be used to reorder a task within a project or\nsection that already contains it.\n\n**Positioning the task:**\n- Use `insert_before` or `insert_after` with a task ID to position relative to another task\n- Use `section` alone to add the task to the end of a section\n- Use `section` with `insert_after: null` to add to the **beginning** of a section\n- Use `section` with `insert_before: null` to add to the **end** of a section\n- Use `section` with `insert_before` or `insert_after` (non-null) to position relative to a task within that section. The anchor task must be in the specified section.\n\nAt most one of `insert_before` or `insert_after` should be specified (both cannot be used together).\n\nA task can have at most 20 projects multi-homed to it.\n\nReturns an empty data block.\n\nThe persistent core model supports the response and query fields named in x-purple-suite-supported-response-fields and x-purple-suite-supported-query. Other fields/options return an explicit 400 errors envelope.",
"tags": [
"Tasks"
],
"operationId": "addProjectForTask",
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
"data"
],
"additionalProperties": false,
"properties": {
"data": {
"type": "object",
"additionalProperties": false,
"required": [
"project"
],
"properties": {
"project": {
"type": "string"
},
"section": {
"type": "string"
}
}
}
}
}
},
"application/x-www-form-urlencoded": {
"schema": {
"type": "object",
"additionalProperties": false,
"required": [
"project"
],
"properties": {
"project": {
"type": "string"
},
"section": {
"type": "string"
}
}
}
}
}
},
"responses": {
"200": {
"description": "Successfully added the specified project to the task.",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"$ref": "#/components/schemas/EmptyResponse"
}
}
}
}
}
},
"400": {
"$ref": "#/components/responses/BadRequest"
},
"401": {
"$ref": "#/components/responses/Unauthorized"
},
"403": {
"$ref": "#/components/responses/Forbidden"
},
"404": {
"$ref": "#/components/responses/NotFound"
},
"500": {
"$ref": "#/components/responses/InternalServerError"
}
},
"security": [
{
"personalAccessToken": []
},
{
"oauth2": [
"tasks:write"
]
}
],
"x-readme": {
"code-samples": [
{
"language": "java",
"install": "<dependency><groupId>com.asana</groupId><artifactId>asana</artifactId><version>1.0.0</version></dependency>",
"code": "import com.asana.Client;\n\nClient client = Client.accessToken(\"PERSONAL_ACCESS_TOKEN\");\n\nJsonElement result = client.tasks.addProjectForTask(taskGid)\n .data(\"field\", \"value\")\n .data(\"field\", \"value\")\n .option(\"pretty\", true)\n .execute();"
},
{
"language": "node",
"install": "npm install asana",
"code": "const Asana = require('asana');\n\nlet client = new Asana.ApiClient();\nclient.authentications.token.accessToken = '<YOUR_ACCESS_TOKEN>';\n\nlet tasksApiInstance = new Asana.TasksApi(client);\nlet body = {\"data\": {\"<PARAM_1>\": \"<VALUE_1>\", \"<PARAM_2>\": \"<VALUE_2>\",}}; // Object | The project to add the task to.\nlet task_gid = \"321654\"; // String | The task to operate on.\n\ntasksApiInstance.addProjectForTask(body, task_gid).then((result) => {\n console.log('API called successfully. Returned data: ' + JSON.stringify(result.data, null, 2));\n}, (error) => {\n console.error(error.response.body);\n});",
"name": "node-sdk-v3"
},
{
"language": "node",
"install": "npm install asana@1.0.5",
"code": "const asana = require('asana');\n\nconst client = asana.Client.create().useAccessToken('PERSONAL_ACCESS_TOKEN');\n\nclient.tasks.addProjectForTask(taskGid, {field: \"value\", field: \"value\", pretty: true})\n .then((result) => {\n console.log(result);\n });",
"name": "node-sdk-v1"
},
{
"language": "python",
"install": "pip install asana",
"code": "import asana\nfrom asana.rest import ApiException\nfrom pprint import pprint\n\nconfiguration = asana.Configuration()\nconfiguration.access_token = '<YOUR_ACCESS_TOKEN>'\napi_client = asana.ApiClient(configuration)\n\n# create an instance of the API class\ntasks_api_instance = asana.TasksApi(api_client)\nbody = {\"data\": {\"<PARAM_1>\": \"<VALUE_1>\", \"<PARAM_2>\": \"<VALUE_2>\",}} # dict | The project to add the task to.\ntask_gid = \"321654\" # str | The task to operate on.\n\n\ntry:\n # Add a project to a task\n api_response = tasks_api_instance.add_project_for_task(body, task_gid)\n pprint(api_response)\nexcept ApiException as e:\n print(\"Exception when calling TasksApi->add_project_for_task: %s\\n\" % e)",
"name": "python-sdk-v5"
},
{
"language": "python",
"install": "pip install asana==3.2.3",
"code": "import asana\n\nclient = asana.Client.access_token('PERSONAL_ACCESS_TOKEN')\n\nresult = client.tasks.add_project_for_task(task_gid, {'field': 'value', 'field': 'value'}, opt_pretty=True)",
"name": "python-sdk-v3"
},
{
"language": "php",
"install": "composer require asana/asana",
"code": "<?php\nrequire 'vendor/autoload.php';\n\n$client = Asana\\Client::accessToken('PERSONAL_ACCESS_TOKEN');\n\n$result = $client->tasks->addProjectForTask($task_gid, array('field' => 'value', 'field' => 'value'), array('opt_pretty' => 'true'))"
},
{
"language": "ruby",
"install": "gem install asana",
"code": "require 'asana'\n\nclient = Asana::Client.new do |c|\n c.authentication :access_token, 'PERSONAL_ACCESS_TOKEN'\nend\n\nresult = client.tasks.add_project_for_task(task_gid: 'task_gid', field: \"value\", field: \"value\", options: {pretty: true})"
}
]
},
"x-purple-suite-runtime": "modeled-core",
"x-purple-suite-supported-query": [
"opt_pretty"
],
"x-purple-suite-supported-response-fields": [
"gid",
"resource_type",
"resource_subtype",
"name",
"notes",
"completed",
"completed_at",
"created_at",
"modified_at",
"assignee",
"assignee_status",
"workspace",
"projects",
"memberships",
"parent",
"due_on",
"start_on",
"tags",
"dependencies",
"num_subtasks",
"archived",
"public",
"color",
"default_view",
"team",
"project",
"section",
"text",
"created_by",
"target",
"type",
"email",
"photo",
"is_organization"
]
}
POST /api/1.0/tasks/{task_gid}/removeProject
Remove a project from a task
<b>Required scope: </b><code>tasks:write</code>
Removes the task from the specified project. The task will still exist in
the system, but it will not be in the project anymore.
Returns an empty data block.
The persistent core model supports the response and query fields named in x-purple-suite-supported-response-fields and x-purple-suite-supported-query. Other fields/options return an explicit 400 errors envelope.
Authentication
[
{
"personalAccessToken": []
},
{
"oauth2": [
"tasks:write"
]
}
]
Path-level parameters and metadata
{
"parameters": [
{
"$ref": "#/components/parameters/task_path_gid"
},
{
"$ref": "#/components/parameters/pretty"
}
]
}
Request, responses and operation details
{
"summary": "Remove a project from a task",
"description": "<b>Required scope: </b><code>tasks:write</code>\n\nRemoves the task from the specified project. The task will still exist in\nthe system, but it will not be in the project anymore.\n\nReturns an empty data block.\n\nThe persistent core model supports the response and query fields named in x-purple-suite-supported-response-fields and x-purple-suite-supported-query. Other fields/options return an explicit 400 errors envelope.",
"tags": [
"Tasks"
],
"operationId": "removeProjectForTask",
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
"data"
],
"additionalProperties": false,
"properties": {
"data": {
"type": "object",
"additionalProperties": false,
"required": [
"project"
],
"properties": {
"project": {
"type": "string"
}
}
}
}
}
},
"application/x-www-form-urlencoded": {
"schema": {
"type": "object",
"additionalProperties": false,
"required": [
"project"
],
"properties": {
"project": {
"type": "string"
}
}
}
}
}
},
"responses": {
"200": {
"description": "Successfully removed the specified project from the task.",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"$ref": "#/components/schemas/EmptyResponse"
}
}
}
}
}
},
"400": {
"$ref": "#/components/responses/BadRequest"
},
"401": {
"$ref": "#/components/responses/Unauthorized"
},
"403": {
"$ref": "#/components/responses/Forbidden"
},
"404": {
"$ref": "#/components/responses/NotFound"
},
"500": {
"$ref": "#/components/responses/InternalServerError"
}
},
"security": [
{
"personalAccessToken": []
},
{
"oauth2": [
"tasks:write"
]
}
],
"x-readme": {
"code-samples": [
{
"language": "java",
"install": "<dependency><groupId>com.asana</groupId><artifactId>asana</artifactId><version>1.0.0</version></dependency>",
"code": "import com.asana.Client;\n\nClient client = Client.accessToken(\"PERSONAL_ACCESS_TOKEN\");\n\nJsonElement result = client.tasks.removeProjectForTask(taskGid)\n .data(\"field\", \"value\")\n .data(\"field\", \"value\")\n .option(\"pretty\", true)\n .execute();"
},
{
"language": "node",
"install": "npm install asana",
"code": "const Asana = require('asana');\n\nlet client = new Asana.ApiClient();\nclient.authentications.token.accessToken = '<YOUR_ACCESS_TOKEN>';\n\nlet tasksApiInstance = new Asana.TasksApi(client);\nlet body = {\"data\": {\"<PARAM_1>\": \"<VALUE_1>\", \"<PARAM_2>\": \"<VALUE_2>\",}}; // Object | The project to remove the task from.\nlet task_gid = \"321654\"; // String | The task to operate on.\n\ntasksApiInstance.removeProjectForTask(body, task_gid).then((result) => {\n console.log('API called successfully. Returned data: ' + JSON.stringify(result.data, null, 2));\n}, (error) => {\n console.error(error.response.body);\n});",
"name": "node-sdk-v3"
},
{
"language": "node",
"install": "npm install asana@1.0.5",
"code": "const asana = require('asana');\n\nconst client = asana.Client.create().useAccessToken('PERSONAL_ACCESS_TOKEN');\n\nclient.tasks.removeProjectForTask(taskGid, {field: \"value\", field: \"value\", pretty: true})\n .then((result) => {\n console.log(result);\n });",
"name": "node-sdk-v1"
},
{
"language": "python",
"install": "pip install asana",
"code": "import asana\nfrom asana.rest import ApiException\nfrom pprint import pprint\n\nconfiguration = asana.Configuration()\nconfiguration.access_token = '<YOUR_ACCESS_TOKEN>'\napi_client = asana.ApiClient(configuration)\n\n# create an instance of the API class\ntasks_api_instance = asana.TasksApi(api_client)\nbody = {\"data\": {\"<PARAM_1>\": \"<VALUE_1>\", \"<PARAM_2>\": \"<VALUE_2>\",}} # dict | The project to remove the task from.\ntask_gid = \"321654\" # str | The task to operate on.\n\n\ntry:\n # Remove a project from a task\n api_response = tasks_api_instance.remove_project_for_task(body, task_gid)\n pprint(api_response)\nexcept ApiException as e:\n print(\"Exception when calling TasksApi->remove_project_for_task: %s\\n\" % e)",
"name": "python-sdk-v5"
},
{
"language": "python",
"install": "pip install asana==3.2.3",
"code": "import asana\n\nclient = asana.Client.access_token('PERSONAL_ACCESS_TOKEN')\n\nresult = client.tasks.remove_project_for_task(task_gid, {'field': 'value', 'field': 'value'}, opt_pretty=True)",
"name": "python-sdk-v3"
},
{
"language": "php",
"install": "composer require asana/asana",
"code": "<?php\nrequire 'vendor/autoload.php';\n\n$client = Asana\\Client::accessToken('PERSONAL_ACCESS_TOKEN');\n\n$result = $client->tasks->removeProjectForTask($task_gid, array('field' => 'value', 'field' => 'value'), array('opt_pretty' => 'true'))"
},
{
"language": "ruby",
"install": "gem install asana",
"code": "require 'asana'\n\nclient = Asana::Client.new do |c|\n c.authentication :access_token, 'PERSONAL_ACCESS_TOKEN'\nend\n\nresult = client.tasks.remove_project_for_task(task_gid: 'task_gid', field: \"value\", field: \"value\", options: {pretty: true})"
}
]
},
"x-purple-suite-runtime": "modeled-core",
"x-purple-suite-supported-query": [
"opt_pretty"
],
"x-purple-suite-supported-response-fields": [
"gid",
"resource_type",
"resource_subtype",
"name",
"notes",
"completed",
"completed_at",
"created_at",
"modified_at",
"assignee",
"assignee_status",
"workspace",
"projects",
"memberships",
"parent",
"due_on",
"start_on",
"tags",
"dependencies",
"num_subtasks",
"archived",
"public",
"color",
"default_view",
"team",
"project",
"section",
"text",
"created_by",
"target",
"type",
"email",
"photo",
"is_organization"
]
}
POST /api/1.0/tasks/{task_gid}/addTag
Add a tag to a task
<b>Required scope: </b><code>tasks:write</code>
Adds a tag to a task. Returns an empty data block.
The persistent core model supports the response and query fields named in x-purple-suite-supported-response-fields and x-purple-suite-supported-query. Other fields/options return an explicit 400 errors envelope.
Authentication
[
{
"personalAccessToken": []
},
{
"oauth2": [
"tasks:write"
]
}
]
Path-level parameters and metadata
{
"parameters": [
{
"$ref": "#/components/parameters/task_path_gid"
},
{
"$ref": "#/components/parameters/pretty"
}
]
}
Request, responses and operation details
{
"summary": "Add a tag to a task",
"description": "<b>Required scope: </b><code>tasks:write</code>\n\nAdds a tag to a task. Returns an empty data block.\n\nThe persistent core model supports the response and query fields named in x-purple-suite-supported-response-fields and x-purple-suite-supported-query. Other fields/options return an explicit 400 errors envelope.",
"tags": [
"Tasks"
],
"operationId": "addTagForTask",
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
"data"
],
"additionalProperties": false,
"properties": {
"data": {
"type": "object",
"additionalProperties": false,
"required": [
"tag"
],
"properties": {
"tag": {
"type": "string"
}
}
}
}
}
},
"application/x-www-form-urlencoded": {
"schema": {
"type": "object",
"additionalProperties": false,
"required": [
"tag"
],
"properties": {
"tag": {
"type": "string"
}
}
}
}
}
},
"responses": {
"200": {
"description": "Successfully added the specified tag to the task.",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"$ref": "#/components/schemas/EmptyResponse"
}
}
}
}
}
},
"400": {
"$ref": "#/components/responses/BadRequest"
},
"401": {
"$ref": "#/components/responses/Unauthorized"
},
"403": {
"$ref": "#/components/responses/Forbidden"
},
"404": {
"$ref": "#/components/responses/NotFound"
},
"500": {
"$ref": "#/components/responses/InternalServerError"
}
},
"security": [
{
"personalAccessToken": []
},
{
"oauth2": [
"tasks:write"
]
}
],
"x-readme": {
"code-samples": [
{
"language": "java",
"install": "<dependency><groupId>com.asana</groupId><artifactId>asana</artifactId><version>1.0.0</version></dependency>",
"code": "import com.asana.Client;\n\nClient client = Client.accessToken(\"PERSONAL_ACCESS_TOKEN\");\n\nJsonElement result = client.tasks.addTagForTask(taskGid)\n .data(\"field\", \"value\")\n .data(\"field\", \"value\")\n .option(\"pretty\", true)\n .execute();"
},
{
"language": "node",
"install": "npm install asana",
"code": "const Asana = require('asana');\n\nlet client = new Asana.ApiClient();\nclient.authentications.token.accessToken = '<YOUR_ACCESS_TOKEN>';\n\nlet tasksApiInstance = new Asana.TasksApi(client);\nlet body = {\"data\": {\"<PARAM_1>\": \"<VALUE_1>\", \"<PARAM_2>\": \"<VALUE_2>\",}}; // Object | The tag to add to the task.\nlet task_gid = \"321654\"; // String | The task to operate on.\n\ntasksApiInstance.addTagForTask(body, task_gid).then((result) => {\n console.log('API called successfully. Returned data: ' + JSON.stringify(result.data, null, 2));\n}, (error) => {\n console.error(error.response.body);\n});",
"name": "node-sdk-v3"
},
{
"language": "node",
"install": "npm install asana@1.0.5",
"code": "const asana = require('asana');\n\nconst client = asana.Client.create().useAccessToken('PERSONAL_ACCESS_TOKEN');\n\nclient.tasks.addTagForTask(taskGid, {field: \"value\", field: \"value\", pretty: true})\n .then((result) => {\n console.log(result);\n });",
"name": "node-sdk-v1"
},
{
"language": "python",
"install": "pip install asana",
"code": "import asana\nfrom asana.rest import ApiException\nfrom pprint import pprint\n\nconfiguration = asana.Configuration()\nconfiguration.access_token = '<YOUR_ACCESS_TOKEN>'\napi_client = asana.ApiClient(configuration)\n\n# create an instance of the API class\ntasks_api_instance = asana.TasksApi(api_client)\nbody = {\"data\": {\"<PARAM_1>\": \"<VALUE_1>\", \"<PARAM_2>\": \"<VALUE_2>\",}} # dict | The tag to add to the task.\ntask_gid = \"321654\" # str | The task to operate on.\n\n\ntry:\n # Add a tag to a task\n api_response = tasks_api_instance.add_tag_for_task(body, task_gid)\n pprint(api_response)\nexcept ApiException as e:\n print(\"Exception when calling TasksApi->add_tag_for_task: %s\\n\" % e)",
"name": "python-sdk-v5"
},
{
"language": "python",
"install": "pip install asana==3.2.3",
"code": "import asana\n\nclient = asana.Client.access_token('PERSONAL_ACCESS_TOKEN')\n\nresult = client.tasks.add_tag_for_task(task_gid, {'field': 'value', 'field': 'value'}, opt_pretty=True)",
"name": "python-sdk-v3"
},
{
"language": "php",
"install": "composer require asana/asana",
"code": "<?php\nrequire 'vendor/autoload.php';\n\n$client = Asana\\Client::accessToken('PERSONAL_ACCESS_TOKEN');\n\n$result = $client->tasks->addTagForTask($task_gid, array('field' => 'value', 'field' => 'value'), array('opt_pretty' => 'true'))"
},
{
"language": "ruby",
"install": "gem install asana",
"code": "require 'asana'\n\nclient = Asana::Client.new do |c|\n c.authentication :access_token, 'PERSONAL_ACCESS_TOKEN'\nend\n\nresult = client.tasks.add_tag_for_task(task_gid: 'task_gid', field: \"value\", field: \"value\", options: {pretty: true})"
}
]
},
"x-purple-suite-runtime": "modeled-core",
"x-purple-suite-supported-query": [
"opt_pretty"
],
"x-purple-suite-supported-response-fields": [
"gid",
"resource_type",
"resource_subtype",
"name",
"notes",
"completed",
"completed_at",
"created_at",
"modified_at",
"assignee",
"assignee_status",
"workspace",
"projects",
"memberships",
"parent",
"due_on",
"start_on",
"tags",
"dependencies",
"num_subtasks",
"archived",
"public",
"color",
"default_view",
"team",
"project",
"section",
"text",
"created_by",
"target",
"type",
"email",
"photo",
"is_organization"
]
}
POST /api/1.0/tasks/{task_gid}/removeTag
Remove a tag from a task
<b>Required scope: </b><code>tasks:write</code>
Removes a tag from a task. Returns an empty data block.
The persistent core model supports the response and query fields named in x-purple-suite-supported-response-fields and x-purple-suite-supported-query. Other fields/options return an explicit 400 errors envelope.
Authentication
[
{
"personalAccessToken": []
},
{
"oauth2": [
"tasks:write"
]
}
]
Path-level parameters and metadata
{
"parameters": [
{
"$ref": "#/components/parameters/task_path_gid"
},
{
"$ref": "#/components/parameters/pretty"
}
]
}
Request, responses and operation details
{
"summary": "Remove a tag from a task",
"description": "<b>Required scope: </b><code>tasks:write</code>\n\nRemoves a tag from a task. Returns an empty data block.\n\nThe persistent core model supports the response and query fields named in x-purple-suite-supported-response-fields and x-purple-suite-supported-query. Other fields/options return an explicit 400 errors envelope.",
"tags": [
"Tasks"
],
"operationId": "removeTagForTask",
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
"data"
],
"additionalProperties": false,
"properties": {
"data": {
"type": "object",
"additionalProperties": false,
"required": [
"tag"
],
"properties": {
"tag": {
"type": "string"
}
}
}
}
}
},
"application/x-www-form-urlencoded": {
"schema": {
"type": "object",
"additionalProperties": false,
"required": [
"tag"
],
"properties": {
"tag": {
"type": "string"
}
}
}
}
}
},
"responses": {
"200": {
"description": "Successfully removed the specified tag from the task.",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"$ref": "#/components/schemas/EmptyResponse"
}
}
}
}
}
},
"400": {
"$ref": "#/components/responses/BadRequest"
},
"401": {
"$ref": "#/components/responses/Unauthorized"
},
"403": {
"$ref": "#/components/responses/Forbidden"
},
"404": {
"$ref": "#/components/responses/NotFound"
},
"500": {
"$ref": "#/components/responses/InternalServerError"
}
},
"security": [
{
"personalAccessToken": []
},
{
"oauth2": [
"tasks:write"
]
}
],
"x-readme": {
"code-samples": [
{
"language": "java",
"install": "<dependency><groupId>com.asana</groupId><artifactId>asana</artifactId><version>1.0.0</version></dependency>",
"code": "import com.asana.Client;\n\nClient client = Client.accessToken(\"PERSONAL_ACCESS_TOKEN\");\n\nJsonElement result = client.tasks.removeTagForTask(taskGid)\n .data(\"field\", \"value\")\n .data(\"field\", \"value\")\n .option(\"pretty\", true)\n .execute();"
},
{
"language": "node",
"install": "npm install asana",
"code": "const Asana = require('asana');\n\nlet client = new Asana.ApiClient();\nclient.authentications.token.accessToken = '<YOUR_ACCESS_TOKEN>';\n\nlet tasksApiInstance = new Asana.TasksApi(client);\nlet body = {\"data\": {\"<PARAM_1>\": \"<VALUE_1>\", \"<PARAM_2>\": \"<VALUE_2>\",}}; // Object | The tag to remove from the task.\nlet task_gid = \"321654\"; // String | The task to operate on.\n\ntasksApiInstance.removeTagForTask(body, task_gid).then((result) => {\n console.log('API called successfully. Returned data: ' + JSON.stringify(result.data, null, 2));\n}, (error) => {\n console.error(error.response.body);\n});",
"name": "node-sdk-v3"
},
{
"language": "node",
"install": "npm install asana@1.0.5",
"code": "const asana = require('asana');\n\nconst client = asana.Client.create().useAccessToken('PERSONAL_ACCESS_TOKEN');\n\nclient.tasks.removeTagForTask(taskGid, {field: \"value\", field: \"value\", pretty: true})\n .then((result) => {\n console.log(result);\n });",
"name": "node-sdk-v1"
},
{
"language": "python",
"install": "pip install asana",
"code": "import asana\nfrom asana.rest import ApiException\nfrom pprint import pprint\n\nconfiguration = asana.Configuration()\nconfiguration.access_token = '<YOUR_ACCESS_TOKEN>'\napi_client = asana.ApiClient(configuration)\n\n# create an instance of the API class\ntasks_api_instance = asana.TasksApi(api_client)\nbody = {\"data\": {\"<PARAM_1>\": \"<VALUE_1>\", \"<PARAM_2>\": \"<VALUE_2>\",}} # dict | The tag to remove from the task.\ntask_gid = \"321654\" # str | The task to operate on.\n\n\ntry:\n # Remove a tag from a task\n api_response = tasks_api_instance.remove_tag_for_task(body, task_gid)\n pprint(api_response)\nexcept ApiException as e:\n print(\"Exception when calling TasksApi->remove_tag_for_task: %s\\n\" % e)",
"name": "python-sdk-v5"
},
{
"language": "python",
"install": "pip install asana==3.2.3",
"code": "import asana\n\nclient = asana.Client.access_token('PERSONAL_ACCESS_TOKEN')\n\nresult = client.tasks.remove_tag_for_task(task_gid, {'field': 'value', 'field': 'value'}, opt_pretty=True)",
"name": "python-sdk-v3"
},
{
"language": "php",
"install": "composer require asana/asana",
"code": "<?php\nrequire 'vendor/autoload.php';\n\n$client = Asana\\Client::accessToken('PERSONAL_ACCESS_TOKEN');\n\n$result = $client->tasks->removeTagForTask($task_gid, array('field' => 'value', 'field' => 'value'), array('opt_pretty' => 'true'))"
},
{
"language": "ruby",
"install": "gem install asana",
"code": "require 'asana'\n\nclient = Asana::Client.new do |c|\n c.authentication :access_token, 'PERSONAL_ACCESS_TOKEN'\nend\n\nresult = client.tasks.remove_tag_for_task(task_gid: 'task_gid', field: \"value\", field: \"value\", options: {pretty: true})"
}
]
},
"x-purple-suite-runtime": "modeled-core",
"x-purple-suite-supported-query": [
"opt_pretty"
],
"x-purple-suite-supported-response-fields": [
"gid",
"resource_type",
"resource_subtype",
"name",
"notes",
"completed",
"completed_at",
"created_at",
"modified_at",
"assignee",
"assignee_status",
"workspace",
"projects",
"memberships",
"parent",
"due_on",
"start_on",
"tags",
"dependencies",
"num_subtasks",
"archived",
"public",
"color",
"default_view",
"team",
"project",
"section",
"text",
"created_by",
"target",
"type",
"email",
"photo",
"is_organization"
]
}
POST /api/1.0/tasks/{task_gid}/addFollowers
Add followers to a task
<b>Required scope: </b><code>tasks:write</code>
Adds followers to a task. Returns an empty data block.
Each task can be associated with zero or more followers in the system.
Requests to add/remove followers, if successful, will return the complete updated task record, described above.
This operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.
Authentication
[
{
"personalAccessToken": []
},
{
"oauth2": [
"tasks:write"
]
}
]
Path-level parameters and metadata
{
"parameters": [
{
"$ref": "#/components/parameters/task_path_gid"
},
{
"$ref": "#/components/parameters/pretty"
}
]
}
Request, responses and operation details
{
"summary": "Add followers to a task",
"description": "<b>Required scope: </b><code>tasks:write</code>\n\nAdds followers to a task. Returns an empty data block.\nEach task can be associated with zero or more followers in the system.\nRequests to add/remove followers, if successful, will return the complete updated task record, described above.\n\nThis operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.",
"tags": [
"Tasks"
],
"operationId": "addFollowersForTask",
"parameters": [
{
"name": "opt_fields",
"in": "query",
"description": "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. Properties can include nested fields. To learn more, see the [input/output options guide](/docs/inputoutput-options#selecting-nested-fields).",
"required": false,
"example": [
"actual_time_minutes",
"approval_status",
"assigned_by",
"assigned_by.name",
"assignee",
"assignee.name",
"assignee_section",
"assignee_section.name",
"assignee_status",
"completed",
"completed_at",
"completed_by",
"completed_by.name",
"created_at",
"created_by",
"custom_fields",
"custom_fields.asana_created_field",
"custom_fields.created_by",
"custom_fields.created_by.name",
"custom_fields.currency_code",
"custom_fields.custom_label",
"custom_fields.custom_label_position",
"custom_fields.date_value",
"custom_fields.date_value.date",
"custom_fields.date_value.date_time",
"custom_fields.default_access_level",
"custom_fields.description",
"custom_fields.display_value",
"custom_fields.enabled",
"custom_fields.enum_options",
"custom_fields.enum_options.color",
"custom_fields.enum_options.enabled",
"custom_fields.enum_options.name",
"custom_fields.enum_value",
"custom_fields.enum_value.color",
"custom_fields.enum_value.enabled",
"custom_fields.enum_value.name",
"custom_fields.format",
"custom_fields.has_notifications_enabled",
"custom_fields.html_text_value",
"custom_fields.id_prefix",
"custom_fields.input_restrictions",
"custom_fields.is_formula_field",
"custom_fields.is_global_to_workspace",
"custom_fields.is_value_read_only",
"custom_fields.multi_enum_values",
"custom_fields.multi_enum_values.color",
"custom_fields.multi_enum_values.enabled",
"custom_fields.multi_enum_values.name",
"custom_fields.name",
"custom_fields.number_value",
"custom_fields.people_value",
"custom_fields.people_value.name",
"custom_fields.precision",
"custom_fields.privacy_setting",
"custom_fields.reference_value",
"custom_fields.reference_value.name",
"custom_fields.representation_type",
"custom_fields.resource_subtype",
"custom_fields.text_value",
"custom_fields.type",
"custom_type",
"custom_type.asana_created_type_identifier",
"custom_type.name",
"custom_type_status_option",
"custom_type_status_option.name",
"dependencies",
"dependents",
"due_at",
"due_on",
"effective_memberships",
"external",
"external.data",
"followers",
"followers.name",
"hearted",
"hearts",
"hearts.user",
"hearts.user.name",
"html_notes",
"is_rendered_as_separator",
"liked",
"likes",
"likes.user",
"likes.user.name",
"memberships",
"memberships.project",
"memberships.project.name",
"memberships.project.resource_subtype",
"memberships.section",
"memberships.section.name",
"modified_at",
"name",
"notes",
"num_hearts",
"num_likes",
"num_subtasks",
"parent",
"parent.created_by",
"parent.name",
"parent.resource_subtype",
"permalink_url",
"projects",
"projects.name",
"projects.resource_subtype",
"resource_subtype",
"start_at",
"start_on",
"tags",
"tags.name",
"workspace",
"workspace.name"
],
"schema": {
"type": "array",
"items": {
"type": "string",
"enum": [
"actual_time_minutes",
"approval_status",
"assigned_by",
"assigned_by.name",
"assignee",
"assignee.name",
"assignee_section",
"assignee_section.name",
"assignee_status",
"completed",
"completed_at",
"completed_by",
"completed_by.name",
"created_at",
"created_by",
"custom_fields",
"custom_fields.asana_created_field",
"custom_fields.created_by",
"custom_fields.created_by.name",
"custom_fields.currency_code",
"custom_fields.custom_label",
"custom_fields.custom_label_position",
"custom_fields.date_value",
"custom_fields.date_value.date",
"custom_fields.date_value.date_time",
"custom_fields.default_access_level",
"custom_fields.description",
"custom_fields.display_value",
"custom_fields.enabled",
"custom_fields.enum_options",
"custom_fields.enum_options.color",
"custom_fields.enum_options.enabled",
"custom_fields.enum_options.name",
"custom_fields.enum_value",
"custom_fields.enum_value.color",
"custom_fields.enum_value.enabled",
"custom_fields.enum_value.name",
"custom_fields.format",
"custom_fields.has_notifications_enabled",
"custom_fields.html_text_value",
"custom_fields.id_prefix",
"custom_fields.input_restrictions",
"custom_fields.is_formula_field",
"custom_fields.is_global_to_workspace",
"custom_fields.is_value_read_only",
"custom_fields.multi_enum_values",
"custom_fields.multi_enum_values.color",
"custom_fields.multi_enum_values.enabled",
"custom_fields.multi_enum_values.name",
"custom_fields.name",
"custom_fields.number_value",
"custom_fields.people_value",
"custom_fields.people_value.name",
"custom_fields.precision",
"custom_fields.privacy_setting",
"custom_fields.reference_value",
"custom_fields.reference_value.name",
"custom_fields.representation_type",
"custom_fields.resource_subtype",
"custom_fields.text_value",
"custom_fields.type",
"custom_type",
"custom_type.asana_created_type_identifier",
"custom_type.name",
"custom_type_status_option",
"custom_type_status_option.name",
"dependencies",
"dependents",
"due_at",
"due_on",
"effective_memberships",
"external",
"external.data",
"followers",
"followers.name",
"hearted",
"hearts",
"hearts.user",
"hearts.user.name",
"html_notes",
"is_rendered_as_separator",
"liked",
"likes",
"likes.user",
"likes.user.name",
"memberships",
"memberships.project",
"memberships.project.name",
"memberships.project.resource_subtype",
"memberships.section",
"memberships.section.name",
"modified_at",
"name",
"notes",
"num_hearts",
"num_likes",
"num_subtasks",
"parent",
"parent.created_by",
"parent.name",
"parent.resource_subtype",
"permalink_url",
"projects",
"projects.name",
"projects.resource_subtype",
"resource_subtype",
"start_at",
"start_on",
"tags",
"tags.name",
"workspace",
"workspace.name"
]
}
},
"style": "form",
"explode": false
}
],
"requestBody": {
"description": "The followers to add to the task.",
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"$ref": "#/components/schemas/TaskAddFollowersRequest"
}
}
}
}
}
},
"responses": {
"200": {
"description": "Successfully added the specified followers to the task.",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"$ref": "#/components/schemas/TaskResponse"
}
}
}
}
}
},
"400": {
"$ref": "#/components/responses/BadRequest"
},
"401": {
"$ref": "#/components/responses/Unauthorized"
},
"403": {
"$ref": "#/components/responses/Forbidden"
},
"404": {
"$ref": "#/components/responses/NotFound"
},
"500": {
"$ref": "#/components/responses/InternalServerError"
}
},
"security": [
{
"personalAccessToken": []
},
{
"oauth2": [
"tasks:write"
]
}
],
"x-readme": {
"code-samples": [
{
"language": "java",
"install": "<dependency><groupId>com.asana</groupId><artifactId>asana</artifactId><version>1.0.0</version></dependency>",
"code": "import com.asana.Client;\n\nClient client = Client.accessToken(\"PERSONAL_ACCESS_TOKEN\");\n\nTask result = client.tasks.addFollowersForTask(taskGid)\n .data(\"field\", \"value\")\n .data(\"field\", \"value\")\n .option(\"pretty\", true)\n .execute();"
},
{
"language": "node",
"install": "npm install asana",
"code": "const Asana = require('asana');\n\nlet client = new Asana.ApiClient();\nclient.authentications.token.accessToken = '<YOUR_ACCESS_TOKEN>';\n\nlet tasksApiInstance = new Asana.TasksApi(client);\nlet body = {\"data\": {\"<PARAM_1>\": \"<VALUE_1>\", \"<PARAM_2>\": \"<VALUE_2>\",}}; // Object | The followers to add to the task.\nlet task_gid = \"321654\"; // String | The task to operate on.\nlet opts = { \n 'opt_fields': \"actual_time_minutes,approval_status,assigned_by,assigned_by.name,assignee,assignee.name,assignee_section,assignee_section.name,assignee_status,completed,completed_at,completed_by,completed_by.name,created_at,created_by,custom_fields,custom_fields.asana_created_field,custom_fields.created_by,custom_fields.created_by.name,custom_fields.currency_code,custom_fields.custom_label,custom_fields.custom_label_position,custom_fields.date_value,custom_fields.date_value.date,custom_fields.date_value.date_time,custom_fields.default_access_level,custom_fields.description,custom_fields.display_value,custom_fields.enabled,custom_fields.enum_options,custom_fields.enum_options.color,custom_fields.enum_options.enabled,custom_fields.enum_options.name,custom_fields.enum_value,custom_fields.enum_value.color,custom_fields.enum_value.enabled,custom_fields.enum_value.name,custom_fields.format,custom_fields.has_notifications_enabled,custom_fields.html_text_value,custom_fields.id_prefix,custom_fields.input_restrictions,custom_fields.is_formula_field,custom_fields.is_global_to_workspace,custom_fields.is_value_read_only,custom_fields.multi_enum_values,custom_fields.multi_enum_values.color,custom_fields.multi_enum_values.enabled,custom_fields.multi_enum_values.name,custom_fields.name,custom_fields.number_value,custom_fields.people_value,custom_fields.people_value.name,custom_fields.precision,custom_fields.privacy_setting,custom_fields.reference_value,custom_fields.reference_value.name,custom_fields.representation_type,custom_fields.resource_subtype,custom_fields.text_value,custom_fields.type,custom_type,custom_type.asana_created_type_identifier,custom_type.name,custom_type_status_option,custom_type_status_option.name,dependencies,dependents,due_at,due_on,effective_memberships,external,external.data,followers,followers.name,hearted,hearts,hearts.user,hearts.user.name,html_notes,is_rendered_as_separator,liked,likes,likes.user,likes.user.name,memberships,memberships.project,memberships.project.name,memberships.project.resource_subtype,memberships.section,memberships.section.name,modified_at,name,notes,num_hearts,num_likes,num_subtasks,parent,parent.created_by,parent.name,parent.resource_subtype,permalink_url,projects,projects.name,projects.resource_subtype,resource_subtype,start_at,start_on,tags,tags.name,workspace,workspace.name\"\n};\ntasksApiInstance.addFollowersForTask(body, task_gid, opts).then((result) => {\n console.log('API called successfully. Returned data: ' + JSON.stringify(result.data, null, 2));\n}, (error) => {\n console.error(error.response.body);\n});",
"name": "node-sdk-v3"
},
{
"language": "node",
"install": "npm install asana@1.0.5",
"code": "const asana = require('asana');\n\nconst client = asana.Client.create().useAccessToken('PERSONAL_ACCESS_TOKEN');\n\nclient.tasks.addFollowersForTask(taskGid, {field: \"value\", field: \"value\", pretty: true})\n .then((result) => {\n console.log(result);\n });",
"name": "node-sdk-v1"
},
{
"language": "python",
"install": "pip install asana",
"code": "import asana\nfrom asana.rest import ApiException\nfrom pprint import pprint\n\nconfiguration = asana.Configuration()\nconfiguration.access_token = '<YOUR_ACCESS_TOKEN>'\napi_client = asana.ApiClient(configuration)\n\n# create an instance of the API class\ntasks_api_instance = asana.TasksApi(api_client)\nbody = {\"data\": {\"<PARAM_1>\": \"<VALUE_1>\", \"<PARAM_2>\": \"<VALUE_2>\",}} # dict | The followers to add to the task.\ntask_gid = \"321654\" # str | The task to operate on.\nopts = {\n 'opt_fields': \"actual_time_minutes,approval_status,assigned_by,assigned_by.name,assignee,assignee.name,assignee_section,assignee_section.name,assignee_status,completed,completed_at,completed_by,completed_by.name,created_at,created_by,custom_fields,custom_fields.asana_created_field,custom_fields.created_by,custom_fields.created_by.name,custom_fields.currency_code,custom_fields.custom_label,custom_fields.custom_label_position,custom_fields.date_value,custom_fields.date_value.date,custom_fields.date_value.date_time,custom_fields.default_access_level,custom_fields.description,custom_fields.display_value,custom_fields.enabled,custom_fields.enum_options,custom_fields.enum_options.color,custom_fields.enum_options.enabled,custom_fields.enum_options.name,custom_fields.enum_value,custom_fields.enum_value.color,custom_fields.enum_value.enabled,custom_fields.enum_value.name,custom_fields.format,custom_fields.has_notifications_enabled,custom_fields.html_text_value,custom_fields.id_prefix,custom_fields.input_restrictions,custom_fields.is_formula_field,custom_fields.is_global_to_workspace,custom_fields.is_value_read_only,custom_fields.multi_enum_values,custom_fields.multi_enum_values.color,custom_fields.multi_enum_values.enabled,custom_fields.multi_enum_values.name,custom_fields.name,custom_fields.number_value,custom_fields.people_value,custom_fields.people_value.name,custom_fields.precision,custom_fields.privacy_setting,custom_fields.reference_value,custom_fields.reference_value.name,custom_fields.representation_type,custom_fields.resource_subtype,custom_fields.text_value,custom_fields.type,custom_type,custom_type.asana_created_type_identifier,custom_type.name,custom_type_status_option,custom_type_status_option.name,dependencies,dependents,due_at,due_on,effective_memberships,external,external.data,followers,followers.name,hearted,hearts,hearts.user,hearts.user.name,html_notes,is_rendered_as_separator,liked,likes,likes.user,likes.user.name,memberships,memberships.project,memberships.project.name,memberships.project.resource_subtype,memberships.section,memberships.section.name,modified_at,name,notes,num_hearts,num_likes,num_subtasks,parent,parent.created_by,parent.name,parent.resource_subtype,permalink_url,projects,projects.name,projects.resource_subtype,resource_subtype,start_at,start_on,tags,tags.name,workspace,workspace.name\", # list[str] | 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.\n}\n\ntry:\n # Add followers to a task\n api_response = tasks_api_instance.add_followers_for_task(body, task_gid, opts)\n pprint(api_response)\nexcept ApiException as e:\n print(\"Exception when calling TasksApi->add_followers_for_task: %s\\n\" % e)",
"name": "python-sdk-v5"
},
{
"language": "python",
"install": "pip install asana==3.2.3",
"code": "import asana\n\nclient = asana.Client.access_token('PERSONAL_ACCESS_TOKEN')\n\nresult = client.tasks.add_followers_for_task(task_gid, {'field': 'value', 'field': 'value'}, opt_pretty=True)",
"name": "python-sdk-v3"
},
{
"language": "php",
"install": "composer require asana/asana",
"code": "<?php\nrequire 'vendor/autoload.php';\n\n$client = Asana\\Client::accessToken('PERSONAL_ACCESS_TOKEN');\n\n$result = $client->tasks->addFollowersForTask($task_gid, array('field' => 'value', 'field' => 'value'), array('opt_pretty' => 'true'))"
},
{
"language": "ruby",
"install": "gem install asana",
"code": "require 'asana'\n\nclient = Asana::Client.new do |c|\n c.authentication :access_token, 'PERSONAL_ACCESS_TOKEN'\nend\n\nresult = client.tasks.add_followers_for_task(task_gid: 'task_gid', field: \"value\", field: \"value\", options: {pretty: true})"
}
]
},
"x-purple-suite-runtime": "unavailable"
}
POST /api/1.0/tasks/{task_gid}/removeFollowers
Remove followers from a task
<b>Required scope: </b><code>tasks:write</code>
Removes each of the specified followers from the task if they are following. Returns the complete, updated record for the affected task.
This operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.
Authentication
[
{
"personalAccessToken": []
},
{
"oauth2": [
"tasks:write"
]
}
]
Path-level parameters and metadata
{
"parameters": [
{
"$ref": "#/components/parameters/task_path_gid"
},
{
"$ref": "#/components/parameters/pretty"
}
]
}
Request, responses and operation details
{
"summary": "Remove followers from a task",
"description": "<b>Required scope: </b><code>tasks:write</code>\n\nRemoves each of the specified followers from the task if they are following. Returns the complete, updated record for the affected task.\n\nThis operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.",
"tags": [
"Tasks"
],
"operationId": "removeFollowerForTask",
"parameters": [
{
"name": "opt_fields",
"in": "query",
"description": "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. Properties can include nested fields. To learn more, see the [input/output options guide](/docs/inputoutput-options#selecting-nested-fields).",
"required": false,
"example": [
"actual_time_minutes",
"approval_status",
"assigned_by",
"assigned_by.name",
"assignee",
"assignee.name",
"assignee_section",
"assignee_section.name",
"assignee_status",
"completed",
"completed_at",
"completed_by",
"completed_by.name",
"created_at",
"created_by",
"custom_fields",
"custom_fields.asana_created_field",
"custom_fields.created_by",
"custom_fields.created_by.name",
"custom_fields.currency_code",
"custom_fields.custom_label",
"custom_fields.custom_label_position",
"custom_fields.date_value",
"custom_fields.date_value.date",
"custom_fields.date_value.date_time",
"custom_fields.default_access_level",
"custom_fields.description",
"custom_fields.display_value",
"custom_fields.enabled",
"custom_fields.enum_options",
"custom_fields.enum_options.color",
"custom_fields.enum_options.enabled",
"custom_fields.enum_options.name",
"custom_fields.enum_value",
"custom_fields.enum_value.color",
"custom_fields.enum_value.enabled",
"custom_fields.enum_value.name",
"custom_fields.format",
"custom_fields.has_notifications_enabled",
"custom_fields.html_text_value",
"custom_fields.id_prefix",
"custom_fields.input_restrictions",
"custom_fields.is_formula_field",
"custom_fields.is_global_to_workspace",
"custom_fields.is_value_read_only",
"custom_fields.multi_enum_values",
"custom_fields.multi_enum_values.color",
"custom_fields.multi_enum_values.enabled",
"custom_fields.multi_enum_values.name",
"custom_fields.name",
"custom_fields.number_value",
"custom_fields.people_value",
"custom_fields.people_value.name",
"custom_fields.precision",
"custom_fields.privacy_setting",
"custom_fields.reference_value",
"custom_fields.reference_value.name",
"custom_fields.representation_type",
"custom_fields.resource_subtype",
"custom_fields.text_value",
"custom_fields.type",
"custom_type",
"custom_type.asana_created_type_identifier",
"custom_type.name",
"custom_type_status_option",
"custom_type_status_option.name",
"dependencies",
"dependents",
"due_at",
"due_on",
"effective_memberships",
"external",
"external.data",
"followers",
"followers.name",
"hearted",
"hearts",
"hearts.user",
"hearts.user.name",
"html_notes",
"is_rendered_as_separator",
"liked",
"likes",
"likes.user",
"likes.user.name",
"memberships",
"memberships.project",
"memberships.project.name",
"memberships.project.resource_subtype",
"memberships.section",
"memberships.section.name",
"modified_at",
"name",
"notes",
"num_hearts",
"num_likes",
"num_subtasks",
"parent",
"parent.created_by",
"parent.name",
"parent.resource_subtype",
"permalink_url",
"projects",
"projects.name",
"projects.resource_subtype",
"resource_subtype",
"start_at",
"start_on",
"tags",
"tags.name",
"workspace",
"workspace.name"
],
"schema": {
"type": "array",
"items": {
"type": "string",
"enum": [
"actual_time_minutes",
"approval_status",
"assigned_by",
"assigned_by.name",
"assignee",
"assignee.name",
"assignee_section",
"assignee_section.name",
"assignee_status",
"completed",
"completed_at",
"completed_by",
"completed_by.name",
"created_at",
"created_by",
"custom_fields",
"custom_fields.asana_created_field",
"custom_fields.created_by",
"custom_fields.created_by.name",
"custom_fields.currency_code",
"custom_fields.custom_label",
"custom_fields.custom_label_position",
"custom_fields.date_value",
"custom_fields.date_value.date",
"custom_fields.date_value.date_time",
"custom_fields.default_access_level",
"custom_fields.description",
"custom_fields.display_value",
"custom_fields.enabled",
"custom_fields.enum_options",
"custom_fields.enum_options.color",
"custom_fields.enum_options.enabled",
"custom_fields.enum_options.name",
"custom_fields.enum_value",
"custom_fields.enum_value.color",
"custom_fields.enum_value.enabled",
"custom_fields.enum_value.name",
"custom_fields.format",
"custom_fields.has_notifications_enabled",
"custom_fields.html_text_value",
"custom_fields.id_prefix",
"custom_fields.input_restrictions",
"custom_fields.is_formula_field",
"custom_fields.is_global_to_workspace",
"custom_fields.is_value_read_only",
"custom_fields.multi_enum_values",
"custom_fields.multi_enum_values.color",
"custom_fields.multi_enum_values.enabled",
"custom_fields.multi_enum_values.name",
"custom_fields.name",
"custom_fields.number_value",
"custom_fields.people_value",
"custom_fields.people_value.name",
"custom_fields.precision",
"custom_fields.privacy_setting",
"custom_fields.reference_value",
"custom_fields.reference_value.name",
"custom_fields.representation_type",
"custom_fields.resource_subtype",
"custom_fields.text_value",
"custom_fields.type",
"custom_type",
"custom_type.asana_created_type_identifier",
"custom_type.name",
"custom_type_status_option",
"custom_type_status_option.name",
"dependencies",
"dependents",
"due_at",
"due_on",
"effective_memberships",
"external",
"external.data",
"followers",
"followers.name",
"hearted",
"hearts",
"hearts.user",
"hearts.user.name",
"html_notes",
"is_rendered_as_separator",
"liked",
"likes",
"likes.user",
"likes.user.name",
"memberships",
"memberships.project",
"memberships.project.name",
"memberships.project.resource_subtype",
"memberships.section",
"memberships.section.name",
"modified_at",
"name",
"notes",
"num_hearts",
"num_likes",
"num_subtasks",
"parent",
"parent.created_by",
"parent.name",
"parent.resource_subtype",
"permalink_url",
"projects",
"projects.name",
"projects.resource_subtype",
"resource_subtype",
"start_at",
"start_on",
"tags",
"tags.name",
"workspace",
"workspace.name"
]
}
},
"style": "form",
"explode": false
}
],
"requestBody": {
"description": "The followers to remove from the task.",
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"$ref": "#/components/schemas/TaskRemoveFollowersRequest"
}
}
}
}
}
},
"responses": {
"200": {
"description": "Successfully removed the specified followers from the task.",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"$ref": "#/components/schemas/TaskResponse"
}
}
}
}
}
},
"400": {
"$ref": "#/components/responses/BadRequest"
},
"401": {
"$ref": "#/components/responses/Unauthorized"
},
"403": {
"$ref": "#/components/responses/Forbidden"
},
"404": {
"$ref": "#/components/responses/NotFound"
},
"500": {
"$ref": "#/components/responses/InternalServerError"
}
},
"security": [
{
"personalAccessToken": []
},
{
"oauth2": [
"tasks:write"
]
}
],
"x-readme": {
"code-samples": [
{
"language": "java",
"install": "<dependency><groupId>com.asana</groupId><artifactId>asana</artifactId><version>1.0.0</version></dependency>",
"code": "import com.asana.Client;\n\nClient client = Client.accessToken(\"PERSONAL_ACCESS_TOKEN\");\n\nTask result = client.tasks.removeFollowerForTask(taskGid)\n .data(\"field\", \"value\")\n .data(\"field\", \"value\")\n .option(\"pretty\", true)\n .execute();"
},
{
"language": "node",
"install": "npm install asana",
"code": "const Asana = require('asana');\n\nlet client = new Asana.ApiClient();\nclient.authentications.token.accessToken = '<YOUR_ACCESS_TOKEN>';\n\nlet tasksApiInstance = new Asana.TasksApi(client);\nlet body = {\"data\": {\"<PARAM_1>\": \"<VALUE_1>\", \"<PARAM_2>\": \"<VALUE_2>\",}}; // Object | The followers to remove from the task.\nlet task_gid = \"321654\"; // String | The task to operate on.\nlet opts = { \n 'opt_fields': \"actual_time_minutes,approval_status,assigned_by,assigned_by.name,assignee,assignee.name,assignee_section,assignee_section.name,assignee_status,completed,completed_at,completed_by,completed_by.name,created_at,created_by,custom_fields,custom_fields.asana_created_field,custom_fields.created_by,custom_fields.created_by.name,custom_fields.currency_code,custom_fields.custom_label,custom_fields.custom_label_position,custom_fields.date_value,custom_fields.date_value.date,custom_fields.date_value.date_time,custom_fields.default_access_level,custom_fields.description,custom_fields.display_value,custom_fields.enabled,custom_fields.enum_options,custom_fields.enum_options.color,custom_fields.enum_options.enabled,custom_fields.enum_options.name,custom_fields.enum_value,custom_fields.enum_value.color,custom_fields.enum_value.enabled,custom_fields.enum_value.name,custom_fields.format,custom_fields.has_notifications_enabled,custom_fields.html_text_value,custom_fields.id_prefix,custom_fields.input_restrictions,custom_fields.is_formula_field,custom_fields.is_global_to_workspace,custom_fields.is_value_read_only,custom_fields.multi_enum_values,custom_fields.multi_enum_values.color,custom_fields.multi_enum_values.enabled,custom_fields.multi_enum_values.name,custom_fields.name,custom_fields.number_value,custom_fields.people_value,custom_fields.people_value.name,custom_fields.precision,custom_fields.privacy_setting,custom_fields.reference_value,custom_fields.reference_value.name,custom_fields.representation_type,custom_fields.resource_subtype,custom_fields.text_value,custom_fields.type,custom_type,custom_type.asana_created_type_identifier,custom_type.name,custom_type_status_option,custom_type_status_option.name,dependencies,dependents,due_at,due_on,effective_memberships,external,external.data,followers,followers.name,hearted,hearts,hearts.user,hearts.user.name,html_notes,is_rendered_as_separator,liked,likes,likes.user,likes.user.name,memberships,memberships.project,memberships.project.name,memberships.project.resource_subtype,memberships.section,memberships.section.name,modified_at,name,notes,num_hearts,num_likes,num_subtasks,parent,parent.created_by,parent.name,parent.resource_subtype,permalink_url,projects,projects.name,projects.resource_subtype,resource_subtype,start_at,start_on,tags,tags.name,workspace,workspace.name\"\n};\ntasksApiInstance.removeFollowerForTask(body, task_gid, opts).then((result) => {\n console.log('API called successfully. Returned data: ' + JSON.stringify(result.data, null, 2));\n}, (error) => {\n console.error(error.response.body);\n});",
"name": "node-sdk-v3"
},
{
"language": "node",
"install": "npm install asana@1.0.5",
"code": "const asana = require('asana');\n\nconst client = asana.Client.create().useAccessToken('PERSONAL_ACCESS_TOKEN');\n\nclient.tasks.removeFollowerForTask(taskGid, {field: \"value\", field: \"value\", pretty: true})\n .then((result) => {\n console.log(result);\n });",
"name": "node-sdk-v1"
},
{
"language": "python",
"install": "pip install asana",
"code": "import asana\nfrom asana.rest import ApiException\nfrom pprint import pprint\n\nconfiguration = asana.Configuration()\nconfiguration.access_token = '<YOUR_ACCESS_TOKEN>'\napi_client = asana.ApiClient(configuration)\n\n# create an instance of the API class\ntasks_api_instance = asana.TasksApi(api_client)\nbody = {\"data\": {\"<PARAM_1>\": \"<VALUE_1>\", \"<PARAM_2>\": \"<VALUE_2>\",}} # dict | The followers to remove from the task.\ntask_gid = \"321654\" # str | The task to operate on.\nopts = {\n 'opt_fields': \"actual_time_minutes,approval_status,assigned_by,assigned_by.name,assignee,assignee.name,assignee_section,assignee_section.name,assignee_status,completed,completed_at,completed_by,completed_by.name,created_at,created_by,custom_fields,custom_fields.asana_created_field,custom_fields.created_by,custom_fields.created_by.name,custom_fields.currency_code,custom_fields.custom_label,custom_fields.custom_label_position,custom_fields.date_value,custom_fields.date_value.date,custom_fields.date_value.date_time,custom_fields.default_access_level,custom_fields.description,custom_fields.display_value,custom_fields.enabled,custom_fields.enum_options,custom_fields.enum_options.color,custom_fields.enum_options.enabled,custom_fields.enum_options.name,custom_fields.enum_value,custom_fields.enum_value.color,custom_fields.enum_value.enabled,custom_fields.enum_value.name,custom_fields.format,custom_fields.has_notifications_enabled,custom_fields.html_text_value,custom_fields.id_prefix,custom_fields.input_restrictions,custom_fields.is_formula_field,custom_fields.is_global_to_workspace,custom_fields.is_value_read_only,custom_fields.multi_enum_values,custom_fields.multi_enum_values.color,custom_fields.multi_enum_values.enabled,custom_fields.multi_enum_values.name,custom_fields.name,custom_fields.number_value,custom_fields.people_value,custom_fields.people_value.name,custom_fields.precision,custom_fields.privacy_setting,custom_fields.reference_value,custom_fields.reference_value.name,custom_fields.representation_type,custom_fields.resource_subtype,custom_fields.text_value,custom_fields.type,custom_type,custom_type.asana_created_type_identifier,custom_type.name,custom_type_status_option,custom_type_status_option.name,dependencies,dependents,due_at,due_on,effective_memberships,external,external.data,followers,followers.name,hearted,hearts,hearts.user,hearts.user.name,html_notes,is_rendered_as_separator,liked,likes,likes.user,likes.user.name,memberships,memberships.project,memberships.project.name,memberships.project.resource_subtype,memberships.section,memberships.section.name,modified_at,name,notes,num_hearts,num_likes,num_subtasks,parent,parent.created_by,parent.name,parent.resource_subtype,permalink_url,projects,projects.name,projects.resource_subtype,resource_subtype,start_at,start_on,tags,tags.name,workspace,workspace.name\", # list[str] | 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.\n}\n\ntry:\n # Remove followers from a task\n api_response = tasks_api_instance.remove_follower_for_task(body, task_gid, opts)\n pprint(api_response)\nexcept ApiException as e:\n print(\"Exception when calling TasksApi->remove_follower_for_task: %s\\n\" % e)",
"name": "python-sdk-v5"
},
{
"language": "python",
"install": "pip install asana==3.2.3",
"code": "import asana\n\nclient = asana.Client.access_token('PERSONAL_ACCESS_TOKEN')\n\nresult = client.tasks.remove_follower_for_task(task_gid, {'field': 'value', 'field': 'value'}, opt_pretty=True)",
"name": "python-sdk-v3"
},
{
"language": "php",
"install": "composer require asana/asana",
"code": "<?php\nrequire 'vendor/autoload.php';\n\n$client = Asana\\Client::accessToken('PERSONAL_ACCESS_TOKEN');\n\n$result = $client->tasks->removeFollowerForTask($task_gid, array('field' => 'value', 'field' => 'value'), array('opt_pretty' => 'true'))"
},
{
"language": "ruby",
"install": "gem install asana",
"code": "require 'asana'\n\nclient = Asana::Client.new do |c|\n c.authentication :access_token, 'PERSONAL_ACCESS_TOKEN'\nend\n\nresult = client.tasks.remove_follower_for_task(task_gid: 'task_gid', field: \"value\", field: \"value\", options: {pretty: true})"
}
]
},
"x-purple-suite-runtime": "unavailable"
}
GET /api/1.0/workspaces/{workspace_gid}/tasks/custom_id/{custom_id}
Get a task for a given custom ID
<b>Required scope: </b><code>tasks:read</code>
<table>
<tr>
<th>Field</th>
<th>Required Scope</th>
</tr>
<tr>
<td><code>memberships</code></td>
<td><code>projects:read</code>, <code>project_sections:read</code></td>
</tr>
<tr>
<td><code>effective_memberships</code></td>
<td><code>projects:read</code>, <code>project_sections:read</code></td>
</tr>
<tr>
<td><code>custom_type</code></td>
<td><code>custom_types:read</code></td>
</tr>
<tr>
<td><code>custom_type_status_option</code></td>
<td><code>custom_types:read</code></td>
</tr>
<tr>
<td><code>actual_time_minutes</code></td>
<td><code>time_tracking_entries:read</code></td>
</tr>
</table>
Returns a task given a custom ID shortcode.
This operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.
Authentication
[
{
"personalAccessToken": []
},
{
"oauth2": [
"tasks:read"
]
}
]
Path-level parameters and metadata
{
"parameters": [
{
"$ref": "#/components/parameters/workspace_path_gid"
},
{
"$ref": "#/components/parameters/custom_id"
}
]
}
Request, responses and operation details
{
"summary": "Get a task for a given custom ID",
"description": "<b>Required scope: </b><code>tasks:read</code>\n\n<table>\n <tr>\n <th>Field</th>\n <th>Required Scope</th>\n </tr>\n <tr>\n <td><code>memberships</code></td>\n <td><code>projects:read</code>, <code>project_sections:read</code></td>\n </tr>\n <tr>\n <td><code>effective_memberships</code></td>\n <td><code>projects:read</code>, <code>project_sections:read</code></td>\n </tr>\n <tr>\n <td><code>custom_type</code></td>\n <td><code>custom_types:read</code></td>\n </tr>\n <tr>\n <td><code>custom_type_status_option</code></td>\n <td><code>custom_types:read</code></td>\n </tr>\n <tr>\n <td><code>actual_time_minutes</code></td>\n <td><code>time_tracking_entries:read</code></td>\n </tr>\n</table>\n\nReturns a task given a custom ID shortcode.\n\nThis operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.",
"tags": [
"Tasks"
],
"operationId": "getTaskForCustomID",
"security": [
{
"personalAccessToken": []
},
{
"oauth2": [
"tasks:read"
]
}
],
"responses": {
"200": {
"description": "Successfully retrieved task for given custom ID.",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"$ref": "#/components/schemas/TaskResponse"
}
}
}
}
}
},
"400": {
"$ref": "#/components/responses/BadRequest"
},
"401": {
"$ref": "#/components/responses/Unauthorized"
},
"403": {
"$ref": "#/components/responses/Forbidden"
},
"404": {
"$ref": "#/components/responses/NotFound"
},
"500": {
"$ref": "#/components/responses/InternalServerError"
}
},
"x-readme": {
"code-samples": [
{
"language": "node",
"install": "npm install asana",
"code": "const Asana = require('asana');\n\nlet client = new Asana.ApiClient();\nclient.authentications.token.accessToken = '<YOUR_ACCESS_TOKEN>';\n\nlet tasksApiInstance = new Asana.TasksApi(client);\nlet workspace_gid = \"12345\"; // String | Globally unique identifier for the workspace or organization.\nlet custom_id = \"EX-1\"; // String | Generated custom ID for a task.\n\ntasksApiInstance.getTaskForCustomID(workspace_gid, custom_id).then((result) => {\n console.log('API called successfully. Returned data: ' + JSON.stringify(result.data, null, 2));\n}, (error) => {\n console.error(error.response.body);\n});",
"name": "node-sdk-v3"
},
{
"language": "node",
"install": "npm install asana@1.0.5",
"code": "const asana = require('asana');\n\nconst client = asana.Client.create().useAccessToken('PERSONAL_ACCESS_TOKEN');\n\nclient.tasks.getTaskForCustomID(workspaceGid, customId, {param: \"value\", param: \"value\", opt_pretty: true})\n .then((result) => {\n console.log(result);\n });",
"name": "node-sdk-v1"
}
]
},
"x-purple-suite-runtime": "unavailable"
}
GET /api/1.0/workspaces/{workspace_gid}/tasks/search
Search tasks in a workspace
<b>Required scope: </b><code>tasks:read</code>
To mirror the functionality of the Asana web app's advanced search feature, the Asana API has a task search endpoint that allows you to build complex filters to find and retrieve the exact data you need.
#### Premium access
Like the Asana web product's advance search feature, this search endpoint will only be available to premium Asana users. A user is premium if any of the following is true:
- The workspace in which the search is being performed is a premium workspace
- The user is a member of a premium team inside the workspace
Even if a user is only a member of a premium team inside a non-premium workspace, search will allow them to find data anywhere in the workspace, not just inside the premium team. Making a search request using credentials of a non-premium user will result in a `402 Payment Required` error.
#### Pagination
Search results are not stable; repeating the same query multiple times may return the data in a different order, even if the data do not change. Because of this, the traditional [pagination](/docs/pagination) available elsewhere in the Asana API is not available here. However, you can paginate manually by sorting the search results by their creation time and then modifying each subsequent query to exclude data you have already seen. Page sizes are limited to a maximum of 100 items, and can be specified by the `limit` query parameter.
#### Eventual consistency
Changes in Asana (regardless of whether they’re made though the web product or the API) are forwarded to our search infrastructure to be indexed. This process can take between 10 and 60 seconds to complete under normal operation, and longer during some production incidents. Making a change to a task that would alter its presence in a particular search query will not be reflected immediately. This is also true of the advanced search feature in the web product.
Because of this delay, the search endpoint is not suited for use cases that require immediate consistency after writes. If you need read-your-write behavior or strongly consistent results, we recommend using [Get multiple tasks](/reference/gettasks) instead.
#### Rate limits
You may receive a `429 Too Many Requests` response if you hit any of our [rate limits](/docs/rate-limits).
#### Custom field parameters
| Parameter name | Custom field type | Accepted type |
|---|---|---|
| custom_fields.{gid}.is_set | All | Boolean |
| custom_fields.{gid}.value | Text | String |
| custom_fields.{gid}.value | Number | Number |
| custom_fields.{gid}.value | Enum | Enum option ID |
| custom_fields.{gid}.value | Date | ISO 8601 date string (yyyy-mm-dd) |
| custom_fields.{gid}.starts_with | Text only | String |
| custom_fields.{gid}.ends_with | Text only | String |
| custom_fields.{gid}.contains | Text only | String |
| custom_fields.{gid}.less_than | Number only | Number |
| custom_fields.{gid}.greater_than | Number only | Number |
| custom_fields.{gid}.before | Date only | ISO 8601 date string (yyyy-mm-dd) |
| custom_fields.{gid}.after | Date only | ISO 8601 date string (yyyy-mm-dd) |
For example, if the gid of the custom field is 12345, the query parameter to find tasks where it is set would be `custom_fields.12345.is_set=true`. To match an exact value for an enum custom field, use the gid of the desired enum option and not the name of the enum option: `custom_fields.12345.value=67890`. To find tasks with a date custom field before April 21, 2026, use `custom_fields.12345.before=2026-04-21`.
**Not Supported**: searching for multiple exact matches of a custom field, searching for multi-enum custom field
#### Custom task type parameters
| Parameter name | Accepted type |
|---|---|
| custom_types.{gid}.custom_type_status_option.gid | Enum option GID |
This parameter filters tasks by their custom task status option. The `{gid}` is the GID of the custom task type, and the value is the GID of a valid status option for that type's status field.
**Requirements**:
- `resource_subtype=custom` must be set when using this parameter.
- Only one `custom_types.*` parameter may be specified per request.
- The provided custom task type GID must reference a valid custom object type.
- The status option GID must be a valid option for the custom type's status field.
- Cannot be combined with `custom_fields.{status_field_gid}.value` when `{status_field_gid}` is the status field belonging to the same custom task type.
For example, to find custom tasks of type `12345` with status option `67890`: `custom_types.12345.custom_type_status_option.gid=67890&resource_subtype=custom`.
*Note: If you specify `projects.any` and `sections.any`, you will receive tasks for the project **and** tasks for the section. If you're looking for only tasks in a section, omit the `projects.any` from the request.*
This operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.
Authentication
[
{
"personalAccessToken": []
},
{
"oauth2": [
"tasks:read"
]
}
]
Path-level parameters and metadata
{
"parameters": [
{
"$ref": "#/components/parameters/workspace_path_gid"
},
{
"$ref": "#/components/parameters/pretty"
},
{
"name": "text",
"in": "query",
"description": "Performs full-text search on both task name and description",
"schema": {
"type": "string"
},
"example": "Bug"
},
{
"name": "resource_subtype",
"in": "query",
"description": "Filters results by the task's resource_subtype",
"schema": {
"type": "string",
"enum": [
"default_task",
"milestone",
"approval",
"custom"
],
"default": "milestone"
}
},
{
"name": "assignee.any",
"in": "query",
"description": "Comma-separated list of user identifiers. This can either be the string \"me\", an email, or the gid of a user.",
"schema": {
"type": "string"
},
"example": "12345,23456,34567"
},
{
"name": "assignee.not",
"in": "query",
"description": "Comma-separated list of user identifiers. This can either be the string \"me\", an email, or the gid of a user.",
"schema": {
"type": "string"
},
"example": "12345,23456,34567"
},
{
"name": "portfolios.any",
"in": "query",
"description": "Comma-separated list of portfolio IDs",
"schema": {
"type": "string"
},
"example": "12345,23456,34567"
},
{
"name": "projects.any",
"in": "query",
"description": "Comma-separated list of project IDs. Returns tasks that are directly in these projects or inherit them from an ancestor task.",
"schema": {
"type": "string"
},
"example": "12345,23456,34567"
},
{
"name": "projects.not",
"in": "query",
"description": "Comma-separated list of project IDs",
"schema": {
"type": "string"
},
"example": "12345,23456,34567"
},
{
"name": "projects.all",
"in": "query",
"description": "Comma-separated list of project IDs",
"schema": {
"type": "string"
},
"example": "12345,23456,34567"
},
{
"name": "sections.any",
"in": "query",
"description": "Comma-separated list of section or column IDs",
"schema": {
"type": "string"
},
"example": "12345,23456,34567"
},
{
"name": "sections.not",
"in": "query",
"description": "Comma-separated list of section or column IDs",
"schema": {
"type": "string"
},
"example": "12345,23456,34567"
},
{
"name": "sections.all",
"in": "query",
"description": "Comma-separated list of section or column IDs",
"schema": {
"type": "string"
},
"example": "12345,23456,34567"
},
{
"name": "tags.any",
"in": "query",
"description": "Comma-separated list of tag IDs",
"schema": {
"type": "string"
},
"example": "12345,23456,34567"
},
{
"name": "tags.not",
"in": "query",
"description": "Comma-separated list of tag IDs",
"schema": {
"type": "string"
},
"example": "12345,23456,34567"
},
{
"name": "tags.all",
"in": "query",
"description": "Comma-separated list of tag IDs",
"schema": {
"type": "string"
},
"example": "12345,23456,34567"
},
{
"name": "teams.any",
"in": "query",
"description": "Comma-separated list of team IDs",
"schema": {
"type": "string"
},
"example": "12345,23456,34567"
},
{
"name": "followers.any",
"in": "query",
"description": "Comma-separated list of user identifiers. This can either be the string \"me\", an email, or the gid of a user.",
"schema": {
"type": "string"
},
"example": "12345,23456,34567"
},
{
"name": "followers.not",
"in": "query",
"description": "Comma-separated list of user identifiers. This can either be the string \"me\", an email, or the gid of a user.",
"schema": {
"type": "string"
},
"example": "12345,23456,34567"
},
{
"name": "created_by.any",
"in": "query",
"description": "Comma-separated list of user identifiers. This can either be the string \"me\", an email, or the gid of a user.",
"schema": {
"type": "string"
},
"example": "12345,23456,34567"
},
{
"name": "created_by.not",
"in": "query",
"description": "Comma-separated list of user identifiers. This can either be the string \"me\", an email, or the gid of a user.",
"schema": {
"type": "string"
},
"example": "12345,23456,34567"
},
{
"name": "assigned_by.any",
"in": "query",
"description": "Comma-separated list of user identifiers. This can either be the string \"me\", an email, or the gid of a user.",
"schema": {
"type": "string"
},
"example": "12345,23456,34567"
},
{
"name": "assigned_by.not",
"in": "query",
"description": "Comma-separated list of user identifiers. This can either be the string \"me\", an email, or the gid of a user.",
"schema": {
"type": "string"
},
"example": "12345,23456,34567"
},
{
"name": "liked_by.not",
"in": "query",
"description": "Comma-separated list of user identifiers. This can either be the string \"me\", an email, or the gid of a user.",
"schema": {
"type": "string"
},
"example": "12345,23456,34567"
},
{
"name": "commented_on_by.not",
"in": "query",
"description": "Comma-separated list of user identifiers. This can either be the string \"me\", an email, or the gid of a user.",
"schema": {
"type": "string"
},
"example": "12345,23456,34567"
},
{
"name": "due_on.before",
"in": "query",
"description": "ISO 8601 date string",
"schema": {
"type": "string",
"format": "date"
},
"example": "2019-09-15"
},
{
"name": "due_on.after",
"in": "query",
"description": "ISO 8601 date string",
"schema": {
"type": "string",
"format": "date"
},
"example": "2019-09-15"
},
{
"name": "due_on",
"in": "query",
"description": "ISO 8601 date string or `null`",
"schema": {
"type": "string",
"format": "date",
"nullable": true
},
"example": "2019-09-15"
},
{
"name": "due_at.before",
"in": "query",
"description": "ISO 8601 datetime string",
"schema": {
"type": "string",
"format": "date-time"
},
"example": "2019-04-15T01:01:46.055Z"
},
{
"name": "due_at.after",
"in": "query",
"description": "ISO 8601 datetime string",
"schema": {
"type": "string",
"format": "date-time"
},
"example": "2019-04-15T01:01:46.055Z"
},
{
"name": "start_on.before",
"in": "query",
"description": "ISO 8601 date string",
"schema": {
"type": "string",
"format": "date"
},
"example": "2019-09-15"
},
{
"name": "start_on.after",
"in": "query",
"description": "ISO 8601 date string",
"schema": {
"type": "string",
"format": "date"
},
"example": "2019-09-15"
},
{
"name": "start_on",
"in": "query",
"description": "ISO 8601 date string or `null`",
"schema": {
"type": "string",
"format": "date",
"nullable": true
},
"example": "2019-09-15"
},
{
"name": "created_on.before",
"in": "query",
"description": "ISO 8601 date string",
"schema": {
"type": "string",
"format": "date"
},
"example": "2019-09-15"
},
{
"name": "created_on.after",
"in": "query",
"description": "ISO 8601 date string",
"schema": {
"type": "string",
"format": "date"
},
"example": "2019-09-15"
},
{
"name": "created_on",
"in": "query",
"description": "ISO 8601 date string or `null`",
"schema": {
"type": "string",
"format": "date",
"nullable": true
},
"example": "2019-09-15"
},
{
"name": "created_at.before",
"in": "query",
"description": "ISO 8601 datetime string",
"schema": {
"type": "string",
"format": "date-time"
},
"example": "2019-04-15T01:01:46.055Z"
},
{
"name": "created_at.after",
"in": "query",
"description": "ISO 8601 datetime string",
"schema": {
"type": "string",
"format": "date-time"
},
"example": "2019-04-15T01:01:46.055Z"
},
{
"name": "completed_on.before",
"in": "query",
"description": "ISO 8601 date string",
"schema": {
"type": "string",
"format": "date"
},
"example": "2019-09-15"
},
{
"name": "completed_on.after",
"in": "query",
"description": "ISO 8601 date string",
"schema": {
"type": "string",
"format": "date"
},
"example": "2019-09-15"
},
{
"name": "completed_on",
"in": "query",
"description": "ISO 8601 date string or `null`",
"schema": {
"type": "string",
"format": "date",
"nullable": true
},
"example": "2019-09-15"
},
{
"name": "completed_at.before",
"in": "query",
"description": "ISO 8601 datetime string",
"schema": {
"type": "string",
"format": "date-time"
},
"example": "2019-04-15T01:01:46.055Z"
},
{
"name": "completed_at.after",
"in": "query",
"description": "ISO 8601 datetime string",
"schema": {
"type": "string",
"format": "date-time"
},
"example": "2019-04-15T01:01:46.055Z"
},
{
"name": "modified_on.before",
"in": "query",
"description": "ISO 8601 date string",
"schema": {
"type": "string",
"format": "date"
},
"example": "2019-09-15"
},
{
"name": "modified_on.after",
"in": "query",
"description": "ISO 8601 date string",
"schema": {
"type": "string",
"format": "date"
},
"example": "2019-09-15"
},
{
"name": "modified_on",
"in": "query",
"description": "ISO 8601 date string or `null`",
"schema": {
"type": "string",
"format": "date",
"nullable": true
},
"example": "2019-09-15"
},
{
"name": "modified_at.before",
"in": "query",
"description": "ISO 8601 datetime string",
"schema": {
"type": "string",
"format": "date-time"
},
"example": "2019-04-15T01:01:46.055Z"
},
{
"name": "modified_at.after",
"in": "query",
"description": "ISO 8601 datetime string",
"schema": {
"type": "string",
"format": "date-time"
},
"example": "2019-04-15T01:01:46.055Z"
},
{
"name": "is_blocking",
"in": "query",
"description": "Filter to incomplete tasks with dependents",
"schema": {
"type": "boolean"
},
"example": false
},
{
"name": "is_blocked",
"in": "query",
"description": "Filter to tasks with incomplete dependencies",
"schema": {
"type": "boolean"
},
"example": false
},
{
"name": "has_attachment",
"in": "query",
"description": "Filter to tasks with attachments",
"schema": {
"type": "boolean"
},
"example": false
},
{
"name": "completed",
"in": "query",
"description": "Filter to completed tasks",
"schema": {
"type": "boolean"
},
"example": false
},
{
"name": "is_subtask",
"in": "query",
"description": "Filter to subtasks",
"schema": {
"type": "boolean"
},
"example": false
},
{
"name": "sort_by",
"in": "query",
"description": "One of `due_date`, `created_at`, `completed_at`, `likes`, `relevance`, or `modified_at`, defaults to `modified_at`",
"schema": {
"type": "string",
"enum": [
"due_date",
"created_at",
"completed_at",
"likes",
"modified_at",
"relevance"
],
"default": "modified_at"
},
"example": "likes"
},
{
"name": "sort_ascending",
"in": "query",
"description": "Default `false`",
"schema": {
"type": "boolean",
"default": false
},
"example": true
}
]
}
Request, responses and operation details
{
"summary": "Search tasks in a workspace",
"description": "<b>Required scope: </b><code>tasks:read</code>\n\nTo mirror the functionality of the Asana web app's advanced search feature, the Asana API has a task search endpoint that allows you to build complex filters to find and retrieve the exact data you need.\n#### Premium access\nLike the Asana web product's advance search feature, this search endpoint will only be available to premium Asana users. A user is premium if any of the following is true:\n\n- The workspace in which the search is being performed is a premium workspace\n- The user is a member of a premium team inside the workspace\n\nEven if a user is only a member of a premium team inside a non-premium workspace, search will allow them to find data anywhere in the workspace, not just inside the premium team. Making a search request using credentials of a non-premium user will result in a `402 Payment Required` error.\n#### Pagination\nSearch results are not stable; repeating the same query multiple times may return the data in a different order, even if the data do not change. Because of this, the traditional [pagination](/docs/pagination) available elsewhere in the Asana API is not available here. However, you can paginate manually by sorting the search results by their creation time and then modifying each subsequent query to exclude data you have already seen. Page sizes are limited to a maximum of 100 items, and can be specified by the `limit` query parameter.\n#### Eventual consistency\nChanges in Asana (regardless of whether they’re made though the web product or the API) are forwarded to our search infrastructure to be indexed. This process can take between 10 and 60 seconds to complete under normal operation, and longer during some production incidents. Making a change to a task that would alter its presence in a particular search query will not be reflected immediately. This is also true of the advanced search feature in the web product.\nBecause of this delay, the search endpoint is not suited for use cases that require immediate consistency after writes. If you need read-your-write behavior or strongly consistent results, we recommend using [Get multiple tasks](/reference/gettasks) instead.\n#### Rate limits\nYou may receive a `429 Too Many Requests` response if you hit any of our [rate limits](/docs/rate-limits).\n#### Custom field parameters\n| Parameter name | Custom field type | Accepted type |\n|---|---|---|\n| custom_fields.{gid}.is_set | All | Boolean |\n| custom_fields.{gid}.value | Text | String |\n| custom_fields.{gid}.value | Number | Number |\n| custom_fields.{gid}.value | Enum | Enum option ID |\n| custom_fields.{gid}.value | Date | ISO 8601 date string (yyyy-mm-dd) |\n| custom_fields.{gid}.starts_with | Text only | String |\n| custom_fields.{gid}.ends_with | Text only | String |\n| custom_fields.{gid}.contains | Text only | String |\n| custom_fields.{gid}.less_than | Number only | Number |\n| custom_fields.{gid}.greater_than | Number only | Number |\n| custom_fields.{gid}.before | Date only | ISO 8601 date string (yyyy-mm-dd) |\n| custom_fields.{gid}.after | Date only | ISO 8601 date string (yyyy-mm-dd) |\n\n\nFor example, if the gid of the custom field is 12345, the query parameter to find tasks where it is set would be `custom_fields.12345.is_set=true`. To match an exact value for an enum custom field, use the gid of the desired enum option and not the name of the enum option: `custom_fields.12345.value=67890`. To find tasks with a date custom field before April 21, 2026, use `custom_fields.12345.before=2026-04-21`.\n\n**Not Supported**: searching for multiple exact matches of a custom field, searching for multi-enum custom field\n\n#### Custom task type parameters\n| Parameter name | Accepted type |\n|---|---|\n| custom_types.{gid}.custom_type_status_option.gid | Enum option GID |\n\nThis parameter filters tasks by their custom task status option. The `{gid}` is the GID of the custom task type, and the value is the GID of a valid status option for that type's status field.\n\n**Requirements**:\n- `resource_subtype=custom` must be set when using this parameter.\n- Only one `custom_types.*` parameter may be specified per request.\n- The provided custom task type GID must reference a valid custom object type.\n- The status option GID must be a valid option for the custom type's status field.\n- Cannot be combined with `custom_fields.{status_field_gid}.value` when `{status_field_gid}` is the status field belonging to the same custom task type.\n\nFor example, to find custom tasks of type `12345` with status option `67890`: `custom_types.12345.custom_type_status_option.gid=67890&resource_subtype=custom`.\n\n*Note: If you specify `projects.any` and `sections.any`, you will receive tasks for the project **and** tasks for the section. If you're looking for only tasks in a section, omit the `projects.any` from the request.*\n\nThis operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.",
"tags": [
"Tasks"
],
"operationId": "searchTasksForWorkspace",
"parameters": [
{
"name": "opt_fields",
"in": "query",
"description": "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. Properties can include nested fields. To learn more, see the [input/output options guide](/docs/inputoutput-options#selecting-nested-fields).",
"required": false,
"example": [
"actual_time_minutes",
"approval_status",
"assigned_by",
"assigned_by.name",
"assignee",
"assignee.name",
"assignee_section",
"assignee_section.name",
"assignee_status",
"completed",
"completed_at",
"completed_by",
"completed_by.name",
"created_at",
"created_by",
"custom_fields",
"custom_fields.asana_created_field",
"custom_fields.created_by",
"custom_fields.created_by.name",
"custom_fields.currency_code",
"custom_fields.custom_label",
"custom_fields.custom_label_position",
"custom_fields.date_value",
"custom_fields.date_value.date",
"custom_fields.date_value.date_time",
"custom_fields.default_access_level",
"custom_fields.description",
"custom_fields.display_value",
"custom_fields.enabled",
"custom_fields.enum_options",
"custom_fields.enum_options.color",
"custom_fields.enum_options.enabled",
"custom_fields.enum_options.name",
"custom_fields.enum_value",
"custom_fields.enum_value.color",
"custom_fields.enum_value.enabled",
"custom_fields.enum_value.name",
"custom_fields.format",
"custom_fields.has_notifications_enabled",
"custom_fields.html_text_value",
"custom_fields.id_prefix",
"custom_fields.input_restrictions",
"custom_fields.is_formula_field",
"custom_fields.is_global_to_workspace",
"custom_fields.is_value_read_only",
"custom_fields.multi_enum_values",
"custom_fields.multi_enum_values.color",
"custom_fields.multi_enum_values.enabled",
"custom_fields.multi_enum_values.name",
"custom_fields.name",
"custom_fields.number_value",
"custom_fields.people_value",
"custom_fields.people_value.name",
"custom_fields.precision",
"custom_fields.privacy_setting",
"custom_fields.reference_value",
"custom_fields.reference_value.name",
"custom_fields.representation_type",
"custom_fields.resource_subtype",
"custom_fields.text_value",
"custom_fields.type",
"custom_type",
"custom_type.asana_created_type_identifier",
"custom_type.name",
"custom_type_status_option",
"custom_type_status_option.name",
"dependencies",
"dependents",
"due_at",
"due_on",
"effective_memberships",
"external",
"external.data",
"followers",
"followers.name",
"hearted",
"hearts",
"hearts.user",
"hearts.user.name",
"html_notes",
"is_rendered_as_separator",
"liked",
"likes",
"likes.user",
"likes.user.name",
"memberships",
"memberships.project",
"memberships.project.name",
"memberships.project.resource_subtype",
"memberships.section",
"memberships.section.name",
"modified_at",
"name",
"notes",
"num_hearts",
"num_likes",
"num_subtasks",
"parent",
"parent.created_by",
"parent.name",
"parent.resource_subtype",
"permalink_url",
"projects",
"projects.name",
"projects.resource_subtype",
"resource_subtype",
"start_at",
"start_on",
"tags",
"tags.name",
"workspace",
"workspace.name"
],
"schema": {
"type": "array",
"items": {
"type": "string",
"enum": [
"actual_time_minutes",
"approval_status",
"assigned_by",
"assigned_by.name",
"assignee",
"assignee.name",
"assignee_section",
"assignee_section.name",
"assignee_status",
"completed",
"completed_at",
"completed_by",
"completed_by.name",
"created_at",
"created_by",
"custom_fields",
"custom_fields.asana_created_field",
"custom_fields.created_by",
"custom_fields.created_by.name",
"custom_fields.currency_code",
"custom_fields.custom_label",
"custom_fields.custom_label_position",
"custom_fields.date_value",
"custom_fields.date_value.date",
"custom_fields.date_value.date_time",
"custom_fields.default_access_level",
"custom_fields.description",
"custom_fields.display_value",
"custom_fields.enabled",
"custom_fields.enum_options",
"custom_fields.enum_options.color",
"custom_fields.enum_options.enabled",
"custom_fields.enum_options.name",
"custom_fields.enum_value",
"custom_fields.enum_value.color",
"custom_fields.enum_value.enabled",
"custom_fields.enum_value.name",
"custom_fields.format",
"custom_fields.has_notifications_enabled",
"custom_fields.html_text_value",
"custom_fields.id_prefix",
"custom_fields.input_restrictions",
"custom_fields.is_formula_field",
"custom_fields.is_global_to_workspace",
"custom_fields.is_value_read_only",
"custom_fields.multi_enum_values",
"custom_fields.multi_enum_values.color",
"custom_fields.multi_enum_values.enabled",
"custom_fields.multi_enum_values.name",
"custom_fields.name",
"custom_fields.number_value",
"custom_fields.people_value",
"custom_fields.people_value.name",
"custom_fields.precision",
"custom_fields.privacy_setting",
"custom_fields.reference_value",
"custom_fields.reference_value.name",
"custom_fields.representation_type",
"custom_fields.resource_subtype",
"custom_fields.text_value",
"custom_fields.type",
"custom_type",
"custom_type.asana_created_type_identifier",
"custom_type.name",
"custom_type_status_option",
"custom_type_status_option.name",
"dependencies",
"dependents",
"due_at",
"due_on",
"effective_memberships",
"external",
"external.data",
"followers",
"followers.name",
"hearted",
"hearts",
"hearts.user",
"hearts.user.name",
"html_notes",
"is_rendered_as_separator",
"liked",
"likes",
"likes.user",
"likes.user.name",
"memberships",
"memberships.project",
"memberships.project.name",
"memberships.project.resource_subtype",
"memberships.section",
"memberships.section.name",
"modified_at",
"name",
"notes",
"num_hearts",
"num_likes",
"num_subtasks",
"parent",
"parent.created_by",
"parent.name",
"parent.resource_subtype",
"permalink_url",
"projects",
"projects.name",
"projects.resource_subtype",
"resource_subtype",
"start_at",
"start_on",
"tags",
"tags.name",
"workspace",
"workspace.name"
]
}
},
"style": "form",
"explode": false
}
],
"responses": {
"200": {
"description": "Successfully retrieved the section's tasks.",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"type": "array",
"items": {
"$ref": "#/components/schemas/TaskCompact"
}
}
}
}
}
}
},
"400": {
"$ref": "#/components/responses/BadRequest"
},
"401": {
"$ref": "#/components/responses/Unauthorized"
},
"403": {
"$ref": "#/components/responses/Forbidden"
},
"404": {
"$ref": "#/components/responses/NotFound"
},
"500": {
"$ref": "#/components/responses/InternalServerError"
}
},
"security": [
{
"personalAccessToken": []
},
{
"oauth2": [
"tasks:read"
]
}
],
"x-readme": {
"code-samples": [
{
"language": "java",
"install": "<dependency><groupId>com.asana</groupId><artifactId>asana</artifactId><version>1.0.0</version></dependency>",
"code": "import com.asana.Client;\n\nClient client = Client.accessToken(\"PERSONAL_ACCESS_TOKEN\");\n\nList<Task> result = client.tasks.searchTasksForWorkspace(workspaceGid, sortAscending, sortBy, isSubtask, completed, hasAttachment, isBlocked, isBlocking, modifiedAtAfter, modifiedAtBefore, dueOn, modifiedOn, modifiedOnAfter, modifiedOnBefore, completedAtAfter, completedAtBefore, completedOn, completedOnAfter, completedOnBefore, createdAtAfter, dueOnAfter, createdAtBefore, createdOn, createdOnAfter, createdOnBefore, startOn, startOnAfter, startOnBefore, dueAtAfter, dueAtBefore, dueOnBefore, commentedOnByNot, likedByNot, assignedByNot, assignedByAny, createdByNot, createdByAny, followersNot, teamsAny, tagsAll, tagsNot, tagsAny, sectionsAll, sectionsNot, sectionsAny, projectsAll, projectsNot, projectsAny, portfoliosAny, assigneeNot, assigneeAny, resourceSubtype, text)\n .option(\"pretty\", true)\n .execute();"
},
{
"language": "node",
"install": "npm install asana",
"code": "const Asana = require('asana');\n\nlet client = new Asana.ApiClient();\nclient.authentications.token.accessToken = '<YOUR_ACCESS_TOKEN>';\n\nlet tasksApiInstance = new Asana.TasksApi(client);\nlet workspace_gid = \"12345\"; // String | Globally unique identifier for the workspace or organization.\nlet opts = { \n 'text': \"Bug\", \n 'resource_subtype': \"milestone\", \n 'assignee.any': \"12345,23456,34567\", \n 'assignee.not': \"12345,23456,34567\", \n 'portfolios.any': \"12345,23456,34567\", \n 'projects.any': \"12345,23456,34567\", \n 'projects.not': \"12345,23456,34567\", \n 'projects.all': \"12345,23456,34567\", \n 'sections.any': \"12345,23456,34567\", \n 'sections.not': \"12345,23456,34567\", \n 'sections.all': \"12345,23456,34567\", \n 'tags.any': \"12345,23456,34567\", \n 'tags.not': \"12345,23456,34567\", \n 'tags.all': \"12345,23456,34567\", \n 'teams.any': \"12345,23456,34567\", \n 'followers.any': \"12345,23456,34567\", \n 'followers.not': \"12345,23456,34567\", \n 'created_by.any': \"12345,23456,34567\", \n 'created_by.not': \"12345,23456,34567\", \n 'assigned_by.any': \"12345,23456,34567\", \n 'assigned_by.not': \"12345,23456,34567\", \n 'liked_by.not': \"12345,23456,34567\", \n 'commented_on_by.not': \"12345,23456,34567\", \n 'due_on.before': \"2019-09-15\", \n 'due_on.after': \"2019-09-15\", \n 'due_on': \"2019-09-15\", \n 'due_at.before': \"2019-04-15T01:01:46.055Z\", \n 'due_at.after': \"2019-04-15T01:01:46.055Z\", \n 'start_on.before': \"2019-09-15\", \n 'start_on.after': \"2019-09-15\", \n 'start_on': \"2019-09-15\", \n 'created_on.before': \"2019-09-15\", \n 'created_on.after': \"2019-09-15\", \n 'created_on': \"2019-09-15\", \n 'created_at.before': \"2019-04-15T01:01:46.055Z\", \n 'created_at.after': \"2019-04-15T01:01:46.055Z\", \n 'completed_on.before': \"2019-09-15\", \n 'completed_on.after': \"2019-09-15\", \n 'completed_on': \"2019-09-15\", \n 'completed_at.before': \"2019-04-15T01:01:46.055Z\", \n 'completed_at.after': \"2019-04-15T01:01:46.055Z\", \n 'modified_on.before': \"2019-09-15\", \n 'modified_on.after': \"2019-09-15\", \n 'modified_on': \"2019-09-15\", \n 'modified_at.before': \"2019-04-15T01:01:46.055Z\", \n 'modified_at.after': \"2019-04-15T01:01:46.055Z\", \n 'is_blocking': false, \n 'is_blocked': false, \n 'has_attachment': false, \n 'completed': false, \n 'is_subtask': false, \n 'sort_by': \"modified_at\", \n 'sort_ascending': false, \n 'opt_fields': \"actual_time_minutes,approval_status,assigned_by,assigned_by.name,assignee,assignee.name,assignee_section,assignee_section.name,assignee_status,completed,completed_at,completed_by,completed_by.name,created_at,created_by,custom_fields,custom_fields.asana_created_field,custom_fields.created_by,custom_fields.created_by.name,custom_fields.currency_code,custom_fields.custom_label,custom_fields.custom_label_position,custom_fields.date_value,custom_fields.date_value.date,custom_fields.date_value.date_time,custom_fields.default_access_level,custom_fields.description,custom_fields.display_value,custom_fields.enabled,custom_fields.enum_options,custom_fields.enum_options.color,custom_fields.enum_options.enabled,custom_fields.enum_options.name,custom_fields.enum_value,custom_fields.enum_value.color,custom_fields.enum_value.enabled,custom_fields.enum_value.name,custom_fields.format,custom_fields.has_notifications_enabled,custom_fields.html_text_value,custom_fields.id_prefix,custom_fields.input_restrictions,custom_fields.is_formula_field,custom_fields.is_global_to_workspace,custom_fields.is_value_read_only,custom_fields.multi_enum_values,custom_fields.multi_enum_values.color,custom_fields.multi_enum_values.enabled,custom_fields.multi_enum_values.name,custom_fields.name,custom_fields.number_value,custom_fields.people_value,custom_fields.people_value.name,custom_fields.precision,custom_fields.privacy_setting,custom_fields.reference_value,custom_fields.reference_value.name,custom_fields.representation_type,custom_fields.resource_subtype,custom_fields.text_value,custom_fields.type,custom_type,custom_type.asana_created_type_identifier,custom_type.name,custom_type_status_option,custom_type_status_option.name,dependencies,dependents,due_at,due_on,effective_memberships,external,external.data,followers,followers.name,hearted,hearts,hearts.user,hearts.user.name,html_notes,is_rendered_as_separator,liked,likes,likes.user,likes.user.name,memberships,memberships.project,memberships.project.name,memberships.project.resource_subtype,memberships.section,memberships.section.name,modified_at,name,notes,num_hearts,num_likes,num_subtasks,parent,parent.created_by,parent.name,parent.resource_subtype,permalink_url,projects,projects.name,projects.resource_subtype,resource_subtype,start_at,start_on,tags,tags.name,workspace,workspace.name\"\n};\n// Custom fields query\nopts['custom_fields.123.is_set'] = true; // Boolean | Replace \"123\" with <YOUR_CUSTOM_FIELD_GID>. NOTE: searching for multiple exact matches of a custom field, searching for multi-enum custom field\nopts['custom_fields.123.value'] = '456'; // String, Number, Enum option ID | Replace \"123\" with <YOUR_CUSTOM_FIELD_GID>. NOTE: searching for multiple exact matches of a custom field, searching for multi-enum custom field\nopts['custom_fields.123.starts_with'] = 'start'; // String | Replace \"123\" with <YOUR_CUSTOM_FIELD_GID>. NOTE: searching for multiple exact matches of a custom field, searching for multi-enum custom field\nopts['custom_fields.123.ends_with'] = 'end'; // String | Replace \"123\" with <YOUR_CUSTOM_FIELD_GID>. NOTE: searching for multiple exact matches of a custom field, searching for multi-enum custom field\nopts['custom_fields.123.contains'] = 'first'; // String | Replace \"123\" with <YOUR_CUSTOM_FIELD_GID>. NOTE: searching for multiple exact matches of a custom field, searching for multi-enum custom field\nopts['custom_fields.123.less_than'] = 10; // Number | Replace \"123\" with <YOUR_CUSTOM_FIELD_GID>. NOTE: searching for multiple exact matches of a custom field, searching for multi-enum custom field\nopts['custom_fields.123.greater_than'] = 100; // Number | Replace \"123\" with <YOUR_CUSTOM_FIELD_GID>. NOTE: searching for multiple exact matches of a custom field, searching for multi-enum custom field\ntasksApiInstance.searchTasksForWorkspace(workspace_gid, opts).then((result) => {\n console.log('API called successfully. Returned data: ' + JSON.stringify(result.data, null, 2));\n}, (error) => {\n console.error(error.response.body);\n});",
"name": "node-sdk-v3"
},
{
"language": "node",
"install": "npm install asana@1.0.5",
"code": "const asana = require('asana');\n\nconst client = asana.Client.create().useAccessToken('PERSONAL_ACCESS_TOKEN');\n\nclient.tasks.searchTasksForWorkspace(workspaceGid, {param: \"value\", param: \"value\", opt_pretty: true})\n .then((result) => {\n console.log(result);\n });",
"name": "node-sdk-v1"
},
{
"language": "python",
"install": "pip install asana",
"code": "import asana\nfrom asana.rest import ApiException\nfrom pprint import pprint\n\nconfiguration = asana.Configuration()\nconfiguration.access_token = '<YOUR_ACCESS_TOKEN>'\napi_client = asana.ApiClient(configuration)\n\n# create an instance of the API class\ntasks_api_instance = asana.TasksApi(api_client)\nworkspace_gid = \"12345\" # str | Globally unique identifier for the workspace or organization.\nopts = {\n 'text': \"Bug\", # str | Performs full-text search on both task name and description\n 'resource_subtype': \"milestone\", # str | Filters results by the task's resource_subtype\n 'assignee.any': \"12345,23456,34567\", # str | Comma-separated list of user identifiers. This can either be the string \\\"me\\\", an email, or the gid of a user.\n 'assignee.not': \"12345,23456,34567\", # str | Comma-separated list of user identifiers. This can either be the string \\\"me\\\", an email, or the gid of a user.\n 'portfolios.any': \"12345,23456,34567\", # str | Comma-separated list of portfolio IDs\n 'projects.any': \"12345,23456,34567\", # str | Comma-separated list of project IDs. Returns tasks that are directly in these projects or inherit them from an ancestor task.\n 'projects.not': \"12345,23456,34567\", # str | Comma-separated list of project IDs\n 'projects.all': \"12345,23456,34567\", # str | Comma-separated list of project IDs\n 'sections.any': \"12345,23456,34567\", # str | Comma-separated list of section or column IDs\n 'sections.not': \"12345,23456,34567\", # str | Comma-separated list of section or column IDs\n 'sections.all': \"12345,23456,34567\", # str | Comma-separated list of section or column IDs\n 'tags.any': \"12345,23456,34567\", # str | Comma-separated list of tag IDs\n 'tags.not': \"12345,23456,34567\", # str | Comma-separated list of tag IDs\n 'tags.all': \"12345,23456,34567\", # str | Comma-separated list of tag IDs\n 'teams.any': \"12345,23456,34567\", # str | Comma-separated list of team IDs\n 'followers.any': \"12345,23456,34567\", # str | Comma-separated list of user identifiers. This can either be the string \\\"me\\\", an email, or the gid of a user.\n 'followers.not': \"12345,23456,34567\", # str | Comma-separated list of user identifiers. This can either be the string \\\"me\\\", an email, or the gid of a user.\n 'created_by.any': \"12345,23456,34567\", # str | Comma-separated list of user identifiers. This can either be the string \\\"me\\\", an email, or the gid of a user.\n 'created_by.not': \"12345,23456,34567\", # str | Comma-separated list of user identifiers. This can either be the string \\\"me\\\", an email, or the gid of a user.\n 'assigned_by.any': \"12345,23456,34567\", # str | Comma-separated list of user identifiers. This can either be the string \\\"me\\\", an email, or the gid of a user.\n 'assigned_by.not': \"12345,23456,34567\", # str | Comma-separated list of user identifiers. This can either be the string \\\"me\\\", an email, or the gid of a user.\n 'liked_by.not': \"12345,23456,34567\", # str | Comma-separated list of user identifiers. This can either be the string \\\"me\\\", an email, or the gid of a user.\n 'commented_on_by.not': \"12345,23456,34567\", # str | Comma-separated list of user identifiers. This can either be the string \\\"me\\\", an email, or the gid of a user.\n 'due_on.before': '2019-09-15', # date | ISO 8601 date string\n 'due_on.after': '2019-09-15', # date | ISO 8601 date string\n 'due_on': '2019-09-15', # date | ISO 8601 date string or `null`\n 'due_at.before': '2019-04-15T01:01:46.055Z', # datetime | ISO 8601 datetime string\n 'due_at.after': '2019-04-15T01:01:46.055Z', # datetime | ISO 8601 datetime string\n 'start_on.before': '2019-09-15', # date | ISO 8601 date string\n 'start_on.after': '2019-09-15', # date | ISO 8601 date string\n 'start_on': '2019-09-15', # date | ISO 8601 date string or `null`\n 'created_on.before': '2019-09-15', # date | ISO 8601 date string\n 'created_on.after': '2019-09-15', # date | ISO 8601 date string\n 'created_on': '2019-09-15', # date | ISO 8601 date string or `null`\n 'created_at.before': '2019-04-15T01:01:46.055Z', # datetime | ISO 8601 datetime string\n 'created_at.after': '2019-04-15T01:01:46.055Z', # datetime | ISO 8601 datetime string\n 'completed_on.before': '2019-09-15', # date | ISO 8601 date string\n 'completed_on.after': '2019-09-15', # date | ISO 8601 date string\n 'completed_on': '2019-09-15', # date | ISO 8601 date string or `null`\n 'completed_at.before': '2019-04-15T01:01:46.055Z', # datetime | ISO 8601 datetime string\n 'completed_at.after': '2019-04-15T01:01:46.055Z', # datetime | ISO 8601 datetime string\n 'modified_on.before': '2019-09-15', # date | ISO 8601 date string\n 'modified_on.after': '2019-09-15', # date | ISO 8601 date string\n 'modified_on': '2019-09-15', # date | ISO 8601 date string or `null`\n 'modified_at.before': '2019-04-15T01:01:46.055Z', # datetime | ISO 8601 datetime string\n 'modified_at.after': '2019-04-15T01:01:46.055Z', # datetime | ISO 8601 datetime string\n 'is_blocking': False, # bool | Filter to incomplete tasks with dependents\n 'is_blocked': False, # bool | Filter to tasks with incomplete dependencies\n 'has_attachment': False, # bool | Filter to tasks with attachments\n 'completed': False, # bool | Filter to completed tasks\n 'is_subtask': False, # bool | Filter to subtasks\n 'sort_by': \"modified_at\", # str | One of `due_date`, `created_at`, `completed_at`, `likes`, `relevance`, or `modified_at`, defaults to `modified_at`\n 'sort_ascending': True, # bool | Default `false`\n 'opt_fields': \"actual_time_minutes,approval_status,assigned_by,assigned_by.name,assignee,assignee.name,assignee_section,assignee_section.name,assignee_status,completed,completed_at,completed_by,completed_by.name,created_at,created_by,custom_fields,custom_fields.asana_created_field,custom_fields.created_by,custom_fields.created_by.name,custom_fields.currency_code,custom_fields.custom_label,custom_fields.custom_label_position,custom_fields.date_value,custom_fields.date_value.date,custom_fields.date_value.date_time,custom_fields.default_access_level,custom_fields.description,custom_fields.display_value,custom_fields.enabled,custom_fields.enum_options,custom_fields.enum_options.color,custom_fields.enum_options.enabled,custom_fields.enum_options.name,custom_fields.enum_value,custom_fields.enum_value.color,custom_fields.enum_value.enabled,custom_fields.enum_value.name,custom_fields.format,custom_fields.has_notifications_enabled,custom_fields.html_text_value,custom_fields.id_prefix,custom_fields.input_restrictions,custom_fields.is_formula_field,custom_fields.is_global_to_workspace,custom_fields.is_value_read_only,custom_fields.multi_enum_values,custom_fields.multi_enum_values.color,custom_fields.multi_enum_values.enabled,custom_fields.multi_enum_values.name,custom_fields.name,custom_fields.number_value,custom_fields.people_value,custom_fields.people_value.name,custom_fields.precision,custom_fields.privacy_setting,custom_fields.reference_value,custom_fields.reference_value.name,custom_fields.representation_type,custom_fields.resource_subtype,custom_fields.text_value,custom_fields.type,custom_type,custom_type.asana_created_type_identifier,custom_type.name,custom_type_status_option,custom_type_status_option.name,dependencies,dependents,due_at,due_on,effective_memberships,external,external.data,followers,followers.name,hearted,hearts,hearts.user,hearts.user.name,html_notes,is_rendered_as_separator,liked,likes,likes.user,likes.user.name,memberships,memberships.project,memberships.project.name,memberships.project.resource_subtype,memberships.section,memberships.section.name,modified_at,name,notes,num_hearts,num_likes,num_subtasks,parent,parent.created_by,parent.name,parent.resource_subtype,permalink_url,projects,projects.name,projects.resource_subtype,resource_subtype,start_at,start_on,tags,tags.name,workspace,workspace.name\", # list[str] | 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.\n}\nopts['custom_fields.123.is_set'] = True # bool | Filiter to tasks with custom field set or unset. Note: searching for multiple exact matches of a custom field, searching for multi-enum custom field\nopts['custom_fields.123.value'] = '456' # str or bool or Enum option ID | Filter to tasks with custom field that matches the provided value. Note: searching for multiple exact matches of a custom field, searching for multi-enum custom field\nopts['custom_fields.123.starts_with'] = 'start' # string | Filter to tasks with custom field that starts with provided string. Note: searching for multiple exact matches of a custom field, searching for multi-enum custom field\nopts['custom_fields.123.ends_with'] = 'end' # string | Filter to tasks with custom field that ends in provided string. Note: searching for multiple exact matches of a custom field, searching for multi-enum custom field\nopts['custom_fields.123.contains'] = 'first' # string | Filter to tasks with custom field that contains the provided string. Note: searching for multiple exact matches of a custom field, searching for multi-enum custom field\nopts['custom_fields.123.less_than'] = 10 # number | Filter to tasks with custom field with number value less than the provided number. Note: searching for multiple exact matches of a custom field, searching for multi-enum custom field\nopts['custom_fields.123.greater_than'] = 100 # number | Filter to tasks with custom field with number value greater than the provided number. Note: searching for multiple exact matches of a custom field, searching for multi-enum custom field\n\ntry:\n # Search tasks in a workspace\n api_response = tasks_api_instance.search_tasks_for_workspace(workspace_gid, opts)\n for data in api_response:\n pprint(data)\nexcept ApiException as e:\n print(\"Exception when calling TasksApi->search_tasks_for_workspace: %s\\n\" % e)",
"name": "python-sdk-v5"
},
{
"language": "python",
"install": "pip install asana==3.2.3",
"code": "import asana\n\nclient = asana.Client.access_token('PERSONAL_ACCESS_TOKEN')\n\nresult = client.tasks.search_tasks_for_workspace(workspace_gid, {'param': 'value', 'param': 'value'}, opt_pretty=True)",
"name": "python-sdk-v3"
},
{
"language": "php",
"install": "composer require asana/asana",
"code": "<?php\nrequire 'vendor/autoload.php';\n\n$client = Asana\\Client::accessToken('PERSONAL_ACCESS_TOKEN');\n\n$result = $client->tasks->searchTasksForWorkspace($workspace_gid, array('param' => 'value', 'param' => 'value'), array('opt_pretty' => 'true'))"
},
{
"language": "ruby",
"install": "gem install asana",
"code": "require 'asana'\n\nclient = Asana::Client.new do |c|\n c.authentication :access_token, 'PERSONAL_ACCESS_TOKEN'\nend\n\nresult = client.tasks.search_tasks_for_workspace(workspace_gid: 'workspace_gid', param: \"value\", param: \"value\", options: {pretty: true})"
}
]
},
"x-purple-suite-runtime": "unavailable"
}
GET /api/1.0/team_memberships/{team_membership_gid}
Get a team membership
<b>Required scope: </b><code>team_memberships:read</code>
<table>
<tr>
<th>Field</th>
<th>Required Scope</th>
</tr>
<tr>
<td><code>team</code></td>
<td><code>teams:read</code></td>
</tr>
</table>
Returns the complete team membership record for a single team membership.
This operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.
Authentication
[
{
"personalAccessToken": []
},
{
"oauth2": [
"team_memberships:read"
]
}
]
Path-level parameters and metadata
{
"parameters": [
{
"$ref": "#/components/parameters/team_membership_path_gid"
},
{
"$ref": "#/components/parameters/pretty"
}
]
}
Request, responses and operation details
{
"summary": "Get a team membership",
"description": "<b>Required scope: </b><code>team_memberships:read</code>\n\n<table>\n <tr>\n <th>Field</th>\n <th>Required Scope</th>\n </tr>\n <tr>\n <td><code>team</code></td>\n <td><code>teams:read</code></td>\n </tr>\n</table>\n\nReturns the complete team membership record for a single team membership.\n\nThis operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.",
"tags": [
"Team memberships"
],
"operationId": "getTeamMembership",
"parameters": [
{
"name": "opt_fields",
"in": "query",
"description": "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. Properties can include nested fields. To learn more, see the [input/output options guide](/docs/inputoutput-options#selecting-nested-fields).",
"required": false,
"example": [
"is_admin",
"is_guest",
"is_limited_access",
"team",
"team.name",
"user",
"user.name"
],
"schema": {
"type": "array",
"items": {
"type": "string",
"enum": [
"is_admin",
"is_guest",
"is_limited_access",
"team",
"team.name",
"user",
"user.name"
]
}
},
"style": "form",
"explode": false
}
],
"responses": {
"200": {
"description": "Successfully retrieved the requested team membership.",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"$ref": "#/components/schemas/TeamMembershipResponse"
}
}
}
}
}
},
"400": {
"$ref": "#/components/responses/BadRequest"
},
"401": {
"$ref": "#/components/responses/Unauthorized"
},
"403": {
"$ref": "#/components/responses/Forbidden"
},
"404": {
"$ref": "#/components/responses/NotFound"
},
"500": {
"$ref": "#/components/responses/InternalServerError"
}
},
"security": [
{
"personalAccessToken": []
},
{
"oauth2": [
"team_memberships:read"
]
}
],
"x-readme": {
"code-samples": [
{
"language": "java",
"install": "<dependency><groupId>com.asana</groupId><artifactId>asana</artifactId><version>1.0.0</version></dependency>",
"code": "import com.asana.Client;\n\nClient client = Client.accessToken(\"PERSONAL_ACCESS_TOKEN\");\n\nJsonElement result = client.teammemberships.getTeamMembership(teamMembershipGid)\n .option(\"pretty\", true)\n .execute();"
},
{
"language": "node",
"install": "npm install asana",
"code": "const Asana = require('asana');\n\nlet client = new Asana.ApiClient();\nclient.authentications.token.accessToken = '<YOUR_ACCESS_TOKEN>';\n\nlet teamMembershipsApiInstance = new Asana.TeamMembershipsApi(client);\nlet team_membership_gid = \"724362\"; // String | \nlet opts = { \n 'opt_fields': \"is_admin,is_guest,is_limited_access,team,team.name,user,user.name\"\n};\nteamMembershipsApiInstance.getTeamMembership(team_membership_gid, opts).then((result) => {\n console.log('API called successfully. Returned data: ' + JSON.stringify(result.data, null, 2));\n}, (error) => {\n console.error(error.response.body);\n});",
"name": "node-sdk-v3"
},
{
"language": "node",
"install": "npm install asana@1.0.5",
"code": "const asana = require('asana');\n\nconst client = asana.Client.create().useAccessToken('PERSONAL_ACCESS_TOKEN');\n\nclient.teammemberships.getTeamMembership(teamMembershipGid, {param: \"value\", param: \"value\", opt_pretty: true})\n .then((result) => {\n console.log(result);\n });",
"name": "node-sdk-v1"
},
{
"language": "python",
"install": "pip install asana",
"code": "import asana\nfrom asana.rest import ApiException\nfrom pprint import pprint\n\nconfiguration = asana.Configuration()\nconfiguration.access_token = '<YOUR_ACCESS_TOKEN>'\napi_client = asana.ApiClient(configuration)\n\n# create an instance of the API class\nteam_memberships_api_instance = asana.TeamMembershipsApi(api_client)\nteam_membership_gid = \"724362\" # str | \nopts = {\n 'opt_fields': \"is_admin,is_guest,is_limited_access,team,team.name,user,user.name\", # list[str] | 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.\n}\n\ntry:\n # Get a team membership\n api_response = team_memberships_api_instance.get_team_membership(team_membership_gid, opts)\n pprint(api_response)\nexcept ApiException as e:\n print(\"Exception when calling TeamMembershipsApi->get_team_membership: %s\\n\" % e)",
"name": "python-sdk-v5"
},
{
"language": "python",
"install": "pip install asana==3.2.3",
"code": "import asana\n\nclient = asana.Client.access_token('PERSONAL_ACCESS_TOKEN')\n\nresult = client.team_memberships.get_team_membership(team_membership_gid, {'param': 'value', 'param': 'value'}, opt_pretty=True)",
"name": "python-sdk-v3"
},
{
"language": "php",
"install": "composer require asana/asana",
"code": "<?php\nrequire 'vendor/autoload.php';\n\n$client = Asana\\Client::accessToken('PERSONAL_ACCESS_TOKEN');\n\n$result = $client->teammemberships->getTeamMembership($team_membership_gid, array('param' => 'value', 'param' => 'value'), array('opt_pretty' => 'true'))"
},
{
"language": "ruby",
"install": "gem install asana",
"code": "require 'asana'\n\nclient = Asana::Client.new do |c|\n c.authentication :access_token, 'PERSONAL_ACCESS_TOKEN'\nend\n\nresult = client.team_memberships.get_team_membership(team_membership_gid: 'team_membership_gid', param: \"value\", param: \"value\", options: {pretty: true})"
}
]
},
"x-purple-suite-runtime": "unavailable"
}
GET /api/1.0/team_memberships
Get team memberships
<b>Required scope: </b><code>team_memberships:read</code>
Returns compact team membership records.
This operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.
Authentication
[
{
"personalAccessToken": []
},
{
"oauth2": [
"team_memberships:read"
]
}
]
Path-level parameters and metadata
{
"parameters": [
{
"$ref": "#/components/parameters/pretty"
},
{
"$ref": "#/components/parameters/limit"
},
{
"$ref": "#/components/parameters/offset"
}
]
}
Request, responses and operation details
{
"summary": "Get team memberships",
"description": "<b>Required scope: </b><code>team_memberships:read</code>\n\nReturns compact team membership records.\n\nThis operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.",
"tags": [
"Team memberships"
],
"operationId": "getTeamMemberships",
"parameters": [
{
"name": "team",
"in": "query",
"description": "Globally unique identifier for the team.",
"schema": {
"type": "string"
},
"example": "159874"
},
{
"name": "user",
"in": "query",
"description": "A string identifying a user. This can either be the string \"me\", an email, or the gid of a user. This parameter must be used with the workspace parameter.",
"schema": {
"type": "string"
},
"example": "512241"
},
{
"name": "workspace",
"in": "query",
"description": "Globally unique identifier for the workspace. This parameter must be used with the user parameter.",
"schema": {
"type": "string"
},
"example": "31326"
},
{
"name": "opt_fields",
"in": "query",
"description": "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. Properties can include nested fields. To learn more, see the [input/output options guide](/docs/inputoutput-options#selecting-nested-fields).",
"required": false,
"example": [
"is_admin",
"is_guest",
"is_limited_access",
"offset",
"path",
"team",
"team.name",
"uri",
"user",
"user.name"
],
"schema": {
"type": "array",
"items": {
"type": "string",
"enum": [
"is_admin",
"is_guest",
"is_limited_access",
"offset",
"path",
"team",
"team.name",
"uri",
"user",
"user.name"
]
}
},
"style": "form",
"explode": false
}
],
"responses": {
"200": {
"description": "Successfully retrieved the requested team memberships.",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"type": "array",
"items": {
"$ref": "#/components/schemas/TeamMembershipCompact"
}
},
"next_page": {
"$ref": "#/components/schemas/NextPage"
}
}
}
}
}
},
"400": {
"$ref": "#/components/responses/BadRequest"
},
"401": {
"$ref": "#/components/responses/Unauthorized"
},
"403": {
"$ref": "#/components/responses/Forbidden"
},
"404": {
"$ref": "#/components/responses/NotFound"
},
"500": {
"$ref": "#/components/responses/InternalServerError"
}
},
"security": [
{
"personalAccessToken": []
},
{
"oauth2": [
"team_memberships:read"
]
}
],
"x-readme": {
"code-samples": [
{
"language": "java",
"install": "<dependency><groupId>com.asana</groupId><artifactId>asana</artifactId><version>1.0.0</version></dependency>",
"code": "import com.asana.Client;\n\nClient client = Client.accessToken(\"PERSONAL_ACCESS_TOKEN\");\n\nList<JsonElement> result = client.teammemberships.getTeamMemberships(workspace, user, team)\n .option(\"pretty\", true)\n .execute();"
},
{
"language": "node",
"install": "npm install asana",
"code": "const Asana = require('asana');\n\nlet client = new Asana.ApiClient();\nclient.authentications.token.accessToken = '<YOUR_ACCESS_TOKEN>';\n\nlet teamMembershipsApiInstance = new Asana.TeamMembershipsApi(client);\nlet opts = { \n 'limit': 50, \n 'offset': \"eyJ0eXAiOJiKV1iQLCJhbGciOiJIUzI1NiJ9\", \n 'team': \"159874\", \n 'user': \"512241\", \n 'workspace': \"31326\", \n 'opt_fields': \"is_admin,is_guest,is_limited_access,offset,path,team,team.name,uri,user,user.name\"\n};\nteamMembershipsApiInstance.getTeamMemberships(opts).then((result) => {\n console.log('API called successfully. Returned data: ' + JSON.stringify(result.data, null, 2));\n}, (error) => {\n console.error(error.response.body);\n});",
"name": "node-sdk-v3"
},
{
"language": "node",
"install": "npm install asana@1.0.5",
"code": "const asana = require('asana');\n\nconst client = asana.Client.create().useAccessToken('PERSONAL_ACCESS_TOKEN');\n\nclient.teammemberships.getTeamMemberships({param: \"value\", param: \"value\", opt_pretty: true})\n .then((result) => {\n console.log(result);\n });",
"name": "node-sdk-v1"
},
{
"language": "python",
"install": "pip install asana",
"code": "import asana\nfrom asana.rest import ApiException\nfrom pprint import pprint\n\nconfiguration = asana.Configuration()\nconfiguration.access_token = '<YOUR_ACCESS_TOKEN>'\napi_client = asana.ApiClient(configuration)\n\n# create an instance of the API class\nteam_memberships_api_instance = asana.TeamMembershipsApi(api_client)\nopts = {\n 'limit': 50, # int | Results per page. The number of objects to return per page. The value must be between 1 and 100.\n 'offset': \"eyJ0eXAiOJiKV1iQLCJhbGciOiJIUzI1NiJ9\", # str | 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.*\n 'team': \"159874\", # str | Globally unique identifier for the team.\n 'user': \"512241\", # str | A string identifying a user. This can either be the string \\\"me\\\", an email, or the gid of a user. This parameter must be used with the workspace parameter.\n 'workspace': \"31326\", # str | Globally unique identifier for the workspace. This parameter must be used with the user parameter.\n 'opt_fields': \"is_admin,is_guest,is_limited_access,offset,path,team,team.name,uri,user,user.name\", # list[str] | 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.\n}\n\ntry:\n # Get team memberships\n api_response = team_memberships_api_instance.get_team_memberships(opts)\n for data in api_response:\n pprint(data)\nexcept ApiException as e:\n print(\"Exception when calling TeamMembershipsApi->get_team_memberships: %s\\n\" % e)",
"name": "python-sdk-v5"
},
{
"language": "python",
"install": "pip install asana==3.2.3",
"code": "import asana\n\nclient = asana.Client.access_token('PERSONAL_ACCESS_TOKEN')\n\nresult = client.team_memberships.get_team_memberships({'param': 'value', 'param': 'value'}, opt_pretty=True)",
"name": "python-sdk-v3"
},
{
"language": "php",
"install": "composer require asana/asana",
"code": "<?php\nrequire 'vendor/autoload.php';\n\n$client = Asana\\Client::accessToken('PERSONAL_ACCESS_TOKEN');\n\n$result = $client->teammemberships->getTeamMemberships(array('param' => 'value', 'param' => 'value'), array('opt_pretty' => 'true'))"
},
{
"language": "ruby",
"install": "gem install asana",
"code": "require 'asana'\n\nclient = Asana::Client.new do |c|\n c.authentication :access_token, 'PERSONAL_ACCESS_TOKEN'\nend\n\nresult = client.team_memberships.get_team_memberships(param: \"value\", param: \"value\", options: {pretty: true})"
}
]
},
"x-purple-suite-runtime": "unavailable"
}
GET /api/1.0/teams/{team_gid}/team_memberships
Get memberships from a team
<b>Required scope: </b><code>team_memberships:read</code>
Returns the compact team memberships for the team.
This operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.
Authentication
[
{
"personalAccessToken": []
},
{
"oauth2": [
"team_memberships:read"
]
}
]
Path-level parameters and metadata
{
"parameters": [
{
"$ref": "#/components/parameters/team_path_gid"
},
{
"$ref": "#/components/parameters/pretty"
},
{
"$ref": "#/components/parameters/limit"
},
{
"$ref": "#/components/parameters/offset"
}
]
}
Request, responses and operation details
{
"summary": "Get memberships from a team",
"description": "<b>Required scope: </b><code>team_memberships:read</code>\n\nReturns the compact team memberships for the team.\n\nThis operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.",
"tags": [
"Team memberships"
],
"operationId": "getTeamMembershipsForTeam",
"parameters": [
{
"name": "opt_fields",
"in": "query",
"description": "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. Properties can include nested fields. To learn more, see the [input/output options guide](/docs/inputoutput-options#selecting-nested-fields).",
"required": false,
"example": [
"is_admin",
"is_guest",
"is_limited_access",
"offset",
"path",
"team",
"team.name",
"uri",
"user",
"user.name"
],
"schema": {
"type": "array",
"items": {
"type": "string",
"enum": [
"is_admin",
"is_guest",
"is_limited_access",
"offset",
"path",
"team",
"team.name",
"uri",
"user",
"user.name"
]
}
},
"style": "form",
"explode": false
}
],
"responses": {
"200": {
"description": "Successfully retrieved the requested team's memberships.",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"type": "array",
"items": {
"$ref": "#/components/schemas/TeamMembershipCompact"
}
},
"next_page": {
"$ref": "#/components/schemas/NextPage"
}
}
}
}
}
},
"400": {
"$ref": "#/components/responses/BadRequest"
},
"401": {
"$ref": "#/components/responses/Unauthorized"
},
"403": {
"$ref": "#/components/responses/Forbidden"
},
"404": {
"$ref": "#/components/responses/NotFound"
},
"500": {
"$ref": "#/components/responses/InternalServerError"
}
},
"security": [
{
"personalAccessToken": []
},
{
"oauth2": [
"team_memberships:read"
]
}
],
"x-readme": {
"code-samples": [
{
"language": "java",
"install": "<dependency><groupId>com.asana</groupId><artifactId>asana</artifactId><version>1.0.0</version></dependency>",
"code": "import com.asana.Client;\n\nClient client = Client.accessToken(\"PERSONAL_ACCESS_TOKEN\");\n\nList<JsonElement> result = client.teammemberships.getTeamMembershipsForTeam(teamGid)\n .option(\"pretty\", true)\n .execute();"
},
{
"language": "node",
"install": "npm install asana",
"code": "const Asana = require('asana');\n\nlet client = new Asana.ApiClient();\nclient.authentications.token.accessToken = '<YOUR_ACCESS_TOKEN>';\n\nlet teamMembershipsApiInstance = new Asana.TeamMembershipsApi(client);\nlet team_gid = \"159874\"; // String | Globally unique identifier for the team.\nlet opts = { \n 'limit': 50, \n 'offset': \"eyJ0eXAiOJiKV1iQLCJhbGciOiJIUzI1NiJ9\", \n 'opt_fields': \"is_admin,is_guest,is_limited_access,offset,path,team,team.name,uri,user,user.name\"\n};\nteamMembershipsApiInstance.getTeamMembershipsForTeam(team_gid, opts).then((result) => {\n console.log('API called successfully. Returned data: ' + JSON.stringify(result.data, null, 2));\n}, (error) => {\n console.error(error.response.body);\n});",
"name": "node-sdk-v3"
},
{
"language": "node",
"install": "npm install asana@1.0.5",
"code": "const asana = require('asana');\n\nconst client = asana.Client.create().useAccessToken('PERSONAL_ACCESS_TOKEN');\n\nclient.teammemberships.getTeamMembershipsForTeam(teamGid, {param: \"value\", param: \"value\", opt_pretty: true})\n .then((result) => {\n console.log(result);\n });",
"name": "node-sdk-v1"
},
{
"language": "python",
"install": "pip install asana",
"code": "import asana\nfrom asana.rest import ApiException\nfrom pprint import pprint\n\nconfiguration = asana.Configuration()\nconfiguration.access_token = '<YOUR_ACCESS_TOKEN>'\napi_client = asana.ApiClient(configuration)\n\n# create an instance of the API class\nteam_memberships_api_instance = asana.TeamMembershipsApi(api_client)\nteam_gid = \"159874\" # str | Globally unique identifier for the team.\nopts = {\n 'limit': 50, # int | Results per page. The number of objects to return per page. The value must be between 1 and 100.\n 'offset': \"eyJ0eXAiOJiKV1iQLCJhbGciOiJIUzI1NiJ9\", # str | 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.*\n 'opt_fields': \"is_admin,is_guest,is_limited_access,offset,path,team,team.name,uri,user,user.name\", # list[str] | 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.\n}\n\ntry:\n # Get memberships from a team\n api_response = team_memberships_api_instance.get_team_memberships_for_team(team_gid, opts)\n for data in api_response:\n pprint(data)\nexcept ApiException as e:\n print(\"Exception when calling TeamMembershipsApi->get_team_memberships_for_team: %s\\n\" % e)",
"name": "python-sdk-v5"
},
{
"language": "python",
"install": "pip install asana==3.2.3",
"code": "import asana\n\nclient = asana.Client.access_token('PERSONAL_ACCESS_TOKEN')\n\nresult = client.team_memberships.get_team_memberships_for_team(team_gid, {'param': 'value', 'param': 'value'}, opt_pretty=True)",
"name": "python-sdk-v3"
},
{
"language": "php",
"install": "composer require asana/asana",
"code": "<?php\nrequire 'vendor/autoload.php';\n\n$client = Asana\\Client::accessToken('PERSONAL_ACCESS_TOKEN');\n\n$result = $client->teammemberships->getTeamMembershipsForTeam($team_gid, array('param' => 'value', 'param' => 'value'), array('opt_pretty' => 'true'))"
},
{
"language": "ruby",
"install": "gem install asana",
"code": "require 'asana'\n\nclient = Asana::Client.new do |c|\n c.authentication :access_token, 'PERSONAL_ACCESS_TOKEN'\nend\n\nresult = client.team_memberships.get_team_memberships_for_team(team_gid: 'team_gid', param: \"value\", param: \"value\", options: {pretty: true})"
}
]
},
"x-purple-suite-runtime": "unavailable"
}
GET /api/1.0/users/{user_gid}/team_memberships
Get memberships from a user
<b>Required scope: </b><code>team_memberships:read</code>
Returns the compact team membership records for the user.
This operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.
Authentication
[
{
"personalAccessToken": []
},
{
"oauth2": [
"team_memberships:read"
]
}
]
Path-level parameters and metadata
{
"parameters": [
{
"$ref": "#/components/parameters/user_path_gid"
},
{
"$ref": "#/components/parameters/pretty"
},
{
"$ref": "#/components/parameters/limit"
},
{
"$ref": "#/components/parameters/offset"
}
]
}
Request, responses and operation details
{
"summary": "Get memberships from a user",
"description": "<b>Required scope: </b><code>team_memberships:read</code>\n\nReturns the compact team membership records for the user.\n\nThis operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.",
"tags": [
"Team memberships"
],
"operationId": "getTeamMembershipsForUser",
"parameters": [
{
"name": "workspace",
"description": "Globally unique identifier for the workspace.",
"in": "query",
"schema": {
"type": "string"
},
"example": "31326",
"required": true
},
{
"name": "opt_fields",
"in": "query",
"description": "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. Properties can include nested fields. To learn more, see the [input/output options guide](/docs/inputoutput-options#selecting-nested-fields).",
"required": false,
"example": [
"is_admin",
"is_guest",
"is_limited_access",
"offset",
"path",
"team",
"team.name",
"uri",
"user",
"user.name"
],
"schema": {
"type": "array",
"items": {
"type": "string",
"enum": [
"is_admin",
"is_guest",
"is_limited_access",
"offset",
"path",
"team",
"team.name",
"uri",
"user",
"user.name"
]
}
},
"style": "form",
"explode": false
}
],
"responses": {
"200": {
"description": "Successfully retrieved the requested users's memberships.",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"type": "array",
"items": {
"$ref": "#/components/schemas/TeamMembershipCompact"
}
},
"next_page": {
"$ref": "#/components/schemas/NextPage"
}
}
}
}
}
},
"400": {
"$ref": "#/components/responses/BadRequest"
},
"401": {
"$ref": "#/components/responses/Unauthorized"
},
"403": {
"$ref": "#/components/responses/Forbidden"
},
"404": {
"$ref": "#/components/responses/NotFound"
},
"500": {
"$ref": "#/components/responses/InternalServerError"
}
},
"security": [
{
"personalAccessToken": []
},
{
"oauth2": [
"team_memberships:read"
]
}
],
"x-readme": {
"code-samples": [
{
"language": "java",
"install": "<dependency><groupId>com.asana</groupId><artifactId>asana</artifactId><version>1.0.0</version></dependency>",
"code": "import com.asana.Client;\n\nClient client = Client.accessToken(\"PERSONAL_ACCESS_TOKEN\");\n\nList<JsonElement> result = client.teammemberships.getTeamMembershipsForUser(userGid, workspace)\n .option(\"pretty\", true)\n .execute();"
},
{
"language": "node",
"install": "npm install asana",
"code": "const Asana = require('asana');\n\nlet client = new Asana.ApiClient();\nclient.authentications.token.accessToken = '<YOUR_ACCESS_TOKEN>';\n\nlet teamMembershipsApiInstance = new Asana.TeamMembershipsApi(client);\nlet user_gid = \"me\"; // String | A string identifying a user. This can either be the string \\\"me\\\", an email, or the gid of a user.\nlet workspace = \"31326\"; // String | Globally unique identifier for the workspace.\nlet opts = { \n 'limit': 50, \n 'offset': \"eyJ0eXAiOJiKV1iQLCJhbGciOiJIUzI1NiJ9\", \n 'opt_fields': \"is_admin,is_guest,is_limited_access,offset,path,team,team.name,uri,user,user.name\"\n};\nteamMembershipsApiInstance.getTeamMembershipsForUser(user_gid, workspace, opts).then((result) => {\n console.log('API called successfully. Returned data: ' + JSON.stringify(result.data, null, 2));\n}, (error) => {\n console.error(error.response.body);\n});",
"name": "node-sdk-v3"
},
{
"language": "node",
"install": "npm install asana@1.0.5",
"code": "const asana = require('asana');\n\nconst client = asana.Client.create().useAccessToken('PERSONAL_ACCESS_TOKEN');\n\nclient.teammemberships.getTeamMembershipsForUser(userGid, {param: \"value\", param: \"value\", opt_pretty: true})\n .then((result) => {\n console.log(result);\n });",
"name": "node-sdk-v1"
},
{
"language": "python",
"install": "pip install asana",
"code": "import asana\nfrom asana.rest import ApiException\nfrom pprint import pprint\n\nconfiguration = asana.Configuration()\nconfiguration.access_token = '<YOUR_ACCESS_TOKEN>'\napi_client = asana.ApiClient(configuration)\n\n# create an instance of the API class\nteam_memberships_api_instance = asana.TeamMembershipsApi(api_client)\nuser_gid = \"me\" # str | A string identifying a user. This can either be the string \\\"me\\\", an email, or the gid of a user.\nworkspace = \"31326\" # str | Globally unique identifier for the workspace.\nopts = {\n 'limit': 50, # int | Results per page. The number of objects to return per page. The value must be between 1 and 100.\n 'offset': \"eyJ0eXAiOJiKV1iQLCJhbGciOiJIUzI1NiJ9\", # str | 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.*\n 'opt_fields': \"is_admin,is_guest,is_limited_access,offset,path,team,team.name,uri,user,user.name\", # list[str] | 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.\n}\n\ntry:\n # Get memberships from a user\n api_response = team_memberships_api_instance.get_team_memberships_for_user(user_gid, workspace, opts)\n for data in api_response:\n pprint(data)\nexcept ApiException as e:\n print(\"Exception when calling TeamMembershipsApi->get_team_memberships_for_user: %s\\n\" % e)",
"name": "python-sdk-v5"
},
{
"language": "python",
"install": "pip install asana==3.2.3",
"code": "import asana\n\nclient = asana.Client.access_token('PERSONAL_ACCESS_TOKEN')\n\nresult = client.team_memberships.get_team_memberships_for_user(user_gid, {'param': 'value', 'param': 'value'}, opt_pretty=True)",
"name": "python-sdk-v3"
},
{
"language": "php",
"install": "composer require asana/asana",
"code": "<?php\nrequire 'vendor/autoload.php';\n\n$client = Asana\\Client::accessToken('PERSONAL_ACCESS_TOKEN');\n\n$result = $client->teammemberships->getTeamMembershipsForUser($user_gid, array('param' => 'value', 'param' => 'value'), array('opt_pretty' => 'true'))"
},
{
"language": "ruby",
"install": "gem install asana",
"code": "require 'asana'\n\nclient = Asana::Client.new do |c|\n c.authentication :access_token, 'PERSONAL_ACCESS_TOKEN'\nend\n\nresult = client.team_memberships.get_team_memberships_for_user(user_gid: 'user_gid', workspace: ''workspace_example'', param: \"value\", param: \"value\", options: {pretty: true})"
}
]
},
"x-purple-suite-runtime": "unavailable"
}
POST /api/1.0/teams
Create a team
Creates a team within the current workspace.
This operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.
Authentication
[
{
"personalAccessToken": []
},
{
"oauth2": []
}
]
Path-level parameters and metadata
{
"parameters": [
{
"$ref": "#/components/parameters/pretty"
}
]
}
Request, responses and operation details
{
"summary": "Create a team",
"description": "Creates a team within the current workspace.\n\nThis operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.",
"tags": [
"Teams"
],
"operationId": "createTeam",
"parameters": [
{
"name": "opt_fields",
"in": "query",
"description": "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. Properties can include nested fields. To learn more, see the [input/output options guide](/docs/inputoutput-options#selecting-nested-fields).",
"required": false,
"example": [
"custom_field_settings",
"custom_field_settings.custom_field",
"custom_field_settings.custom_field.asana_created_field",
"custom_field_settings.custom_field.created_by",
"custom_field_settings.custom_field.created_by.name",
"custom_field_settings.custom_field.currency_code",
"custom_field_settings.custom_field.custom_label",
"custom_field_settings.custom_field.custom_label_position",
"custom_field_settings.custom_field.date_value",
"custom_field_settings.custom_field.date_value.date",
"custom_field_settings.custom_field.date_value.date_time",
"custom_field_settings.custom_field.default_access_level",
"custom_field_settings.custom_field.description",
"custom_field_settings.custom_field.display_value",
"custom_field_settings.custom_field.enabled",
"custom_field_settings.custom_field.enum_options",
"custom_field_settings.custom_field.enum_options.color",
"custom_field_settings.custom_field.enum_options.enabled",
"custom_field_settings.custom_field.enum_options.name",
"custom_field_settings.custom_field.enum_value",
"custom_field_settings.custom_field.enum_value.color",
"custom_field_settings.custom_field.enum_value.enabled",
"custom_field_settings.custom_field.enum_value.name",
"custom_field_settings.custom_field.format",
"custom_field_settings.custom_field.has_notifications_enabled",
"custom_field_settings.custom_field.html_text_value",
"custom_field_settings.custom_field.id_prefix",
"custom_field_settings.custom_field.input_restrictions",
"custom_field_settings.custom_field.is_formula_field",
"custom_field_settings.custom_field.is_global_to_workspace",
"custom_field_settings.custom_field.is_value_read_only",
"custom_field_settings.custom_field.multi_enum_values",
"custom_field_settings.custom_field.multi_enum_values.color",
"custom_field_settings.custom_field.multi_enum_values.enabled",
"custom_field_settings.custom_field.multi_enum_values.name",
"custom_field_settings.custom_field.name",
"custom_field_settings.custom_field.number_value",
"custom_field_settings.custom_field.people_value",
"custom_field_settings.custom_field.people_value.name",
"custom_field_settings.custom_field.precision",
"custom_field_settings.custom_field.privacy_setting",
"custom_field_settings.custom_field.reference_value",
"custom_field_settings.custom_field.reference_value.name",
"custom_field_settings.custom_field.representation_type",
"custom_field_settings.custom_field.resource_subtype",
"custom_field_settings.custom_field.text_value",
"custom_field_settings.custom_field.type",
"custom_field_settings.is_important",
"custom_field_settings.parent",
"custom_field_settings.parent.name",
"custom_field_settings.parent.resource_subtype",
"custom_field_settings.project",
"custom_field_settings.project.name",
"custom_field_settings.project.resource_subtype",
"description",
"edit_team_name_or_description_access_level",
"edit_team_visibility_or_trash_team_access_level",
"endorsed",
"guest_invite_management_access_level",
"html_description",
"join_request_management_access_level",
"member_invite_management_access_level",
"name",
"organization",
"organization.name",
"permalink_url",
"team_content_management_access_level",
"team_member_removal_access_level",
"visibility"
],
"schema": {
"type": "array",
"items": {
"type": "string",
"enum": [
"custom_field_settings",
"custom_field_settings.custom_field",
"custom_field_settings.custom_field.asana_created_field",
"custom_field_settings.custom_field.created_by",
"custom_field_settings.custom_field.created_by.name",
"custom_field_settings.custom_field.currency_code",
"custom_field_settings.custom_field.custom_label",
"custom_field_settings.custom_field.custom_label_position",
"custom_field_settings.custom_field.date_value",
"custom_field_settings.custom_field.date_value.date",
"custom_field_settings.custom_field.date_value.date_time",
"custom_field_settings.custom_field.default_access_level",
"custom_field_settings.custom_field.description",
"custom_field_settings.custom_field.display_value",
"custom_field_settings.custom_field.enabled",
"custom_field_settings.custom_field.enum_options",
"custom_field_settings.custom_field.enum_options.color",
"custom_field_settings.custom_field.enum_options.enabled",
"custom_field_settings.custom_field.enum_options.name",
"custom_field_settings.custom_field.enum_value",
"custom_field_settings.custom_field.enum_value.color",
"custom_field_settings.custom_field.enum_value.enabled",
"custom_field_settings.custom_field.enum_value.name",
"custom_field_settings.custom_field.format",
"custom_field_settings.custom_field.has_notifications_enabled",
"custom_field_settings.custom_field.html_text_value",
"custom_field_settings.custom_field.id_prefix",
"custom_field_settings.custom_field.input_restrictions",
"custom_field_settings.custom_field.is_formula_field",
"custom_field_settings.custom_field.is_global_to_workspace",
"custom_field_settings.custom_field.is_value_read_only",
"custom_field_settings.custom_field.multi_enum_values",
"custom_field_settings.custom_field.multi_enum_values.color",
"custom_field_settings.custom_field.multi_enum_values.enabled",
"custom_field_settings.custom_field.multi_enum_values.name",
"custom_field_settings.custom_field.name",
"custom_field_settings.custom_field.number_value",
"custom_field_settings.custom_field.people_value",
"custom_field_settings.custom_field.people_value.name",
"custom_field_settings.custom_field.precision",
"custom_field_settings.custom_field.privacy_setting",
"custom_field_settings.custom_field.reference_value",
"custom_field_settings.custom_field.reference_value.name",
"custom_field_settings.custom_field.representation_type",
"custom_field_settings.custom_field.resource_subtype",
"custom_field_settings.custom_field.text_value",
"custom_field_settings.custom_field.type",
"custom_field_settings.is_important",
"custom_field_settings.parent",
"custom_field_settings.parent.name",
"custom_field_settings.parent.resource_subtype",
"custom_field_settings.project",
"custom_field_settings.project.name",
"custom_field_settings.project.resource_subtype",
"description",
"edit_team_name_or_description_access_level",
"edit_team_visibility_or_trash_team_access_level",
"endorsed",
"guest_invite_management_access_level",
"html_description",
"join_request_management_access_level",
"member_invite_management_access_level",
"name",
"organization",
"organization.name",
"permalink_url",
"team_content_management_access_level",
"team_member_removal_access_level",
"visibility"
]
}
},
"style": "form",
"explode": false
}
],
"requestBody": {
"description": "The team to create.",
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"$ref": "#/components/schemas/TeamRequest"
}
}
}
}
}
},
"responses": {
"201": {
"description": "Successfully created a new team.",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"$ref": "#/components/schemas/TeamResponse"
}
}
}
}
}
},
"400": {
"$ref": "#/components/responses/BadRequest"
},
"401": {
"$ref": "#/components/responses/Unauthorized"
},
"403": {
"$ref": "#/components/responses/Forbidden"
},
"404": {
"$ref": "#/components/responses/NotFound"
},
"500": {
"$ref": "#/components/responses/InternalServerError"
}
},
"security": [
{
"personalAccessToken": []
},
{
"oauth2": []
}
],
"x-readme": {
"code-samples": [
{
"language": "java",
"install": "<dependency><groupId>com.asana</groupId><artifactId>asana</artifactId><version>1.0.0</version></dependency>",
"code": "import com.asana.Client;\n\nClient client = Client.accessToken(\"PERSONAL_ACCESS_TOKEN\");\n\nTeam result = client.teams.createTeam()\n .data(\"field\", \"value\")\n .data(\"field\", \"value\")\n .option(\"pretty\", true)\n .execute();"
},
{
"language": "node",
"install": "npm install asana",
"code": "const Asana = require('asana');\n\nlet client = new Asana.ApiClient();\nclient.authentications.token.accessToken = '<YOUR_ACCESS_TOKEN>';\n\nlet teamsApiInstance = new Asana.TeamsApi(client);\nlet body = {\"data\": {\"<PARAM_1>\": \"<VALUE_1>\", \"<PARAM_2>\": \"<VALUE_2>\",}}; // Object | The team to create.\nlet opts = { \n 'opt_fields': \"custom_field_settings,custom_field_settings.custom_field,custom_field_settings.custom_field.asana_created_field,custom_field_settings.custom_field.created_by,custom_field_settings.custom_field.created_by.name,custom_field_settings.custom_field.currency_code,custom_field_settings.custom_field.custom_label,custom_field_settings.custom_field.custom_label_position,custom_field_settings.custom_field.date_value,custom_field_settings.custom_field.date_value.date,custom_field_settings.custom_field.date_value.date_time,custom_field_settings.custom_field.default_access_level,custom_field_settings.custom_field.description,custom_field_settings.custom_field.display_value,custom_field_settings.custom_field.enabled,custom_field_settings.custom_field.enum_options,custom_field_settings.custom_field.enum_options.color,custom_field_settings.custom_field.enum_options.enabled,custom_field_settings.custom_field.enum_options.name,custom_field_settings.custom_field.enum_value,custom_field_settings.custom_field.enum_value.color,custom_field_settings.custom_field.enum_value.enabled,custom_field_settings.custom_field.enum_value.name,custom_field_settings.custom_field.format,custom_field_settings.custom_field.has_notifications_enabled,custom_field_settings.custom_field.html_text_value,custom_field_settings.custom_field.id_prefix,custom_field_settings.custom_field.input_restrictions,custom_field_settings.custom_field.is_formula_field,custom_field_settings.custom_field.is_global_to_workspace,custom_field_settings.custom_field.is_value_read_only,custom_field_settings.custom_field.multi_enum_values,custom_field_settings.custom_field.multi_enum_values.color,custom_field_settings.custom_field.multi_enum_values.enabled,custom_field_settings.custom_field.multi_enum_values.name,custom_field_settings.custom_field.name,custom_field_settings.custom_field.number_value,custom_field_settings.custom_field.people_value,custom_field_settings.custom_field.people_value.name,custom_field_settings.custom_field.precision,custom_field_settings.custom_field.privacy_setting,custom_field_settings.custom_field.reference_value,custom_field_settings.custom_field.reference_value.name,custom_field_settings.custom_field.representation_type,custom_field_settings.custom_field.resource_subtype,custom_field_settings.custom_field.text_value,custom_field_settings.custom_field.type,custom_field_settings.is_important,custom_field_settings.parent,custom_field_settings.parent.name,custom_field_settings.parent.resource_subtype,custom_field_settings.project,custom_field_settings.project.name,custom_field_settings.project.resource_subtype,description,edit_team_name_or_description_access_level,edit_team_visibility_or_trash_team_access_level,endorsed,guest_invite_management_access_level,html_description,join_request_management_access_level,member_invite_management_access_level,name,organization,organization.name,permalink_url,team_content_management_access_level,team_member_removal_access_level,visibility\"\n};\nteamsApiInstance.createTeam(body, opts).then((result) => {\n console.log('API called successfully. Returned data: ' + JSON.stringify(result.data, null, 2));\n}, (error) => {\n console.error(error.response.body);\n});",
"name": "node-sdk-v3"
},
{
"language": "node",
"install": "npm install asana@1.0.5",
"code": "const asana = require('asana');\n\nconst client = asana.Client.create().useAccessToken('PERSONAL_ACCESS_TOKEN');\n\nclient.teams.createTeam({field: \"value\", field: \"value\", pretty: true})\n .then((result) => {\n console.log(result);\n });",
"name": "node-sdk-v1"
},
{
"language": "python",
"install": "pip install asana",
"code": "import asana\nfrom asana.rest import ApiException\nfrom pprint import pprint\n\nconfiguration = asana.Configuration()\nconfiguration.access_token = '<YOUR_ACCESS_TOKEN>'\napi_client = asana.ApiClient(configuration)\n\n# create an instance of the API class\nteams_api_instance = asana.TeamsApi(api_client)\nbody = {\"data\": {\"<PARAM_1>\": \"<VALUE_1>\", \"<PARAM_2>\": \"<VALUE_2>\",}} # dict | The team to create.\nopts = {\n 'opt_fields': \"custom_field_settings,custom_field_settings.custom_field,custom_field_settings.custom_field.asana_created_field,custom_field_settings.custom_field.created_by,custom_field_settings.custom_field.created_by.name,custom_field_settings.custom_field.currency_code,custom_field_settings.custom_field.custom_label,custom_field_settings.custom_field.custom_label_position,custom_field_settings.custom_field.date_value,custom_field_settings.custom_field.date_value.date,custom_field_settings.custom_field.date_value.date_time,custom_field_settings.custom_field.default_access_level,custom_field_settings.custom_field.description,custom_field_settings.custom_field.display_value,custom_field_settings.custom_field.enabled,custom_field_settings.custom_field.enum_options,custom_field_settings.custom_field.enum_options.color,custom_field_settings.custom_field.enum_options.enabled,custom_field_settings.custom_field.enum_options.name,custom_field_settings.custom_field.enum_value,custom_field_settings.custom_field.enum_value.color,custom_field_settings.custom_field.enum_value.enabled,custom_field_settings.custom_field.enum_value.name,custom_field_settings.custom_field.format,custom_field_settings.custom_field.has_notifications_enabled,custom_field_settings.custom_field.html_text_value,custom_field_settings.custom_field.id_prefix,custom_field_settings.custom_field.input_restrictions,custom_field_settings.custom_field.is_formula_field,custom_field_settings.custom_field.is_global_to_workspace,custom_field_settings.custom_field.is_value_read_only,custom_field_settings.custom_field.multi_enum_values,custom_field_settings.custom_field.multi_enum_values.color,custom_field_settings.custom_field.multi_enum_values.enabled,custom_field_settings.custom_field.multi_enum_values.name,custom_field_settings.custom_field.name,custom_field_settings.custom_field.number_value,custom_field_settings.custom_field.people_value,custom_field_settings.custom_field.people_value.name,custom_field_settings.custom_field.precision,custom_field_settings.custom_field.privacy_setting,custom_field_settings.custom_field.reference_value,custom_field_settings.custom_field.reference_value.name,custom_field_settings.custom_field.representation_type,custom_field_settings.custom_field.resource_subtype,custom_field_settings.custom_field.text_value,custom_field_settings.custom_field.type,custom_field_settings.is_important,custom_field_settings.parent,custom_field_settings.parent.name,custom_field_settings.parent.resource_subtype,custom_field_settings.project,custom_field_settings.project.name,custom_field_settings.project.resource_subtype,description,edit_team_name_or_description_access_level,edit_team_visibility_or_trash_team_access_level,endorsed,guest_invite_management_access_level,html_description,join_request_management_access_level,member_invite_management_access_level,name,organization,organization.name,permalink_url,team_content_management_access_level,team_member_removal_access_level,visibility\", # list[str] | 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.\n}\n\ntry:\n # Create a team\n api_response = teams_api_instance.create_team(body, opts)\n pprint(api_response)\nexcept ApiException as e:\n print(\"Exception when calling TeamsApi->create_team: %s\\n\" % e)",
"name": "python-sdk-v5"
},
{
"language": "python",
"install": "pip install asana==3.2.3",
"code": "import asana\n\nclient = asana.Client.access_token('PERSONAL_ACCESS_TOKEN')\n\nresult = client.teams.create_team({'field': 'value', 'field': 'value'}, opt_pretty=True)",
"name": "python-sdk-v3"
},
{
"language": "php",
"install": "composer require asana/asana",
"code": "<?php\nrequire 'vendor/autoload.php';\n\n$client = Asana\\Client::accessToken('PERSONAL_ACCESS_TOKEN');\n\n$result = $client->teams->createTeam(array('field' => 'value', 'field' => 'value'), array('opt_pretty' => 'true'))"
},
{
"language": "ruby",
"install": "gem install asana",
"code": "require 'asana'\n\nclient = Asana::Client.new do |c|\n c.authentication :access_token, 'PERSONAL_ACCESS_TOKEN'\nend\n\nresult = client.teams.create_team(field: \"value\", field: \"value\", options: {pretty: true})"
}
]
},
"x-purple-suite-runtime": "unavailable"
}
GET /api/1.0/teams/{team_gid}
Get a team
<b>Required scope: </b><code>teams:read</code>
Returns the full record for a single team.
The persistent core model supports the response and query fields named in x-purple-suite-supported-response-fields and x-purple-suite-supported-query. Other fields/options return an explicit 400 errors envelope.
Authentication
[
{
"personalAccessToken": []
},
{
"oauth2": [
"teams:read"
]
}
]
Path-level parameters and metadata
{
"parameters": [
{
"$ref": "#/components/parameters/team_path_gid"
},
{
"$ref": "#/components/parameters/pretty"
}
]
}
Request, responses and operation details
{
"summary": "Get a team",
"description": "<b>Required scope: </b><code>teams:read</code>\n\nReturns the full record for a single team.\n\nThe persistent core model supports the response and query fields named in x-purple-suite-supported-response-fields and x-purple-suite-supported-query. Other fields/options return an explicit 400 errors envelope.",
"tags": [
"Teams"
],
"operationId": "getTeam",
"parameters": [
{
"name": "opt_fields",
"in": "query",
"description": "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. Properties can include nested fields. To learn more, see the [input/output options guide](/docs/inputoutput-options#selecting-nested-fields).",
"required": false,
"example": [
"custom_field_settings",
"custom_field_settings.custom_field",
"custom_field_settings.custom_field.asana_created_field",
"custom_field_settings.custom_field.created_by",
"custom_field_settings.custom_field.created_by.name",
"custom_field_settings.custom_field.currency_code",
"custom_field_settings.custom_field.custom_label",
"custom_field_settings.custom_field.custom_label_position",
"custom_field_settings.custom_field.date_value",
"custom_field_settings.custom_field.date_value.date",
"custom_field_settings.custom_field.date_value.date_time",
"custom_field_settings.custom_field.default_access_level",
"custom_field_settings.custom_field.description",
"custom_field_settings.custom_field.display_value",
"custom_field_settings.custom_field.enabled",
"custom_field_settings.custom_field.enum_options",
"custom_field_settings.custom_field.enum_options.color",
"custom_field_settings.custom_field.enum_options.enabled",
"custom_field_settings.custom_field.enum_options.name",
"custom_field_settings.custom_field.enum_value",
"custom_field_settings.custom_field.enum_value.color",
"custom_field_settings.custom_field.enum_value.enabled",
"custom_field_settings.custom_field.enum_value.name",
"custom_field_settings.custom_field.format",
"custom_field_settings.custom_field.has_notifications_enabled",
"custom_field_settings.custom_field.html_text_value",
"custom_field_settings.custom_field.id_prefix",
"custom_field_settings.custom_field.input_restrictions",
"custom_field_settings.custom_field.is_formula_field",
"custom_field_settings.custom_field.is_global_to_workspace",
"custom_field_settings.custom_field.is_value_read_only",
"custom_field_settings.custom_field.multi_enum_values",
"custom_field_settings.custom_field.multi_enum_values.color",
"custom_field_settings.custom_field.multi_enum_values.enabled",
"custom_field_settings.custom_field.multi_enum_values.name",
"custom_field_settings.custom_field.name",
"custom_field_settings.custom_field.number_value",
"custom_field_settings.custom_field.people_value",
"custom_field_settings.custom_field.people_value.name",
"custom_field_settings.custom_field.precision",
"custom_field_settings.custom_field.privacy_setting",
"custom_field_settings.custom_field.reference_value",
"custom_field_settings.custom_field.reference_value.name",
"custom_field_settings.custom_field.representation_type",
"custom_field_settings.custom_field.resource_subtype",
"custom_field_settings.custom_field.text_value",
"custom_field_settings.custom_field.type",
"custom_field_settings.is_important",
"custom_field_settings.parent",
"custom_field_settings.parent.name",
"custom_field_settings.parent.resource_subtype",
"custom_field_settings.project",
"custom_field_settings.project.name",
"custom_field_settings.project.resource_subtype",
"description",
"edit_team_name_or_description_access_level",
"edit_team_visibility_or_trash_team_access_level",
"endorsed",
"guest_invite_management_access_level",
"html_description",
"join_request_management_access_level",
"member_invite_management_access_level",
"name",
"organization",
"organization.name",
"permalink_url",
"team_content_management_access_level",
"team_member_removal_access_level",
"visibility"
],
"schema": {
"type": "array",
"items": {
"type": "string",
"enum": [
"custom_field_settings",
"custom_field_settings.custom_field",
"custom_field_settings.custom_field.asana_created_field",
"custom_field_settings.custom_field.created_by",
"custom_field_settings.custom_field.created_by.name",
"custom_field_settings.custom_field.currency_code",
"custom_field_settings.custom_field.custom_label",
"custom_field_settings.custom_field.custom_label_position",
"custom_field_settings.custom_field.date_value",
"custom_field_settings.custom_field.date_value.date",
"custom_field_settings.custom_field.date_value.date_time",
"custom_field_settings.custom_field.default_access_level",
"custom_field_settings.custom_field.description",
"custom_field_settings.custom_field.display_value",
"custom_field_settings.custom_field.enabled",
"custom_field_settings.custom_field.enum_options",
"custom_field_settings.custom_field.enum_options.color",
"custom_field_settings.custom_field.enum_options.enabled",
"custom_field_settings.custom_field.enum_options.name",
"custom_field_settings.custom_field.enum_value",
"custom_field_settings.custom_field.enum_value.color",
"custom_field_settings.custom_field.enum_value.enabled",
"custom_field_settings.custom_field.enum_value.name",
"custom_field_settings.custom_field.format",
"custom_field_settings.custom_field.has_notifications_enabled",
"custom_field_settings.custom_field.html_text_value",
"custom_field_settings.custom_field.id_prefix",
"custom_field_settings.custom_field.input_restrictions",
"custom_field_settings.custom_field.is_formula_field",
"custom_field_settings.custom_field.is_global_to_workspace",
"custom_field_settings.custom_field.is_value_read_only",
"custom_field_settings.custom_field.multi_enum_values",
"custom_field_settings.custom_field.multi_enum_values.color",
"custom_field_settings.custom_field.multi_enum_values.enabled",
"custom_field_settings.custom_field.multi_enum_values.name",
"custom_field_settings.custom_field.name",
"custom_field_settings.custom_field.number_value",
"custom_field_settings.custom_field.people_value",
"custom_field_settings.custom_field.people_value.name",
"custom_field_settings.custom_field.precision",
"custom_field_settings.custom_field.privacy_setting",
"custom_field_settings.custom_field.reference_value",
"custom_field_settings.custom_field.reference_value.name",
"custom_field_settings.custom_field.representation_type",
"custom_field_settings.custom_field.resource_subtype",
"custom_field_settings.custom_field.text_value",
"custom_field_settings.custom_field.type",
"custom_field_settings.is_important",
"custom_field_settings.parent",
"custom_field_settings.parent.name",
"custom_field_settings.parent.resource_subtype",
"custom_field_settings.project",
"custom_field_settings.project.name",
"custom_field_settings.project.resource_subtype",
"description",
"edit_team_name_or_description_access_level",
"edit_team_visibility_or_trash_team_access_level",
"endorsed",
"guest_invite_management_access_level",
"html_description",
"join_request_management_access_level",
"member_invite_management_access_level",
"name",
"organization",
"organization.name",
"permalink_url",
"team_content_management_access_level",
"team_member_removal_access_level",
"visibility"
]
}
},
"style": "form",
"explode": false
}
],
"responses": {
"200": {
"description": "Successfully retrieved the record for a single team.",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"$ref": "#/components/schemas/TeamResponse"
}
}
}
}
}
},
"400": {
"$ref": "#/components/responses/BadRequest"
},
"401": {
"$ref": "#/components/responses/Unauthorized"
},
"403": {
"$ref": "#/components/responses/Forbidden"
},
"404": {
"$ref": "#/components/responses/NotFound"
},
"500": {
"$ref": "#/components/responses/InternalServerError"
}
},
"security": [
{
"personalAccessToken": []
},
{
"oauth2": [
"teams:read"
]
}
],
"x-readme": {
"code-samples": [
{
"language": "java",
"install": "<dependency><groupId>com.asana</groupId><artifactId>asana</artifactId><version>1.0.0</version></dependency>",
"code": "import com.asana.Client;\n\nClient client = Client.accessToken(\"PERSONAL_ACCESS_TOKEN\");\n\nTeam result = client.teams.getTeam(teamGid)\n .option(\"pretty\", true)\n .execute();"
},
{
"language": "node",
"install": "npm install asana",
"code": "const Asana = require('asana');\n\nlet client = new Asana.ApiClient();\nclient.authentications.token.accessToken = '<YOUR_ACCESS_TOKEN>';\n\nlet teamsApiInstance = new Asana.TeamsApi(client);\nlet team_gid = \"159874\"; // String | Globally unique identifier for the team.\nlet opts = { \n 'opt_fields': \"custom_field_settings,custom_field_settings.custom_field,custom_field_settings.custom_field.asana_created_field,custom_field_settings.custom_field.created_by,custom_field_settings.custom_field.created_by.name,custom_field_settings.custom_field.currency_code,custom_field_settings.custom_field.custom_label,custom_field_settings.custom_field.custom_label_position,custom_field_settings.custom_field.date_value,custom_field_settings.custom_field.date_value.date,custom_field_settings.custom_field.date_value.date_time,custom_field_settings.custom_field.default_access_level,custom_field_settings.custom_field.description,custom_field_settings.custom_field.display_value,custom_field_settings.custom_field.enabled,custom_field_settings.custom_field.enum_options,custom_field_settings.custom_field.enum_options.color,custom_field_settings.custom_field.enum_options.enabled,custom_field_settings.custom_field.enum_options.name,custom_field_settings.custom_field.enum_value,custom_field_settings.custom_field.enum_value.color,custom_field_settings.custom_field.enum_value.enabled,custom_field_settings.custom_field.enum_value.name,custom_field_settings.custom_field.format,custom_field_settings.custom_field.has_notifications_enabled,custom_field_settings.custom_field.html_text_value,custom_field_settings.custom_field.id_prefix,custom_field_settings.custom_field.input_restrictions,custom_field_settings.custom_field.is_formula_field,custom_field_settings.custom_field.is_global_to_workspace,custom_field_settings.custom_field.is_value_read_only,custom_field_settings.custom_field.multi_enum_values,custom_field_settings.custom_field.multi_enum_values.color,custom_field_settings.custom_field.multi_enum_values.enabled,custom_field_settings.custom_field.multi_enum_values.name,custom_field_settings.custom_field.name,custom_field_settings.custom_field.number_value,custom_field_settings.custom_field.people_value,custom_field_settings.custom_field.people_value.name,custom_field_settings.custom_field.precision,custom_field_settings.custom_field.privacy_setting,custom_field_settings.custom_field.reference_value,custom_field_settings.custom_field.reference_value.name,custom_field_settings.custom_field.representation_type,custom_field_settings.custom_field.resource_subtype,custom_field_settings.custom_field.text_value,custom_field_settings.custom_field.type,custom_field_settings.is_important,custom_field_settings.parent,custom_field_settings.parent.name,custom_field_settings.parent.resource_subtype,custom_field_settings.project,custom_field_settings.project.name,custom_field_settings.project.resource_subtype,description,edit_team_name_or_description_access_level,edit_team_visibility_or_trash_team_access_level,endorsed,guest_invite_management_access_level,html_description,join_request_management_access_level,member_invite_management_access_level,name,organization,organization.name,permalink_url,team_content_management_access_level,team_member_removal_access_level,visibility\"\n};\nteamsApiInstance.getTeam(team_gid, opts).then((result) => {\n console.log('API called successfully. Returned data: ' + JSON.stringify(result.data, null, 2));\n}, (error) => {\n console.error(error.response.body);\n});",
"name": "node-sdk-v3"
},
{
"language": "node",
"install": "npm install asana@1.0.5",
"code": "const asana = require('asana');\n\nconst client = asana.Client.create().useAccessToken('PERSONAL_ACCESS_TOKEN');\n\nclient.teams.getTeam(teamGid, {param: \"value\", param: \"value\", opt_pretty: true})\n .then((result) => {\n console.log(result);\n });",
"name": "node-sdk-v1"
},
{
"language": "python",
"install": "pip install asana",
"code": "import asana\nfrom asana.rest import ApiException\nfrom pprint import pprint\n\nconfiguration = asana.Configuration()\nconfiguration.access_token = '<YOUR_ACCESS_TOKEN>'\napi_client = asana.ApiClient(configuration)\n\n# create an instance of the API class\nteams_api_instance = asana.TeamsApi(api_client)\nteam_gid = \"159874\" # str | Globally unique identifier for the team.\nopts = {\n 'opt_fields': \"custom_field_settings,custom_field_settings.custom_field,custom_field_settings.custom_field.asana_created_field,custom_field_settings.custom_field.created_by,custom_field_settings.custom_field.created_by.name,custom_field_settings.custom_field.currency_code,custom_field_settings.custom_field.custom_label,custom_field_settings.custom_field.custom_label_position,custom_field_settings.custom_field.date_value,custom_field_settings.custom_field.date_value.date,custom_field_settings.custom_field.date_value.date_time,custom_field_settings.custom_field.default_access_level,custom_field_settings.custom_field.description,custom_field_settings.custom_field.display_value,custom_field_settings.custom_field.enabled,custom_field_settings.custom_field.enum_options,custom_field_settings.custom_field.enum_options.color,custom_field_settings.custom_field.enum_options.enabled,custom_field_settings.custom_field.enum_options.name,custom_field_settings.custom_field.enum_value,custom_field_settings.custom_field.enum_value.color,custom_field_settings.custom_field.enum_value.enabled,custom_field_settings.custom_field.enum_value.name,custom_field_settings.custom_field.format,custom_field_settings.custom_field.has_notifications_enabled,custom_field_settings.custom_field.html_text_value,custom_field_settings.custom_field.id_prefix,custom_field_settings.custom_field.input_restrictions,custom_field_settings.custom_field.is_formula_field,custom_field_settings.custom_field.is_global_to_workspace,custom_field_settings.custom_field.is_value_read_only,custom_field_settings.custom_field.multi_enum_values,custom_field_settings.custom_field.multi_enum_values.color,custom_field_settings.custom_field.multi_enum_values.enabled,custom_field_settings.custom_field.multi_enum_values.name,custom_field_settings.custom_field.name,custom_field_settings.custom_field.number_value,custom_field_settings.custom_field.people_value,custom_field_settings.custom_field.people_value.name,custom_field_settings.custom_field.precision,custom_field_settings.custom_field.privacy_setting,custom_field_settings.custom_field.reference_value,custom_field_settings.custom_field.reference_value.name,custom_field_settings.custom_field.representation_type,custom_field_settings.custom_field.resource_subtype,custom_field_settings.custom_field.text_value,custom_field_settings.custom_field.type,custom_field_settings.is_important,custom_field_settings.parent,custom_field_settings.parent.name,custom_field_settings.parent.resource_subtype,custom_field_settings.project,custom_field_settings.project.name,custom_field_settings.project.resource_subtype,description,edit_team_name_or_description_access_level,edit_team_visibility_or_trash_team_access_level,endorsed,guest_invite_management_access_level,html_description,join_request_management_access_level,member_invite_management_access_level,name,organization,organization.name,permalink_url,team_content_management_access_level,team_member_removal_access_level,visibility\", # list[str] | 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.\n}\n\ntry:\n # Get a team\n api_response = teams_api_instance.get_team(team_gid, opts)\n pprint(api_response)\nexcept ApiException as e:\n print(\"Exception when calling TeamsApi->get_team: %s\\n\" % e)",
"name": "python-sdk-v5"
},
{
"language": "python",
"install": "pip install asana==3.2.3",
"code": "import asana\n\nclient = asana.Client.access_token('PERSONAL_ACCESS_TOKEN')\n\nresult = client.teams.get_team(team_gid, {'param': 'value', 'param': 'value'}, opt_pretty=True)",
"name": "python-sdk-v3"
},
{
"language": "php",
"install": "composer require asana/asana",
"code": "<?php\nrequire 'vendor/autoload.php';\n\n$client = Asana\\Client::accessToken('PERSONAL_ACCESS_TOKEN');\n\n$result = $client->teams->getTeam($team_gid, array('param' => 'value', 'param' => 'value'), array('opt_pretty' => 'true'))"
},
{
"language": "ruby",
"install": "gem install asana",
"code": "require 'asana'\n\nclient = Asana::Client.new do |c|\n c.authentication :access_token, 'PERSONAL_ACCESS_TOKEN'\nend\n\nresult = client.teams.get_team(team_gid: 'team_gid', param: \"value\", param: \"value\", options: {pretty: true})"
}
]
},
"x-purple-suite-runtime": "modeled-core",
"x-purple-suite-supported-query": [
"opt_pretty",
"opt_fields"
],
"x-purple-suite-supported-response-fields": [
"gid",
"resource_type",
"resource_subtype",
"name",
"notes",
"completed",
"completed_at",
"created_at",
"modified_at",
"assignee",
"assignee_status",
"workspace",
"projects",
"memberships",
"parent",
"due_on",
"start_on",
"tags",
"dependencies",
"num_subtasks",
"archived",
"public",
"color",
"default_view",
"team",
"project",
"section",
"text",
"created_by",
"target",
"type",
"email",
"photo",
"is_organization"
]
}
PUT /api/1.0/teams/{team_gid}
Update a team
Updates a team within the current workspace.
This operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.
Authentication
[
{
"personalAccessToken": []
},
{
"oauth2": []
}
]
Path-level parameters and metadata
{
"parameters": [
{
"$ref": "#/components/parameters/team_path_gid"
},
{
"$ref": "#/components/parameters/pretty"
}
]
}
Request, responses and operation details
{
"summary": "Update a team",
"description": "Updates a team within the current workspace.\n\nThis operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.",
"tags": [
"Teams"
],
"operationId": "updateTeam",
"parameters": [
{
"name": "opt_fields",
"in": "query",
"description": "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. Properties can include nested fields. To learn more, see the [input/output options guide](/docs/inputoutput-options#selecting-nested-fields).",
"required": false,
"example": [
"custom_field_settings",
"custom_field_settings.custom_field",
"custom_field_settings.custom_field.asana_created_field",
"custom_field_settings.custom_field.created_by",
"custom_field_settings.custom_field.created_by.name",
"custom_field_settings.custom_field.currency_code",
"custom_field_settings.custom_field.custom_label",
"custom_field_settings.custom_field.custom_label_position",
"custom_field_settings.custom_field.date_value",
"custom_field_settings.custom_field.date_value.date",
"custom_field_settings.custom_field.date_value.date_time",
"custom_field_settings.custom_field.default_access_level",
"custom_field_settings.custom_field.description",
"custom_field_settings.custom_field.display_value",
"custom_field_settings.custom_field.enabled",
"custom_field_settings.custom_field.enum_options",
"custom_field_settings.custom_field.enum_options.color",
"custom_field_settings.custom_field.enum_options.enabled",
"custom_field_settings.custom_field.enum_options.name",
"custom_field_settings.custom_field.enum_value",
"custom_field_settings.custom_field.enum_value.color",
"custom_field_settings.custom_field.enum_value.enabled",
"custom_field_settings.custom_field.enum_value.name",
"custom_field_settings.custom_field.format",
"custom_field_settings.custom_field.has_notifications_enabled",
"custom_field_settings.custom_field.html_text_value",
"custom_field_settings.custom_field.id_prefix",
"custom_field_settings.custom_field.input_restrictions",
"custom_field_settings.custom_field.is_formula_field",
"custom_field_settings.custom_field.is_global_to_workspace",
"custom_field_settings.custom_field.is_value_read_only",
"custom_field_settings.custom_field.multi_enum_values",
"custom_field_settings.custom_field.multi_enum_values.color",
"custom_field_settings.custom_field.multi_enum_values.enabled",
"custom_field_settings.custom_field.multi_enum_values.name",
"custom_field_settings.custom_field.name",
"custom_field_settings.custom_field.number_value",
"custom_field_settings.custom_field.people_value",
"custom_field_settings.custom_field.people_value.name",
"custom_field_settings.custom_field.precision",
"custom_field_settings.custom_field.privacy_setting",
"custom_field_settings.custom_field.reference_value",
"custom_field_settings.custom_field.reference_value.name",
"custom_field_settings.custom_field.representation_type",
"custom_field_settings.custom_field.resource_subtype",
"custom_field_settings.custom_field.text_value",
"custom_field_settings.custom_field.type",
"custom_field_settings.is_important",
"custom_field_settings.parent",
"custom_field_settings.parent.name",
"custom_field_settings.parent.resource_subtype",
"custom_field_settings.project",
"custom_field_settings.project.name",
"custom_field_settings.project.resource_subtype",
"description",
"edit_team_name_or_description_access_level",
"edit_team_visibility_or_trash_team_access_level",
"endorsed",
"guest_invite_management_access_level",
"html_description",
"join_request_management_access_level",
"member_invite_management_access_level",
"name",
"organization",
"organization.name",
"permalink_url",
"team_content_management_access_level",
"team_member_removal_access_level",
"visibility"
],
"schema": {
"type": "array",
"items": {
"type": "string",
"enum": [
"custom_field_settings",
"custom_field_settings.custom_field",
"custom_field_settings.custom_field.asana_created_field",
"custom_field_settings.custom_field.created_by",
"custom_field_settings.custom_field.created_by.name",
"custom_field_settings.custom_field.currency_code",
"custom_field_settings.custom_field.custom_label",
"custom_field_settings.custom_field.custom_label_position",
"custom_field_settings.custom_field.date_value",
"custom_field_settings.custom_field.date_value.date",
"custom_field_settings.custom_field.date_value.date_time",
"custom_field_settings.custom_field.default_access_level",
"custom_field_settings.custom_field.description",
"custom_field_settings.custom_field.display_value",
"custom_field_settings.custom_field.enabled",
"custom_field_settings.custom_field.enum_options",
"custom_field_settings.custom_field.enum_options.color",
"custom_field_settings.custom_field.enum_options.enabled",
"custom_field_settings.custom_field.enum_options.name",
"custom_field_settings.custom_field.enum_value",
"custom_field_settings.custom_field.enum_value.color",
"custom_field_settings.custom_field.enum_value.enabled",
"custom_field_settings.custom_field.enum_value.name",
"custom_field_settings.custom_field.format",
"custom_field_settings.custom_field.has_notifications_enabled",
"custom_field_settings.custom_field.html_text_value",
"custom_field_settings.custom_field.id_prefix",
"custom_field_settings.custom_field.input_restrictions",
"custom_field_settings.custom_field.is_formula_field",
"custom_field_settings.custom_field.is_global_to_workspace",
"custom_field_settings.custom_field.is_value_read_only",
"custom_field_settings.custom_field.multi_enum_values",
"custom_field_settings.custom_field.multi_enum_values.color",
"custom_field_settings.custom_field.multi_enum_values.enabled",
"custom_field_settings.custom_field.multi_enum_values.name",
"custom_field_settings.custom_field.name",
"custom_field_settings.custom_field.number_value",
"custom_field_settings.custom_field.people_value",
"custom_field_settings.custom_field.people_value.name",
"custom_field_settings.custom_field.precision",
"custom_field_settings.custom_field.privacy_setting",
"custom_field_settings.custom_field.reference_value",
"custom_field_settings.custom_field.reference_value.name",
"custom_field_settings.custom_field.representation_type",
"custom_field_settings.custom_field.resource_subtype",
"custom_field_settings.custom_field.text_value",
"custom_field_settings.custom_field.type",
"custom_field_settings.is_important",
"custom_field_settings.parent",
"custom_field_settings.parent.name",
"custom_field_settings.parent.resource_subtype",
"custom_field_settings.project",
"custom_field_settings.project.name",
"custom_field_settings.project.resource_subtype",
"description",
"edit_team_name_or_description_access_level",
"edit_team_visibility_or_trash_team_access_level",
"endorsed",
"guest_invite_management_access_level",
"html_description",
"join_request_management_access_level",
"member_invite_management_access_level",
"name",
"organization",
"organization.name",
"permalink_url",
"team_content_management_access_level",
"team_member_removal_access_level",
"visibility"
]
}
},
"style": "form",
"explode": false
}
],
"requestBody": {
"description": "The team to update.",
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"$ref": "#/components/schemas/TeamRequest"
}
}
}
}
}
},
"responses": {
"200": {
"description": "Successfully updated the team.",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"$ref": "#/components/schemas/TeamResponse"
}
}
}
}
}
},
"400": {
"$ref": "#/components/responses/BadRequest"
},
"401": {
"$ref": "#/components/responses/Unauthorized"
},
"403": {
"$ref": "#/components/responses/Forbidden"
},
"404": {
"$ref": "#/components/responses/NotFound"
},
"500": {
"$ref": "#/components/responses/InternalServerError"
}
},
"security": [
{
"personalAccessToken": []
},
{
"oauth2": []
}
],
"x-readme": {
"code-samples": [
{
"language": "java",
"install": "<dependency><groupId>com.asana</groupId><artifactId>asana</artifactId><version>1.0.0</version></dependency>",
"code": "import com.asana.Client;\n\nClient client = Client.accessToken(\"PERSONAL_ACCESS_TOKEN\");\n\nTeam result = client.teams.updateTeam()\n .data(\"field\", \"value\")\n .data(\"field\", \"value\")\n .option(\"pretty\", true)\n .execute();"
},
{
"language": "node",
"install": "npm install asana",
"code": "const Asana = require('asana');\n\nlet client = new Asana.ApiClient();\nclient.authentications.token.accessToken = '<YOUR_ACCESS_TOKEN>';\n\nlet teamsApiInstance = new Asana.TeamsApi(client);\nlet body = {\"data\": {\"<PARAM_1>\": \"<VALUE_1>\", \"<PARAM_2>\": \"<VALUE_2>\",}}; // Object | The team to update.\nlet team_gid = \"159874\"; // String | Globally unique identifier for the team.\nlet opts = { \n 'opt_fields': \"custom_field_settings,custom_field_settings.custom_field,custom_field_settings.custom_field.asana_created_field,custom_field_settings.custom_field.created_by,custom_field_settings.custom_field.created_by.name,custom_field_settings.custom_field.currency_code,custom_field_settings.custom_field.custom_label,custom_field_settings.custom_field.custom_label_position,custom_field_settings.custom_field.date_value,custom_field_settings.custom_field.date_value.date,custom_field_settings.custom_field.date_value.date_time,custom_field_settings.custom_field.default_access_level,custom_field_settings.custom_field.description,custom_field_settings.custom_field.display_value,custom_field_settings.custom_field.enabled,custom_field_settings.custom_field.enum_options,custom_field_settings.custom_field.enum_options.color,custom_field_settings.custom_field.enum_options.enabled,custom_field_settings.custom_field.enum_options.name,custom_field_settings.custom_field.enum_value,custom_field_settings.custom_field.enum_value.color,custom_field_settings.custom_field.enum_value.enabled,custom_field_settings.custom_field.enum_value.name,custom_field_settings.custom_field.format,custom_field_settings.custom_field.has_notifications_enabled,custom_field_settings.custom_field.html_text_value,custom_field_settings.custom_field.id_prefix,custom_field_settings.custom_field.input_restrictions,custom_field_settings.custom_field.is_formula_field,custom_field_settings.custom_field.is_global_to_workspace,custom_field_settings.custom_field.is_value_read_only,custom_field_settings.custom_field.multi_enum_values,custom_field_settings.custom_field.multi_enum_values.color,custom_field_settings.custom_field.multi_enum_values.enabled,custom_field_settings.custom_field.multi_enum_values.name,custom_field_settings.custom_field.name,custom_field_settings.custom_field.number_value,custom_field_settings.custom_field.people_value,custom_field_settings.custom_field.people_value.name,custom_field_settings.custom_field.precision,custom_field_settings.custom_field.privacy_setting,custom_field_settings.custom_field.reference_value,custom_field_settings.custom_field.reference_value.name,custom_field_settings.custom_field.representation_type,custom_field_settings.custom_field.resource_subtype,custom_field_settings.custom_field.text_value,custom_field_settings.custom_field.type,custom_field_settings.is_important,custom_field_settings.parent,custom_field_settings.parent.name,custom_field_settings.parent.resource_subtype,custom_field_settings.project,custom_field_settings.project.name,custom_field_settings.project.resource_subtype,description,edit_team_name_or_description_access_level,edit_team_visibility_or_trash_team_access_level,endorsed,guest_invite_management_access_level,html_description,join_request_management_access_level,member_invite_management_access_level,name,organization,organization.name,permalink_url,team_content_management_access_level,team_member_removal_access_level,visibility\"\n};\nteamsApiInstance.updateTeam(body, team_gid, opts).then((result) => {\n console.log('API called successfully. Returned data: ' + JSON.stringify(result.data, null, 2));\n}, (error) => {\n console.error(error.response.body);\n});",
"name": "node-sdk-v3"
},
{
"language": "node",
"install": "npm install asana@1.0.5",
"code": "const asana = require('asana');\n\nconst client = asana.Client.create().useAccessToken('PERSONAL_ACCESS_TOKEN');\n\nclient.teams.updateTeam(teamGid, {field: \"value\", field: \"value\", pretty: true})\n .then((result) => {\n console.log(result);\n });",
"name": "node-sdk-v1"
},
{
"language": "python",
"install": "pip install asana",
"code": "import asana\nfrom asana.rest import ApiException\nfrom pprint import pprint\n\nconfiguration = asana.Configuration()\nconfiguration.access_token = '<YOUR_ACCESS_TOKEN>'\napi_client = asana.ApiClient(configuration)\n\n# create an instance of the API class\nteams_api_instance = asana.TeamsApi(api_client)\nbody = {\"data\": {\"<PARAM_1>\": \"<VALUE_1>\", \"<PARAM_2>\": \"<VALUE_2>\",}} # dict | The team to update.\nteam_gid = \"159874\" # str | Globally unique identifier for the team.\nopts = {\n 'opt_fields': \"custom_field_settings,custom_field_settings.custom_field,custom_field_settings.custom_field.asana_created_field,custom_field_settings.custom_field.created_by,custom_field_settings.custom_field.created_by.name,custom_field_settings.custom_field.currency_code,custom_field_settings.custom_field.custom_label,custom_field_settings.custom_field.custom_label_position,custom_field_settings.custom_field.date_value,custom_field_settings.custom_field.date_value.date,custom_field_settings.custom_field.date_value.date_time,custom_field_settings.custom_field.default_access_level,custom_field_settings.custom_field.description,custom_field_settings.custom_field.display_value,custom_field_settings.custom_field.enabled,custom_field_settings.custom_field.enum_options,custom_field_settings.custom_field.enum_options.color,custom_field_settings.custom_field.enum_options.enabled,custom_field_settings.custom_field.enum_options.name,custom_field_settings.custom_field.enum_value,custom_field_settings.custom_field.enum_value.color,custom_field_settings.custom_field.enum_value.enabled,custom_field_settings.custom_field.enum_value.name,custom_field_settings.custom_field.format,custom_field_settings.custom_field.has_notifications_enabled,custom_field_settings.custom_field.html_text_value,custom_field_settings.custom_field.id_prefix,custom_field_settings.custom_field.input_restrictions,custom_field_settings.custom_field.is_formula_field,custom_field_settings.custom_field.is_global_to_workspace,custom_field_settings.custom_field.is_value_read_only,custom_field_settings.custom_field.multi_enum_values,custom_field_settings.custom_field.multi_enum_values.color,custom_field_settings.custom_field.multi_enum_values.enabled,custom_field_settings.custom_field.multi_enum_values.name,custom_field_settings.custom_field.name,custom_field_settings.custom_field.number_value,custom_field_settings.custom_field.people_value,custom_field_settings.custom_field.people_value.name,custom_field_settings.custom_field.precision,custom_field_settings.custom_field.privacy_setting,custom_field_settings.custom_field.reference_value,custom_field_settings.custom_field.reference_value.name,custom_field_settings.custom_field.representation_type,custom_field_settings.custom_field.resource_subtype,custom_field_settings.custom_field.text_value,custom_field_settings.custom_field.type,custom_field_settings.is_important,custom_field_settings.parent,custom_field_settings.parent.name,custom_field_settings.parent.resource_subtype,custom_field_settings.project,custom_field_settings.project.name,custom_field_settings.project.resource_subtype,description,edit_team_name_or_description_access_level,edit_team_visibility_or_trash_team_access_level,endorsed,guest_invite_management_access_level,html_description,join_request_management_access_level,member_invite_management_access_level,name,organization,organization.name,permalink_url,team_content_management_access_level,team_member_removal_access_level,visibility\", # list[str] | 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.\n}\n\ntry:\n # Update a team\n api_response = teams_api_instance.update_team(body, team_gid, opts)\n pprint(api_response)\nexcept ApiException as e:\n print(\"Exception when calling TeamsApi->update_team: %s\\n\" % e)",
"name": "python-sdk-v5"
},
{
"language": "python",
"install": "pip install asana==3.2.3",
"code": "import asana\n\nclient = asana.Client.access_token('PERSONAL_ACCESS_TOKEN')\n\nresult = client.teams.update_team(team_gid, {'field': 'value', 'field': 'value'}, opt_pretty=True)",
"name": "python-sdk-v3"
},
{
"language": "php",
"install": "composer require asana/asana",
"code": "<?php\nrequire 'vendor/autoload.php';\n\n$client = Asana\\Client::accessToken('PERSONAL_ACCESS_TOKEN');\n\n$result = $client->teams->updateTeam(array('field' => 'value', 'field' => 'value'), array('opt_pretty' => 'true'))"
},
{
"language": "ruby",
"install": "gem install asana",
"code": "require 'asana'\n\nclient = Asana::Client.new do |c|\n c.authentication :access_token, 'PERSONAL_ACCESS_TOKEN'\nend\n\nresult = client.teams.update_team(field: \"value\", field: \"value\", options: {pretty: true})"
}
]
},
"x-purple-suite-runtime": "unavailable"
}
GET /api/1.0/workspaces/{workspace_gid}/teams
Get teams in a workspace
<b>Required scope: </b><code>teams:read</code>
Returns the compact records for all teams in the workspace visible to the authorized user.
The persistent core model supports the response and query fields named in x-purple-suite-supported-response-fields and x-purple-suite-supported-query. Other fields/options return an explicit 400 errors envelope.
Authentication
[
{
"personalAccessToken": []
},
{
"oauth2": [
"teams:read"
]
}
]
Path-level parameters and metadata
{
"parameters": [
{
"$ref": "#/components/parameters/workspace_path_gid"
},
{
"$ref": "#/components/parameters/pretty"
},
{
"$ref": "#/components/parameters/limit"
},
{
"$ref": "#/components/parameters/offset"
}
]
}
Request, responses and operation details
{
"summary": "Get teams in a workspace",
"description": "<b>Required scope: </b><code>teams:read</code>\n\nReturns the compact records for all teams in the workspace visible to the authorized user.\n\nThe persistent core model supports the response and query fields named in x-purple-suite-supported-response-fields and x-purple-suite-supported-query. Other fields/options return an explicit 400 errors envelope.",
"tags": [
"Teams"
],
"operationId": "getTeamsForWorkspace",
"parameters": [
{
"name": "opt_fields",
"in": "query",
"description": "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. Properties can include nested fields. To learn more, see the [input/output options guide](/docs/inputoutput-options#selecting-nested-fields).",
"required": false,
"example": [
"custom_field_settings",
"custom_field_settings.custom_field",
"custom_field_settings.custom_field.asana_created_field",
"custom_field_settings.custom_field.created_by",
"custom_field_settings.custom_field.created_by.name",
"custom_field_settings.custom_field.currency_code",
"custom_field_settings.custom_field.custom_label",
"custom_field_settings.custom_field.custom_label_position",
"custom_field_settings.custom_field.date_value",
"custom_field_settings.custom_field.date_value.date",
"custom_field_settings.custom_field.date_value.date_time",
"custom_field_settings.custom_field.default_access_level",
"custom_field_settings.custom_field.description",
"custom_field_settings.custom_field.display_value",
"custom_field_settings.custom_field.enabled",
"custom_field_settings.custom_field.enum_options",
"custom_field_settings.custom_field.enum_options.color",
"custom_field_settings.custom_field.enum_options.enabled",
"custom_field_settings.custom_field.enum_options.name",
"custom_field_settings.custom_field.enum_value",
"custom_field_settings.custom_field.enum_value.color",
"custom_field_settings.custom_field.enum_value.enabled",
"custom_field_settings.custom_field.enum_value.name",
"custom_field_settings.custom_field.format",
"custom_field_settings.custom_field.has_notifications_enabled",
"custom_field_settings.custom_field.html_text_value",
"custom_field_settings.custom_field.id_prefix",
"custom_field_settings.custom_field.input_restrictions",
"custom_field_settings.custom_field.is_formula_field",
"custom_field_settings.custom_field.is_global_to_workspace",
"custom_field_settings.custom_field.is_value_read_only",
"custom_field_settings.custom_field.multi_enum_values",
"custom_field_settings.custom_field.multi_enum_values.color",
"custom_field_settings.custom_field.multi_enum_values.enabled",
"custom_field_settings.custom_field.multi_enum_values.name",
"custom_field_settings.custom_field.name",
"custom_field_settings.custom_field.number_value",
"custom_field_settings.custom_field.people_value",
"custom_field_settings.custom_field.people_value.name",
"custom_field_settings.custom_field.precision",
"custom_field_settings.custom_field.privacy_setting",
"custom_field_settings.custom_field.reference_value",
"custom_field_settings.custom_field.reference_value.name",
"custom_field_settings.custom_field.representation_type",
"custom_field_settings.custom_field.resource_subtype",
"custom_field_settings.custom_field.text_value",
"custom_field_settings.custom_field.type",
"custom_field_settings.is_important",
"custom_field_settings.parent",
"custom_field_settings.parent.name",
"custom_field_settings.parent.resource_subtype",
"custom_field_settings.project",
"custom_field_settings.project.name",
"custom_field_settings.project.resource_subtype",
"description",
"edit_team_name_or_description_access_level",
"edit_team_visibility_or_trash_team_access_level",
"endorsed",
"guest_invite_management_access_level",
"html_description",
"join_request_management_access_level",
"member_invite_management_access_level",
"name",
"offset",
"organization",
"organization.name",
"path",
"permalink_url",
"team_content_management_access_level",
"team_member_removal_access_level",
"uri",
"visibility"
],
"schema": {
"type": "array",
"items": {
"type": "string",
"enum": [
"custom_field_settings",
"custom_field_settings.custom_field",
"custom_field_settings.custom_field.asana_created_field",
"custom_field_settings.custom_field.created_by",
"custom_field_settings.custom_field.created_by.name",
"custom_field_settings.custom_field.currency_code",
"custom_field_settings.custom_field.custom_label",
"custom_field_settings.custom_field.custom_label_position",
"custom_field_settings.custom_field.date_value",
"custom_field_settings.custom_field.date_value.date",
"custom_field_settings.custom_field.date_value.date_time",
"custom_field_settings.custom_field.default_access_level",
"custom_field_settings.custom_field.description",
"custom_field_settings.custom_field.display_value",
"custom_field_settings.custom_field.enabled",
"custom_field_settings.custom_field.enum_options",
"custom_field_settings.custom_field.enum_options.color",
"custom_field_settings.custom_field.enum_options.enabled",
"custom_field_settings.custom_field.enum_options.name",
"custom_field_settings.custom_field.enum_value",
"custom_field_settings.custom_field.enum_value.color",
"custom_field_settings.custom_field.enum_value.enabled",
"custom_field_settings.custom_field.enum_value.name",
"custom_field_settings.custom_field.format",
"custom_field_settings.custom_field.has_notifications_enabled",
"custom_field_settings.custom_field.html_text_value",
"custom_field_settings.custom_field.id_prefix",
"custom_field_settings.custom_field.input_restrictions",
"custom_field_settings.custom_field.is_formula_field",
"custom_field_settings.custom_field.is_global_to_workspace",
"custom_field_settings.custom_field.is_value_read_only",
"custom_field_settings.custom_field.multi_enum_values",
"custom_field_settings.custom_field.multi_enum_values.color",
"custom_field_settings.custom_field.multi_enum_values.enabled",
"custom_field_settings.custom_field.multi_enum_values.name",
"custom_field_settings.custom_field.name",
"custom_field_settings.custom_field.number_value",
"custom_field_settings.custom_field.people_value",
"custom_field_settings.custom_field.people_value.name",
"custom_field_settings.custom_field.precision",
"custom_field_settings.custom_field.privacy_setting",
"custom_field_settings.custom_field.reference_value",
"custom_field_settings.custom_field.reference_value.name",
"custom_field_settings.custom_field.representation_type",
"custom_field_settings.custom_field.resource_subtype",
"custom_field_settings.custom_field.text_value",
"custom_field_settings.custom_field.type",
"custom_field_settings.is_important",
"custom_field_settings.parent",
"custom_field_settings.parent.name",
"custom_field_settings.parent.resource_subtype",
"custom_field_settings.project",
"custom_field_settings.project.name",
"custom_field_settings.project.resource_subtype",
"description",
"edit_team_name_or_description_access_level",
"edit_team_visibility_or_trash_team_access_level",
"endorsed",
"guest_invite_management_access_level",
"html_description",
"join_request_management_access_level",
"member_invite_management_access_level",
"name",
"offset",
"organization",
"organization.name",
"path",
"permalink_url",
"team_content_management_access_level",
"team_member_removal_access_level",
"uri",
"visibility"
]
}
},
"style": "form",
"explode": false
}
],
"responses": {
"200": {
"description": "Returns the team records for all teams in the organization or workspace accessible to the authenticated user.",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"type": "array",
"items": {
"$ref": "#/components/schemas/TeamCompact"
}
},
"next_page": {
"$ref": "#/components/schemas/NextPage"
}
}
}
}
}
},
"400": {
"$ref": "#/components/responses/BadRequest"
},
"401": {
"$ref": "#/components/responses/Unauthorized"
},
"403": {
"$ref": "#/components/responses/Forbidden"
},
"404": {
"$ref": "#/components/responses/NotFound"
},
"500": {
"$ref": "#/components/responses/InternalServerError"
}
},
"security": [
{
"personalAccessToken": []
},
{
"oauth2": [
"teams:read"
]
}
],
"x-readme": {
"code-samples": [
{
"language": "java",
"install": "<dependency><groupId>com.asana</groupId><artifactId>asana</artifactId><version>1.0.0</version></dependency>",
"code": "import com.asana.Client;\n\nClient client = Client.accessToken(\"PERSONAL_ACCESS_TOKEN\");\n\nList<Team> result = client.teams.getTeamsForWorkspace(workspaceGid)\n .option(\"pretty\", true)\n .execute();"
},
{
"language": "node",
"install": "npm install asana",
"code": "const Asana = require('asana');\n\nlet client = new Asana.ApiClient();\nclient.authentications.token.accessToken = '<YOUR_ACCESS_TOKEN>';\n\nlet teamsApiInstance = new Asana.TeamsApi(client);\nlet workspace_gid = \"12345\"; // String | Globally unique identifier for the workspace or organization.\nlet opts = { \n 'limit': 50, \n 'offset': \"eyJ0eXAiOJiKV1iQLCJhbGciOiJIUzI1NiJ9\", \n 'opt_fields': \"custom_field_settings,custom_field_settings.custom_field,custom_field_settings.custom_field.asana_created_field,custom_field_settings.custom_field.created_by,custom_field_settings.custom_field.created_by.name,custom_field_settings.custom_field.currency_code,custom_field_settings.custom_field.custom_label,custom_field_settings.custom_field.custom_label_position,custom_field_settings.custom_field.date_value,custom_field_settings.custom_field.date_value.date,custom_field_settings.custom_field.date_value.date_time,custom_field_settings.custom_field.default_access_level,custom_field_settings.custom_field.description,custom_field_settings.custom_field.display_value,custom_field_settings.custom_field.enabled,custom_field_settings.custom_field.enum_options,custom_field_settings.custom_field.enum_options.color,custom_field_settings.custom_field.enum_options.enabled,custom_field_settings.custom_field.enum_options.name,custom_field_settings.custom_field.enum_value,custom_field_settings.custom_field.enum_value.color,custom_field_settings.custom_field.enum_value.enabled,custom_field_settings.custom_field.enum_value.name,custom_field_settings.custom_field.format,custom_field_settings.custom_field.has_notifications_enabled,custom_field_settings.custom_field.html_text_value,custom_field_settings.custom_field.id_prefix,custom_field_settings.custom_field.input_restrictions,custom_field_settings.custom_field.is_formula_field,custom_field_settings.custom_field.is_global_to_workspace,custom_field_settings.custom_field.is_value_read_only,custom_field_settings.custom_field.multi_enum_values,custom_field_settings.custom_field.multi_enum_values.color,custom_field_settings.custom_field.multi_enum_values.enabled,custom_field_settings.custom_field.multi_enum_values.name,custom_field_settings.custom_field.name,custom_field_settings.custom_field.number_value,custom_field_settings.custom_field.people_value,custom_field_settings.custom_field.people_value.name,custom_field_settings.custom_field.precision,custom_field_settings.custom_field.privacy_setting,custom_field_settings.custom_field.reference_value,custom_field_settings.custom_field.reference_value.name,custom_field_settings.custom_field.representation_type,custom_field_settings.custom_field.resource_subtype,custom_field_settings.custom_field.text_value,custom_field_settings.custom_field.type,custom_field_settings.is_important,custom_field_settings.parent,custom_field_settings.parent.name,custom_field_settings.parent.resource_subtype,custom_field_settings.project,custom_field_settings.project.name,custom_field_settings.project.resource_subtype,description,edit_team_name_or_description_access_level,edit_team_visibility_or_trash_team_access_level,endorsed,guest_invite_management_access_level,html_description,join_request_management_access_level,member_invite_management_access_level,name,offset,organization,organization.name,path,permalink_url,team_content_management_access_level,team_member_removal_access_level,uri,visibility\"\n};\nteamsApiInstance.getTeamsForWorkspace(workspace_gid, opts).then((result) => {\n console.log('API called successfully. Returned data: ' + JSON.stringify(result.data, null, 2));\n}, (error) => {\n console.error(error.response.body);\n});",
"name": "node-sdk-v3"
},
{
"language": "node",
"install": "npm install asana@1.0.5",
"code": "const asana = require('asana');\n\nconst client = asana.Client.create().useAccessToken('PERSONAL_ACCESS_TOKEN');\n\nclient.teams.getTeamsForWorkspace(workspaceGid, {param: \"value\", param: \"value\", opt_pretty: true})\n .then((result) => {\n console.log(result);\n });",
"name": "node-sdk-v1"
},
{
"language": "python",
"install": "pip install asana",
"code": "import asana\nfrom asana.rest import ApiException\nfrom pprint import pprint\n\nconfiguration = asana.Configuration()\nconfiguration.access_token = '<YOUR_ACCESS_TOKEN>'\napi_client = asana.ApiClient(configuration)\n\n# create an instance of the API class\nteams_api_instance = asana.TeamsApi(api_client)\nworkspace_gid = \"12345\" # str | Globally unique identifier for the workspace or organization.\nopts = {\n 'limit': 50, # int | Results per page. The number of objects to return per page. The value must be between 1 and 100.\n 'offset': \"eyJ0eXAiOJiKV1iQLCJhbGciOiJIUzI1NiJ9\", # str | 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.*\n 'opt_fields': \"custom_field_settings,custom_field_settings.custom_field,custom_field_settings.custom_field.asana_created_field,custom_field_settings.custom_field.created_by,custom_field_settings.custom_field.created_by.name,custom_field_settings.custom_field.currency_code,custom_field_settings.custom_field.custom_label,custom_field_settings.custom_field.custom_label_position,custom_field_settings.custom_field.date_value,custom_field_settings.custom_field.date_value.date,custom_field_settings.custom_field.date_value.date_time,custom_field_settings.custom_field.default_access_level,custom_field_settings.custom_field.description,custom_field_settings.custom_field.display_value,custom_field_settings.custom_field.enabled,custom_field_settings.custom_field.enum_options,custom_field_settings.custom_field.enum_options.color,custom_field_settings.custom_field.enum_options.enabled,custom_field_settings.custom_field.enum_options.name,custom_field_settings.custom_field.enum_value,custom_field_settings.custom_field.enum_value.color,custom_field_settings.custom_field.enum_value.enabled,custom_field_settings.custom_field.enum_value.name,custom_field_settings.custom_field.format,custom_field_settings.custom_field.has_notifications_enabled,custom_field_settings.custom_field.html_text_value,custom_field_settings.custom_field.id_prefix,custom_field_settings.custom_field.input_restrictions,custom_field_settings.custom_field.is_formula_field,custom_field_settings.custom_field.is_global_to_workspace,custom_field_settings.custom_field.is_value_read_only,custom_field_settings.custom_field.multi_enum_values,custom_field_settings.custom_field.multi_enum_values.color,custom_field_settings.custom_field.multi_enum_values.enabled,custom_field_settings.custom_field.multi_enum_values.name,custom_field_settings.custom_field.name,custom_field_settings.custom_field.number_value,custom_field_settings.custom_field.people_value,custom_field_settings.custom_field.people_value.name,custom_field_settings.custom_field.precision,custom_field_settings.custom_field.privacy_setting,custom_field_settings.custom_field.reference_value,custom_field_settings.custom_field.reference_value.name,custom_field_settings.custom_field.representation_type,custom_field_settings.custom_field.resource_subtype,custom_field_settings.custom_field.text_value,custom_field_settings.custom_field.type,custom_field_settings.is_important,custom_field_settings.parent,custom_field_settings.parent.name,custom_field_settings.parent.resource_subtype,custom_field_settings.project,custom_field_settings.project.name,custom_field_settings.project.resource_subtype,description,edit_team_name_or_description_access_level,edit_team_visibility_or_trash_team_access_level,endorsed,guest_invite_management_access_level,html_description,join_request_management_access_level,member_invite_management_access_level,name,offset,organization,organization.name,path,permalink_url,team_content_management_access_level,team_member_removal_access_level,uri,visibility\", # list[str] | 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.\n}\n\ntry:\n # Get teams in a workspace\n api_response = teams_api_instance.get_teams_for_workspace(workspace_gid, opts)\n for data in api_response:\n pprint(data)\nexcept ApiException as e:\n print(\"Exception when calling TeamsApi->get_teams_for_workspace: %s\\n\" % e)",
"name": "python-sdk-v5"
},
{
"language": "python",
"install": "pip install asana==3.2.3",
"code": "import asana\n\nclient = asana.Client.access_token('PERSONAL_ACCESS_TOKEN')\n\nresult = client.teams.get_teams_for_workspace(workspace_gid, {'param': 'value', 'param': 'value'}, opt_pretty=True)",
"name": "python-sdk-v3"
},
{
"language": "php",
"install": "composer require asana/asana",
"code": "<?php\nrequire 'vendor/autoload.php';\n\n$client = Asana\\Client::accessToken('PERSONAL_ACCESS_TOKEN');\n\n$result = $client->teams->getTeamsForWorkspace($workspace_gid, array('param' => 'value', 'param' => 'value'), array('opt_pretty' => 'true'))"
},
{
"language": "ruby",
"install": "gem install asana",
"code": "require 'asana'\n\nclient = Asana::Client.new do |c|\n c.authentication :access_token, 'PERSONAL_ACCESS_TOKEN'\nend\n\nresult = client.teams.get_teams_for_workspace(workspace_gid: 'workspace_gid', param: \"value\", param: \"value\", options: {pretty: true})"
}
]
},
"x-purple-suite-runtime": "modeled-core",
"x-purple-suite-supported-query": [
"opt_pretty",
"limit",
"offset",
"opt_fields"
],
"x-purple-suite-supported-response-fields": [
"gid",
"resource_type",
"resource_subtype",
"name",
"notes",
"completed",
"completed_at",
"created_at",
"modified_at",
"assignee",
"assignee_status",
"workspace",
"projects",
"memberships",
"parent",
"due_on",
"start_on",
"tags",
"dependencies",
"num_subtasks",
"archived",
"public",
"color",
"default_view",
"team",
"project",
"section",
"text",
"created_by",
"target",
"type",
"email",
"photo",
"is_organization"
]
}
GET /api/1.0/users/{user_gid}/teams
Get teams for a user
<b>Required scope: </b><code>teams:read</code>
Returns the compact records for all teams to which the given user is assigned.
This operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.
Authentication
[
{
"personalAccessToken": []
},
{
"oauth2": [
"teams:read"
]
}
]
Path-level parameters and metadata
{
"parameters": [
{
"$ref": "#/components/parameters/user_path_gid"
},
{
"$ref": "#/components/parameters/pretty"
},
{
"$ref": "#/components/parameters/limit"
},
{
"$ref": "#/components/parameters/offset"
},
{
"name": "organization",
"in": "query",
"description": "The workspace or organization to filter teams on.",
"required": true,
"schema": {
"type": "string"
},
"example": "1331"
}
]
}
Request, responses and operation details
{
"summary": "Get teams for a user",
"description": "<b>Required scope: </b><code>teams:read</code>\n\nReturns the compact records for all teams to which the given user is assigned.\n\nThis operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.",
"tags": [
"Teams"
],
"operationId": "getTeamsForUser",
"parameters": [
{
"name": "opt_fields",
"in": "query",
"description": "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. Properties can include nested fields. To learn more, see the [input/output options guide](/docs/inputoutput-options#selecting-nested-fields).",
"required": false,
"example": [
"custom_field_settings",
"custom_field_settings.custom_field",
"custom_field_settings.custom_field.asana_created_field",
"custom_field_settings.custom_field.created_by",
"custom_field_settings.custom_field.created_by.name",
"custom_field_settings.custom_field.currency_code",
"custom_field_settings.custom_field.custom_label",
"custom_field_settings.custom_field.custom_label_position",
"custom_field_settings.custom_field.date_value",
"custom_field_settings.custom_field.date_value.date",
"custom_field_settings.custom_field.date_value.date_time",
"custom_field_settings.custom_field.default_access_level",
"custom_field_settings.custom_field.description",
"custom_field_settings.custom_field.display_value",
"custom_field_settings.custom_field.enabled",
"custom_field_settings.custom_field.enum_options",
"custom_field_settings.custom_field.enum_options.color",
"custom_field_settings.custom_field.enum_options.enabled",
"custom_field_settings.custom_field.enum_options.name",
"custom_field_settings.custom_field.enum_value",
"custom_field_settings.custom_field.enum_value.color",
"custom_field_settings.custom_field.enum_value.enabled",
"custom_field_settings.custom_field.enum_value.name",
"custom_field_settings.custom_field.format",
"custom_field_settings.custom_field.has_notifications_enabled",
"custom_field_settings.custom_field.html_text_value",
"custom_field_settings.custom_field.id_prefix",
"custom_field_settings.custom_field.input_restrictions",
"custom_field_settings.custom_field.is_formula_field",
"custom_field_settings.custom_field.is_global_to_workspace",
"custom_field_settings.custom_field.is_value_read_only",
"custom_field_settings.custom_field.multi_enum_values",
"custom_field_settings.custom_field.multi_enum_values.color",
"custom_field_settings.custom_field.multi_enum_values.enabled",
"custom_field_settings.custom_field.multi_enum_values.name",
"custom_field_settings.custom_field.name",
"custom_field_settings.custom_field.number_value",
"custom_field_settings.custom_field.people_value",
"custom_field_settings.custom_field.people_value.name",
"custom_field_settings.custom_field.precision",
"custom_field_settings.custom_field.privacy_setting",
"custom_field_settings.custom_field.reference_value",
"custom_field_settings.custom_field.reference_value.name",
"custom_field_settings.custom_field.representation_type",
"custom_field_settings.custom_field.resource_subtype",
"custom_field_settings.custom_field.text_value",
"custom_field_settings.custom_field.type",
"custom_field_settings.is_important",
"custom_field_settings.parent",
"custom_field_settings.parent.name",
"custom_field_settings.parent.resource_subtype",
"custom_field_settings.project",
"custom_field_settings.project.name",
"custom_field_settings.project.resource_subtype",
"description",
"edit_team_name_or_description_access_level",
"edit_team_visibility_or_trash_team_access_level",
"endorsed",
"guest_invite_management_access_level",
"html_description",
"join_request_management_access_level",
"member_invite_management_access_level",
"name",
"offset",
"organization",
"organization.name",
"path",
"permalink_url",
"team_content_management_access_level",
"team_member_removal_access_level",
"uri",
"visibility"
],
"schema": {
"type": "array",
"items": {
"type": "string",
"enum": [
"custom_field_settings",
"custom_field_settings.custom_field",
"custom_field_settings.custom_field.asana_created_field",
"custom_field_settings.custom_field.created_by",
"custom_field_settings.custom_field.created_by.name",
"custom_field_settings.custom_field.currency_code",
"custom_field_settings.custom_field.custom_label",
"custom_field_settings.custom_field.custom_label_position",
"custom_field_settings.custom_field.date_value",
"custom_field_settings.custom_field.date_value.date",
"custom_field_settings.custom_field.date_value.date_time",
"custom_field_settings.custom_field.default_access_level",
"custom_field_settings.custom_field.description",
"custom_field_settings.custom_field.display_value",
"custom_field_settings.custom_field.enabled",
"custom_field_settings.custom_field.enum_options",
"custom_field_settings.custom_field.enum_options.color",
"custom_field_settings.custom_field.enum_options.enabled",
"custom_field_settings.custom_field.enum_options.name",
"custom_field_settings.custom_field.enum_value",
"custom_field_settings.custom_field.enum_value.color",
"custom_field_settings.custom_field.enum_value.enabled",
"custom_field_settings.custom_field.enum_value.name",
"custom_field_settings.custom_field.format",
"custom_field_settings.custom_field.has_notifications_enabled",
"custom_field_settings.custom_field.html_text_value",
"custom_field_settings.custom_field.id_prefix",
"custom_field_settings.custom_field.input_restrictions",
"custom_field_settings.custom_field.is_formula_field",
"custom_field_settings.custom_field.is_global_to_workspace",
"custom_field_settings.custom_field.is_value_read_only",
"custom_field_settings.custom_field.multi_enum_values",
"custom_field_settings.custom_field.multi_enum_values.color",
"custom_field_settings.custom_field.multi_enum_values.enabled",
"custom_field_settings.custom_field.multi_enum_values.name",
"custom_field_settings.custom_field.name",
"custom_field_settings.custom_field.number_value",
"custom_field_settings.custom_field.people_value",
"custom_field_settings.custom_field.people_value.name",
"custom_field_settings.custom_field.precision",
"custom_field_settings.custom_field.privacy_setting",
"custom_field_settings.custom_field.reference_value",
"custom_field_settings.custom_field.reference_value.name",
"custom_field_settings.custom_field.representation_type",
"custom_field_settings.custom_field.resource_subtype",
"custom_field_settings.custom_field.text_value",
"custom_field_settings.custom_field.type",
"custom_field_settings.is_important",
"custom_field_settings.parent",
"custom_field_settings.parent.name",
"custom_field_settings.parent.resource_subtype",
"custom_field_settings.project",
"custom_field_settings.project.name",
"custom_field_settings.project.resource_subtype",
"description",
"edit_team_name_or_description_access_level",
"edit_team_visibility_or_trash_team_access_level",
"endorsed",
"guest_invite_management_access_level",
"html_description",
"join_request_management_access_level",
"member_invite_management_access_level",
"name",
"offset",
"organization",
"organization.name",
"path",
"permalink_url",
"team_content_management_access_level",
"team_member_removal_access_level",
"uri",
"visibility"
]
}
},
"style": "form",
"explode": false
}
],
"responses": {
"200": {
"description": "Returns the team records for all teams in the organization or workspace to which the given user is assigned.",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"type": "array",
"items": {
"$ref": "#/components/schemas/TeamCompact"
}
},
"next_page": {
"$ref": "#/components/schemas/NextPage"
}
}
}
}
}
},
"400": {
"$ref": "#/components/responses/BadRequest"
},
"401": {
"$ref": "#/components/responses/Unauthorized"
},
"403": {
"$ref": "#/components/responses/Forbidden"
},
"404": {
"$ref": "#/components/responses/NotFound"
},
"500": {
"$ref": "#/components/responses/InternalServerError"
}
},
"security": [
{
"personalAccessToken": []
},
{
"oauth2": [
"teams:read"
]
}
],
"x-readme": {
"code-samples": [
{
"language": "java",
"install": "<dependency><groupId>com.asana</groupId><artifactId>asana</artifactId><version>1.0.0</version></dependency>",
"code": "import com.asana.Client;\n\nClient client = Client.accessToken(\"PERSONAL_ACCESS_TOKEN\");\n\nList<Team> result = client.teams.getTeamsForUser(userGid, organization)\n .option(\"pretty\", true)\n .execute();"
},
{
"language": "node",
"install": "npm install asana",
"code": "const Asana = require('asana');\n\nlet client = new Asana.ApiClient();\nclient.authentications.token.accessToken = '<YOUR_ACCESS_TOKEN>';\n\nlet teamsApiInstance = new Asana.TeamsApi(client);\nlet user_gid = \"me\"; // String | A string identifying a user. This can either be the string \\\"me\\\", an email, or the gid of a user.\nlet organization = \"1331\"; // String | The workspace or organization to filter teams on.\nlet opts = { \n 'limit': 50, \n 'offset': \"eyJ0eXAiOJiKV1iQLCJhbGciOiJIUzI1NiJ9\", \n 'opt_fields': \"custom_field_settings,custom_field_settings.custom_field,custom_field_settings.custom_field.asana_created_field,custom_field_settings.custom_field.created_by,custom_field_settings.custom_field.created_by.name,custom_field_settings.custom_field.currency_code,custom_field_settings.custom_field.custom_label,custom_field_settings.custom_field.custom_label_position,custom_field_settings.custom_field.date_value,custom_field_settings.custom_field.date_value.date,custom_field_settings.custom_field.date_value.date_time,custom_field_settings.custom_field.default_access_level,custom_field_settings.custom_field.description,custom_field_settings.custom_field.display_value,custom_field_settings.custom_field.enabled,custom_field_settings.custom_field.enum_options,custom_field_settings.custom_field.enum_options.color,custom_field_settings.custom_field.enum_options.enabled,custom_field_settings.custom_field.enum_options.name,custom_field_settings.custom_field.enum_value,custom_field_settings.custom_field.enum_value.color,custom_field_settings.custom_field.enum_value.enabled,custom_field_settings.custom_field.enum_value.name,custom_field_settings.custom_field.format,custom_field_settings.custom_field.has_notifications_enabled,custom_field_settings.custom_field.html_text_value,custom_field_settings.custom_field.id_prefix,custom_field_settings.custom_field.input_restrictions,custom_field_settings.custom_field.is_formula_field,custom_field_settings.custom_field.is_global_to_workspace,custom_field_settings.custom_field.is_value_read_only,custom_field_settings.custom_field.multi_enum_values,custom_field_settings.custom_field.multi_enum_values.color,custom_field_settings.custom_field.multi_enum_values.enabled,custom_field_settings.custom_field.multi_enum_values.name,custom_field_settings.custom_field.name,custom_field_settings.custom_field.number_value,custom_field_settings.custom_field.people_value,custom_field_settings.custom_field.people_value.name,custom_field_settings.custom_field.precision,custom_field_settings.custom_field.privacy_setting,custom_field_settings.custom_field.reference_value,custom_field_settings.custom_field.reference_value.name,custom_field_settings.custom_field.representation_type,custom_field_settings.custom_field.resource_subtype,custom_field_settings.custom_field.text_value,custom_field_settings.custom_field.type,custom_field_settings.is_important,custom_field_settings.parent,custom_field_settings.parent.name,custom_field_settings.parent.resource_subtype,custom_field_settings.project,custom_field_settings.project.name,custom_field_settings.project.resource_subtype,description,edit_team_name_or_description_access_level,edit_team_visibility_or_trash_team_access_level,endorsed,guest_invite_management_access_level,html_description,join_request_management_access_level,member_invite_management_access_level,name,offset,organization,organization.name,path,permalink_url,team_content_management_access_level,team_member_removal_access_level,uri,visibility\"\n};\nteamsApiInstance.getTeamsForUser(user_gid, organization, opts).then((result) => {\n console.log('API called successfully. Returned data: ' + JSON.stringify(result.data, null, 2));\n}, (error) => {\n console.error(error.response.body);\n});",
"name": "node-sdk-v3"
},
{
"language": "node",
"install": "npm install asana@1.0.5",
"code": "const asana = require('asana');\n\nconst client = asana.Client.create().useAccessToken('PERSONAL_ACCESS_TOKEN');\n\nclient.teams.getTeamsForUser(userGid, {param: \"value\", param: \"value\", opt_pretty: true})\n .then((result) => {\n console.log(result);\n });",
"name": "node-sdk-v1"
},
{
"language": "python",
"install": "pip install asana",
"code": "import asana\nfrom asana.rest import ApiException\nfrom pprint import pprint\n\nconfiguration = asana.Configuration()\nconfiguration.access_token = '<YOUR_ACCESS_TOKEN>'\napi_client = asana.ApiClient(configuration)\n\n# create an instance of the API class\nteams_api_instance = asana.TeamsApi(api_client)\nuser_gid = \"me\" # str | A string identifying a user. This can either be the string \\\"me\\\", an email, or the gid of a user.\norganization = \"1331\" # str | The workspace or organization to filter teams on.\nopts = {\n 'limit': 50, # int | Results per page. The number of objects to return per page. The value must be between 1 and 100.\n 'offset': \"eyJ0eXAiOJiKV1iQLCJhbGciOiJIUzI1NiJ9\", # str | 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.*\n 'opt_fields': \"custom_field_settings,custom_field_settings.custom_field,custom_field_settings.custom_field.asana_created_field,custom_field_settings.custom_field.created_by,custom_field_settings.custom_field.created_by.name,custom_field_settings.custom_field.currency_code,custom_field_settings.custom_field.custom_label,custom_field_settings.custom_field.custom_label_position,custom_field_settings.custom_field.date_value,custom_field_settings.custom_field.date_value.date,custom_field_settings.custom_field.date_value.date_time,custom_field_settings.custom_field.default_access_level,custom_field_settings.custom_field.description,custom_field_settings.custom_field.display_value,custom_field_settings.custom_field.enabled,custom_field_settings.custom_field.enum_options,custom_field_settings.custom_field.enum_options.color,custom_field_settings.custom_field.enum_options.enabled,custom_field_settings.custom_field.enum_options.name,custom_field_settings.custom_field.enum_value,custom_field_settings.custom_field.enum_value.color,custom_field_settings.custom_field.enum_value.enabled,custom_field_settings.custom_field.enum_value.name,custom_field_settings.custom_field.format,custom_field_settings.custom_field.has_notifications_enabled,custom_field_settings.custom_field.html_text_value,custom_field_settings.custom_field.id_prefix,custom_field_settings.custom_field.input_restrictions,custom_field_settings.custom_field.is_formula_field,custom_field_settings.custom_field.is_global_to_workspace,custom_field_settings.custom_field.is_value_read_only,custom_field_settings.custom_field.multi_enum_values,custom_field_settings.custom_field.multi_enum_values.color,custom_field_settings.custom_field.multi_enum_values.enabled,custom_field_settings.custom_field.multi_enum_values.name,custom_field_settings.custom_field.name,custom_field_settings.custom_field.number_value,custom_field_settings.custom_field.people_value,custom_field_settings.custom_field.people_value.name,custom_field_settings.custom_field.precision,custom_field_settings.custom_field.privacy_setting,custom_field_settings.custom_field.reference_value,custom_field_settings.custom_field.reference_value.name,custom_field_settings.custom_field.representation_type,custom_field_settings.custom_field.resource_subtype,custom_field_settings.custom_field.text_value,custom_field_settings.custom_field.type,custom_field_settings.is_important,custom_field_settings.parent,custom_field_settings.parent.name,custom_field_settings.parent.resource_subtype,custom_field_settings.project,custom_field_settings.project.name,custom_field_settings.project.resource_subtype,description,edit_team_name_or_description_access_level,edit_team_visibility_or_trash_team_access_level,endorsed,guest_invite_management_access_level,html_description,join_request_management_access_level,member_invite_management_access_level,name,offset,organization,organization.name,path,permalink_url,team_content_management_access_level,team_member_removal_access_level,uri,visibility\", # list[str] | 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.\n}\n\ntry:\n # Get teams for a user\n api_response = teams_api_instance.get_teams_for_user(user_gid, organization, opts)\n for data in api_response:\n pprint(data)\nexcept ApiException as e:\n print(\"Exception when calling TeamsApi->get_teams_for_user: %s\\n\" % e)",
"name": "python-sdk-v5"
},
{
"language": "python",
"install": "pip install asana==3.2.3",
"code": "import asana\n\nclient = asana.Client.access_token('PERSONAL_ACCESS_TOKEN')\n\nresult = client.teams.get_teams_for_user(user_gid, {'param': 'value', 'param': 'value'}, opt_pretty=True)",
"name": "python-sdk-v3"
},
{
"language": "php",
"install": "composer require asana/asana",
"code": "<?php\nrequire 'vendor/autoload.php';\n\n$client = Asana\\Client::accessToken('PERSONAL_ACCESS_TOKEN');\n\n$result = $client->teams->getTeamsForUser($user_gid, array('param' => 'value', 'param' => 'value'), array('opt_pretty' => 'true'))"
},
{
"language": "ruby",
"install": "gem install asana",
"code": "require 'asana'\n\nclient = Asana::Client.new do |c|\n c.authentication :access_token, 'PERSONAL_ACCESS_TOKEN'\nend\n\nresult = client.teams.get_teams_for_user(user_gid: 'user_gid', organization: ''organization_example'', param: \"value\", param: \"value\", options: {pretty: true})"
}
]
},
"x-purple-suite-runtime": "unavailable"
}
POST /api/1.0/teams/{team_gid}/addUser
Add a user to a team
The user making this call must be a member of the team in order to add others. The user being added must exist in the same organization as the team.
Returns the complete team membership record for the newly added user.
This operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.
Authentication
[
{
"personalAccessToken": []
},
{
"oauth2": []
}
]
Path-level parameters and metadata
{
"parameters": [
{
"$ref": "#/components/parameters/team_path_gid"
},
{
"$ref": "#/components/parameters/pretty"
}
]
}
Request, responses and operation details
{
"summary": "Add a user to a team",
"description": "The user making this call must be a member of the team in order to add others. The user being added must exist in the same organization as the team.\n\nReturns the complete team membership record for the newly added user.\n\nThis operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.",
"tags": [
"Teams"
],
"operationId": "addUserForTeam",
"parameters": [
{
"name": "opt_fields",
"in": "query",
"description": "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. Properties can include nested fields. To learn more, see the [input/output options guide](/docs/inputoutput-options#selecting-nested-fields).",
"required": false,
"example": [
"is_admin",
"is_guest",
"is_limited_access",
"team",
"team.name",
"user",
"user.name"
],
"schema": {
"type": "array",
"items": {
"type": "string",
"enum": [
"is_admin",
"is_guest",
"is_limited_access",
"team",
"team.name",
"user",
"user.name"
]
}
},
"style": "form",
"explode": false
}
],
"requestBody": {
"description": "The user to add to the team.",
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"$ref": "#/components/schemas/TeamAddUserRequest"
}
}
}
}
}
},
"responses": {
"200": {
"description": "Successfully added user to the team.",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"$ref": "#/components/schemas/TeamMembershipResponse"
}
}
}
}
}
},
"400": {
"$ref": "#/components/responses/BadRequest"
},
"401": {
"$ref": "#/components/responses/Unauthorized"
},
"403": {
"$ref": "#/components/responses/Forbidden"
},
"404": {
"$ref": "#/components/responses/NotFound"
},
"500": {
"$ref": "#/components/responses/InternalServerError"
}
},
"security": [
{
"personalAccessToken": []
},
{
"oauth2": []
}
],
"x-readme": {
"code-samples": [
{
"language": "java",
"install": "<dependency><groupId>com.asana</groupId><artifactId>asana</artifactId><version>1.0.0</version></dependency>",
"code": "import com.asana.Client;\n\nClient client = Client.accessToken(\"PERSONAL_ACCESS_TOKEN\");\n\nJsonElement result = client.teams.addUserForTeam(teamGid)\n .data(\"field\", \"value\")\n .data(\"field\", \"value\")\n .option(\"pretty\", true)\n .execute();"
},
{
"language": "node",
"install": "npm install asana",
"code": "const Asana = require('asana');\n\nlet client = new Asana.ApiClient();\nclient.authentications.token.accessToken = '<YOUR_ACCESS_TOKEN>';\n\nlet teamsApiInstance = new Asana.TeamsApi(client);\nlet body = {\"data\": {\"<PARAM_1>\": \"<VALUE_1>\", \"<PARAM_2>\": \"<VALUE_2>\",}}; // Object | The user to add to the team.\nlet team_gid = \"159874\"; // String | Globally unique identifier for the team.\nlet opts = { \n 'opt_fields': \"is_admin,is_guest,is_limited_access,team,team.name,user,user.name\"\n};\nteamsApiInstance.addUserForTeam(body, team_gid, opts).then((result) => {\n console.log('API called successfully. Returned data: ' + JSON.stringify(result.data, null, 2));\n}, (error) => {\n console.error(error.response.body);\n});",
"name": "node-sdk-v3"
},
{
"language": "node",
"install": "npm install asana@1.0.5",
"code": "const asana = require('asana');\n\nconst client = asana.Client.create().useAccessToken('PERSONAL_ACCESS_TOKEN');\n\nclient.teams.addUserForTeam(teamGid, {field: \"value\", field: \"value\", pretty: true})\n .then((result) => {\n console.log(result);\n });",
"name": "node-sdk-v1"
},
{
"language": "python",
"install": "pip install asana",
"code": "import asana\nfrom asana.rest import ApiException\nfrom pprint import pprint\n\nconfiguration = asana.Configuration()\nconfiguration.access_token = '<YOUR_ACCESS_TOKEN>'\napi_client = asana.ApiClient(configuration)\n\n# create an instance of the API class\nteams_api_instance = asana.TeamsApi(api_client)\nbody = {\"data\": {\"<PARAM_1>\": \"<VALUE_1>\", \"<PARAM_2>\": \"<VALUE_2>\",}} # dict | The user to add to the team.\nteam_gid = \"159874\" # str | Globally unique identifier for the team.\nopts = {\n 'opt_fields': \"is_admin,is_guest,is_limited_access,team,team.name,user,user.name\", # list[str] | 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.\n}\n\ntry:\n # Add a user to a team\n api_response = teams_api_instance.add_user_for_team(body, team_gid, opts)\n pprint(api_response)\nexcept ApiException as e:\n print(\"Exception when calling TeamsApi->add_user_for_team: %s\\n\" % e)",
"name": "python-sdk-v5"
},
{
"language": "python",
"install": "pip install asana==3.2.3",
"code": "import asana\n\nclient = asana.Client.access_token('PERSONAL_ACCESS_TOKEN')\n\nresult = client.teams.add_user_for_team(team_gid, {'field': 'value', 'field': 'value'}, opt_pretty=True)",
"name": "python-sdk-v3"
},
{
"language": "php",
"install": "composer require asana/asana",
"code": "<?php\nrequire 'vendor/autoload.php';\n\n$client = Asana\\Client::accessToken('PERSONAL_ACCESS_TOKEN');\n\n$result = $client->teams->addUserForTeam($team_gid, array('field' => 'value', 'field' => 'value'), array('opt_pretty' => 'true'))"
},
{
"language": "ruby",
"install": "gem install asana",
"code": "require 'asana'\n\nclient = Asana::Client.new do |c|\n c.authentication :access_token, 'PERSONAL_ACCESS_TOKEN'\nend\n\nresult = client.teams.add_user_for_team(team_gid: 'team_gid', field: \"value\", field: \"value\", options: {pretty: true})"
}
]
},
"x-purple-suite-runtime": "unavailable"
}
POST /api/1.0/teams/{team_gid}/removeUser
Remove a user from a team
The user making this call must be a member of the team in order to remove themselves or others.
This operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.
Authentication
[
{
"personalAccessToken": []
},
{
"oauth2": []
}
]
Path-level parameters and metadata
{
"parameters": [
{
"$ref": "#/components/parameters/team_path_gid"
},
{
"$ref": "#/components/parameters/pretty"
}
]
}
Request, responses and operation details
{
"summary": "Remove a user from a team",
"description": "The user making this call must be a member of the team in order to remove themselves or others.\n\nThis operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.",
"tags": [
"Teams"
],
"operationId": "removeUserForTeam",
"requestBody": {
"description": "The user to remove from the team.",
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"$ref": "#/components/schemas/TeamRemoveUserRequest"
}
}
}
}
}
},
"responses": {
"200": {
"description": "Returns an empty data record",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"$ref": "#/components/schemas/EmptyResponse"
}
}
}
}
}
},
"400": {
"$ref": "#/components/responses/BadRequest"
},
"401": {
"$ref": "#/components/responses/Unauthorized"
},
"403": {
"$ref": "#/components/responses/Forbidden"
},
"404": {
"$ref": "#/components/responses/NotFound"
},
"500": {
"$ref": "#/components/responses/InternalServerError"
}
},
"security": [
{
"personalAccessToken": []
},
{
"oauth2": []
}
],
"x-readme": {
"code-samples": [
{
"language": "java",
"install": "<dependency><groupId>com.asana</groupId><artifactId>asana</artifactId><version>1.0.0</version></dependency>",
"code": "import com.asana.Client;\n\nClient client = Client.accessToken(\"PERSONAL_ACCESS_TOKEN\");\n\nJsonElement result = client.teams.removeUserForTeam(teamGid)\n .data(\"field\", \"value\")\n .data(\"field\", \"value\")\n .option(\"pretty\", true)\n .execute();"
},
{
"language": "node",
"install": "npm install asana",
"code": "const Asana = require('asana');\n\nlet client = new Asana.ApiClient();\nclient.authentications.token.accessToken = '<YOUR_ACCESS_TOKEN>';\n\nlet teamsApiInstance = new Asana.TeamsApi(client);\nlet body = {\"data\": {\"<PARAM_1>\": \"<VALUE_1>\", \"<PARAM_2>\": \"<VALUE_2>\",}}; // Object | The user to remove from the team.\nlet team_gid = \"159874\"; // String | Globally unique identifier for the team.\n\nteamsApiInstance.removeUserForTeam(body, team_gid).then((result) => {\n console.log('API called successfully. Returned data: ' + JSON.stringify(result.data, null, 2));\n}, (error) => {\n console.error(error.response.body);\n});",
"name": "node-sdk-v3"
},
{
"language": "node",
"install": "npm install asana@1.0.5",
"code": "const asana = require('asana');\n\nconst client = asana.Client.create().useAccessToken('PERSONAL_ACCESS_TOKEN');\n\nclient.teams.removeUserForTeam(teamGid, {field: \"value\", field: \"value\", pretty: true})\n .then((result) => {\n console.log(result);\n });",
"name": "node-sdk-v1"
},
{
"language": "python",
"install": "pip install asana",
"code": "import asana\nfrom asana.rest import ApiException\nfrom pprint import pprint\n\nconfiguration = asana.Configuration()\nconfiguration.access_token = '<YOUR_ACCESS_TOKEN>'\napi_client = asana.ApiClient(configuration)\n\n# create an instance of the API class\nteams_api_instance = asana.TeamsApi(api_client)\nbody = {\"data\": {\"<PARAM_1>\": \"<VALUE_1>\", \"<PARAM_2>\": \"<VALUE_2>\",}} # dict | The user to remove from the team.\nteam_gid = \"159874\" # str | Globally unique identifier for the team.\n\n\ntry:\n # Remove a user from a team\n api_response = teams_api_instance.remove_user_for_team(body, team_gid)\n pprint(api_response)\nexcept ApiException as e:\n print(\"Exception when calling TeamsApi->remove_user_for_team: %s\\n\" % e)",
"name": "python-sdk-v5"
},
{
"language": "python",
"install": "pip install asana==3.2.3",
"code": "import asana\n\nclient = asana.Client.access_token('PERSONAL_ACCESS_TOKEN')\n\nresult = client.teams.remove_user_for_team(team_gid, {'field': 'value', 'field': 'value'}, opt_pretty=True)",
"name": "python-sdk-v3"
},
{
"language": "php",
"install": "composer require asana/asana",
"code": "<?php\nrequire 'vendor/autoload.php';\n\n$client = Asana\\Client::accessToken('PERSONAL_ACCESS_TOKEN');\n\n$result = $client->teams->removeUserForTeam($team_gid, array('field' => 'value', 'field' => 'value'), array('opt_pretty' => 'true'))"
},
{
"language": "ruby",
"install": "gem install asana",
"code": "require 'asana'\n\nclient = Asana::Client.new do |c|\n c.authentication :access_token, 'PERSONAL_ACCESS_TOKEN'\nend\n\nresult = client.teams.remove_user_for_team(team_gid: 'team_gid', field: \"value\", field: \"value\", options: {pretty: true})"
}
]
},
"x-purple-suite-runtime": "unavailable"
}
GET /api/1.0/time_periods/{time_period_gid}
Get a time period
Returns the full record for a single time period.
This operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.
Authentication
[
{
"personalAccessToken": []
},
{
"oauth2": []
}
]
Path-level parameters and metadata
{
"parameters": [
{
"$ref": "#/components/parameters/time_period_path_gid"
},
{
"$ref": "#/components/parameters/pretty"
}
]
}
Request, responses and operation details
{
"summary": "Get a time period",
"description": "Returns the full record for a single time period.\n\nThis operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.",
"tags": [
"Time periods"
],
"operationId": "getTimePeriod",
"parameters": [
{
"name": "opt_fields",
"in": "query",
"description": "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. Properties can include nested fields. To learn more, see the [input/output options guide](/docs/inputoutput-options#selecting-nested-fields).",
"required": false,
"example": [
"display_name",
"end_on",
"parent",
"parent.display_name",
"parent.end_on",
"parent.period",
"parent.start_on",
"period",
"start_on"
],
"schema": {
"type": "array",
"items": {
"type": "string",
"enum": [
"display_name",
"end_on",
"parent",
"parent.display_name",
"parent.end_on",
"parent.period",
"parent.start_on",
"period",
"start_on"
]
}
},
"style": "form",
"explode": false
}
],
"responses": {
"200": {
"description": "Successfully retrieved the record for a single time period.",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"$ref": "#/components/schemas/TimePeriodResponse"
}
}
}
}
}
},
"400": {
"$ref": "#/components/responses/BadRequest"
},
"401": {
"$ref": "#/components/responses/Unauthorized"
},
"403": {
"$ref": "#/components/responses/Forbidden"
},
"404": {
"$ref": "#/components/responses/NotFound"
},
"500": {
"$ref": "#/components/responses/InternalServerError"
}
},
"security": [
{
"personalAccessToken": []
},
{
"oauth2": []
}
],
"x-readme": {
"code-samples": [
{
"language": "java",
"install": "<dependency><groupId>com.asana</groupId><artifactId>asana</artifactId><version>1.0.0</version></dependency>",
"code": "import com.asana.Client;\n\nClient client = Client.accessToken(\"PERSONAL_ACCESS_TOKEN\");\n\nJsonElement result = client.timeperiods.getTimePeriod(timePeriodGid)\n .option(\"pretty\", true)\n .execute();"
},
{
"language": "node",
"install": "npm install asana",
"code": "const Asana = require('asana');\n\nlet client = new Asana.ApiClient();\nclient.authentications.token.accessToken = '<YOUR_ACCESS_TOKEN>';\n\nlet timePeriodsApiInstance = new Asana.TimePeriodsApi(client);\nlet time_period_gid = \"917392\"; // String | Globally unique identifier for the time period.\nlet opts = { \n 'opt_fields': \"display_name,end_on,parent,parent.display_name,parent.end_on,parent.period,parent.start_on,period,start_on\"\n};\ntimePeriodsApiInstance.getTimePeriod(time_period_gid, opts).then((result) => {\n console.log('API called successfully. Returned data: ' + JSON.stringify(result.data, null, 2));\n}, (error) => {\n console.error(error.response.body);\n});",
"name": "node-sdk-v3"
},
{
"language": "node",
"install": "npm install asana@1.0.5",
"code": "const asana = require('asana');\n\nconst client = asana.Client.create().useAccessToken('PERSONAL_ACCESS_TOKEN');\n\nclient.timeperiods.getTimePeriod(timePeriodGid, {param: \"value\", param: \"value\", opt_pretty: true})\n .then((result) => {\n console.log(result);\n });",
"name": "node-sdk-v1"
},
{
"language": "python",
"install": "pip install asana",
"code": "import asana\nfrom asana.rest import ApiException\nfrom pprint import pprint\n\nconfiguration = asana.Configuration()\nconfiguration.access_token = '<YOUR_ACCESS_TOKEN>'\napi_client = asana.ApiClient(configuration)\n\n# create an instance of the API class\ntime_periods_api_instance = asana.TimePeriodsApi(api_client)\ntime_period_gid = \"917392\" # str | Globally unique identifier for the time period.\nopts = {\n 'opt_fields': \"display_name,end_on,parent,parent.display_name,parent.end_on,parent.period,parent.start_on,period,start_on\", # list[str] | 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.\n}\n\ntry:\n # Get a time period\n api_response = time_periods_api_instance.get_time_period(time_period_gid, opts)\n pprint(api_response)\nexcept ApiException as e:\n print(\"Exception when calling TimePeriodsApi->get_time_period: %s\\n\" % e)",
"name": "python-sdk-v5"
},
{
"language": "python",
"install": "pip install asana==3.2.3",
"code": "import asana\n\nclient = asana.Client.access_token('PERSONAL_ACCESS_TOKEN')\n\nresult = client.time_periods.get_time_period(time_period_gid, {'param': 'value', 'param': 'value'}, opt_pretty=True)",
"name": "python-sdk-v3"
},
{
"language": "php",
"install": "composer require asana/asana",
"code": "<?php\nrequire 'vendor/autoload.php';\n\n$client = Asana\\Client::accessToken('PERSONAL_ACCESS_TOKEN');\n\n$result = $client->timeperiods->getTimePeriod($time_period_gid, array('param' => 'value', 'param' => 'value'), array('opt_pretty' => 'true'))"
},
{
"language": "ruby",
"install": "gem install asana",
"code": "require 'asana'\n\nclient = Asana::Client.new do |c|\n c.authentication :access_token, 'PERSONAL_ACCESS_TOKEN'\nend\n\nresult = client.time_periods.get_time_period(time_period_gid: 'time_period_gid', param: \"value\", param: \"value\", options: {pretty: true})"
}
]
},
"x-purple-suite-runtime": "unavailable"
}
GET /api/1.0/time_periods
Get time periods
Returns compact time period records.
This operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.
Authentication
[
{
"personalAccessToken": []
},
{
"oauth2": []
}
]
Path-level parameters and metadata
{
"parameters": [
{
"$ref": "#/components/parameters/pretty"
},
{
"$ref": "#/components/parameters/limit"
},
{
"$ref": "#/components/parameters/offset"
}
]
}
Request, responses and operation details
{
"summary": "Get time periods",
"description": "Returns compact time period records.\n\nThis operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.",
"tags": [
"Time periods"
],
"operationId": "getTimePeriods",
"parameters": [
{
"name": "start_on",
"in": "query",
"description": "ISO 8601 date string",
"schema": {
"type": "string",
"format": "date"
},
"example": "2019-09-15"
},
{
"name": "end_on",
"in": "query",
"description": "ISO 8601 date string",
"schema": {
"type": "string",
"format": "date"
},
"example": "2019-09-15"
},
{
"name": "workspace",
"in": "query",
"required": true,
"description": "Globally unique identifier for the workspace.",
"schema": {
"type": "string"
},
"example": "31326"
},
{
"name": "opt_fields",
"in": "query",
"description": "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. Properties can include nested fields. To learn more, see the [input/output options guide](/docs/inputoutput-options#selecting-nested-fields).",
"required": false,
"example": [
"display_name",
"end_on",
"offset",
"parent",
"parent.display_name",
"parent.end_on",
"parent.period",
"parent.start_on",
"path",
"period",
"start_on",
"uri"
],
"schema": {
"type": "array",
"items": {
"type": "string",
"enum": [
"display_name",
"end_on",
"offset",
"parent",
"parent.display_name",
"parent.end_on",
"parent.period",
"parent.start_on",
"path",
"period",
"start_on",
"uri"
]
}
},
"style": "form",
"explode": false
}
],
"responses": {
"200": {
"description": "Successfully retrieved the requested time periods.",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"type": "array",
"items": {
"$ref": "#/components/schemas/TimePeriodCompact"
}
},
"next_page": {
"$ref": "#/components/schemas/NextPage"
}
}
}
}
}
},
"400": {
"$ref": "#/components/responses/BadRequest"
},
"401": {
"$ref": "#/components/responses/Unauthorized"
},
"403": {
"$ref": "#/components/responses/Forbidden"
},
"404": {
"$ref": "#/components/responses/NotFound"
},
"500": {
"$ref": "#/components/responses/InternalServerError"
}
},
"security": [
{
"personalAccessToken": []
},
{
"oauth2": []
}
],
"x-readme": {
"code-samples": [
{
"language": "java",
"install": "<dependency><groupId>com.asana</groupId><artifactId>asana</artifactId><version>1.0.0</version></dependency>",
"code": "import com.asana.Client;\n\nClient client = Client.accessToken(\"PERSONAL_ACCESS_TOKEN\");\n\nList<JsonElement> result = client.timeperiods.getTimePeriods(endOn, startOn, workspace)\n .option(\"pretty\", true)\n .execute();"
},
{
"language": "node",
"install": "npm install asana",
"code": "const Asana = require('asana');\n\nlet client = new Asana.ApiClient();\nclient.authentications.token.accessToken = '<YOUR_ACCESS_TOKEN>';\n\nlet timePeriodsApiInstance = new Asana.TimePeriodsApi(client);\nlet workspace = \"31326\"; // String | Globally unique identifier for the workspace.\nlet opts = { \n 'limit': 50, \n 'offset': \"eyJ0eXAiOJiKV1iQLCJhbGciOiJIUzI1NiJ9\", \n 'start_on': \"2019-09-15\", \n 'end_on': \"2019-09-15\", \n 'opt_fields': \"display_name,end_on,offset,parent,parent.display_name,parent.end_on,parent.period,parent.start_on,path,period,start_on,uri\"\n};\ntimePeriodsApiInstance.getTimePeriods(workspace, opts).then((result) => {\n console.log('API called successfully. Returned data: ' + JSON.stringify(result.data, null, 2));\n}, (error) => {\n console.error(error.response.body);\n});",
"name": "node-sdk-v3"
},
{
"language": "node",
"install": "npm install asana@1.0.5",
"code": "const asana = require('asana');\n\nconst client = asana.Client.create().useAccessToken('PERSONAL_ACCESS_TOKEN');\n\nclient.timeperiods.getTimePeriods({param: \"value\", param: \"value\", opt_pretty: true})\n .then((result) => {\n console.log(result);\n });",
"name": "node-sdk-v1"
},
{
"language": "python",
"install": "pip install asana",
"code": "import asana\nfrom asana.rest import ApiException\nfrom pprint import pprint\n\nconfiguration = asana.Configuration()\nconfiguration.access_token = '<YOUR_ACCESS_TOKEN>'\napi_client = asana.ApiClient(configuration)\n\n# create an instance of the API class\ntime_periods_api_instance = asana.TimePeriodsApi(api_client)\nworkspace = \"31326\" # str | Globally unique identifier for the workspace.\nopts = {\n 'limit': 50, # int | Results per page. The number of objects to return per page. The value must be between 1 and 100.\n 'offset': \"eyJ0eXAiOJiKV1iQLCJhbGciOiJIUzI1NiJ9\", # str | 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.*\n 'start_on': '2019-09-15', # date | ISO 8601 date string\n 'end_on': '2019-09-15', # date | ISO 8601 date string\n 'opt_fields': \"display_name,end_on,offset,parent,parent.display_name,parent.end_on,parent.period,parent.start_on,path,period,start_on,uri\", # list[str] | 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.\n}\n\ntry:\n # Get time periods\n api_response = time_periods_api_instance.get_time_periods(workspace, opts)\n for data in api_response:\n pprint(data)\nexcept ApiException as e:\n print(\"Exception when calling TimePeriodsApi->get_time_periods: %s\\n\" % e)",
"name": "python-sdk-v5"
},
{
"language": "python",
"install": "pip install asana==3.2.3",
"code": "import asana\n\nclient = asana.Client.access_token('PERSONAL_ACCESS_TOKEN')\n\nresult = client.time_periods.get_time_periods({'param': 'value', 'param': 'value'}, opt_pretty=True)",
"name": "python-sdk-v3"
},
{
"language": "php",
"install": "composer require asana/asana",
"code": "<?php\nrequire 'vendor/autoload.php';\n\n$client = Asana\\Client::accessToken('PERSONAL_ACCESS_TOKEN');\n\n$result = $client->timeperiods->getTimePeriods(array('param' => 'value', 'param' => 'value'), array('opt_pretty' => 'true'))"
},
{
"language": "ruby",
"install": "gem install asana",
"code": "require 'asana'\n\nclient = Asana::Client.new do |c|\n c.authentication :access_token, 'PERSONAL_ACCESS_TOKEN'\nend\n\nresult = client.time_periods.get_time_periods(workspace: ''workspace_example'', param: \"value\", param: \"value\", options: {pretty: true})"
}
]
},
"x-purple-suite-runtime": "unavailable"
}
GET /api/1.0/time_tracking_categories/{time_tracking_category_gid}
Get a time tracking category
<b>Required scope: </b><code>time_tracking_categories:read</code>
Returns the complete time tracking category record for a single time tracking category.
This operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.
Authentication
[
{
"personalAccessToken": []
},
{
"oauth2": [
"time_tracking_categories:read"
]
}
]
Path-level parameters and metadata
{
"parameters": [
{
"$ref": "#/components/parameters/time_tracking_category_path_gid"
},
{
"$ref": "#/components/parameters/pretty"
}
]
}
Request, responses and operation details
{
"summary": "Get a time tracking category",
"description": "<b>Required scope: </b><code>time_tracking_categories:read</code>\n\nReturns the complete time tracking category record for a single time tracking category.\n\nThis operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.",
"tags": [
"Time tracking categories"
],
"operationId": "getTimeTrackingCategory",
"parameters": [
{
"name": "opt_fields",
"in": "query",
"description": "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. Properties can include nested fields. To learn more, see the [input/output options guide](/docs/inputoutput-options#selecting-nested-fields).",
"required": false,
"example": [
"color",
"is_archived",
"name"
],
"schema": {
"type": "array",
"items": {
"type": "string",
"enum": [
"color",
"is_archived",
"name"
]
}
},
"style": "form",
"explode": false
}
],
"responses": {
"200": {
"description": "Successfully retrieved the requested time tracking category.",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"$ref": "#/components/schemas/TimeTrackingCategoryResponse"
}
}
}
}
}
},
"400": {
"$ref": "#/components/responses/BadRequest"
},
"401": {
"$ref": "#/components/responses/Unauthorized"
},
"403": {
"$ref": "#/components/responses/Forbidden"
},
"404": {
"$ref": "#/components/responses/NotFound"
},
"500": {
"$ref": "#/components/responses/InternalServerError"
}
},
"security": [
{
"personalAccessToken": []
},
{
"oauth2": [
"time_tracking_categories:read"
]
}
],
"x-readme": {
"code-samples": [
{
"language": "node",
"install": "npm install asana",
"code": "const Asana = require('asana');\n\nlet client = new Asana.ApiClient();\nclient.authentications.token.accessToken = '<YOUR_ACCESS_TOKEN>';\n\nlet timeTrackingCategoriesApiInstance = new Asana.TimeTrackingCategoriesApi(client);\nlet time_tracking_category_gid = \"917392\"; // String | Globally unique identifier for the time tracking category.\nlet opts = { \n 'opt_fields': \"color,is_archived,name\"\n};\ntimeTrackingCategoriesApiInstance.getTimeTrackingCategory(time_tracking_category_gid, opts).then((result) => {\n console.log('API called successfully. Returned data: ' + JSON.stringify(result.data, null, 2));\n}, (error) => {\n console.error(error.response.body);\n});",
"name": "node-sdk-v3"
},
{
"language": "python",
"install": "pip install asana",
"code": "import asana\nfrom asana.rest import ApiException\nfrom pprint import pprint\n\nconfiguration = asana.Configuration()\nconfiguration.access_token = '<YOUR_ACCESS_TOKEN>'\napi_client = asana.ApiClient(configuration)\n\n# create an instance of the API class\ntime_tracking_categories_api_instance = asana.TimeTrackingCategoriesApi(api_client)\ntime_tracking_category_gid = \"917392\" # str | Globally unique identifier for the time tracking category.\nopts = {\n 'opt_fields': \"color,is_archived,name\", # list[str] | 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.\n}\n\ntry:\n # Get a time tracking category\n api_response = time_tracking_categories_api_instance.get_time_tracking_category(time_tracking_category_gid, opts)\n pprint(api_response)\nexcept ApiException as e:\n print(\"Exception when calling TimeTrackingCategoriesApi->get_time_tracking_category: %s\\n\" % e)",
"name": "python-sdk-v5"
}
]
},
"x-purple-suite-runtime": "unavailable"
}
PUT /api/1.0/time_tracking_categories/{time_tracking_category_gid}
Update a time tracking category
<b>Required scope: </b><code>time_tracking_categories:write</code>
Updates the properties of a time tracking category. Only the fields provided in the
`data` block will be updated; any unspecified fields will remain unchanged.
Returns the complete updated time tracking category record.
This operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.
Authentication
[
{
"personalAccessToken": []
},
{
"oauth2": [
"time_tracking_categories:write"
]
}
]
Path-level parameters and metadata
{
"parameters": [
{
"$ref": "#/components/parameters/time_tracking_category_path_gid"
},
{
"$ref": "#/components/parameters/pretty"
}
]
}
Request, responses and operation details
{
"summary": "Update a time tracking category",
"description": "<b>Required scope: </b><code>time_tracking_categories:write</code>\n\nUpdates the properties of a time tracking category. Only the fields provided in the\n`data` block will be updated; any unspecified fields will remain unchanged.\n\nReturns the complete updated time tracking category record.\n\nThis operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.",
"tags": [
"Time tracking categories"
],
"operationId": "updateTimeTrackingCategory",
"parameters": [
{
"name": "opt_fields",
"in": "query",
"description": "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. Properties can include nested fields. To learn more, see the [input/output options guide](/docs/inputoutput-options#selecting-nested-fields).",
"required": false,
"example": [
"color",
"is_archived",
"name"
],
"schema": {
"type": "array",
"items": {
"type": "string",
"enum": [
"color",
"is_archived",
"name"
]
}
},
"style": "form",
"explode": false
}
],
"requestBody": {
"description": "The updated fields for the time tracking category.",
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"$ref": "#/components/schemas/TimeTrackingCategoryUpdateRequest"
}
}
}
}
}
},
"responses": {
"200": {
"description": "Successfully updated the time tracking category.",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"$ref": "#/components/schemas/TimeTrackingCategoryResponse"
}
}
}
}
}
},
"400": {
"$ref": "#/components/responses/BadRequest"
},
"401": {
"$ref": "#/components/responses/Unauthorized"
},
"403": {
"$ref": "#/components/responses/Forbidden"
},
"404": {
"$ref": "#/components/responses/NotFound"
},
"500": {
"$ref": "#/components/responses/InternalServerError"
}
},
"security": [
{
"personalAccessToken": []
},
{
"oauth2": [
"time_tracking_categories:write"
]
}
],
"x-readme": {
"code-samples": [
{
"language": "node",
"install": "npm install asana",
"code": "const Asana = require('asana');\n\nlet client = new Asana.ApiClient();\nclient.authentications.token.accessToken = '<YOUR_ACCESS_TOKEN>';\n\nlet timeTrackingCategoriesApiInstance = new Asana.TimeTrackingCategoriesApi(client);\nlet body = {\"data\": {\"<PARAM_1>\": \"<VALUE_1>\", \"<PARAM_2>\": \"<VALUE_2>\",}}; // Object | The updated fields for the time tracking category.\nlet time_tracking_category_gid = \"917392\"; // String | Globally unique identifier for the time tracking category.\nlet opts = { \n 'opt_fields': \"color,is_archived,name\"\n};\ntimeTrackingCategoriesApiInstance.updateTimeTrackingCategory(body, time_tracking_category_gid, opts).then((result) => {\n console.log('API called successfully. Returned data: ' + JSON.stringify(result.data, null, 2));\n}, (error) => {\n console.error(error.response.body);\n});",
"name": "node-sdk-v3"
},
{
"language": "python",
"install": "pip install asana",
"code": "import asana\nfrom asana.rest import ApiException\nfrom pprint import pprint\n\nconfiguration = asana.Configuration()\nconfiguration.access_token = '<YOUR_ACCESS_TOKEN>'\napi_client = asana.ApiClient(configuration)\n\n# create an instance of the API class\ntime_tracking_categories_api_instance = asana.TimeTrackingCategoriesApi(api_client)\nbody = {\"data\": {\"<PARAM_1>\": \"<VALUE_1>\", \"<PARAM_2>\": \"<VALUE_2>\",}} # dict | The updated fields for the time tracking category.\ntime_tracking_category_gid = \"917392\" # str | Globally unique identifier for the time tracking category.\nopts = {\n 'opt_fields': \"color,is_archived,name\", # list[str] | 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.\n}\n\ntry:\n # Update a time tracking category\n api_response = time_tracking_categories_api_instance.update_time_tracking_category(body, time_tracking_category_gid, opts)\n pprint(api_response)\nexcept ApiException as e:\n print(\"Exception when calling TimeTrackingCategoriesApi->update_time_tracking_category: %s\\n\" % e)",
"name": "python-sdk-v5"
}
]
},
"x-purple-suite-runtime": "unavailable"
}
DELETE /api/1.0/time_tracking_categories/{time_tracking_category_gid}
Delete a time tracking category
<b>Required scope: </b><code>time_tracking_categories:delete</code>
Deletes a specific, existing time tracking category.
Returns an empty data record.
This operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.
Authentication
[
{
"personalAccessToken": []
},
{
"oauth2": [
"time_tracking_categories:delete"
]
}
]
Path-level parameters and metadata
{
"parameters": [
{
"$ref": "#/components/parameters/time_tracking_category_path_gid"
},
{
"$ref": "#/components/parameters/pretty"
}
]
}
Request, responses and operation details
{
"summary": "Delete a time tracking category",
"description": "<b>Required scope: </b><code>time_tracking_categories:delete</code>\n\nDeletes a specific, existing time tracking category.\n\nReturns an empty data record.\n\nThis operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.",
"tags": [
"Time tracking categories"
],
"operationId": "deleteTimeTrackingCategory",
"responses": {
"200": {
"description": "Successfully deleted the specified time tracking category.",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"$ref": "#/components/schemas/EmptyResponse"
}
}
}
}
}
},
"400": {
"$ref": "#/components/responses/BadRequest"
},
"401": {
"$ref": "#/components/responses/Unauthorized"
},
"403": {
"$ref": "#/components/responses/Forbidden"
},
"404": {
"$ref": "#/components/responses/NotFound"
},
"500": {
"$ref": "#/components/responses/InternalServerError"
}
},
"security": [
{
"personalAccessToken": []
},
{
"oauth2": [
"time_tracking_categories:delete"
]
}
],
"x-readme": {
"code-samples": [
{
"language": "node",
"install": "npm install asana",
"code": "const Asana = require('asana');\n\nlet client = new Asana.ApiClient();\nclient.authentications.token.accessToken = '<YOUR_ACCESS_TOKEN>';\n\nlet timeTrackingCategoriesApiInstance = new Asana.TimeTrackingCategoriesApi(client);\nlet time_tracking_category_gid = \"917392\"; // String | Globally unique identifier for the time tracking category.\n\ntimeTrackingCategoriesApiInstance.deleteTimeTrackingCategory(time_tracking_category_gid).then((result) => {\n console.log('API called successfully. Returned data: ' + JSON.stringify(result.data, null, 2));\n}, (error) => {\n console.error(error.response.body);\n});",
"name": "node-sdk-v3"
},
{
"language": "python",
"install": "pip install asana",
"code": "import asana\nfrom asana.rest import ApiException\nfrom pprint import pprint\n\nconfiguration = asana.Configuration()\nconfiguration.access_token = '<YOUR_ACCESS_TOKEN>'\napi_client = asana.ApiClient(configuration)\n\n# create an instance of the API class\ntime_tracking_categories_api_instance = asana.TimeTrackingCategoriesApi(api_client)\ntime_tracking_category_gid = \"917392\" # str | Globally unique identifier for the time tracking category.\n\n\ntry:\n # Delete a time tracking category\n api_response = time_tracking_categories_api_instance.delete_time_tracking_category(time_tracking_category_gid)\n pprint(api_response)\nexcept ApiException as e:\n print(\"Exception when calling TimeTrackingCategoriesApi->delete_time_tracking_category: %s\\n\" % e)",
"name": "python-sdk-v5"
}
]
},
"x-purple-suite-runtime": "unavailable"
}
GET /api/1.0/time_tracking_categories/{time_tracking_category_gid}/time_tracking_entries
Get time tracking entries for a time tracking category
<b>Required scope: </b><code>time_tracking_categories:read</code>
Returns a paginated list of time tracking entries filtered by a given time tracking category.
This operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.
Authentication
[
{
"personalAccessToken": []
},
{
"oauth2": [
"time_tracking_categories:read"
]
}
]
Path-level parameters and metadata
{
"parameters": [
{
"$ref": "#/components/parameters/time_tracking_category_path_gid"
},
{
"$ref": "#/components/parameters/pretty"
}
]
}
Request, responses and operation details
{
"summary": "Get time tracking entries for a time tracking category",
"description": "<b>Required scope: </b><code>time_tracking_categories:read</code>\n\nReturns a paginated list of time tracking entries filtered by a given time tracking category.\n\nThis operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.",
"tags": [
"Time tracking categories"
],
"operationId": "getTimeTrackingEntriesForTimeTrackingCategory",
"parameters": [
{
"name": "start_date",
"in": "query",
"description": "The start date for filtering time tracking entries by their entry date.",
"schema": {
"type": "string",
"format": "date"
},
"example": "2025-01-01"
},
{
"name": "end_date",
"in": "query",
"description": "The end date for filtering time tracking entries by their entry date.",
"schema": {
"type": "string",
"format": "date"
},
"example": "2025-12-31"
},
{
"$ref": "#/components/parameters/limit"
},
{
"$ref": "#/components/parameters/offset"
},
{
"name": "opt_fields",
"in": "query",
"description": "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. Properties can include nested fields. To learn more, see the [input/output options guide](/docs/inputoutput-options#selecting-nested-fields).",
"required": false,
"example": [
"attributable_to",
"attributable_to.name",
"attributable_to.resource_subtype",
"categories",
"categories.color",
"categories.name",
"created_by",
"created_by.name",
"duration_minutes",
"entered_on",
"offset",
"path",
"uri"
],
"schema": {
"type": "array",
"items": {
"type": "string",
"enum": [
"attributable_to",
"attributable_to.name",
"attributable_to.resource_subtype",
"categories",
"categories.color",
"categories.name",
"created_by",
"created_by.name",
"duration_minutes",
"entered_on",
"offset",
"path",
"uri"
]
}
},
"style": "form",
"explode": false
}
],
"responses": {
"200": {
"description": "Successfully retrieved the requested time tracking entries.",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"type": "array",
"items": {
"$ref": "#/components/schemas/TimeTrackingEntryCompact"
}
},
"next_page": {
"$ref": "#/components/schemas/NextPage"
}
}
}
}
}
},
"400": {
"$ref": "#/components/responses/BadRequest"
},
"401": {
"$ref": "#/components/responses/Unauthorized"
},
"403": {
"$ref": "#/components/responses/Forbidden"
},
"404": {
"$ref": "#/components/responses/NotFound"
},
"500": {
"$ref": "#/components/responses/InternalServerError"
}
},
"security": [
{
"personalAccessToken": []
},
{
"oauth2": [
"time_tracking_categories:read"
]
}
],
"x-readme": {
"code-samples": [
{
"language": "node",
"install": "npm install asana",
"code": "const Asana = require('asana');\n\nlet client = new Asana.ApiClient();\nclient.authentications.token.accessToken = '<YOUR_ACCESS_TOKEN>';\n\nlet timeTrackingCategoriesApiInstance = new Asana.TimeTrackingCategoriesApi(client);\nlet time_tracking_category_gid = \"917392\"; // String | Globally unique identifier for the time tracking category.\nlet opts = { \n 'start_date': \"2025-01-01\", \n 'end_date': \"2025-12-31\", \n 'limit': 50, \n 'offset': \"eyJ0eXAiOJiKV1iQLCJhbGciOiJIUzI1NiJ9\", \n 'opt_fields': \"attributable_to,attributable_to.name,attributable_to.resource_subtype,categories,categories.color,categories.name,created_by,created_by.name,duration_minutes,entered_on,offset,path,uri\"\n};\ntimeTrackingCategoriesApiInstance.getTimeTrackingEntriesForTimeTrackingCategory(time_tracking_category_gid, opts).then((result) => {\n console.log('API called successfully. Returned data: ' + JSON.stringify(result.data, null, 2));\n}, (error) => {\n console.error(error.response.body);\n});",
"name": "node-sdk-v3"
},
{
"language": "python",
"install": "pip install asana",
"code": "import asana\nfrom asana.rest import ApiException\nfrom pprint import pprint\n\nconfiguration = asana.Configuration()\nconfiguration.access_token = '<YOUR_ACCESS_TOKEN>'\napi_client = asana.ApiClient(configuration)\n\n# create an instance of the API class\ntime_tracking_categories_api_instance = asana.TimeTrackingCategoriesApi(api_client)\ntime_tracking_category_gid = \"917392\" # str | Globally unique identifier for the time tracking category.\nopts = {\n 'start_date': '2025-01-01', # date | The start date for filtering time tracking entries by their entry date.\n 'end_date': '2025-12-31', # date | The end date for filtering time tracking entries by their entry date.\n 'limit': 50, # int | Results per page. The number of objects to return per page. The value must be between 1 and 100.\n 'offset': \"eyJ0eXAiOJiKV1iQLCJhbGciOiJIUzI1NiJ9\", # str | 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.*\n 'opt_fields': \"attributable_to,attributable_to.name,attributable_to.resource_subtype,categories,categories.color,categories.name,created_by,created_by.name,duration_minutes,entered_on,offset,path,uri\", # list[str] | 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.\n}\n\ntry:\n # Get time tracking entries for a time tracking category\n api_response = time_tracking_categories_api_instance.get_time_tracking_entries_for_time_tracking_category(time_tracking_category_gid, opts)\n for data in api_response:\n pprint(data)\nexcept ApiException as e:\n print(\"Exception when calling TimeTrackingCategoriesApi->get_time_tracking_entries_for_time_tracking_category: %s\\n\" % e)",
"name": "python-sdk-v5"
}
]
},
"x-purple-suite-runtime": "unavailable"
}
GET /api/1.0/time_tracking_categories
Get time tracking categories for a workspace
<b>Required scope: </b><code>time_tracking_categories:read</code>
Returns a paginated list of time tracking categories for a given workspace.
This operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.
Authentication
[
{
"personalAccessToken": []
},
{
"oauth2": [
"time_tracking_categories:read"
]
}
]
Path-level parameters and metadata
{
"parameters": [
{
"$ref": "#/components/parameters/pretty"
}
]
}
Request, responses and operation details
{
"summary": "Get time tracking categories for a workspace",
"description": "<b>Required scope: </b><code>time_tracking_categories:read</code>\n\nReturns a paginated list of time tracking categories for a given workspace.\n\nThis operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.",
"tags": [
"Time tracking categories"
],
"operationId": "getTimeTrackingCategories",
"parameters": [
{
"name": "workspace",
"in": "query",
"required": true,
"description": "Globally unique identifier for the workspace.",
"schema": {
"type": "string"
},
"example": "12345"
},
{
"name": "is_archived",
"in": "query",
"description": "Filter by archived status. If not provided, defaults to returning non-archived categories.",
"schema": {
"type": "boolean"
},
"example": false
},
{
"$ref": "#/components/parameters/limit"
},
{
"$ref": "#/components/parameters/offset"
},
{
"name": "opt_fields",
"in": "query",
"description": "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. Properties can include nested fields. To learn more, see the [input/output options guide](/docs/inputoutput-options#selecting-nested-fields).",
"required": false,
"example": [
"color",
"is_archived",
"name",
"offset",
"path",
"uri"
],
"schema": {
"type": "array",
"items": {
"type": "string",
"enum": [
"color",
"is_archived",
"name",
"offset",
"path",
"uri"
]
}
},
"style": "form",
"explode": false
}
],
"responses": {
"200": {
"description": "Successfully retrieved the requested time tracking categories.",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"type": "array",
"items": {
"$ref": "#/components/schemas/TimeTrackingCategoryCompact"
}
},
"next_page": {
"$ref": "#/components/schemas/NextPage"
}
}
}
}
}
},
"400": {
"$ref": "#/components/responses/BadRequest"
},
"401": {
"$ref": "#/components/responses/Unauthorized"
},
"403": {
"$ref": "#/components/responses/Forbidden"
},
"404": {
"$ref": "#/components/responses/NotFound"
},
"500": {
"$ref": "#/components/responses/InternalServerError"
}
},
"security": [
{
"personalAccessToken": []
},
{
"oauth2": [
"time_tracking_categories:read"
]
}
],
"x-readme": {
"code-samples": [
{
"language": "node",
"install": "npm install asana",
"code": "const Asana = require('asana');\n\nlet client = new Asana.ApiClient();\nclient.authentications.token.accessToken = '<YOUR_ACCESS_TOKEN>';\n\nlet timeTrackingCategoriesApiInstance = new Asana.TimeTrackingCategoriesApi(client);\nlet workspace = \"12345\"; // String | Globally unique identifier for the workspace.\nlet opts = { \n 'is_archived': false, \n 'limit': 50, \n 'offset': \"eyJ0eXAiOJiKV1iQLCJhbGciOiJIUzI1NiJ9\", \n 'opt_fields': \"color,is_archived,name,offset,path,uri\"\n};\ntimeTrackingCategoriesApiInstance.getTimeTrackingCategories(workspace, opts).then((result) => {\n console.log('API called successfully. Returned data: ' + JSON.stringify(result.data, null, 2));\n}, (error) => {\n console.error(error.response.body);\n});",
"name": "node-sdk-v3"
},
{
"language": "python",
"install": "pip install asana",
"code": "import asana\nfrom asana.rest import ApiException\nfrom pprint import pprint\n\nconfiguration = asana.Configuration()\nconfiguration.access_token = '<YOUR_ACCESS_TOKEN>'\napi_client = asana.ApiClient(configuration)\n\n# create an instance of the API class\ntime_tracking_categories_api_instance = asana.TimeTrackingCategoriesApi(api_client)\nworkspace = \"12345\" # str | Globally unique identifier for the workspace.\nopts = {\n 'is_archived': False, # bool | Filter by archived status. If not provided, defaults to returning non-archived categories.\n 'limit': 50, # int | Results per page. The number of objects to return per page. The value must be between 1 and 100.\n 'offset': \"eyJ0eXAiOJiKV1iQLCJhbGciOiJIUzI1NiJ9\", # str | 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.*\n 'opt_fields': \"color,is_archived,name,offset,path,uri\", # list[str] | 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.\n}\n\ntry:\n # Get time tracking categories for a workspace\n api_response = time_tracking_categories_api_instance.get_time_tracking_categories(workspace, opts)\n for data in api_response:\n pprint(data)\nexcept ApiException as e:\n print(\"Exception when calling TimeTrackingCategoriesApi->get_time_tracking_categories: %s\\n\" % e)",
"name": "python-sdk-v5"
}
]
},
"x-purple-suite-runtime": "unavailable"
}
POST /api/1.0/time_tracking_categories
Create a time tracking category
<b>Required scope: </b><code>time_tracking_categories:write</code>
Creates a new time tracking category in a given workspace.
Returns the record of the newly created time tracking category.
This operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.
Authentication
[
{
"personalAccessToken": []
},
{
"oauth2": [
"time_tracking_categories:write"
]
}
]
Path-level parameters and metadata
{
"parameters": [
{
"$ref": "#/components/parameters/pretty"
}
]
}
Request, responses and operation details
{
"summary": "Create a time tracking category",
"description": "<b>Required scope: </b><code>time_tracking_categories:write</code>\n\nCreates a new time tracking category in a given workspace.\n\nReturns the record of the newly created time tracking category.\n\nThis operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.",
"tags": [
"Time tracking categories"
],
"operationId": "createTimeTrackingCategory",
"parameters": [
{
"name": "opt_fields",
"in": "query",
"description": "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. Properties can include nested fields. To learn more, see the [input/output options guide](/docs/inputoutput-options#selecting-nested-fields).",
"required": false,
"example": [
"color",
"is_archived",
"name"
],
"schema": {
"type": "array",
"items": {
"type": "string",
"enum": [
"color",
"is_archived",
"name"
]
}
},
"style": "form",
"explode": false
}
],
"requestBody": {
"description": "Information about the time tracking category.",
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"$ref": "#/components/schemas/TimeTrackingCategoryCreateRequest"
}
}
}
}
}
},
"responses": {
"201": {
"description": "Successfully created a time tracking category.",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"$ref": "#/components/schemas/TimeTrackingCategoryResponse"
}
}
}
}
}
},
"400": {
"$ref": "#/components/responses/BadRequest"
},
"401": {
"$ref": "#/components/responses/Unauthorized"
},
"403": {
"$ref": "#/components/responses/Forbidden"
},
"404": {
"$ref": "#/components/responses/NotFound"
},
"500": {
"$ref": "#/components/responses/InternalServerError"
}
},
"security": [
{
"personalAccessToken": []
},
{
"oauth2": [
"time_tracking_categories:write"
]
}
],
"x-readme": {
"code-samples": [
{
"language": "node",
"install": "npm install asana",
"code": "const Asana = require('asana');\n\nlet client = new Asana.ApiClient();\nclient.authentications.token.accessToken = '<YOUR_ACCESS_TOKEN>';\n\nlet timeTrackingCategoriesApiInstance = new Asana.TimeTrackingCategoriesApi(client);\nlet body = {\"data\": {\"<PARAM_1>\": \"<VALUE_1>\", \"<PARAM_2>\": \"<VALUE_2>\",}}; // Object | Information about the time tracking category.\nlet opts = { \n 'opt_fields': \"color,is_archived,name\"\n};\ntimeTrackingCategoriesApiInstance.createTimeTrackingCategory(body, opts).then((result) => {\n console.log('API called successfully. Returned data: ' + JSON.stringify(result.data, null, 2));\n}, (error) => {\n console.error(error.response.body);\n});",
"name": "node-sdk-v3"
},
{
"language": "python",
"install": "pip install asana",
"code": "import asana\nfrom asana.rest import ApiException\nfrom pprint import pprint\n\nconfiguration = asana.Configuration()\nconfiguration.access_token = '<YOUR_ACCESS_TOKEN>'\napi_client = asana.ApiClient(configuration)\n\n# create an instance of the API class\ntime_tracking_categories_api_instance = asana.TimeTrackingCategoriesApi(api_client)\nbody = {\"data\": {\"<PARAM_1>\": \"<VALUE_1>\", \"<PARAM_2>\": \"<VALUE_2>\",}} # dict | Information about the time tracking category.\nopts = {\n 'opt_fields': \"color,is_archived,name\", # list[str] | 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.\n}\n\ntry:\n # Create a time tracking category\n api_response = time_tracking_categories_api_instance.create_time_tracking_category(body, opts)\n pprint(api_response)\nexcept ApiException as e:\n print(\"Exception when calling TimeTrackingCategoriesApi->create_time_tracking_category: %s\\n\" % e)",
"name": "python-sdk-v5"
}
]
},
"x-purple-suite-runtime": "unavailable"
}
GET /api/1.0/tasks/{task_gid}/time_tracking_entries
Get time tracking entries for a task
<b>Required scope: </b><code>time_tracking_entries:read</code>
Returns time tracking entries for a given task.
This operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.
Authentication
[
{
"personalAccessToken": []
},
{
"oauth2": [
"time_tracking_entries:read"
]
}
]
Path-level parameters and metadata
{
"parameters": [
{
"$ref": "#/components/parameters/task_path_gid"
},
{
"$ref": "#/components/parameters/pretty"
}
]
}
Request, responses and operation details
{
"summary": "Get time tracking entries for a task",
"description": "<b>Required scope: </b><code>time_tracking_entries:read</code>\n\nReturns time tracking entries for a given task.\n\nThis operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.",
"tags": [
"Time tracking entries"
],
"operationId": "getTimeTrackingEntriesForTask",
"parameters": [
{
"$ref": "#/components/parameters/limit"
},
{
"$ref": "#/components/parameters/offset"
},
{
"name": "opt_fields",
"in": "query",
"description": "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. Properties can include nested fields. To learn more, see the [input/output options guide](/docs/inputoutput-options#selecting-nested-fields).",
"required": false,
"example": [
"attributable_to",
"attributable_to.name",
"attributable_to.resource_subtype",
"categories",
"categories.color",
"categories.name",
"created_by",
"created_by.name",
"duration_minutes",
"entered_on",
"offset",
"path",
"uri"
],
"schema": {
"type": "array",
"items": {
"type": "string",
"enum": [
"attributable_to",
"attributable_to.name",
"attributable_to.resource_subtype",
"categories",
"categories.color",
"categories.name",
"created_by",
"created_by.name",
"duration_minutes",
"entered_on",
"offset",
"path",
"uri"
]
}
},
"style": "form",
"explode": false
}
],
"responses": {
"200": {
"description": "Successfully retrieved the requested time tracking entries.",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"type": "array",
"items": {
"$ref": "#/components/schemas/TimeTrackingEntryCompact"
}
},
"next_page": {
"$ref": "#/components/schemas/NextPage"
}
}
}
}
}
},
"400": {
"$ref": "#/components/responses/BadRequest"
},
"401": {
"$ref": "#/components/responses/Unauthorized"
},
"403": {
"$ref": "#/components/responses/Forbidden"
},
"404": {
"$ref": "#/components/responses/NotFound"
},
"500": {
"$ref": "#/components/responses/InternalServerError"
}
},
"security": [
{
"personalAccessToken": []
},
{
"oauth2": [
"time_tracking_entries:read"
]
}
],
"x-readme": {
"code-samples": [
{
"language": "node",
"install": "npm install asana",
"code": "const Asana = require('asana');\n\nlet client = new Asana.ApiClient();\nclient.authentications.token.accessToken = '<YOUR_ACCESS_TOKEN>';\n\nlet timeTrackingEntriesApiInstance = new Asana.TimeTrackingEntriesApi(client);\nlet task_gid = \"321654\"; // String | The task to operate on.\nlet opts = { \n 'limit': 50, \n 'offset': \"eyJ0eXAiOJiKV1iQLCJhbGciOiJIUzI1NiJ9\", \n 'opt_fields': \"attributable_to,attributable_to.name,attributable_to.resource_subtype,categories,categories.color,categories.name,created_by,created_by.name,duration_minutes,entered_on,offset,path,uri\"\n};\ntimeTrackingEntriesApiInstance.getTimeTrackingEntriesForTask(task_gid, opts).then((result) => {\n console.log('API called successfully. Returned data: ' + JSON.stringify(result.data, null, 2));\n}, (error) => {\n console.error(error.response.body);\n});",
"name": "node-sdk-v3"
},
{
"language": "node",
"install": "npm install asana@1.0.5",
"code": "const asana = require('asana');\n\nconst client = asana.Client.create().useAccessToken('PERSONAL_ACCESS_TOKEN');\n\nclient.timetrackingentries.getTimeTrackingEntriesForTask(taskGid, {param: \"value\", param: \"value\", opt_pretty: true})\n .then((result) => {\n console.log(result);\n });",
"name": "node-sdk-v1"
},
{
"language": "python",
"install": "pip install asana",
"code": "import asana\nfrom asana.rest import ApiException\nfrom pprint import pprint\n\nconfiguration = asana.Configuration()\nconfiguration.access_token = '<YOUR_ACCESS_TOKEN>'\napi_client = asana.ApiClient(configuration)\n\n# create an instance of the API class\ntime_tracking_entries_api_instance = asana.TimeTrackingEntriesApi(api_client)\ntask_gid = \"321654\" # str | The task to operate on.\nopts = {\n 'limit': 50, # int | Results per page. The number of objects to return per page. The value must be between 1 and 100.\n 'offset': \"eyJ0eXAiOJiKV1iQLCJhbGciOiJIUzI1NiJ9\", # str | 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.*\n 'opt_fields': \"attributable_to,attributable_to.name,attributable_to.resource_subtype,categories,categories.color,categories.name,created_by,created_by.name,duration_minutes,entered_on,offset,path,uri\", # list[str] | 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.\n}\n\ntry:\n # Get time tracking entries for a task\n api_response = time_tracking_entries_api_instance.get_time_tracking_entries_for_task(task_gid, opts)\n for data in api_response:\n pprint(data)\nexcept ApiException as e:\n print(\"Exception when calling TimeTrackingEntriesApi->get_time_tracking_entries_for_task: %s\\n\" % e)",
"name": "python-sdk-v5"
},
{
"language": "python",
"install": "pip install asana==3.2.3",
"code": "import asana\n\nclient = asana.Client.access_token('PERSONAL_ACCESS_TOKEN')\n\nresult = client.time_tracking_entries.get_time_tracking_entries_for_task(task_gid, {'param': 'value', 'param': 'value'}, opt_pretty=True)",
"name": "python-sdk-v3"
}
]
},
"x-purple-suite-runtime": "unavailable"
}
POST /api/1.0/tasks/{task_gid}/time_tracking_entries
Create a time tracking entry
Creates a time tracking entry on a given task.
Returns the record of the newly created time tracking entry.
#### Access requirements
Access to this endpoint has two levels:
- **Endpoint access** requires time tracking to be available through the domain's plan
or add-ons. A request from a domain without time tracking access returns a
`402 Payment Required` error for every request to this endpoint.
- **Field access** for some request fields requires the Timesheets and Budgets add-on.
Fields with this requirement are noted in the request schema. Including one of these
fields without the add-on returns a `402 Payment Required` error, even when the rest of
the request is valid.
Because the field-level requirement is separate, the same endpoint may return `201` or
`402` for the same domain depending on which fields are sent: a request that only uses
fields available with endpoint access succeeds on any domain that meets the endpoint
requirement, while a request that includes a field requiring the add-on also requires
the add-on.
This operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.
Authentication
[
{
"personalAccessToken": []
},
{
"oauth2": []
}
]
Path-level parameters and metadata
{
"parameters": [
{
"$ref": "#/components/parameters/task_path_gid"
},
{
"$ref": "#/components/parameters/pretty"
}
]
}
Request, responses and operation details
{
"summary": "Create a time tracking entry",
"description": "Creates a time tracking entry on a given task.\n\nReturns the record of the newly created time tracking entry.\n\n#### Access requirements\n\nAccess to this endpoint has two levels:\n\n- **Endpoint access** requires time tracking to be available through the domain's plan\nor add-ons. A request from a domain without time tracking access returns a\n`402 Payment Required` error for every request to this endpoint.\n\n- **Field access** for some request fields requires the Timesheets and Budgets add-on.\nFields with this requirement are noted in the request schema. Including one of these\nfields without the add-on returns a `402 Payment Required` error, even when the rest of\nthe request is valid.\n\nBecause the field-level requirement is separate, the same endpoint may return `201` or\n`402` for the same domain depending on which fields are sent: a request that only uses\nfields available with endpoint access succeeds on any domain that meets the endpoint\nrequirement, while a request that includes a field requiring the add-on also requires\nthe add-on.\n\nThis operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.",
"tags": [
"Time tracking entries"
],
"operationId": "createTimeTrackingEntry",
"parameters": [
{
"name": "opt_fields",
"in": "query",
"description": "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. Properties can include nested fields. To learn more, see the [input/output options guide](/docs/inputoutput-options#selecting-nested-fields).",
"required": false,
"example": [
"approval_status",
"attributable_to",
"attributable_to.name",
"attributable_to.resource_subtype",
"billable_status",
"categories",
"categories.color",
"categories.name",
"created_at",
"created_by",
"created_by.name",
"description",
"duration_minutes",
"entered_on",
"task",
"task.created_by",
"task.name",
"task.resource_subtype"
],
"schema": {
"type": "array",
"items": {
"type": "string",
"enum": [
"approval_status",
"attributable_to",
"attributable_to.name",
"attributable_to.resource_subtype",
"billable_status",
"categories",
"categories.color",
"categories.name",
"created_at",
"created_by",
"created_by.name",
"description",
"duration_minutes",
"entered_on",
"task",
"task.created_by",
"task.name",
"task.resource_subtype"
]
}
},
"style": "form",
"explode": false
}
],
"requestBody": {
"description": "Information about the time tracking entry.",
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"$ref": "#/components/schemas/CreateTimeTrackingEntryRequest"
}
}
}
}
}
},
"responses": {
"201": {
"description": "Successfully created a time tracking entry for the task.",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"$ref": "#/components/schemas/TimeTrackingEntryBase"
}
}
}
}
}
},
"400": {
"$ref": "#/components/responses/BadRequest"
},
"401": {
"$ref": "#/components/responses/Unauthorized"
},
"402": {
"$ref": "#/components/responses/PaymentRequired"
},
"403": {
"$ref": "#/components/responses/Forbidden"
},
"404": {
"$ref": "#/components/responses/NotFound"
},
"500": {
"$ref": "#/components/responses/InternalServerError"
}
},
"security": [
{
"personalAccessToken": []
},
{
"oauth2": []
}
],
"x-readme": {
"code-samples": [
{
"language": "node",
"install": "npm install asana",
"code": "const Asana = require('asana');\n\nlet client = new Asana.ApiClient();\nclient.authentications.token.accessToken = '<YOUR_ACCESS_TOKEN>';\n\nlet timeTrackingEntriesApiInstance = new Asana.TimeTrackingEntriesApi(client);\nlet body = {\"data\": {\"<PARAM_1>\": \"<VALUE_1>\", \"<PARAM_2>\": \"<VALUE_2>\",}}; // Object | Information about the time tracking entry.\nlet task_gid = \"321654\"; // String | The task to operate on.\nlet opts = { \n 'opt_fields': \"approval_status,attributable_to,attributable_to.name,attributable_to.resource_subtype,billable_status,categories,categories.color,categories.name,created_at,created_by,created_by.name,description,duration_minutes,entered_on,task,task.created_by,task.name,task.resource_subtype\"\n};\ntimeTrackingEntriesApiInstance.createTimeTrackingEntry(body, task_gid, opts).then((result) => {\n console.log('API called successfully. Returned data: ' + JSON.stringify(result.data, null, 2));\n}, (error) => {\n console.error(error.response.body);\n});",
"name": "node-sdk-v3"
},
{
"language": "node",
"install": "npm install asana@1.0.5",
"code": "const asana = require('asana');\n\nconst client = asana.Client.create().useAccessToken('PERSONAL_ACCESS_TOKEN');\n\nclient.timetrackingentries.createTimeTrackingEntry(taskGid, {field: \"value\", field: \"value\", pretty: true})\n .then((result) => {\n console.log(result);\n });",
"name": "node-sdk-v1"
},
{
"language": "python",
"install": "pip install asana",
"code": "import asana\nfrom asana.rest import ApiException\nfrom pprint import pprint\n\nconfiguration = asana.Configuration()\nconfiguration.access_token = '<YOUR_ACCESS_TOKEN>'\napi_client = asana.ApiClient(configuration)\n\n# create an instance of the API class\ntime_tracking_entries_api_instance = asana.TimeTrackingEntriesApi(api_client)\nbody = {\"data\": {\"<PARAM_1>\": \"<VALUE_1>\", \"<PARAM_2>\": \"<VALUE_2>\",}} # dict | Information about the time tracking entry.\ntask_gid = \"321654\" # str | The task to operate on.\nopts = {\n 'opt_fields': \"approval_status,attributable_to,attributable_to.name,attributable_to.resource_subtype,billable_status,categories,categories.color,categories.name,created_at,created_by,created_by.name,description,duration_minutes,entered_on,task,task.created_by,task.name,task.resource_subtype\", # list[str] | 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.\n}\n\ntry:\n # Create a time tracking entry\n api_response = time_tracking_entries_api_instance.create_time_tracking_entry(body, task_gid, opts)\n pprint(api_response)\nexcept ApiException as e:\n print(\"Exception when calling TimeTrackingEntriesApi->create_time_tracking_entry: %s\\n\" % e)",
"name": "python-sdk-v5"
},
{
"language": "python",
"install": "pip install asana==3.2.3",
"code": "import asana\n\nclient = asana.Client.access_token('PERSONAL_ACCESS_TOKEN')\n\nresult = client.time_tracking_entries.create_time_tracking_entry(task_gid, {'field': 'value', 'field': 'value'}, opt_pretty=True)",
"name": "python-sdk-v3"
}
]
},
"x-purple-suite-runtime": "unavailable"
}
GET /api/1.0/time_tracking_entries/{time_tracking_entry_gid}
Get a time tracking entry
<b>Required scope: </b><code>time_tracking_entries:read</code>
<table>
<tr>
<th>Field</th>
<th>Required Scope</th>
</tr>
<tr>
<td><code>categories</code></td>
<td><code>time_tracking_categories:read</code></td>
</tr>
</table>
Returns the complete time tracking entry record for a single time tracking entry.
This operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.
Authentication
[
{
"personalAccessToken": []
},
{
"oauth2": [
"time_tracking_entries:read"
]
}
]
Path-level parameters and metadata
{
"parameters": [
{
"$ref": "#/components/parameters/time_tracking_entry_path_gid"
},
{
"$ref": "#/components/parameters/pretty"
}
]
}
Request, responses and operation details
{
"summary": "Get a time tracking entry",
"description": "<b>Required scope: </b><code>time_tracking_entries:read</code>\n\n<table>\n <tr>\n <th>Field</th>\n <th>Required Scope</th>\n </tr>\n <tr>\n <td><code>categories</code></td>\n <td><code>time_tracking_categories:read</code></td>\n </tr>\n</table>\n\nReturns the complete time tracking entry record for a single time tracking entry.\n\nThis operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.",
"tags": [
"Time tracking entries"
],
"operationId": "getTimeTrackingEntry",
"parameters": [
{
"name": "opt_fields",
"in": "query",
"description": "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. Properties can include nested fields. To learn more, see the [input/output options guide](/docs/inputoutput-options#selecting-nested-fields).",
"required": false,
"example": [
"approval_status",
"attributable_to",
"attributable_to.name",
"attributable_to.resource_subtype",
"billable_status",
"categories",
"categories.color",
"categories.name",
"created_at",
"created_by",
"created_by.name",
"description",
"duration_minutes",
"entered_on",
"task",
"task.created_by",
"task.name",
"task.resource_subtype"
],
"schema": {
"type": "array",
"items": {
"type": "string",
"enum": [
"approval_status",
"attributable_to",
"attributable_to.name",
"attributable_to.resource_subtype",
"billable_status",
"categories",
"categories.color",
"categories.name",
"created_at",
"created_by",
"created_by.name",
"description",
"duration_minutes",
"entered_on",
"task",
"task.created_by",
"task.name",
"task.resource_subtype"
]
}
},
"style": "form",
"explode": false
}
],
"responses": {
"200": {
"description": "Successfully retrieved the requested time tracking entry.",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"$ref": "#/components/schemas/TimeTrackingEntryBase"
}
}
}
}
}
},
"400": {
"$ref": "#/components/responses/BadRequest"
},
"401": {
"$ref": "#/components/responses/Unauthorized"
},
"403": {
"$ref": "#/components/responses/Forbidden"
},
"404": {
"$ref": "#/components/responses/NotFound"
},
"500": {
"$ref": "#/components/responses/InternalServerError"
}
},
"security": [
{
"personalAccessToken": []
},
{
"oauth2": [
"time_tracking_entries:read"
]
}
],
"x-readme": {
"code-samples": [
{
"language": "node",
"install": "npm install asana",
"code": "const Asana = require('asana');\n\nlet client = new Asana.ApiClient();\nclient.authentications.token.accessToken = '<YOUR_ACCESS_TOKEN>';\n\nlet timeTrackingEntriesApiInstance = new Asana.TimeTrackingEntriesApi(client);\nlet time_tracking_entry_gid = \"917392\"; // String | Globally unique identifier for the time tracking entry.\nlet opts = { \n 'opt_fields': \"approval_status,attributable_to,attributable_to.name,attributable_to.resource_subtype,billable_status,categories,categories.color,categories.name,created_at,created_by,created_by.name,description,duration_minutes,entered_on,task,task.created_by,task.name,task.resource_subtype\"\n};\ntimeTrackingEntriesApiInstance.getTimeTrackingEntry(time_tracking_entry_gid, opts).then((result) => {\n console.log('API called successfully. Returned data: ' + JSON.stringify(result.data, null, 2));\n}, (error) => {\n console.error(error.response.body);\n});",
"name": "node-sdk-v3"
},
{
"language": "node",
"install": "npm install asana@1.0.5",
"code": "const asana = require('asana');\n\nconst client = asana.Client.create().useAccessToken('PERSONAL_ACCESS_TOKEN');\n\nclient.timetrackingentries.getTimeTrackingEntry(timeTrackingEntryGid, {param: \"value\", param: \"value\", opt_pretty: true})\n .then((result) => {\n console.log(result);\n });",
"name": "node-sdk-v1"
},
{
"language": "python",
"install": "pip install asana",
"code": "import asana\nfrom asana.rest import ApiException\nfrom pprint import pprint\n\nconfiguration = asana.Configuration()\nconfiguration.access_token = '<YOUR_ACCESS_TOKEN>'\napi_client = asana.ApiClient(configuration)\n\n# create an instance of the API class\ntime_tracking_entries_api_instance = asana.TimeTrackingEntriesApi(api_client)\ntime_tracking_entry_gid = \"917392\" # str | Globally unique identifier for the time tracking entry.\nopts = {\n 'opt_fields': \"approval_status,attributable_to,attributable_to.name,attributable_to.resource_subtype,billable_status,categories,categories.color,categories.name,created_at,created_by,created_by.name,description,duration_minutes,entered_on,task,task.created_by,task.name,task.resource_subtype\", # list[str] | 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.\n}\n\ntry:\n # Get a time tracking entry\n api_response = time_tracking_entries_api_instance.get_time_tracking_entry(time_tracking_entry_gid, opts)\n pprint(api_response)\nexcept ApiException as e:\n print(\"Exception when calling TimeTrackingEntriesApi->get_time_tracking_entry: %s\\n\" % e)",
"name": "python-sdk-v5"
},
{
"language": "python",
"install": "pip install asana==3.2.3",
"code": "import asana\n\nclient = asana.Client.access_token('PERSONAL_ACCESS_TOKEN')\n\nresult = client.time_tracking_entries.get_time_tracking_entry(time_tracking_entry_gid, {'param': 'value', 'param': 'value'}, opt_pretty=True)",
"name": "python-sdk-v3"
}
]
},
"x-purple-suite-runtime": "unavailable"
}
PUT /api/1.0/time_tracking_entries/{time_tracking_entry_gid}
Update a time tracking entry
A specific, existing time tracking entry can be updated by making a `PUT` request on
the URL for that time tracking entry. Only the fields provided in the `data` block
will be updated; any unspecified fields will remain unchanged.
When using this method, it is best to specify only those fields you wish
to change, or else you may overwrite changes made by another user since
you last retrieved the task.
Returns the complete updated time tracking entry record.
#### Access requirements
Access to this endpoint has two levels:
- **Endpoint access** requires time tracking to be available through the domain's plan
or add-ons. A request from a domain without time tracking access returns a
`402 Payment Required` error for every request to this endpoint.
- **Field access** for some request fields requires the Timesheets and Budgets add-on.
Fields with this requirement are noted in the request schema. Including one of these
fields without the add-on returns a `402 Payment Required` error, even when the rest of
the request is valid.
Because the field-level requirement is separate, the same endpoint may return `200` or
`402` for the same domain depending on which fields are sent: a request that only uses
fields available with endpoint access succeeds on any domain that meets the endpoint
requirement, while a request that includes a field requiring the add-on also requires
the add-on.
This operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.
Authentication
[
{
"personalAccessToken": []
},
{
"oauth2": []
}
]
Path-level parameters and metadata
{
"parameters": [
{
"$ref": "#/components/parameters/time_tracking_entry_path_gid"
},
{
"$ref": "#/components/parameters/pretty"
}
]
}
Request, responses and operation details
{
"summary": "Update a time tracking entry",
"description": "A specific, existing time tracking entry can be updated by making a `PUT` request on\nthe URL for that time tracking entry. Only the fields provided in the `data` block\nwill be updated; any unspecified fields will remain unchanged.\n\nWhen using this method, it is best to specify only those fields you wish\nto change, or else you may overwrite changes made by another user since\nyou last retrieved the task.\n\nReturns the complete updated time tracking entry record.\n\n#### Access requirements\n\nAccess to this endpoint has two levels:\n\n- **Endpoint access** requires time tracking to be available through the domain's plan\nor add-ons. A request from a domain without time tracking access returns a\n`402 Payment Required` error for every request to this endpoint.\n\n- **Field access** for some request fields requires the Timesheets and Budgets add-on.\nFields with this requirement are noted in the request schema. Including one of these\nfields without the add-on returns a `402 Payment Required` error, even when the rest of\nthe request is valid.\n\nBecause the field-level requirement is separate, the same endpoint may return `200` or\n`402` for the same domain depending on which fields are sent: a request that only uses\nfields available with endpoint access succeeds on any domain that meets the endpoint\nrequirement, while a request that includes a field requiring the add-on also requires\nthe add-on.\n\nThis operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.",
"tags": [
"Time tracking entries"
],
"operationId": "updateTimeTrackingEntry",
"parameters": [
{
"name": "opt_fields",
"in": "query",
"description": "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. Properties can include nested fields. To learn more, see the [input/output options guide](/docs/inputoutput-options#selecting-nested-fields).",
"required": false,
"example": [
"approval_status",
"attributable_to",
"attributable_to.name",
"attributable_to.resource_subtype",
"billable_status",
"categories",
"categories.color",
"categories.name",
"created_at",
"created_by",
"created_by.name",
"description",
"duration_minutes",
"entered_on",
"task",
"task.created_by",
"task.name",
"task.resource_subtype"
],
"schema": {
"type": "array",
"items": {
"type": "string",
"enum": [
"approval_status",
"attributable_to",
"attributable_to.name",
"attributable_to.resource_subtype",
"billable_status",
"categories",
"categories.color",
"categories.name",
"created_at",
"created_by",
"created_by.name",
"description",
"duration_minutes",
"entered_on",
"task",
"task.created_by",
"task.name",
"task.resource_subtype"
]
}
},
"style": "form",
"explode": false
}
],
"requestBody": {
"description": "The updated fields for the time tracking entry.",
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"$ref": "#/components/schemas/UpdateTimeTrackingEntryRequest"
}
}
}
}
}
},
"responses": {
"200": {
"description": "Successfully updated the time tracking entry.",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"$ref": "#/components/schemas/TimeTrackingEntryBase"
}
}
}
}
}
},
"400": {
"$ref": "#/components/responses/BadRequest"
},
"401": {
"$ref": "#/components/responses/Unauthorized"
},
"402": {
"$ref": "#/components/responses/PaymentRequired"
},
"403": {
"$ref": "#/components/responses/Forbidden"
},
"404": {
"$ref": "#/components/responses/NotFound"
},
"500": {
"$ref": "#/components/responses/InternalServerError"
}
},
"security": [
{
"personalAccessToken": []
},
{
"oauth2": []
}
],
"x-readme": {
"code-samples": [
{
"language": "node",
"install": "npm install asana",
"code": "const Asana = require('asana');\n\nlet client = new Asana.ApiClient();\nclient.authentications.token.accessToken = '<YOUR_ACCESS_TOKEN>';\n\nlet timeTrackingEntriesApiInstance = new Asana.TimeTrackingEntriesApi(client);\nlet body = {\"data\": {\"<PARAM_1>\": \"<VALUE_1>\", \"<PARAM_2>\": \"<VALUE_2>\",}}; // Object | The updated fields for the time tracking entry.\nlet time_tracking_entry_gid = \"917392\"; // String | Globally unique identifier for the time tracking entry.\nlet opts = { \n 'opt_fields': \"approval_status,attributable_to,attributable_to.name,attributable_to.resource_subtype,billable_status,categories,categories.color,categories.name,created_at,created_by,created_by.name,description,duration_minutes,entered_on,task,task.created_by,task.name,task.resource_subtype\"\n};\ntimeTrackingEntriesApiInstance.updateTimeTrackingEntry(body, time_tracking_entry_gid, opts).then((result) => {\n console.log('API called successfully. Returned data: ' + JSON.stringify(result.data, null, 2));\n}, (error) => {\n console.error(error.response.body);\n});",
"name": "node-sdk-v3"
},
{
"language": "node",
"install": "npm install asana@1.0.5",
"code": "const asana = require('asana');\n\nconst client = asana.Client.create().useAccessToken('PERSONAL_ACCESS_TOKEN');\n\nclient.timetrackingentries.updateTimeTrackingEntry(timeTrackingEntryGid, {field: \"value\", field: \"value\", pretty: true})\n .then((result) => {\n console.log(result);\n });",
"name": "node-sdk-v1"
},
{
"language": "python",
"install": "pip install asana",
"code": "import asana\nfrom asana.rest import ApiException\nfrom pprint import pprint\n\nconfiguration = asana.Configuration()\nconfiguration.access_token = '<YOUR_ACCESS_TOKEN>'\napi_client = asana.ApiClient(configuration)\n\n# create an instance of the API class\ntime_tracking_entries_api_instance = asana.TimeTrackingEntriesApi(api_client)\nbody = {\"data\": {\"<PARAM_1>\": \"<VALUE_1>\", \"<PARAM_2>\": \"<VALUE_2>\",}} # dict | The updated fields for the time tracking entry.\ntime_tracking_entry_gid = \"917392\" # str | Globally unique identifier for the time tracking entry.\nopts = {\n 'opt_fields': \"approval_status,attributable_to,attributable_to.name,attributable_to.resource_subtype,billable_status,categories,categories.color,categories.name,created_at,created_by,created_by.name,description,duration_minutes,entered_on,task,task.created_by,task.name,task.resource_subtype\", # list[str] | 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.\n}\n\ntry:\n # Update a time tracking entry\n api_response = time_tracking_entries_api_instance.update_time_tracking_entry(body, time_tracking_entry_gid, opts)\n pprint(api_response)\nexcept ApiException as e:\n print(\"Exception when calling TimeTrackingEntriesApi->update_time_tracking_entry: %s\\n\" % e)",
"name": "python-sdk-v5"
},
{
"language": "python",
"install": "pip install asana==3.2.3",
"code": "import asana\n\nclient = asana.Client.access_token('PERSONAL_ACCESS_TOKEN')\n\nresult = client.time_tracking_entries.update_time_tracking_entry(time_tracking_entry_gid, {'field': 'value', 'field': 'value'}, opt_pretty=True)",
"name": "python-sdk-v3"
}
]
},
"x-purple-suite-runtime": "unavailable"
}
DELETE /api/1.0/time_tracking_entries/{time_tracking_entry_gid}
Delete a time tracking entry
A specific, existing time tracking entry can be deleted by making a `DELETE` request on
the URL for that time tracking entry.
Returns an empty data record.
#### Access requirements
This endpoint is available only when time tracking is available through the domain's
plan or add-ons. A request from a domain without time tracking access returns a
`402 Payment Required` error.
This operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.
Authentication
[
{
"personalAccessToken": []
},
{
"oauth2": []
}
]
Path-level parameters and metadata
{
"parameters": [
{
"$ref": "#/components/parameters/time_tracking_entry_path_gid"
},
{
"$ref": "#/components/parameters/pretty"
}
]
}
Request, responses and operation details
{
"summary": "Delete a time tracking entry",
"description": "A specific, existing time tracking entry can be deleted by making a `DELETE` request on\nthe URL for that time tracking entry.\n\nReturns an empty data record.\n\n#### Access requirements\n\nThis endpoint is available only when time tracking is available through the domain's\nplan or add-ons. A request from a domain without time tracking access returns a\n`402 Payment Required` error.\n\nThis operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.",
"tags": [
"Time tracking entries"
],
"operationId": "deleteTimeTrackingEntry",
"responses": {
"200": {
"description": "Successfully deleted the specified time tracking entry.",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"$ref": "#/components/schemas/EmptyResponse"
}
}
}
}
}
},
"400": {
"$ref": "#/components/responses/BadRequest"
},
"401": {
"$ref": "#/components/responses/Unauthorized"
},
"402": {
"$ref": "#/components/responses/PaymentRequired"
},
"403": {
"$ref": "#/components/responses/Forbidden"
},
"404": {
"$ref": "#/components/responses/NotFound"
},
"500": {
"$ref": "#/components/responses/InternalServerError"
}
},
"security": [
{
"personalAccessToken": []
},
{
"oauth2": []
}
],
"x-readme": {
"code-samples": [
{
"language": "node",
"install": "npm install asana",
"code": "const Asana = require('asana');\n\nlet client = new Asana.ApiClient();\nclient.authentications.token.accessToken = '<YOUR_ACCESS_TOKEN>';\n\nlet timeTrackingEntriesApiInstance = new Asana.TimeTrackingEntriesApi(client);\nlet time_tracking_entry_gid = \"917392\"; // String | Globally unique identifier for the time tracking entry.\n\ntimeTrackingEntriesApiInstance.deleteTimeTrackingEntry(time_tracking_entry_gid).then((result) => {\n console.log('API called successfully. Returned data: ' + JSON.stringify(result.data, null, 2));\n}, (error) => {\n console.error(error.response.body);\n});",
"name": "node-sdk-v3"
},
{
"language": "node",
"install": "npm install asana@1.0.5",
"code": "const asana = require('asana');\n\nconst client = asana.Client.create().useAccessToken('PERSONAL_ACCESS_TOKEN');\n\nclient.timetrackingentries.deleteTimeTrackingEntry(timeTrackingEntryGid)\n .then((result) => {\n console.log(result);\n });",
"name": "node-sdk-v1"
},
{
"language": "python",
"install": "pip install asana",
"code": "import asana\nfrom asana.rest import ApiException\nfrom pprint import pprint\n\nconfiguration = asana.Configuration()\nconfiguration.access_token = '<YOUR_ACCESS_TOKEN>'\napi_client = asana.ApiClient(configuration)\n\n# create an instance of the API class\ntime_tracking_entries_api_instance = asana.TimeTrackingEntriesApi(api_client)\ntime_tracking_entry_gid = \"917392\" # str | Globally unique identifier for the time tracking entry.\n\n\ntry:\n # Delete a time tracking entry\n api_response = time_tracking_entries_api_instance.delete_time_tracking_entry(time_tracking_entry_gid)\n pprint(api_response)\nexcept ApiException as e:\n print(\"Exception when calling TimeTrackingEntriesApi->delete_time_tracking_entry: %s\\n\" % e)",
"name": "python-sdk-v5"
},
{
"language": "python",
"install": "pip install asana==3.2.3",
"code": "import asana\n\nclient = asana.Client.access_token('PERSONAL_ACCESS_TOKEN')\n\nresult = client.time_tracking_entries.delete_time_tracking_entry(time_tracking_entry_gid, opt_pretty=True)",
"name": "python-sdk-v3"
}
]
},
"x-purple-suite-runtime": "unavailable"
}
GET /api/1.0/time_tracking_entries
Get multiple time tracking entries
<b>Required scope: </b><code>time_tracking_entries:read</code>
Returns a list of time tracking entries filtered to a task, attributed project, portfolio or user.
This operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.
Authentication
[
{
"personalAccessToken": []
},
{
"oauth2": [
"time_tracking_entries:read"
]
}
]
Path-level parameters and metadata
{
"parameters": [
{
"$ref": "#/components/parameters/pretty"
}
]
}
Request, responses and operation details
{
"summary": "Get multiple time tracking entries",
"description": "<b>Required scope: </b><code>time_tracking_entries:read</code>\n\nReturns a list of time tracking entries filtered to a task, attributed project, portfolio or user.\n\nThis operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.",
"tags": [
"Time tracking entries"
],
"operationId": "getTimeTrackingEntries",
"parameters": [
{
"name": "task",
"in": "query",
"description": "Globally unique identifier for the task to filter time tracking entries by.",
"schema": {
"type": "string"
},
"example": "12345"
},
{
"name": "attributable_to",
"in": "query",
"description": "Globally unique identifier for the project the time tracking entries are attributed to.",
"schema": {
"type": "string"
},
"example": "12345"
},
{
"name": "portfolio",
"in": "query",
"description": "Globally unique identifier for the portfolio to filter time tracking entries by.",
"schema": {
"type": "string"
},
"example": "12345"
},
{
"name": "user",
"in": "query",
"description": "Globally unique identifier for the user to filter time tracking entries by.",
"schema": {
"type": "string"
},
"example": "12345"
},
{
"name": "workspace",
"in": "query",
"description": "Globally unique identifier for the workspace. At least one of `entered_on_start_date` or `entered_on_end_date` must be provided when filtering by workspace.",
"schema": {
"type": "string"
},
"example": "98765"
},
{
"name": "entered_on_start_date",
"in": "query",
"description": "The start date for filtering time tracking entries by when they were entered.",
"schema": {
"type": "string",
"format": "date"
},
"example": "2025-01-01"
},
{
"name": "entered_on_end_date",
"in": "query",
"description": "The end date for filtering time tracking entries by when they were entered.",
"schema": {
"type": "string",
"format": "date"
},
"example": "2025-12-31"
},
{
"name": "timesheet_approval_status",
"in": "query",
"description": "Globally unique identifier for the timesheet approval status to filter time tracking entries by.",
"schema": {
"type": "string"
},
"example": "12345"
},
{
"$ref": "#/components/parameters/limit"
},
{
"$ref": "#/components/parameters/offset"
},
{
"name": "opt_fields",
"in": "query",
"description": "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. Properties can include nested fields. To learn more, see the [input/output options guide](/docs/inputoutput-options#selecting-nested-fields).",
"required": false,
"example": [
"attributable_to",
"attributable_to.name",
"attributable_to.resource_subtype",
"categories",
"categories.color",
"categories.name",
"created_by",
"created_by.name",
"duration_minutes",
"entered_on",
"offset",
"path",
"uri"
],
"schema": {
"type": "array",
"items": {
"type": "string",
"enum": [
"attributable_to",
"attributable_to.name",
"attributable_to.resource_subtype",
"categories",
"categories.color",
"categories.name",
"created_by",
"created_by.name",
"duration_minutes",
"entered_on",
"offset",
"path",
"uri"
]
}
},
"style": "form",
"explode": false
}
],
"responses": {
"200": {
"description": "Successfully retrieved the requested time tracking entries.",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"type": "array",
"items": {
"$ref": "#/components/schemas/TimeTrackingEntryCompact"
}
},
"next_page": {
"$ref": "#/components/schemas/NextPage"
}
}
}
}
}
},
"400": {
"$ref": "#/components/responses/BadRequest"
},
"401": {
"$ref": "#/components/responses/Unauthorized"
},
"402": {
"$ref": "#/components/responses/PaymentRequired"
},
"403": {
"$ref": "#/components/responses/Forbidden"
},
"404": {
"$ref": "#/components/responses/NotFound"
},
"500": {
"$ref": "#/components/responses/InternalServerError"
}
},
"security": [
{
"personalAccessToken": []
},
{
"oauth2": [
"time_tracking_entries:read"
]
}
],
"x-readme": {
"code-samples": [
{
"language": "node",
"install": "npm install asana",
"code": "const Asana = require('asana');\n\nlet client = new Asana.ApiClient();\nclient.authentications.token.accessToken = '<YOUR_ACCESS_TOKEN>';\n\nlet timeTrackingEntriesApiInstance = new Asana.TimeTrackingEntriesApi(client);\nlet opts = { \n 'task': \"12345\", \n 'attributable_to': \"12345\", \n 'portfolio': \"12345\", \n 'user': \"12345\", \n 'workspace': \"98765\", \n 'entered_on_start_date': \"2025-01-01\", \n 'entered_on_end_date': \"2025-12-31\", \n 'timesheet_approval_status': \"12345\", \n 'limit': 50, \n 'offset': \"eyJ0eXAiOJiKV1iQLCJhbGciOiJIUzI1NiJ9\", \n 'opt_fields': \"attributable_to,attributable_to.name,attributable_to.resource_subtype,categories,categories.color,categories.name,created_by,created_by.name,duration_minutes,entered_on,offset,path,uri\"\n};\ntimeTrackingEntriesApiInstance.getTimeTrackingEntries(opts).then((result) => {\n console.log('API called successfully. Returned data: ' + JSON.stringify(result.data, null, 2));\n}, (error) => {\n console.error(error.response.body);\n});",
"name": "node-sdk-v3"
},
{
"language": "python",
"install": "pip install asana",
"code": "import asana\nfrom asana.rest import ApiException\nfrom pprint import pprint\n\nconfiguration = asana.Configuration()\nconfiguration.access_token = '<YOUR_ACCESS_TOKEN>'\napi_client = asana.ApiClient(configuration)\n\n# create an instance of the API class\ntime_tracking_entries_api_instance = asana.TimeTrackingEntriesApi(api_client)\nopts = {\n 'task': \"12345\", # str | Globally unique identifier for the task to filter time tracking entries by.\n 'attributable_to': \"12345\", # str | Globally unique identifier for the project the time tracking entries are attributed to.\n 'portfolio': \"12345\", # str | Globally unique identifier for the portfolio to filter time tracking entries by.\n 'user': \"12345\", # str | Globally unique identifier for the user to filter time tracking entries by.\n 'workspace': \"98765\", # str | Globally unique identifier for the workspace. At least one of `entered_on_start_date` or `entered_on_end_date` must be provided when filtering by workspace.\n 'entered_on_start_date': '2025-01-01', # date | The start date for filtering time tracking entries by when they were entered.\n 'entered_on_end_date': '2025-12-31', # date | The end date for filtering time tracking entries by when they were entered.\n 'timesheet_approval_status': \"12345\", # str | Globally unique identifier for the timesheet approval status to filter time tracking entries by.\n 'limit': 50, # int | Results per page. The number of objects to return per page. The value must be between 1 and 100.\n 'offset': \"eyJ0eXAiOJiKV1iQLCJhbGciOiJIUzI1NiJ9\", # str | 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.*\n 'opt_fields': \"attributable_to,attributable_to.name,attributable_to.resource_subtype,categories,categories.color,categories.name,created_by,created_by.name,duration_minutes,entered_on,offset,path,uri\", # list[str] | 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.\n}\n\ntry:\n # Get multiple time tracking entries\n api_response = time_tracking_entries_api_instance.get_time_tracking_entries(opts)\n for data in api_response:\n pprint(data)\nexcept ApiException as e:\n print(\"Exception when calling TimeTrackingEntriesApi->get_time_tracking_entries: %s\\n\" % e)",
"name": "python-sdk-v5"
}
]
},
"x-purple-suite-runtime": "unavailable"
}
GET /api/1.0/timesheet_approval_statuses/{timesheet_approval_status_gid}
Get a timesheet approval status
<b>Required scope: </b><code>timesheet_approval_statuses:read</code>
Returns the complete timesheet approval status record for a single timesheet approval status.
This operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.
Authentication
[
{
"personalAccessToken": []
},
{
"oauth2": [
"timesheet_approval_statuses:read"
]
}
]
Path-level parameters and metadata
{
"parameters": [
{
"$ref": "#/components/parameters/timesheet_approval_status_path_gid"
},
{
"$ref": "#/components/parameters/pretty"
}
]
}
Request, responses and operation details
{
"summary": "Get a timesheet approval status",
"description": "<b>Required scope: </b><code>timesheet_approval_statuses:read</code>\n\nReturns the complete timesheet approval status record for a single timesheet approval status.\n\nThis operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.",
"tags": [
"Timesheet approval statuses"
],
"operationId": "getTimesheetApprovalStatus",
"parameters": [
{
"name": "opt_fields",
"in": "query",
"description": "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. Properties can include nested fields. To learn more, see the [input/output options guide](/docs/inputoutput-options#selecting-nested-fields).",
"required": false,
"example": [
"approval_status",
"created_at",
"end_date",
"start_date",
"user",
"user.name",
"workspace",
"workspace.name"
],
"schema": {
"type": "array",
"items": {
"type": "string",
"enum": [
"approval_status",
"created_at",
"end_date",
"start_date",
"user",
"user.name",
"workspace",
"workspace.name"
]
}
},
"style": "form",
"explode": false
}
],
"responses": {
"200": {
"description": "Successfully retrieved the requested timesheet approval status.",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"$ref": "#/components/schemas/TimesheetApprovalStatusResponse"
}
}
}
}
}
},
"400": {
"$ref": "#/components/responses/BadRequest"
},
"401": {
"$ref": "#/components/responses/Unauthorized"
},
"403": {
"$ref": "#/components/responses/Forbidden"
},
"404": {
"$ref": "#/components/responses/NotFound"
},
"500": {
"$ref": "#/components/responses/InternalServerError"
}
},
"security": [
{
"personalAccessToken": []
},
{
"oauth2": [
"timesheet_approval_statuses:read"
]
}
],
"x-readme": {
"code-samples": [
{
"language": "node",
"install": "npm install asana",
"code": "const Asana = require('asana');\n\nlet client = new Asana.ApiClient();\nclient.authentications.token.accessToken = '<YOUR_ACCESS_TOKEN>';\n\nlet timesheetApprovalStatusesApiInstance = new Asana.TimesheetApprovalStatusesApi(client);\nlet timesheet_approval_status_gid = \"917392\"; // String | Globally unique identifier for the timesheet approval status.\nlet opts = { \n 'opt_fields': \"approval_status,created_at,end_date,start_date,user,user.name,workspace,workspace.name\"\n};\ntimesheetApprovalStatusesApiInstance.getTimesheetApprovalStatus(timesheet_approval_status_gid, opts).then((result) => {\n console.log('API called successfully. Returned data: ' + JSON.stringify(result.data, null, 2));\n}, (error) => {\n console.error(error.response.body);\n});",
"name": "node-sdk-v3"
},
{
"language": "python",
"install": "pip install asana",
"code": "import asana\nfrom asana.rest import ApiException\nfrom pprint import pprint\n\nconfiguration = asana.Configuration()\nconfiguration.access_token = '<YOUR_ACCESS_TOKEN>'\napi_client = asana.ApiClient(configuration)\n\n# create an instance of the API class\ntimesheet_approval_statuses_api_instance = asana.TimesheetApprovalStatusesApi(api_client)\ntimesheet_approval_status_gid = \"917392\" # str | Globally unique identifier for the timesheet approval status.\nopts = {\n 'opt_fields': \"approval_status,created_at,end_date,start_date,user,user.name,workspace,workspace.name\", # list[str] | 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.\n}\n\ntry:\n # Get a timesheet approval status\n api_response = timesheet_approval_statuses_api_instance.get_timesheet_approval_status(timesheet_approval_status_gid, opts)\n pprint(api_response)\nexcept ApiException as e:\n print(\"Exception when calling TimesheetApprovalStatusesApi->get_timesheet_approval_status: %s\\n\" % e)",
"name": "python-sdk-v5"
}
]
},
"x-purple-suite-runtime": "unavailable"
}
PUT /api/1.0/timesheet_approval_statuses/{timesheet_approval_status_gid}
Update a timesheet approval status
<b>Required scope: </b><code>timesheet_approval_statuses:write</code>
Updates the approval status of a timesheet approval status. The update supports state transitions such as submitting, recalling submission, approving, and rejecting. Only the fields provided in the `data` block will be updated; any unspecified fields will remain unchanged. Invalid transitions will result in a 400 error.
This operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.
Authentication
[
{
"personalAccessToken": []
},
{
"oauth2": [
"timesheet_approval_statuses:write"
]
}
]
Path-level parameters and metadata
{
"parameters": [
{
"$ref": "#/components/parameters/timesheet_approval_status_path_gid"
},
{
"$ref": "#/components/parameters/pretty"
}
]
}
Request, responses and operation details
{
"summary": "Update a timesheet approval status",
"description": "<b>Required scope: </b><code>timesheet_approval_statuses:write</code>\n\nUpdates the approval status of a timesheet approval status. The update supports state transitions such as submitting, recalling submission, approving, and rejecting. Only the fields provided in the `data` block will be updated; any unspecified fields will remain unchanged. Invalid transitions will result in a 400 error.\n\nThis operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.",
"tags": [
"Timesheet approval statuses"
],
"operationId": "updateTimesheetApprovalStatus",
"parameters": [
{
"name": "opt_fields",
"in": "query",
"description": "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. Properties can include nested fields. To learn more, see the [input/output options guide](/docs/inputoutput-options#selecting-nested-fields).",
"required": false,
"example": [
"approval_status",
"created_at",
"end_date",
"start_date",
"user",
"user.name",
"workspace",
"workspace.name"
],
"schema": {
"type": "array",
"items": {
"type": "string",
"enum": [
"approval_status",
"created_at",
"end_date",
"start_date",
"user",
"user.name",
"workspace",
"workspace.name"
]
}
},
"style": "form",
"explode": false
}
],
"requestBody": {
"description": "The fields to update on the timesheet approval status.",
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"$ref": "#/components/schemas/UpdateTimesheetApprovalStatusRequest"
}
}
}
}
}
},
"responses": {
"200": {
"description": "Successfully updated the requested timesheet approval status.",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"$ref": "#/components/schemas/TimesheetApprovalStatusResponse"
}
}
}
}
}
},
"400": {
"$ref": "#/components/responses/BadRequest"
},
"401": {
"$ref": "#/components/responses/Unauthorized"
},
"402": {
"$ref": "#/components/responses/PaymentRequired"
},
"403": {
"$ref": "#/components/responses/Forbidden"
},
"404": {
"$ref": "#/components/responses/NotFound"
},
"500": {
"$ref": "#/components/responses/InternalServerError"
}
},
"security": [
{
"personalAccessToken": []
},
{
"oauth2": [
"timesheet_approval_statuses:write"
]
}
],
"x-readme": {
"code-samples": [
{
"language": "node",
"install": "npm install asana",
"code": "const Asana = require('asana');\n\nlet client = new Asana.ApiClient();\nclient.authentications.token.accessToken = '<YOUR_ACCESS_TOKEN>';\n\nlet timesheetApprovalStatusesApiInstance = new Asana.TimesheetApprovalStatusesApi(client);\nlet body = {\"data\": {\"<PARAM_1>\": \"<VALUE_1>\", \"<PARAM_2>\": \"<VALUE_2>\",}}; // Object | The fields to update on the timesheet approval status.\nlet timesheet_approval_status_gid = \"917392\"; // String | Globally unique identifier for the timesheet approval status.\nlet opts = { \n 'opt_fields': \"approval_status,created_at,end_date,start_date,user,user.name,workspace,workspace.name\"\n};\ntimesheetApprovalStatusesApiInstance.updateTimesheetApprovalStatus(body, timesheet_approval_status_gid, opts).then((result) => {\n console.log('API called successfully. Returned data: ' + JSON.stringify(result.data, null, 2));\n}, (error) => {\n console.error(error.response.body);\n});",
"name": "node-sdk-v3"
},
{
"language": "python",
"install": "pip install asana",
"code": "import asana\nfrom asana.rest import ApiException\nfrom pprint import pprint\n\nconfiguration = asana.Configuration()\nconfiguration.access_token = '<YOUR_ACCESS_TOKEN>'\napi_client = asana.ApiClient(configuration)\n\n# create an instance of the API class\ntimesheet_approval_statuses_api_instance = asana.TimesheetApprovalStatusesApi(api_client)\nbody = {\"data\": {\"<PARAM_1>\": \"<VALUE_1>\", \"<PARAM_2>\": \"<VALUE_2>\",}} # dict | The fields to update on the timesheet approval status.\ntimesheet_approval_status_gid = \"917392\" # str | Globally unique identifier for the timesheet approval status.\nopts = {\n 'opt_fields': \"approval_status,created_at,end_date,start_date,user,user.name,workspace,workspace.name\", # list[str] | 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.\n}\n\ntry:\n # Update a timesheet approval status\n api_response = timesheet_approval_statuses_api_instance.update_timesheet_approval_status(body, timesheet_approval_status_gid, opts)\n pprint(api_response)\nexcept ApiException as e:\n print(\"Exception when calling TimesheetApprovalStatusesApi->update_timesheet_approval_status: %s\\n\" % e)",
"name": "python-sdk-v5"
}
]
},
"x-purple-suite-runtime": "unavailable"
}
GET /api/1.0/timesheet_approval_statuses
Get multiple timesheet approval statuses
<b>Required scope: </b><code>timesheet_approval_statuses:read</code>
Returns a list of timesheet approval statuses filtered by workspace and optionally by user, date range, or approval status.
This operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.
Authentication
[
{
"personalAccessToken": []
},
{
"oauth2": [
"timesheet_approval_statuses:read"
]
}
]
Path-level parameters and metadata
{
"parameters": [
{
"$ref": "#/components/parameters/pretty"
}
]
}
Request, responses and operation details
{
"summary": "Get multiple timesheet approval statuses",
"description": "<b>Required scope: </b><code>timesheet_approval_statuses:read</code>\n\nReturns a list of timesheet approval statuses filtered by workspace and optionally by user, date range, or approval status.\n\nThis operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.",
"tags": [
"Timesheet approval statuses"
],
"operationId": "getTimesheetApprovalStatuses",
"parameters": [
{
"name": "workspace",
"in": "query",
"required": true,
"description": "Globally unique identifier for the workspace.",
"schema": {
"type": "string"
},
"example": "12345"
},
{
"name": "user",
"in": "query",
"description": "Globally unique identifier for the user to filter timesheet approval statuses by.",
"schema": {
"type": "string"
},
"example": "67890"
},
{
"name": "from_date",
"in": "query",
"description": "The start date for filtering timesheet approval statuses.",
"schema": {
"type": "string",
"format": "date"
},
"example": "2025-11-01"
},
{
"name": "to_date",
"in": "query",
"description": "The end date for filtering timesheet approval statuses.",
"schema": {
"type": "string",
"format": "date"
},
"example": "2025-11-30"
},
{
"name": "approval_statuses",
"in": "query",
"description": "Filter by approval status. Can be one or more of draft, submitted, approved, or rejected.",
"schema": {
"type": "string"
},
"example": "draft"
},
{
"$ref": "#/components/parameters/limit"
},
{
"$ref": "#/components/parameters/offset"
},
{
"name": "opt_fields",
"in": "query",
"description": "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. Properties can include nested fields. To learn more, see the [input/output options guide](/docs/inputoutput-options#selecting-nested-fields).",
"required": false,
"example": [
"approval_status",
"created_at",
"end_date",
"offset",
"path",
"start_date",
"uri",
"user",
"user.name",
"workspace",
"workspace.name"
],
"schema": {
"type": "array",
"items": {
"type": "string",
"enum": [
"approval_status",
"created_at",
"end_date",
"offset",
"path",
"start_date",
"uri",
"user",
"user.name",
"workspace",
"workspace.name"
]
}
},
"style": "form",
"explode": false
}
],
"responses": {
"200": {
"description": "Successfully retrieved the requested timesheet approval statuses.",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"type": "array",
"items": {
"$ref": "#/components/schemas/TimesheetApprovalStatusCompact"
}
},
"next_page": {
"$ref": "#/components/schemas/NextPage"
}
}
}
}
}
},
"400": {
"$ref": "#/components/responses/BadRequest"
},
"401": {
"$ref": "#/components/responses/Unauthorized"
},
"403": {
"$ref": "#/components/responses/Forbidden"
},
"404": {
"$ref": "#/components/responses/NotFound"
},
"500": {
"$ref": "#/components/responses/InternalServerError"
}
},
"security": [
{
"personalAccessToken": []
},
{
"oauth2": [
"timesheet_approval_statuses:read"
]
}
],
"x-readme": {
"code-samples": [
{
"language": "node",
"install": "npm install asana",
"code": "const Asana = require('asana');\n\nlet client = new Asana.ApiClient();\nclient.authentications.token.accessToken = '<YOUR_ACCESS_TOKEN>';\n\nlet timesheetApprovalStatusesApiInstance = new Asana.TimesheetApprovalStatusesApi(client);\nlet workspace = \"12345\"; // String | Globally unique identifier for the workspace.\nlet opts = { \n 'user': \"67890\", \n 'from_date': \"2025-11-01\", \n 'to_date': \"2025-11-30\", \n 'approval_statuses': \"draft\", \n 'limit': 50, \n 'offset': \"eyJ0eXAiOJiKV1iQLCJhbGciOiJIUzI1NiJ9\", \n 'opt_fields': \"approval_status,created_at,end_date,offset,path,start_date,uri,user,user.name,workspace,workspace.name\"\n};\ntimesheetApprovalStatusesApiInstance.getTimesheetApprovalStatuses(workspace, opts).then((result) => {\n console.log('API called successfully. Returned data: ' + JSON.stringify(result.data, null, 2));\n}, (error) => {\n console.error(error.response.body);\n});",
"name": "node-sdk-v3"
},
{
"language": "python",
"install": "pip install asana",
"code": "import asana\nfrom asana.rest import ApiException\nfrom pprint import pprint\n\nconfiguration = asana.Configuration()\nconfiguration.access_token = '<YOUR_ACCESS_TOKEN>'\napi_client = asana.ApiClient(configuration)\n\n# create an instance of the API class\ntimesheet_approval_statuses_api_instance = asana.TimesheetApprovalStatusesApi(api_client)\nworkspace = \"12345\" # str | Globally unique identifier for the workspace.\nopts = {\n 'user': \"67890\", # str | Globally unique identifier for the user to filter timesheet approval statuses by.\n 'from_date': '2025-11-01', # date | The start date for filtering timesheet approval statuses.\n 'to_date': '2025-11-30', # date | The end date for filtering timesheet approval statuses.\n 'approval_statuses': \"draft\", # str | Filter by approval status. Can be one or more of draft, submitted, approved, or rejected.\n 'limit': 50, # int | Results per page. The number of objects to return per page. The value must be between 1 and 100.\n 'offset': \"eyJ0eXAiOJiKV1iQLCJhbGciOiJIUzI1NiJ9\", # str | 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.*\n 'opt_fields': \"approval_status,created_at,end_date,offset,path,start_date,uri,user,user.name,workspace,workspace.name\", # list[str] | 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.\n}\n\ntry:\n # Get multiple timesheet approval statuses\n api_response = timesheet_approval_statuses_api_instance.get_timesheet_approval_statuses(workspace, opts)\n for data in api_response:\n pprint(data)\nexcept ApiException as e:\n print(\"Exception when calling TimesheetApprovalStatusesApi->get_timesheet_approval_statuses: %s\\n\" % e)",
"name": "python-sdk-v5"
}
]
},
"x-purple-suite-runtime": "unavailable"
}
POST /api/1.0/timesheet_approval_statuses
Create a timesheet approval status
<b>Required scope: </b><code>timesheet_approval_statuses:write</code>
Creates a new timesheet approval status for a user's timesheet week. The start_date must be a Monday or Sunday, and end_date must be the last day of that week (Sunday for a Monday start, Saturday for a Sunday start).
Returns the created timesheet approval status record.
This operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.
Authentication
[
{
"personalAccessToken": []
},
{
"oauth2": [
"timesheet_approval_statuses:write"
]
}
]
Path-level parameters and metadata
{
"parameters": [
{
"$ref": "#/components/parameters/pretty"
}
]
}
Request, responses and operation details
{
"summary": "Create a timesheet approval status",
"description": "<b>Required scope: </b><code>timesheet_approval_statuses:write</code>\n\nCreates a new timesheet approval status for a user's timesheet week. The start_date must be a Monday or Sunday, and end_date must be the last day of that week (Sunday for a Monday start, Saturday for a Sunday start).\nReturns the created timesheet approval status record.\n\nThis operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.",
"tags": [
"Timesheet approval statuses"
],
"operationId": "createTimesheetApprovalStatus",
"parameters": [
{
"name": "opt_fields",
"in": "query",
"description": "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. Properties can include nested fields. To learn more, see the [input/output options guide](/docs/inputoutput-options#selecting-nested-fields).",
"required": false,
"example": [
"approval_status",
"created_at",
"end_date",
"start_date",
"user",
"user.name",
"workspace",
"workspace.name"
],
"schema": {
"type": "array",
"items": {
"type": "string",
"enum": [
"approval_status",
"created_at",
"end_date",
"start_date",
"user",
"user.name",
"workspace",
"workspace.name"
]
}
},
"style": "form",
"explode": false
}
],
"requestBody": {
"description": "The timesheet approval status to create.",
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"$ref": "#/components/schemas/CreateTimesheetApprovalStatusRequest"
}
}
}
}
}
},
"responses": {
"201": {
"description": "Successfully created a timesheet approval status.",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"$ref": "#/components/schemas/TimesheetApprovalStatusResponse"
}
}
}
}
}
},
"400": {
"$ref": "#/components/responses/BadRequest"
},
"401": {
"$ref": "#/components/responses/Unauthorized"
},
"402": {
"$ref": "#/components/responses/PaymentRequired"
},
"403": {
"$ref": "#/components/responses/Forbidden"
},
"404": {
"$ref": "#/components/responses/NotFound"
},
"500": {
"$ref": "#/components/responses/InternalServerError"
}
},
"security": [
{
"personalAccessToken": []
},
{
"oauth2": [
"timesheet_approval_statuses:write"
]
}
],
"x-readme": {
"code-samples": [
{
"language": "node",
"install": "npm install asana",
"code": "const Asana = require('asana');\n\nlet client = new Asana.ApiClient();\nclient.authentications.token.accessToken = '<YOUR_ACCESS_TOKEN>';\n\nlet timesheetApprovalStatusesApiInstance = new Asana.TimesheetApprovalStatusesApi(client);\nlet body = {\"data\": {\"<PARAM_1>\": \"<VALUE_1>\", \"<PARAM_2>\": \"<VALUE_2>\",}}; // Object | The timesheet approval status to create.\nlet opts = { \n 'opt_fields': \"approval_status,created_at,end_date,start_date,user,user.name,workspace,workspace.name\"\n};\ntimesheetApprovalStatusesApiInstance.createTimesheetApprovalStatus(body, opts).then((result) => {\n console.log('API called successfully. Returned data: ' + JSON.stringify(result.data, null, 2));\n}, (error) => {\n console.error(error.response.body);\n});",
"name": "node-sdk-v3"
},
{
"language": "python",
"install": "pip install asana",
"code": "import asana\nfrom asana.rest import ApiException\nfrom pprint import pprint\n\nconfiguration = asana.Configuration()\nconfiguration.access_token = '<YOUR_ACCESS_TOKEN>'\napi_client = asana.ApiClient(configuration)\n\n# create an instance of the API class\ntimesheet_approval_statuses_api_instance = asana.TimesheetApprovalStatusesApi(api_client)\nbody = {\"data\": {\"<PARAM_1>\": \"<VALUE_1>\", \"<PARAM_2>\": \"<VALUE_2>\",}} # dict | The timesheet approval status to create.\nopts = {\n 'opt_fields': \"approval_status,created_at,end_date,start_date,user,user.name,workspace,workspace.name\", # list[str] | 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.\n}\n\ntry:\n # Create a timesheet approval status\n api_response = timesheet_approval_statuses_api_instance.create_timesheet_approval_status(body, opts)\n pprint(api_response)\nexcept ApiException as e:\n print(\"Exception when calling TimesheetApprovalStatusesApi->create_timesheet_approval_status: %s\\n\" % e)",
"name": "python-sdk-v5"
}
]
},
"x-purple-suite-runtime": "unavailable"
}
GET /api/1.0/workspaces/{workspace_gid}/typeahead
Get objects via typeahead
<b>Required scope: </b><code>workspaces.typeahead:read</code>
Retrieves objects in the workspace based via an auto-completion/typeahead
search algorithm. This feature is meant to provide results quickly, so do
not rely on this API to provide extremely accurate search results. The
result set is limited to a single page of results with a maximum size, so
you won’t be able to fetch large numbers of results.
The typeahead search API provides search for objects from a single
workspace. This endpoint should be used to query for objects when
creating an auto-completion/typeahead search feature. This API is meant
to provide results quickly and should not be relied upon for accurate or
exhaustive search results. The results sets are limited in size and
cannot be paginated.
Queries return a compact representation of each object which is typically
the gid and name fields. Interested in a specific set of fields or all of
the fields?! Of course you are. Use field selectors to manipulate what
data is included in a response.
Resources with type `user` are returned in order of most contacted to
least contacted. This is determined by task assignments, adding the user
to projects, and adding the user as a follower to tasks, messages,
etc.
Resources with type `project` are returned in order of recency. This is
determined when the user visits the project, is added to the project, and
completes tasks in the project.
Resources with type `task` are returned with priority placed on tasks
the user is following, but no guarantee on the order of those tasks.
Resources with type `project_template` are returned with priority
placed on favorited project templates.
Leaving the `query` string empty or omitted will give you results, still
following the resource ordering above. This could be used to list users or
projects that are relevant for the requesting user's api token.
The `agent` type returns only agents, currently limited to AI Teammates, which are Asana's first-party agents. The `actor` type returns a combined set of users and agents.
This operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.
Authentication
[
{
"personalAccessToken": []
},
{
"oauth2": [
"workspaces.typeahead:read"
]
}
]
Path-level parameters and metadata
{
"parameters": [
{
"$ref": "#/components/parameters/workspace_path_gid"
},
{
"name": "resource_type",
"in": "query",
"description": "The type of values the typeahead should return. You can choose from one of the following: `actor`, `agent`, `custom_field`, `goal`, `project`, `project_template`, `portfolio`, `tag`, `task`, `team`, and `user`. Note that unlike in the names of endpoints, the types listed here are in singular form (e.g. `task`). Using multiple types is not yet supported. The `agent` type returns only agents, currently limited to AI Teammates, which are Asana's first-party agents. The `actor` type returns a combined set of users and agents.",
"required": true,
"schema": {
"type": "string",
"enum": [
"actor",
"agent",
"custom_field",
"goal",
"project",
"project_template",
"portfolio",
"tag",
"task",
"team",
"user"
],
"default": "user"
}
},
{
"name": "type",
"in": "query",
"description": "*Deprecated: new integrations should prefer the resource_type field.*",
"required": false,
"schema": {
"type": "string",
"enum": [
"custom_field",
"portfolio",
"project",
"tag",
"task",
"user"
],
"default": "user"
}
},
{
"name": "query",
"in": "query",
"description": "The string that will be used to search for relevant objects. If an empty string is passed in, the API will return results.",
"schema": {
"type": "string"
},
"example": "Greg"
},
{
"name": "count",
"in": "query",
"description": "The number of results to return. The default is 20 if this parameter is omitted, with a minimum of 1 and a maximum of 100. If there are fewer results found than requested, all will be returned.",
"schema": {
"type": "integer"
},
"example": 20
},
{
"$ref": "#/components/parameters/pretty"
}
]
}
Request, responses and operation details
{
"summary": "Get objects via typeahead",
"description": "<b>Required scope: </b><code>workspaces.typeahead:read</code>\n\nRetrieves objects in the workspace based via an auto-completion/typeahead\nsearch algorithm. This feature is meant to provide results quickly, so do\nnot rely on this API to provide extremely accurate search results. The\nresult set is limited to a single page of results with a maximum size, so\nyou won’t be able to fetch large numbers of results.\n\nThe typeahead search API provides search for objects from a single\nworkspace. This endpoint should be used to query for objects when\ncreating an auto-completion/typeahead search feature. This API is meant\nto provide results quickly and should not be relied upon for accurate or\nexhaustive search results. The results sets are limited in size and\ncannot be paginated.\n\nQueries return a compact representation of each object which is typically\nthe gid and name fields. Interested in a specific set of fields or all of\nthe fields?! Of course you are. Use field selectors to manipulate what\ndata is included in a response.\n\nResources with type `user` are returned in order of most contacted to\nleast contacted. This is determined by task assignments, adding the user\nto projects, and adding the user as a follower to tasks, messages,\netc.\n\nResources with type `project` are returned in order of recency. This is\ndetermined when the user visits the project, is added to the project, and\ncompletes tasks in the project.\n\nResources with type `task` are returned with priority placed on tasks\nthe user is following, but no guarantee on the order of those tasks.\n\nResources with type `project_template` are returned with priority\nplaced on favorited project templates.\n\nLeaving the `query` string empty or omitted will give you results, still\nfollowing the resource ordering above. This could be used to list users or\nprojects that are relevant for the requesting user's api token.\n\nThe `agent` type returns only agents, currently limited to AI Teammates, which are Asana's first-party agents. The `actor` type returns a combined set of users and agents.\n\nThis operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.",
"tags": [
"Typeahead"
],
"operationId": "typeaheadForWorkspace",
"parameters": [
{
"name": "opt_fields",
"in": "query",
"description": "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. Properties can include nested fields. To learn more, see the [input/output options guide](/docs/inputoutput-options#selecting-nested-fields).",
"required": false,
"example": [
"name"
],
"schema": {
"type": "array",
"items": {
"type": "string",
"enum": [
"name"
]
}
},
"style": "form",
"explode": false
}
],
"responses": {
"200": {
"description": "Successfully retrieved objects via a typeahead search algorithm.",
"content": {
"application/json": {
"schema": {
"type": "object",
"description": "A generic list of objects, such as those returned by the typeahead search endpoint.",
"properties": {
"data": {
"type": "array",
"items": {
"$ref": "#/components/schemas/AsanaNamedResource"
}
}
}
}
}
}
},
"400": {
"$ref": "#/components/responses/BadRequest"
},
"401": {
"$ref": "#/components/responses/Unauthorized"
},
"403": {
"$ref": "#/components/responses/Forbidden"
},
"404": {
"$ref": "#/components/responses/NotFound"
},
"500": {
"$ref": "#/components/responses/InternalServerError"
}
},
"security": [
{
"personalAccessToken": []
},
{
"oauth2": [
"workspaces.typeahead:read"
]
}
],
"x-readme": {
"code-samples": [
{
"language": "java",
"install": "<dependency><groupId>com.asana</groupId><artifactId>asana</artifactId><version>1.0.0</version></dependency>",
"code": "import com.asana.Client;\n\nClient client = Client.accessToken(\"PERSONAL_ACCESS_TOKEN\");\n\nList<JsonElement> result = client.typeahead.typeaheadForWorkspace(workspaceGid, count, query, type, resourceType)\n .option(\"pretty\", true)\n .execute();"
},
{
"language": "node",
"install": "npm install asana",
"code": "const Asana = require('asana');\n\nlet client = new Asana.ApiClient();\nclient.authentications.token.accessToken = '<YOUR_ACCESS_TOKEN>';\n\nlet typeaheadApiInstance = new Asana.TypeaheadApi(client);\nlet workspace_gid = \"12345\"; // String | Globally unique identifier for the workspace or organization.\nlet resource_type = \"user\"; // String | The type of values the typeahead should return. You can choose from one of the following: `actor`, `agent`, `custom_field`, `goal`, `project`, `project_template`, `portfolio`, `tag`, `task`, `team`, and `user`. Note that unlike in the names of endpoints, the types listed here are in singular form (e.g. `task`). Using multiple types is not yet supported. The `agent` type returns only agents, currently limited to AI Teammates, which are Asana's first-party agents. The `actor` type returns a combined set of users and agents.\nlet opts = { \n 'type': \"user\", \n 'query': \"Greg\", \n 'count': 20, \n 'opt_fields': \"name\"\n};\ntypeaheadApiInstance.typeaheadForWorkspace(workspace_gid, resource_type, opts).then((result) => {\n console.log('API called successfully. Returned data: ' + JSON.stringify(result.data, null, 2));\n}, (error) => {\n console.error(error.response.body);\n});",
"name": "node-sdk-v3"
},
{
"language": "node",
"install": "npm install asana@1.0.5",
"code": "const asana = require('asana');\n\nconst client = asana.Client.create().useAccessToken('PERSONAL_ACCESS_TOKEN');\n\nclient.typeahead.typeaheadForWorkspace(workspaceGid, {param: \"value\", param: \"value\", opt_pretty: true})\n .then((result) => {\n console.log(result);\n });",
"name": "node-sdk-v1"
},
{
"language": "python",
"install": "pip install asana",
"code": "import asana\nfrom asana.rest import ApiException\nfrom pprint import pprint\n\nconfiguration = asana.Configuration()\nconfiguration.access_token = '<YOUR_ACCESS_TOKEN>'\napi_client = asana.ApiClient(configuration)\n\n# create an instance of the API class\ntypeahead_api_instance = asana.TypeaheadApi(api_client)\nworkspace_gid = \"12345\" # str | Globally unique identifier for the workspace or organization.\nresource_type = \"user\" # str | The type of values the typeahead should return. You can choose from one of the following: `actor`, `agent`, `custom_field`, `goal`, `project`, `project_template`, `portfolio`, `tag`, `task`, `team`, and `user`. Note that unlike in the names of endpoints, the types listed here are in singular form (e.g. `task`). Using multiple types is not yet supported. The `agent` type returns only agents, currently limited to AI Teammates, which are Asana's first-party agents. The `actor` type returns a combined set of users and agents.\nopts = {\n 'type': \"user\", # str | *Deprecated: new integrations should prefer the resource_type field.*\n 'query': \"Greg\", # str | The string that will be used to search for relevant objects. If an empty string is passed in, the API will return results.\n 'count': 20, # int | The number of results to return. The default is 20 if this parameter is omitted, with a minimum of 1 and a maximum of 100. If there are fewer results found than requested, all will be returned.\n 'opt_fields': \"name\", # list[str] | 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.\n}\n\ntry:\n # Get objects via typeahead\n api_response = typeahead_api_instance.typeahead_for_workspace(workspace_gid, resource_type, opts)\n for data in api_response:\n pprint(data)\nexcept ApiException as e:\n print(\"Exception when calling TypeaheadApi->typeahead_for_workspace: %s\\n\" % e)",
"name": "python-sdk-v5"
},
{
"language": "python",
"install": "pip install asana==3.2.3",
"code": "import asana\n\nclient = asana.Client.access_token('PERSONAL_ACCESS_TOKEN')\n\nresult = client.typeahead.typeahead_for_workspace(workspace_gid, {'param': 'value', 'param': 'value'}, opt_pretty=True)",
"name": "python-sdk-v3"
},
{
"language": "php",
"install": "composer require asana/asana",
"code": "<?php\nrequire 'vendor/autoload.php';\n\n$client = Asana\\Client::accessToken('PERSONAL_ACCESS_TOKEN');\n\n$result = $client->typeahead->typeaheadForWorkspace($workspace_gid, array('param' => 'value', 'param' => 'value'), array('opt_pretty' => 'true'))"
},
{
"language": "ruby",
"install": "gem install asana",
"code": "require 'asana'\n\nclient = Asana::Client.new do |c|\n c.authentication :access_token, 'PERSONAL_ACCESS_TOKEN'\nend\n\nresult = client.typeahead.typeahead_for_workspace(workspace_gid: 'workspace_gid', resource_type: ''resource_type_example'', param: \"value\", param: \"value\", options: {pretty: true})"
}
]
},
"x-purple-suite-runtime": "unavailable"
}
GET /api/1.0/user_task_lists/{user_task_list_gid}
Get a user task list
<b>Required scope: </b><code>tasks:read</code>
Returns the full record for a user task list.
This operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.
Authentication
[
{
"personalAccessToken": []
},
{
"oauth2": [
"tasks:read"
]
}
]
Path-level parameters and metadata
{
"parameters": [
{
"$ref": "#/components/parameters/user_task_list_path_gid"
},
{
"$ref": "#/components/parameters/pretty"
}
]
}
Request, responses and operation details
{
"summary": "Get a user task list",
"description": "<b>Required scope: </b><code>tasks:read</code>\n\nReturns the full record for a user task list.\n\nThis operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.",
"tags": [
"User task lists"
],
"operationId": "getUserTaskList",
"parameters": [
{
"name": "opt_fields",
"in": "query",
"description": "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. Properties can include nested fields. To learn more, see the [input/output options guide](/docs/inputoutput-options#selecting-nested-fields).",
"required": false,
"example": [
"name",
"owner",
"workspace"
],
"schema": {
"type": "array",
"items": {
"type": "string",
"enum": [
"name",
"owner",
"workspace"
]
}
},
"style": "form",
"explode": false
}
],
"responses": {
"200": {
"description": "Successfully retrieved the user task list.",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"$ref": "#/components/schemas/UserTaskListResponse"
}
}
}
}
}
},
"400": {
"$ref": "#/components/responses/BadRequest"
},
"401": {
"$ref": "#/components/responses/Unauthorized"
},
"403": {
"$ref": "#/components/responses/Forbidden"
},
"404": {
"$ref": "#/components/responses/NotFound"
},
"500": {
"$ref": "#/components/responses/InternalServerError"
}
},
"security": [
{
"personalAccessToken": []
},
{
"oauth2": [
"tasks:read"
]
}
],
"x-readme": {
"code-samples": [
{
"language": "java",
"install": "<dependency><groupId>com.asana</groupId><artifactId>asana</artifactId><version>1.0.0</version></dependency>",
"code": "import com.asana.Client;\n\nClient client = Client.accessToken(\"PERSONAL_ACCESS_TOKEN\");\n\nUserTaskList result = client.usertasklists.getUserTaskList(userTaskListGid)\n .option(\"pretty\", true)\n .execute();"
},
{
"language": "node",
"install": "npm install asana",
"code": "const Asana = require('asana');\n\nlet client = new Asana.ApiClient();\nclient.authentications.token.accessToken = '<YOUR_ACCESS_TOKEN>';\n\nlet userTaskListsApiInstance = new Asana.UserTaskListsApi(client);\nlet user_task_list_gid = \"12345\"; // String | Globally unique identifier for the user task list.\nlet opts = { \n 'opt_fields': \"name,owner,workspace\"\n};\nuserTaskListsApiInstance.getUserTaskList(user_task_list_gid, opts).then((result) => {\n console.log('API called successfully. Returned data: ' + JSON.stringify(result.data, null, 2));\n}, (error) => {\n console.error(error.response.body);\n});",
"name": "node-sdk-v3"
},
{
"language": "node",
"install": "npm install asana@1.0.5",
"code": "const asana = require('asana');\n\nconst client = asana.Client.create().useAccessToken('PERSONAL_ACCESS_TOKEN');\n\nclient.usertasklists.getUserTaskList(userTaskListGid, {param: \"value\", param: \"value\", opt_pretty: true})\n .then((result) => {\n console.log(result);\n });",
"name": "node-sdk-v1"
},
{
"language": "python",
"install": "pip install asana",
"code": "import asana\nfrom asana.rest import ApiException\nfrom pprint import pprint\n\nconfiguration = asana.Configuration()\nconfiguration.access_token = '<YOUR_ACCESS_TOKEN>'\napi_client = asana.ApiClient(configuration)\n\n# create an instance of the API class\nuser_task_lists_api_instance = asana.UserTaskListsApi(api_client)\nuser_task_list_gid = \"12345\" # str | Globally unique identifier for the user task list.\nopts = {\n 'opt_fields': \"name,owner,workspace\", # list[str] | 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.\n}\n\ntry:\n # Get a user task list\n api_response = user_task_lists_api_instance.get_user_task_list(user_task_list_gid, opts)\n pprint(api_response)\nexcept ApiException as e:\n print(\"Exception when calling UserTaskListsApi->get_user_task_list: %s\\n\" % e)",
"name": "python-sdk-v5"
},
{
"language": "python",
"install": "pip install asana==3.2.3",
"code": "import asana\n\nclient = asana.Client.access_token('PERSONAL_ACCESS_TOKEN')\n\nresult = client.user_task_lists.get_user_task_list(user_task_list_gid, {'param': 'value', 'param': 'value'}, opt_pretty=True)",
"name": "python-sdk-v3"
},
{
"language": "php",
"install": "composer require asana/asana",
"code": "<?php\nrequire 'vendor/autoload.php';\n\n$client = Asana\\Client::accessToken('PERSONAL_ACCESS_TOKEN');\n\n$result = $client->usertasklists->getUserTaskList($user_task_list_gid, array('param' => 'value', 'param' => 'value'), array('opt_pretty' => 'true'))"
},
{
"language": "ruby",
"install": "gem install asana",
"code": "require 'asana'\n\nclient = Asana::Client.new do |c|\n c.authentication :access_token, 'PERSONAL_ACCESS_TOKEN'\nend\n\nresult = client.user_task_lists.get_user_task_list(user_task_list_gid: 'user_task_list_gid', param: \"value\", param: \"value\", options: {pretty: true})"
}
]
},
"x-purple-suite-runtime": "unavailable"
}
GET /api/1.0/users/{user_gid}/user_task_list
Get a user's task list
<b>Required scope: </b><code>tasks:read</code>
Returns the full record for a user's task list.
This operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.
Authentication
[
{
"personalAccessToken": []
},
{
"oauth2": [
"tasks:read"
]
}
]
Path-level parameters and metadata
{
"parameters": [
{
"$ref": "#/components/parameters/user_path_gid"
},
{
"$ref": "#/components/parameters/pretty"
},
{
"name": "workspace",
"in": "query",
"required": true,
"description": "The workspace in which to get the user task list.",
"schema": {
"type": "string"
},
"example": "1234"
}
]
}
Request, responses and operation details
{
"summary": "Get a user's task list",
"description": "<b>Required scope: </b><code>tasks:read</code>\n\nReturns the full record for a user's task list.\n\nThis operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.",
"tags": [
"User task lists"
],
"operationId": "getUserTaskListForUser",
"parameters": [
{
"name": "opt_fields",
"in": "query",
"description": "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. Properties can include nested fields. To learn more, see the [input/output options guide](/docs/inputoutput-options#selecting-nested-fields).",
"required": false,
"example": [
"name",
"owner",
"workspace"
],
"schema": {
"type": "array",
"items": {
"type": "string",
"enum": [
"name",
"owner",
"workspace"
]
}
},
"style": "form",
"explode": false
}
],
"responses": {
"200": {
"description": "Successfully retrieved the user's task list.",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"$ref": "#/components/schemas/UserTaskListResponse"
}
}
}
}
}
},
"400": {
"$ref": "#/components/responses/BadRequest"
},
"401": {
"$ref": "#/components/responses/Unauthorized"
},
"403": {
"$ref": "#/components/responses/Forbidden"
},
"404": {
"$ref": "#/components/responses/NotFound"
},
"500": {
"$ref": "#/components/responses/InternalServerError"
}
},
"security": [
{
"personalAccessToken": []
},
{
"oauth2": [
"tasks:read"
]
}
],
"x-readme": {
"code-samples": [
{
"language": "java",
"install": "<dependency><groupId>com.asana</groupId><artifactId>asana</artifactId><version>1.0.0</version></dependency>",
"code": "import com.asana.Client;\n\nClient client = Client.accessToken(\"PERSONAL_ACCESS_TOKEN\");\n\nUserTaskList result = client.usertasklists.getUserTaskListForUser(userGid, workspace)\n .option(\"pretty\", true)\n .execute();"
},
{
"language": "node",
"install": "npm install asana",
"code": "const Asana = require('asana');\n\nlet client = new Asana.ApiClient();\nclient.authentications.token.accessToken = '<YOUR_ACCESS_TOKEN>';\n\nlet userTaskListsApiInstance = new Asana.UserTaskListsApi(client);\nlet user_gid = \"me\"; // String | A string identifying a user. This can either be the string \\\"me\\\", an email, or the gid of a user.\nlet workspace = \"1234\"; // String | The workspace in which to get the user task list.\nlet opts = { \n 'opt_fields': \"name,owner,workspace\"\n};\nuserTaskListsApiInstance.getUserTaskListForUser(user_gid, workspace, opts).then((result) => {\n console.log('API called successfully. Returned data: ' + JSON.stringify(result.data, null, 2));\n}, (error) => {\n console.error(error.response.body);\n});",
"name": "node-sdk-v3"
},
{
"language": "node",
"install": "npm install asana@1.0.5",
"code": "const asana = require('asana');\n\nconst client = asana.Client.create().useAccessToken('PERSONAL_ACCESS_TOKEN');\n\nclient.usertasklists.getUserTaskListForUser(userGid, {param: \"value\", param: \"value\", opt_pretty: true})\n .then((result) => {\n console.log(result);\n });",
"name": "node-sdk-v1"
},
{
"language": "python",
"install": "pip install asana",
"code": "import asana\nfrom asana.rest import ApiException\nfrom pprint import pprint\n\nconfiguration = asana.Configuration()\nconfiguration.access_token = '<YOUR_ACCESS_TOKEN>'\napi_client = asana.ApiClient(configuration)\n\n# create an instance of the API class\nuser_task_lists_api_instance = asana.UserTaskListsApi(api_client)\nuser_gid = \"me\" # str | A string identifying a user. This can either be the string \\\"me\\\", an email, or the gid of a user.\nworkspace = \"1234\" # str | The workspace in which to get the user task list.\nopts = {\n 'opt_fields': \"name,owner,workspace\", # list[str] | 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.\n}\n\ntry:\n # Get a user's task list\n api_response = user_task_lists_api_instance.get_user_task_list_for_user(user_gid, workspace, opts)\n pprint(api_response)\nexcept ApiException as e:\n print(\"Exception when calling UserTaskListsApi->get_user_task_list_for_user: %s\\n\" % e)",
"name": "python-sdk-v5"
},
{
"language": "python",
"install": "pip install asana==3.2.3",
"code": "import asana\n\nclient = asana.Client.access_token('PERSONAL_ACCESS_TOKEN')\n\nresult = client.user_task_lists.get_user_task_list_for_user(user_gid, {'param': 'value', 'param': 'value'}, opt_pretty=True)",
"name": "python-sdk-v3"
},
{
"language": "php",
"install": "composer require asana/asana",
"code": "<?php\nrequire 'vendor/autoload.php';\n\n$client = Asana\\Client::accessToken('PERSONAL_ACCESS_TOKEN');\n\n$result = $client->usertasklists->getUserTaskListForUser($user_gid, array('param' => 'value', 'param' => 'value'), array('opt_pretty' => 'true'))"
},
{
"language": "ruby",
"install": "gem install asana",
"code": "require 'asana'\n\nclient = Asana::Client.new do |c|\n c.authentication :access_token, 'PERSONAL_ACCESS_TOKEN'\nend\n\nresult = client.user_task_lists.get_user_task_list_for_user(user_gid: 'user_gid', workspace: ''workspace_example'', param: \"value\", param: \"value\", options: {pretty: true})"
}
]
},
"x-purple-suite-runtime": "unavailable"
}
GET /api/1.0/users
Get multiple users
<b>Required scope: </b><code>users:read</code>
Returns the user records for all users in all workspaces and organizations accessible to the authenticated user. Accepts an optional workspace ID parameter.
Results are sorted by user ID.
The persistent core model supports the response and query fields named in x-purple-suite-supported-response-fields and x-purple-suite-supported-query. Other fields/options return an explicit 400 errors envelope.
Authentication
[
{
"personalAccessToken": []
},
{
"oauth2": [
"users:read"
]
}
]
Path-level parameters and metadata
{
"parameters": [
{
"name": "workspace",
"in": "query",
"description": "The workspace or organization ID to filter users on.",
"schema": {
"type": "string"
},
"example": "1331"
},
{
"name": "team",
"in": "query",
"description": "The team ID to filter users on.",
"schema": {
"type": "string"
},
"example": "15627"
},
{
"$ref": "#/components/parameters/pretty"
},
{
"$ref": "#/components/parameters/limit"
},
{
"$ref": "#/components/parameters/offset"
}
]
}
Request, responses and operation details
{
"summary": "Get multiple users",
"description": "<b>Required scope: </b><code>users:read</code>\n\nReturns the user records for all users in all workspaces and organizations accessible to the authenticated user. Accepts an optional workspace ID parameter.\nResults are sorted by user ID.\n\nThe persistent core model supports the response and query fields named in x-purple-suite-supported-response-fields and x-purple-suite-supported-query. Other fields/options return an explicit 400 errors envelope.",
"tags": [
"Users"
],
"operationId": "getUsers",
"parameters": [
{
"name": "opt_fields",
"in": "query",
"description": "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. Properties can include nested fields. To learn more, see the [input/output options guide](/docs/inputoutput-options#selecting-nested-fields).",
"required": false,
"example": [
"custom_fields",
"custom_fields.date_value",
"custom_fields.date_value.date",
"custom_fields.date_value.date_time",
"custom_fields.display_value",
"custom_fields.enabled",
"custom_fields.enum_options",
"custom_fields.enum_options.color",
"custom_fields.enum_options.enabled",
"custom_fields.enum_options.name",
"custom_fields.enum_value",
"custom_fields.enum_value.color",
"custom_fields.enum_value.enabled",
"custom_fields.enum_value.name",
"custom_fields.id_prefix",
"custom_fields.input_restrictions",
"custom_fields.is_formula_field",
"custom_fields.multi_enum_values",
"custom_fields.multi_enum_values.color",
"custom_fields.multi_enum_values.enabled",
"custom_fields.multi_enum_values.name",
"custom_fields.name",
"custom_fields.number_value",
"custom_fields.representation_type",
"custom_fields.text_value",
"custom_fields.type",
"email",
"name",
"offset",
"path",
"photo",
"photo.image_1024x1024",
"photo.image_128x128",
"photo.image_21x21",
"photo.image_27x27",
"photo.image_36x36",
"photo.image_60x60",
"uri",
"workspaces",
"workspaces.name"
],
"schema": {
"type": "array",
"items": {
"type": "string",
"enum": [
"custom_fields",
"custom_fields.date_value",
"custom_fields.date_value.date",
"custom_fields.date_value.date_time",
"custom_fields.display_value",
"custom_fields.enabled",
"custom_fields.enum_options",
"custom_fields.enum_options.color",
"custom_fields.enum_options.enabled",
"custom_fields.enum_options.name",
"custom_fields.enum_value",
"custom_fields.enum_value.color",
"custom_fields.enum_value.enabled",
"custom_fields.enum_value.name",
"custom_fields.id_prefix",
"custom_fields.input_restrictions",
"custom_fields.is_formula_field",
"custom_fields.multi_enum_values",
"custom_fields.multi_enum_values.color",
"custom_fields.multi_enum_values.enabled",
"custom_fields.multi_enum_values.name",
"custom_fields.name",
"custom_fields.number_value",
"custom_fields.representation_type",
"custom_fields.text_value",
"custom_fields.type",
"email",
"name",
"offset",
"path",
"photo",
"photo.image_1024x1024",
"photo.image_128x128",
"photo.image_21x21",
"photo.image_27x27",
"photo.image_36x36",
"photo.image_60x60",
"uri",
"workspaces",
"workspaces.name"
]
}
},
"style": "form",
"explode": false
}
],
"responses": {
"200": {
"description": "Successfully retrieved the requested user records.",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"type": "array",
"items": {
"$ref": "#/components/schemas/UserCompact"
}
},
"next_page": {
"$ref": "#/components/schemas/NextPage"
}
}
}
}
}
},
"400": {
"$ref": "#/components/responses/BadRequest"
},
"401": {
"$ref": "#/components/responses/Unauthorized"
},
"403": {
"$ref": "#/components/responses/Forbidden"
},
"404": {
"$ref": "#/components/responses/NotFound"
},
"500": {
"$ref": "#/components/responses/InternalServerError"
}
},
"security": [
{
"personalAccessToken": []
},
{
"oauth2": [
"users:read"
]
}
],
"x-readme": {
"code-samples": [
{
"language": "java",
"install": "<dependency><groupId>com.asana</groupId><artifactId>asana</artifactId><version>1.0.0</version></dependency>",
"code": "import com.asana.Client;\n\nClient client = Client.accessToken(\"PERSONAL_ACCESS_TOKEN\");\n\nList<User> result = client.users.getUsers(team, workspace)\n .option(\"pretty\", true)\n .execute();"
},
{
"language": "node",
"install": "npm install asana",
"code": "const Asana = require('asana');\n\nlet client = new Asana.ApiClient();\nclient.authentications.token.accessToken = '<YOUR_ACCESS_TOKEN>';\n\nlet usersApiInstance = new Asana.UsersApi(client);\nlet opts = { \n 'workspace': \"1331\", \n 'team': \"15627\", \n 'limit': 50, \n 'offset': \"eyJ0eXAiOJiKV1iQLCJhbGciOiJIUzI1NiJ9\", \n 'opt_fields': \"custom_fields,custom_fields.date_value,custom_fields.date_value.date,custom_fields.date_value.date_time,custom_fields.display_value,custom_fields.enabled,custom_fields.enum_options,custom_fields.enum_options.color,custom_fields.enum_options.enabled,custom_fields.enum_options.name,custom_fields.enum_value,custom_fields.enum_value.color,custom_fields.enum_value.enabled,custom_fields.enum_value.name,custom_fields.id_prefix,custom_fields.input_restrictions,custom_fields.is_formula_field,custom_fields.multi_enum_values,custom_fields.multi_enum_values.color,custom_fields.multi_enum_values.enabled,custom_fields.multi_enum_values.name,custom_fields.name,custom_fields.number_value,custom_fields.representation_type,custom_fields.text_value,custom_fields.type,email,name,offset,path,photo,photo.image_1024x1024,photo.image_128x128,photo.image_21x21,photo.image_27x27,photo.image_36x36,photo.image_60x60,uri,workspaces,workspaces.name\"\n};\nusersApiInstance.getUsers(opts).then((result) => {\n console.log('API called successfully. Returned data: ' + JSON.stringify(result.data, null, 2));\n}, (error) => {\n console.error(error.response.body);\n});",
"name": "node-sdk-v3"
},
{
"language": "node",
"install": "npm install asana@1.0.5",
"code": "const asana = require('asana');\n\nconst client = asana.Client.create().useAccessToken('PERSONAL_ACCESS_TOKEN');\n\nclient.users.getUsers({param: \"value\", param: \"value\", opt_pretty: true})\n .then((result) => {\n console.log(result);\n });",
"name": "node-sdk-v1"
},
{
"language": "python",
"install": "pip install asana",
"code": "import asana\nfrom asana.rest import ApiException\nfrom pprint import pprint\n\nconfiguration = asana.Configuration()\nconfiguration.access_token = '<YOUR_ACCESS_TOKEN>'\napi_client = asana.ApiClient(configuration)\n\n# create an instance of the API class\nusers_api_instance = asana.UsersApi(api_client)\nopts = {\n 'workspace': \"1331\", # str | The workspace or organization ID to filter users on.\n 'team': \"15627\", # str | The team ID to filter users on.\n 'limit': 50, # int | Results per page. The number of objects to return per page. The value must be between 1 and 100.\n 'offset': \"eyJ0eXAiOJiKV1iQLCJhbGciOiJIUzI1NiJ9\", # str | 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.*\n 'opt_fields': \"custom_fields,custom_fields.date_value,custom_fields.date_value.date,custom_fields.date_value.date_time,custom_fields.display_value,custom_fields.enabled,custom_fields.enum_options,custom_fields.enum_options.color,custom_fields.enum_options.enabled,custom_fields.enum_options.name,custom_fields.enum_value,custom_fields.enum_value.color,custom_fields.enum_value.enabled,custom_fields.enum_value.name,custom_fields.id_prefix,custom_fields.input_restrictions,custom_fields.is_formula_field,custom_fields.multi_enum_values,custom_fields.multi_enum_values.color,custom_fields.multi_enum_values.enabled,custom_fields.multi_enum_values.name,custom_fields.name,custom_fields.number_value,custom_fields.representation_type,custom_fields.text_value,custom_fields.type,email,name,offset,path,photo,photo.image_1024x1024,photo.image_128x128,photo.image_21x21,photo.image_27x27,photo.image_36x36,photo.image_60x60,uri,workspaces,workspaces.name\", # list[str] | 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.\n}\n\ntry:\n # Get multiple users\n api_response = users_api_instance.get_users(opts)\n for data in api_response:\n pprint(data)\nexcept ApiException as e:\n print(\"Exception when calling UsersApi->get_users: %s\\n\" % e)",
"name": "python-sdk-v5"
},
{
"language": "python",
"install": "pip install asana==3.2.3",
"code": "import asana\n\nclient = asana.Client.access_token('PERSONAL_ACCESS_TOKEN')\n\nresult = client.users.get_users({'param': 'value', 'param': 'value'}, opt_pretty=True)",
"name": "python-sdk-v3"
},
{
"language": "php",
"install": "composer require asana/asana",
"code": "<?php\nrequire 'vendor/autoload.php';\n\n$client = Asana\\Client::accessToken('PERSONAL_ACCESS_TOKEN');\n\n$result = $client->users->getUsers(array('param' => 'value', 'param' => 'value'), array('opt_pretty' => 'true'))"
},
{
"language": "ruby",
"install": "gem install asana",
"code": "require 'asana'\n\nclient = Asana::Client.new do |c|\n c.authentication :access_token, 'PERSONAL_ACCESS_TOKEN'\nend\n\nresult = client.users.get_users(param: \"value\", param: \"value\", options: {pretty: true})"
}
]
},
"x-purple-suite-runtime": "modeled-core",
"x-purple-suite-supported-query": [
"workspace",
"opt_pretty",
"limit",
"offset",
"opt_fields"
],
"x-purple-suite-supported-response-fields": [
"gid",
"resource_type",
"resource_subtype",
"name",
"notes",
"completed",
"completed_at",
"created_at",
"modified_at",
"assignee",
"assignee_status",
"workspace",
"projects",
"memberships",
"parent",
"due_on",
"start_on",
"tags",
"dependencies",
"num_subtasks",
"archived",
"public",
"color",
"default_view",
"team",
"project",
"section",
"text",
"created_by",
"target",
"type",
"email",
"photo",
"is_organization"
]
}
GET /api/1.0/users/{user_gid}
Get a user
<b>Required scope: </b><code>users:read</code>
Returns the full user record for the single user with the provided ID.
The persistent core model supports the response and query fields named in x-purple-suite-supported-response-fields and x-purple-suite-supported-query. Other fields/options return an explicit 400 errors envelope.
Authentication
[
{
"personalAccessToken": []
},
{
"oauth2": [
"users:read"
]
}
]
Path-level parameters and metadata
{
"parameters": [
{
"$ref": "#/components/parameters/user_path_gid"
},
{
"$ref": "#/components/parameters/pretty"
},
{
"$ref": "#/components/parameters/workspace_query_param"
}
]
}
Request, responses and operation details
{
"summary": "Get a user",
"description": "<b>Required scope: </b><code>users:read</code>\n\nReturns the full user record for the single user with the provided ID.\n\nThe persistent core model supports the response and query fields named in x-purple-suite-supported-response-fields and x-purple-suite-supported-query. Other fields/options return an explicit 400 errors envelope.",
"tags": [
"Users"
],
"operationId": "getUser",
"parameters": [
{
"name": "opt_fields",
"in": "query",
"description": "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. Properties can include nested fields. To learn more, see the [input/output options guide](/docs/inputoutput-options#selecting-nested-fields).",
"required": false,
"example": [
"custom_fields",
"custom_fields.date_value",
"custom_fields.date_value.date",
"custom_fields.date_value.date_time",
"custom_fields.display_value",
"custom_fields.enabled",
"custom_fields.enum_options",
"custom_fields.enum_options.color",
"custom_fields.enum_options.enabled",
"custom_fields.enum_options.name",
"custom_fields.enum_value",
"custom_fields.enum_value.color",
"custom_fields.enum_value.enabled",
"custom_fields.enum_value.name",
"custom_fields.id_prefix",
"custom_fields.input_restrictions",
"custom_fields.is_formula_field",
"custom_fields.multi_enum_values",
"custom_fields.multi_enum_values.color",
"custom_fields.multi_enum_values.enabled",
"custom_fields.multi_enum_values.name",
"custom_fields.name",
"custom_fields.number_value",
"custom_fields.representation_type",
"custom_fields.text_value",
"custom_fields.type",
"email",
"name",
"photo",
"photo.image_1024x1024",
"photo.image_128x128",
"photo.image_21x21",
"photo.image_27x27",
"photo.image_36x36",
"photo.image_60x60",
"workspaces",
"workspaces.name"
],
"schema": {
"type": "array",
"items": {
"type": "string",
"enum": [
"custom_fields",
"custom_fields.date_value",
"custom_fields.date_value.date",
"custom_fields.date_value.date_time",
"custom_fields.display_value",
"custom_fields.enabled",
"custom_fields.enum_options",
"custom_fields.enum_options.color",
"custom_fields.enum_options.enabled",
"custom_fields.enum_options.name",
"custom_fields.enum_value",
"custom_fields.enum_value.color",
"custom_fields.enum_value.enabled",
"custom_fields.enum_value.name",
"custom_fields.id_prefix",
"custom_fields.input_restrictions",
"custom_fields.is_formula_field",
"custom_fields.multi_enum_values",
"custom_fields.multi_enum_values.color",
"custom_fields.multi_enum_values.enabled",
"custom_fields.multi_enum_values.name",
"custom_fields.name",
"custom_fields.number_value",
"custom_fields.representation_type",
"custom_fields.text_value",
"custom_fields.type",
"email",
"name",
"photo",
"photo.image_1024x1024",
"photo.image_128x128",
"photo.image_21x21",
"photo.image_27x27",
"photo.image_36x36",
"photo.image_60x60",
"workspaces",
"workspaces.name"
]
}
},
"style": "form",
"explode": false
}
],
"responses": {
"200": {
"description": "Returns the user specified.",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"$ref": "#/components/schemas/UserResponse"
}
}
}
}
}
},
"400": {
"$ref": "#/components/responses/BadRequest"
},
"401": {
"$ref": "#/components/responses/Unauthorized"
},
"403": {
"$ref": "#/components/responses/Forbidden"
},
"404": {
"$ref": "#/components/responses/NotFound"
},
"500": {
"$ref": "#/components/responses/InternalServerError"
}
},
"security": [
{
"personalAccessToken": []
},
{
"oauth2": [
"users:read"
]
}
],
"x-readme": {
"code-samples": [
{
"language": "java",
"install": "<dependency><groupId>com.asana</groupId><artifactId>asana</artifactId><version>1.0.0</version></dependency>",
"code": "import com.asana.Client;\n\nClient client = Client.accessToken(\"PERSONAL_ACCESS_TOKEN\");\n\nUser result = client.users.getUser(userGid)\n .option(\"pretty\", true)\n .execute();"
},
{
"language": "node",
"install": "npm install asana",
"code": "const Asana = require('asana');\n\nlet client = new Asana.ApiClient();\nclient.authentications.token.accessToken = '<YOUR_ACCESS_TOKEN>';\n\nlet usersApiInstance = new Asana.UsersApi(client);\nlet user_gid = \"me\"; // String | A string identifying a user. This can either be the string \\\"me\\\", an email, or the gid of a user.\nlet opts = { \n 'workspace': \"12345\", \n 'opt_fields': \"custom_fields,custom_fields.date_value,custom_fields.date_value.date,custom_fields.date_value.date_time,custom_fields.display_value,custom_fields.enabled,custom_fields.enum_options,custom_fields.enum_options.color,custom_fields.enum_options.enabled,custom_fields.enum_options.name,custom_fields.enum_value,custom_fields.enum_value.color,custom_fields.enum_value.enabled,custom_fields.enum_value.name,custom_fields.id_prefix,custom_fields.input_restrictions,custom_fields.is_formula_field,custom_fields.multi_enum_values,custom_fields.multi_enum_values.color,custom_fields.multi_enum_values.enabled,custom_fields.multi_enum_values.name,custom_fields.name,custom_fields.number_value,custom_fields.representation_type,custom_fields.text_value,custom_fields.type,email,name,photo,photo.image_1024x1024,photo.image_128x128,photo.image_21x21,photo.image_27x27,photo.image_36x36,photo.image_60x60,workspaces,workspaces.name\"\n};\nusersApiInstance.getUser(user_gid, opts).then((result) => {\n console.log('API called successfully. Returned data: ' + JSON.stringify(result.data, null, 2));\n}, (error) => {\n console.error(error.response.body);\n});",
"name": "node-sdk-v3"
},
{
"language": "node",
"install": "npm install asana@1.0.5",
"code": "const asana = require('asana');\n\nconst client = asana.Client.create().useAccessToken('PERSONAL_ACCESS_TOKEN');\n\nclient.users.getUser(userGid, {param: \"value\", param: \"value\", opt_pretty: true})\n .then((result) => {\n console.log(result);\n });",
"name": "node-sdk-v1"
},
{
"language": "python",
"install": "pip install asana",
"code": "import asana\nfrom asana.rest import ApiException\nfrom pprint import pprint\n\nconfiguration = asana.Configuration()\nconfiguration.access_token = '<YOUR_ACCESS_TOKEN>'\napi_client = asana.ApiClient(configuration)\n\n# create an instance of the API class\nusers_api_instance = asana.UsersApi(api_client)\nuser_gid = \"me\" # str | A string identifying a user. This can either be the string \\\"me\\\", an email, or the gid of a user.\nopts = {\n 'workspace': \"12345\", # str | The workspace to filter results on.\n 'opt_fields': \"custom_fields,custom_fields.date_value,custom_fields.date_value.date,custom_fields.date_value.date_time,custom_fields.display_value,custom_fields.enabled,custom_fields.enum_options,custom_fields.enum_options.color,custom_fields.enum_options.enabled,custom_fields.enum_options.name,custom_fields.enum_value,custom_fields.enum_value.color,custom_fields.enum_value.enabled,custom_fields.enum_value.name,custom_fields.id_prefix,custom_fields.input_restrictions,custom_fields.is_formula_field,custom_fields.multi_enum_values,custom_fields.multi_enum_values.color,custom_fields.multi_enum_values.enabled,custom_fields.multi_enum_values.name,custom_fields.name,custom_fields.number_value,custom_fields.representation_type,custom_fields.text_value,custom_fields.type,email,name,photo,photo.image_1024x1024,photo.image_128x128,photo.image_21x21,photo.image_27x27,photo.image_36x36,photo.image_60x60,workspaces,workspaces.name\", # list[str] | 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.\n}\n\ntry:\n # Get a user\n api_response = users_api_instance.get_user(user_gid, opts)\n pprint(api_response)\nexcept ApiException as e:\n print(\"Exception when calling UsersApi->get_user: %s\\n\" % e)",
"name": "python-sdk-v5"
},
{
"language": "python",
"install": "pip install asana==3.2.3",
"code": "import asana\n\nclient = asana.Client.access_token('PERSONAL_ACCESS_TOKEN')\n\nresult = client.users.get_user(user_gid, {'param': 'value', 'param': 'value'}, opt_pretty=True)",
"name": "python-sdk-v3"
},
{
"language": "php",
"install": "composer require asana/asana",
"code": "<?php\nrequire 'vendor/autoload.php';\n\n$client = Asana\\Client::accessToken('PERSONAL_ACCESS_TOKEN');\n\n$result = $client->users->getUser($user_gid, array('param' => 'value', 'param' => 'value'), array('opt_pretty' => 'true'))"
},
{
"language": "ruby",
"install": "gem install asana",
"code": "require 'asana'\n\nclient = Asana::Client.new do |c|\n c.authentication :access_token, 'PERSONAL_ACCESS_TOKEN'\nend\n\nresult = client.users.get_user(user_gid: 'user_gid', param: \"value\", param: \"value\", options: {pretty: true})"
}
]
},
"x-purple-suite-runtime": "modeled-core",
"x-purple-suite-supported-query": [
"opt_pretty",
"workspace",
"opt_fields"
],
"x-purple-suite-supported-response-fields": [
"gid",
"resource_type",
"resource_subtype",
"name",
"notes",
"completed",
"completed_at",
"created_at",
"modified_at",
"assignee",
"assignee_status",
"workspace",
"projects",
"memberships",
"parent",
"due_on",
"start_on",
"tags",
"dependencies",
"num_subtasks",
"archived",
"public",
"color",
"default_view",
"team",
"project",
"section",
"text",
"created_by",
"target",
"type",
"email",
"photo",
"is_organization"
]
}
PUT /api/1.0/users/{user_gid}
Update a user
A specific, existing user can be updated by making a PUT request on the
URL for that user. Only the fields provided in the `data` block will be
updated; any unspecified fields will remain unchanged.
Returns the complete updated user record.
This operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.
Authentication
[
{
"personalAccessToken": []
},
{
"oauth2": []
}
]
Path-level parameters and metadata
{
"parameters": [
{
"$ref": "#/components/parameters/user_path_gid"
},
{
"$ref": "#/components/parameters/pretty"
},
{
"$ref": "#/components/parameters/workspace_query_param"
}
]
}
Request, responses and operation details
{
"summary": "Update a user",
"description": "A specific, existing user can be updated by making a PUT request on the\nURL for that user. Only the fields provided in the `data` block will be\nupdated; any unspecified fields will remain unchanged.\n\nReturns the complete updated user record.\n\nThis operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.",
"tags": [
"Users"
],
"operationId": "updateUser",
"parameters": [
{
"name": "opt_fields",
"in": "query",
"description": "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. Properties can include nested fields. To learn more, see the [input/output options guide](/docs/inputoutput-options#selecting-nested-fields).",
"required": false,
"example": [
"custom_fields",
"custom_fields.date_value",
"custom_fields.date_value.date",
"custom_fields.date_value.date_time",
"custom_fields.display_value",
"custom_fields.enabled",
"custom_fields.enum_options",
"custom_fields.enum_options.color",
"custom_fields.enum_options.enabled",
"custom_fields.enum_options.name",
"custom_fields.enum_value",
"custom_fields.enum_value.color",
"custom_fields.enum_value.enabled",
"custom_fields.enum_value.name",
"custom_fields.id_prefix",
"custom_fields.input_restrictions",
"custom_fields.is_formula_field",
"custom_fields.multi_enum_values",
"custom_fields.multi_enum_values.color",
"custom_fields.multi_enum_values.enabled",
"custom_fields.multi_enum_values.name",
"custom_fields.name",
"custom_fields.number_value",
"custom_fields.representation_type",
"custom_fields.text_value",
"custom_fields.type",
"email",
"name",
"photo",
"photo.image_1024x1024",
"photo.image_128x128",
"photo.image_21x21",
"photo.image_27x27",
"photo.image_36x36",
"photo.image_60x60",
"workspaces",
"workspaces.name"
],
"schema": {
"type": "array",
"items": {
"type": "string",
"enum": [
"custom_fields",
"custom_fields.date_value",
"custom_fields.date_value.date",
"custom_fields.date_value.date_time",
"custom_fields.display_value",
"custom_fields.enabled",
"custom_fields.enum_options",
"custom_fields.enum_options.color",
"custom_fields.enum_options.enabled",
"custom_fields.enum_options.name",
"custom_fields.enum_value",
"custom_fields.enum_value.color",
"custom_fields.enum_value.enabled",
"custom_fields.enum_value.name",
"custom_fields.id_prefix",
"custom_fields.input_restrictions",
"custom_fields.is_formula_field",
"custom_fields.multi_enum_values",
"custom_fields.multi_enum_values.color",
"custom_fields.multi_enum_values.enabled",
"custom_fields.multi_enum_values.name",
"custom_fields.name",
"custom_fields.number_value",
"custom_fields.representation_type",
"custom_fields.text_value",
"custom_fields.type",
"email",
"name",
"photo",
"photo.image_1024x1024",
"photo.image_128x128",
"photo.image_21x21",
"photo.image_27x27",
"photo.image_36x36",
"photo.image_60x60",
"workspaces",
"workspaces.name"
]
}
},
"style": "form",
"explode": false
}
],
"requestBody": {
"description": "The user to update.",
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"$ref": "#/components/schemas/UserUpdateRequest"
}
}
}
}
}
},
"responses": {
"200": {
"description": "Successfully updated the specified user.",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"$ref": "#/components/schemas/UserResponse"
}
}
}
}
}
},
"400": {
"$ref": "#/components/responses/BadRequest"
},
"401": {
"$ref": "#/components/responses/Unauthorized"
},
"403": {
"$ref": "#/components/responses/Forbidden"
},
"404": {
"$ref": "#/components/responses/NotFound"
},
"500": {
"$ref": "#/components/responses/InternalServerError"
}
},
"security": [
{
"personalAccessToken": []
},
{
"oauth2": []
}
],
"x-readme": {
"code-samples": [
{
"language": "node",
"install": "npm install asana",
"code": "const Asana = require('asana');\n\nlet client = new Asana.ApiClient();\nclient.authentications.token.accessToken = '<YOUR_ACCESS_TOKEN>';\n\nlet usersApiInstance = new Asana.UsersApi(client);\nlet body = {\"data\": {\"<PARAM_1>\": \"<VALUE_1>\", \"<PARAM_2>\": \"<VALUE_2>\",}}; // Object | The user to update.\nlet user_gid = \"me\"; // String | A string identifying a user. This can either be the string \\\"me\\\", an email, or the gid of a user.\nlet opts = { \n 'workspace': \"12345\", \n 'opt_fields': \"custom_fields,custom_fields.date_value,custom_fields.date_value.date,custom_fields.date_value.date_time,custom_fields.display_value,custom_fields.enabled,custom_fields.enum_options,custom_fields.enum_options.color,custom_fields.enum_options.enabled,custom_fields.enum_options.name,custom_fields.enum_value,custom_fields.enum_value.color,custom_fields.enum_value.enabled,custom_fields.enum_value.name,custom_fields.id_prefix,custom_fields.input_restrictions,custom_fields.is_formula_field,custom_fields.multi_enum_values,custom_fields.multi_enum_values.color,custom_fields.multi_enum_values.enabled,custom_fields.multi_enum_values.name,custom_fields.name,custom_fields.number_value,custom_fields.representation_type,custom_fields.text_value,custom_fields.type,email,name,photo,photo.image_1024x1024,photo.image_128x128,photo.image_21x21,photo.image_27x27,photo.image_36x36,photo.image_60x60,workspaces,workspaces.name\"\n};\nusersApiInstance.updateUser(body, user_gid, opts).then((result) => {\n console.log('API called successfully. Returned data: ' + JSON.stringify(result.data, null, 2));\n}, (error) => {\n console.error(error.response.body);\n});",
"name": "node-sdk-v3"
},
{
"language": "python",
"install": "pip install asana",
"code": "import asana\nfrom asana.rest import ApiException\nfrom pprint import pprint\n\nconfiguration = asana.Configuration()\nconfiguration.access_token = '<YOUR_ACCESS_TOKEN>'\napi_client = asana.ApiClient(configuration)\n\n# create an instance of the API class\nusers_api_instance = asana.UsersApi(api_client)\nbody = {\"data\": {\"<PARAM_1>\": \"<VALUE_1>\", \"<PARAM_2>\": \"<VALUE_2>\",}} # dict | The user to update.\nuser_gid = \"me\" # str | A string identifying a user. This can either be the string \\\"me\\\", an email, or the gid of a user.\nopts = {\n 'workspace': \"12345\", # str | The workspace to filter results on.\n 'opt_fields': \"custom_fields,custom_fields.date_value,custom_fields.date_value.date,custom_fields.date_value.date_time,custom_fields.display_value,custom_fields.enabled,custom_fields.enum_options,custom_fields.enum_options.color,custom_fields.enum_options.enabled,custom_fields.enum_options.name,custom_fields.enum_value,custom_fields.enum_value.color,custom_fields.enum_value.enabled,custom_fields.enum_value.name,custom_fields.id_prefix,custom_fields.input_restrictions,custom_fields.is_formula_field,custom_fields.multi_enum_values,custom_fields.multi_enum_values.color,custom_fields.multi_enum_values.enabled,custom_fields.multi_enum_values.name,custom_fields.name,custom_fields.number_value,custom_fields.representation_type,custom_fields.text_value,custom_fields.type,email,name,photo,photo.image_1024x1024,photo.image_128x128,photo.image_21x21,photo.image_27x27,photo.image_36x36,photo.image_60x60,workspaces,workspaces.name\", # list[str] | 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.\n}\n\ntry:\n # Update a user\n api_response = users_api_instance.update_user(body, user_gid, opts)\n pprint(api_response)\nexcept ApiException as e:\n print(\"Exception when calling UsersApi->update_user: %s\\n\" % e)",
"name": "python-sdk-v5"
}
]
},
"x-purple-suite-runtime": "unavailable"
}
GET /api/1.0/users/{user_gid}/favorites
Get a user's favorites
<b>Required scope: </b><code>users:read</code>
Returns all of a user's favorites within a specified workspace and of a given type. The results are ordered exactly as they appear in the user's Asana sidebar in the web application. Note that this endpoint currently only returns favorites for the current user (i.e., the user associated with the authentication token).
This operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.
Authentication
[
{
"personalAccessToken": []
},
{
"oauth2": [
"users:read"
]
}
]
Path-level parameters and metadata
{
"parameters": [
{
"$ref": "#/components/parameters/user_path_gid"
},
{
"$ref": "#/components/parameters/pretty"
},
{
"$ref": "#/components/parameters/limit"
},
{
"$ref": "#/components/parameters/offset"
},
{
"name": "resource_type",
"in": "query",
"required": true,
"description": "The resource type of favorites to be returned.",
"schema": {
"type": "string",
"enum": [
"portfolio",
"project",
"tag",
"task",
"user",
"project_template"
],
"default": "project"
}
},
{
"name": "workspace",
"in": "query",
"required": true,
"description": "The workspace in which to get favorites.",
"schema": {
"type": "string"
},
"example": "1234"
}
]
}
Request, responses and operation details
{
"summary": "Get a user's favorites",
"description": "<b>Required scope: </b><code>users:read</code>\n\nReturns all of a user's favorites within a specified workspace and of a given type. The results are ordered exactly as they appear in the user's Asana sidebar in the web application. Note that this endpoint currently only returns favorites for the current user (i.e., the user associated with the authentication token).\n\nThis operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.",
"tags": [
"Users"
],
"operationId": "getFavoritesForUser",
"parameters": [
{
"name": "opt_fields",
"in": "query",
"description": "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. Properties can include nested fields. To learn more, see the [input/output options guide](/docs/inputoutput-options#selecting-nested-fields).",
"required": false,
"example": [
"name",
"offset",
"path",
"uri"
],
"schema": {
"type": "array",
"items": {
"type": "string",
"enum": [
"name",
"offset",
"path",
"uri"
]
}
},
"style": "form",
"explode": false
}
],
"responses": {
"200": {
"description": "Returns the specified user's favorites.",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"type": "array",
"items": {
"$ref": "#/components/schemas/AsanaNamedResource"
}
},
"next_page": {
"$ref": "#/components/schemas/NextPage"
}
}
}
}
}
},
"400": {
"$ref": "#/components/responses/BadRequest"
},
"401": {
"$ref": "#/components/responses/Unauthorized"
},
"403": {
"$ref": "#/components/responses/Forbidden"
},
"404": {
"$ref": "#/components/responses/NotFound"
},
"500": {
"$ref": "#/components/responses/InternalServerError"
}
},
"security": [
{
"personalAccessToken": []
},
{
"oauth2": [
"users:read"
]
}
],
"x-readme": {
"code-samples": [
{
"language": "java",
"install": "<dependency><groupId>com.asana</groupId><artifactId>asana</artifactId><version>1.0.0</version></dependency>",
"code": "import com.asana.Client;\n\nClient client = Client.accessToken(\"PERSONAL_ACCESS_TOKEN\");\n\nList<JsonElement> result = client.users.getFavoritesForUser(userGid, workspace, resourceType)\n .option(\"pretty\", true)\n .execute();"
},
{
"language": "node",
"install": "npm install asana",
"code": "const Asana = require('asana');\n\nlet client = new Asana.ApiClient();\nclient.authentications.token.accessToken = '<YOUR_ACCESS_TOKEN>';\n\nlet usersApiInstance = new Asana.UsersApi(client);\nlet user_gid = \"me\"; // String | A string identifying a user. This can either be the string \\\"me\\\", an email, or the gid of a user.\nlet resource_type = \"project\"; // String | The resource type of favorites to be returned.\nlet workspace = \"1234\"; // String | The workspace in which to get favorites.\nlet opts = { \n 'limit': 50, \n 'offset': \"eyJ0eXAiOJiKV1iQLCJhbGciOiJIUzI1NiJ9\", \n 'opt_fields': \"name,offset,path,uri\"\n};\nusersApiInstance.getFavoritesForUser(user_gid, resource_type, workspace, opts).then((result) => {\n console.log('API called successfully. Returned data: ' + JSON.stringify(result.data, null, 2));\n}, (error) => {\n console.error(error.response.body);\n});",
"name": "node-sdk-v3"
},
{
"language": "node",
"install": "npm install asana@1.0.5",
"code": "const asana = require('asana');\n\nconst client = asana.Client.create().useAccessToken('PERSONAL_ACCESS_TOKEN');\n\nclient.users.getFavoritesForUser(userGid, {param: \"value\", param: \"value\", opt_pretty: true})\n .then((result) => {\n console.log(result);\n });",
"name": "node-sdk-v1"
},
{
"language": "python",
"install": "pip install asana",
"code": "import asana\nfrom asana.rest import ApiException\nfrom pprint import pprint\n\nconfiguration = asana.Configuration()\nconfiguration.access_token = '<YOUR_ACCESS_TOKEN>'\napi_client = asana.ApiClient(configuration)\n\n# create an instance of the API class\nusers_api_instance = asana.UsersApi(api_client)\nuser_gid = \"me\" # str | A string identifying a user. This can either be the string \\\"me\\\", an email, or the gid of a user.\nresource_type = \"project\" # str | The resource type of favorites to be returned.\nworkspace = \"1234\" # str | The workspace in which to get favorites.\nopts = {\n 'limit': 50, # int | Results per page. The number of objects to return per page. The value must be between 1 and 100.\n 'offset': \"eyJ0eXAiOJiKV1iQLCJhbGciOiJIUzI1NiJ9\", # str | 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.*\n 'opt_fields': \"name,offset,path,uri\", # list[str] | 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.\n}\n\ntry:\n # Get a user's favorites\n api_response = users_api_instance.get_favorites_for_user(user_gid, resource_type, workspace, opts)\n for data in api_response:\n pprint(data)\nexcept ApiException as e:\n print(\"Exception when calling UsersApi->get_favorites_for_user: %s\\n\" % e)",
"name": "python-sdk-v5"
},
{
"language": "python",
"install": "pip install asana==3.2.3",
"code": "import asana\n\nclient = asana.Client.access_token('PERSONAL_ACCESS_TOKEN')\n\nresult = client.users.get_favorites_for_user(user_gid, {'param': 'value', 'param': 'value'}, opt_pretty=True)",
"name": "python-sdk-v3"
},
{
"language": "php",
"install": "composer require asana/asana",
"code": "<?php\nrequire 'vendor/autoload.php';\n\n$client = Asana\\Client::accessToken('PERSONAL_ACCESS_TOKEN');\n\n$result = $client->users->getFavoritesForUser($user_gid, array('param' => 'value', 'param' => 'value'), array('opt_pretty' => 'true'))"
},
{
"language": "ruby",
"install": "gem install asana",
"code": "require 'asana'\n\nclient = Asana::Client.new do |c|\n c.authentication :access_token, 'PERSONAL_ACCESS_TOKEN'\nend\n\nresult = client.users.get_favorites_for_user(user_gid: 'user_gid', resource_type: ''resource_type_example'', workspace: ''workspace_example'', param: \"value\", param: \"value\", options: {pretty: true})"
}
]
},
"x-purple-suite-runtime": "unavailable"
}
GET /api/1.0/teams/{team_gid}/users
Get users in a team
<b>Required scope: </b><code>users:read</code>
Returns the compact records for all users that are members of the team.
Results are sorted alphabetically and limited to 2000. For more results use the `/users` endpoint.
The persistent core model supports the response and query fields named in x-purple-suite-supported-response-fields and x-purple-suite-supported-query. Other fields/options return an explicit 400 errors envelope.
Authentication
[
{
"personalAccessToken": []
},
{
"oauth2": [
"users:read"
]
}
]
Path-level parameters and metadata
{
"parameters": [
{
"$ref": "#/components/parameters/team_path_gid"
},
{
"$ref": "#/components/parameters/pretty"
},
{
"$ref": "#/components/parameters/offset"
}
]
}
Request, responses and operation details
{
"summary": "Get users in a team",
"description": "<b>Required scope: </b><code>users:read</code>\n\nReturns the compact records for all users that are members of the team.\nResults are sorted alphabetically and limited to 2000. For more results use the `/users` endpoint.\n\nThe persistent core model supports the response and query fields named in x-purple-suite-supported-response-fields and x-purple-suite-supported-query. Other fields/options return an explicit 400 errors envelope.",
"tags": [
"Users"
],
"operationId": "getUsersForTeam",
"parameters": [
{
"name": "opt_fields",
"in": "query",
"description": "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. Properties can include nested fields. To learn more, see the [input/output options guide](/docs/inputoutput-options#selecting-nested-fields).",
"required": false,
"example": [
"custom_fields",
"custom_fields.date_value",
"custom_fields.date_value.date",
"custom_fields.date_value.date_time",
"custom_fields.display_value",
"custom_fields.enabled",
"custom_fields.enum_options",
"custom_fields.enum_options.color",
"custom_fields.enum_options.enabled",
"custom_fields.enum_options.name",
"custom_fields.enum_value",
"custom_fields.enum_value.color",
"custom_fields.enum_value.enabled",
"custom_fields.enum_value.name",
"custom_fields.id_prefix",
"custom_fields.input_restrictions",
"custom_fields.is_formula_field",
"custom_fields.multi_enum_values",
"custom_fields.multi_enum_values.color",
"custom_fields.multi_enum_values.enabled",
"custom_fields.multi_enum_values.name",
"custom_fields.name",
"custom_fields.number_value",
"custom_fields.representation_type",
"custom_fields.text_value",
"custom_fields.type",
"email",
"name",
"photo",
"photo.image_1024x1024",
"photo.image_128x128",
"photo.image_21x21",
"photo.image_27x27",
"photo.image_36x36",
"photo.image_60x60",
"workspaces",
"workspaces.name"
],
"schema": {
"type": "array",
"items": {
"type": "string",
"enum": [
"custom_fields",
"custom_fields.date_value",
"custom_fields.date_value.date",
"custom_fields.date_value.date_time",
"custom_fields.display_value",
"custom_fields.enabled",
"custom_fields.enum_options",
"custom_fields.enum_options.color",
"custom_fields.enum_options.enabled",
"custom_fields.enum_options.name",
"custom_fields.enum_value",
"custom_fields.enum_value.color",
"custom_fields.enum_value.enabled",
"custom_fields.enum_value.name",
"custom_fields.id_prefix",
"custom_fields.input_restrictions",
"custom_fields.is_formula_field",
"custom_fields.multi_enum_values",
"custom_fields.multi_enum_values.color",
"custom_fields.multi_enum_values.enabled",
"custom_fields.multi_enum_values.name",
"custom_fields.name",
"custom_fields.number_value",
"custom_fields.representation_type",
"custom_fields.text_value",
"custom_fields.type",
"email",
"name",
"photo",
"photo.image_1024x1024",
"photo.image_128x128",
"photo.image_21x21",
"photo.image_27x27",
"photo.image_36x36",
"photo.image_60x60",
"workspaces",
"workspaces.name"
]
}
},
"style": "form",
"explode": false
}
],
"responses": {
"200": {
"description": "Returns the user records for all the members of the team, including guests and limited access users.",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"type": "array",
"items": {
"$ref": "#/components/schemas/UserCompact"
}
}
}
}
}
}
},
"400": {
"$ref": "#/components/responses/BadRequest"
},
"401": {
"$ref": "#/components/responses/Unauthorized"
},
"403": {
"$ref": "#/components/responses/Forbidden"
},
"404": {
"$ref": "#/components/responses/NotFound"
},
"500": {
"$ref": "#/components/responses/InternalServerError"
}
},
"security": [
{
"personalAccessToken": []
},
{
"oauth2": [
"users:read"
]
}
],
"x-readme": {
"code-samples": [
{
"language": "java",
"install": "<dependency><groupId>com.asana</groupId><artifactId>asana</artifactId><version>1.0.0</version></dependency>",
"code": "import com.asana.Client;\n\nClient client = Client.accessToken(\"PERSONAL_ACCESS_TOKEN\");\n\nList<User> result = client.users.getUsersForTeam(teamGid)\n .option(\"pretty\", true)\n .execute();"
},
{
"language": "node",
"install": "npm install asana",
"code": "const Asana = require('asana');\n\nlet client = new Asana.ApiClient();\nclient.authentications.token.accessToken = '<YOUR_ACCESS_TOKEN>';\n\nlet usersApiInstance = new Asana.UsersApi(client);\nlet team_gid = \"159874\"; // String | Globally unique identifier for the team.\nlet opts = { \n 'offset': \"eyJ0eXAiOJiKV1iQLCJhbGciOiJIUzI1NiJ9\", \n 'opt_fields': \"custom_fields,custom_fields.date_value,custom_fields.date_value.date,custom_fields.date_value.date_time,custom_fields.display_value,custom_fields.enabled,custom_fields.enum_options,custom_fields.enum_options.color,custom_fields.enum_options.enabled,custom_fields.enum_options.name,custom_fields.enum_value,custom_fields.enum_value.color,custom_fields.enum_value.enabled,custom_fields.enum_value.name,custom_fields.id_prefix,custom_fields.input_restrictions,custom_fields.is_formula_field,custom_fields.multi_enum_values,custom_fields.multi_enum_values.color,custom_fields.multi_enum_values.enabled,custom_fields.multi_enum_values.name,custom_fields.name,custom_fields.number_value,custom_fields.representation_type,custom_fields.text_value,custom_fields.type,email,name,photo,photo.image_1024x1024,photo.image_128x128,photo.image_21x21,photo.image_27x27,photo.image_36x36,photo.image_60x60,workspaces,workspaces.name\"\n};\nusersApiInstance.getUsersForTeam(team_gid, opts).then((result) => {\n console.log('API called successfully. Returned data: ' + JSON.stringify(result.data, null, 2));\n}, (error) => {\n console.error(error.response.body);\n});",
"name": "node-sdk-v3"
},
{
"language": "node",
"install": "npm install asana@1.0.5",
"code": "const asana = require('asana');\n\nconst client = asana.Client.create().useAccessToken('PERSONAL_ACCESS_TOKEN');\n\nclient.users.getUsersForTeam(teamGid, {param: \"value\", param: \"value\", opt_pretty: true})\n .then((result) => {\n console.log(result);\n });",
"name": "node-sdk-v1"
},
{
"language": "python",
"install": "pip install asana",
"code": "import asana\nfrom asana.rest import ApiException\nfrom pprint import pprint\n\nconfiguration = asana.Configuration()\nconfiguration.access_token = '<YOUR_ACCESS_TOKEN>'\napi_client = asana.ApiClient(configuration)\n\n# create an instance of the API class\nusers_api_instance = asana.UsersApi(api_client)\nteam_gid = \"159874\" # str | Globally unique identifier for the team.\nopts = {\n 'offset': \"eyJ0eXAiOJiKV1iQLCJhbGciOiJIUzI1NiJ9\", # str | 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.*\n 'opt_fields': \"custom_fields,custom_fields.date_value,custom_fields.date_value.date,custom_fields.date_value.date_time,custom_fields.display_value,custom_fields.enabled,custom_fields.enum_options,custom_fields.enum_options.color,custom_fields.enum_options.enabled,custom_fields.enum_options.name,custom_fields.enum_value,custom_fields.enum_value.color,custom_fields.enum_value.enabled,custom_fields.enum_value.name,custom_fields.id_prefix,custom_fields.input_restrictions,custom_fields.is_formula_field,custom_fields.multi_enum_values,custom_fields.multi_enum_values.color,custom_fields.multi_enum_values.enabled,custom_fields.multi_enum_values.name,custom_fields.name,custom_fields.number_value,custom_fields.representation_type,custom_fields.text_value,custom_fields.type,email,name,photo,photo.image_1024x1024,photo.image_128x128,photo.image_21x21,photo.image_27x27,photo.image_36x36,photo.image_60x60,workspaces,workspaces.name\", # list[str] | 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.\n}\n\ntry:\n # Get users in a team\n api_response = users_api_instance.get_users_for_team(team_gid, opts)\n for data in api_response:\n pprint(data)\nexcept ApiException as e:\n print(\"Exception when calling UsersApi->get_users_for_team: %s\\n\" % e)",
"name": "python-sdk-v5"
},
{
"language": "python",
"install": "pip install asana==3.2.3",
"code": "import asana\n\nclient = asana.Client.access_token('PERSONAL_ACCESS_TOKEN')\n\nresult = client.users.get_users_for_team(team_gid, {'param': 'value', 'param': 'value'}, opt_pretty=True)",
"name": "python-sdk-v3"
},
{
"language": "php",
"install": "composer require asana/asana",
"code": "<?php\nrequire 'vendor/autoload.php';\n\n$client = Asana\\Client::accessToken('PERSONAL_ACCESS_TOKEN');\n\n$result = $client->users->getUsersForTeam($team_gid, array('param' => 'value', 'param' => 'value'), array('opt_pretty' => 'true'))"
},
{
"language": "ruby",
"install": "gem install asana",
"code": "require 'asana'\n\nclient = Asana::Client.new do |c|\n c.authentication :access_token, 'PERSONAL_ACCESS_TOKEN'\nend\n\nresult = client.users.get_users_for_team(team_gid: 'team_gid', param: \"value\", param: \"value\", options: {pretty: true})"
}
]
},
"x-purple-suite-runtime": "modeled-core",
"x-purple-suite-supported-query": [
"opt_pretty",
"offset",
"opt_fields"
],
"x-purple-suite-supported-response-fields": [
"gid",
"resource_type",
"resource_subtype",
"name",
"notes",
"completed",
"completed_at",
"created_at",
"modified_at",
"assignee",
"assignee_status",
"workspace",
"projects",
"memberships",
"parent",
"due_on",
"start_on",
"tags",
"dependencies",
"num_subtasks",
"archived",
"public",
"color",
"default_view",
"team",
"project",
"section",
"text",
"created_by",
"target",
"type",
"email",
"photo",
"is_organization"
]
}
GET /api/1.0/workspaces/{workspace_gid}/users
Get users in a workspace or organization
<b>Required scope: </b><code>users:read</code>
Returns the compact records for all users in the specified workspace or organization.
Results are sorted alphabetically and limited to 2000. For more results use the `/users` endpoint.
The persistent core model supports the response and query fields named in x-purple-suite-supported-response-fields and x-purple-suite-supported-query. Other fields/options return an explicit 400 errors envelope.
Authentication
[
{
"personalAccessToken": []
},
{
"oauth2": [
"users:read"
]
}
]
Path-level parameters and metadata
{
"parameters": [
{
"$ref": "#/components/parameters/workspace_path_gid"
},
{
"$ref": "#/components/parameters/pretty"
},
{
"$ref": "#/components/parameters/offset"
}
]
}
Request, responses and operation details
{
"summary": "Get users in a workspace or organization",
"description": "<b>Required scope: </b><code>users:read</code>\n\nReturns the compact records for all users in the specified workspace or organization.\nResults are sorted alphabetically and limited to 2000. For more results use the `/users` endpoint.\n\nThe persistent core model supports the response and query fields named in x-purple-suite-supported-response-fields and x-purple-suite-supported-query. Other fields/options return an explicit 400 errors envelope.",
"tags": [
"Users"
],
"operationId": "getUsersForWorkspace",
"parameters": [
{
"name": "opt_fields",
"in": "query",
"description": "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. Properties can include nested fields. To learn more, see the [input/output options guide](/docs/inputoutput-options#selecting-nested-fields).",
"required": false,
"example": [
"custom_fields",
"custom_fields.date_value",
"custom_fields.date_value.date",
"custom_fields.date_value.date_time",
"custom_fields.display_value",
"custom_fields.enabled",
"custom_fields.enum_options",
"custom_fields.enum_options.color",
"custom_fields.enum_options.enabled",
"custom_fields.enum_options.name",
"custom_fields.enum_value",
"custom_fields.enum_value.color",
"custom_fields.enum_value.enabled",
"custom_fields.enum_value.name",
"custom_fields.id_prefix",
"custom_fields.input_restrictions",
"custom_fields.is_formula_field",
"custom_fields.multi_enum_values",
"custom_fields.multi_enum_values.color",
"custom_fields.multi_enum_values.enabled",
"custom_fields.multi_enum_values.name",
"custom_fields.name",
"custom_fields.number_value",
"custom_fields.representation_type",
"custom_fields.text_value",
"custom_fields.type",
"email",
"name",
"photo",
"photo.image_1024x1024",
"photo.image_128x128",
"photo.image_21x21",
"photo.image_27x27",
"photo.image_36x36",
"photo.image_60x60",
"workspaces",
"workspaces.name"
],
"schema": {
"type": "array",
"items": {
"type": "string",
"enum": [
"custom_fields",
"custom_fields.date_value",
"custom_fields.date_value.date",
"custom_fields.date_value.date_time",
"custom_fields.display_value",
"custom_fields.enabled",
"custom_fields.enum_options",
"custom_fields.enum_options.color",
"custom_fields.enum_options.enabled",
"custom_fields.enum_options.name",
"custom_fields.enum_value",
"custom_fields.enum_value.color",
"custom_fields.enum_value.enabled",
"custom_fields.enum_value.name",
"custom_fields.id_prefix",
"custom_fields.input_restrictions",
"custom_fields.is_formula_field",
"custom_fields.multi_enum_values",
"custom_fields.multi_enum_values.color",
"custom_fields.multi_enum_values.enabled",
"custom_fields.multi_enum_values.name",
"custom_fields.name",
"custom_fields.number_value",
"custom_fields.representation_type",
"custom_fields.text_value",
"custom_fields.type",
"email",
"name",
"photo",
"photo.image_1024x1024",
"photo.image_128x128",
"photo.image_21x21",
"photo.image_27x27",
"photo.image_36x36",
"photo.image_60x60",
"workspaces",
"workspaces.name"
]
}
},
"style": "form",
"explode": false
}
],
"responses": {
"200": {
"description": "Return the users in the specified workspace or org.",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"type": "array",
"items": {
"$ref": "#/components/schemas/UserCompact"
}
}
}
}
}
}
},
"400": {
"$ref": "#/components/responses/BadRequest"
},
"401": {
"$ref": "#/components/responses/Unauthorized"
},
"403": {
"$ref": "#/components/responses/Forbidden"
},
"404": {
"$ref": "#/components/responses/NotFound"
},
"500": {
"$ref": "#/components/responses/InternalServerError"
}
},
"security": [
{
"personalAccessToken": []
},
{
"oauth2": [
"users:read"
]
}
],
"x-readme": {
"code-samples": [
{
"language": "java",
"install": "<dependency><groupId>com.asana</groupId><artifactId>asana</artifactId><version>1.0.0</version></dependency>",
"code": "import com.asana.Client;\n\nClient client = Client.accessToken(\"PERSONAL_ACCESS_TOKEN\");\n\nList<User> result = client.users.getUsersForWorkspace(workspaceGid)\n .option(\"pretty\", true)\n .execute();"
},
{
"language": "node",
"install": "npm install asana",
"code": "const Asana = require('asana');\n\nlet client = new Asana.ApiClient();\nclient.authentications.token.accessToken = '<YOUR_ACCESS_TOKEN>';\n\nlet usersApiInstance = new Asana.UsersApi(client);\nlet workspace_gid = \"12345\"; // String | Globally unique identifier for the workspace or organization.\nlet opts = { \n 'offset': \"eyJ0eXAiOJiKV1iQLCJhbGciOiJIUzI1NiJ9\", \n 'opt_fields': \"custom_fields,custom_fields.date_value,custom_fields.date_value.date,custom_fields.date_value.date_time,custom_fields.display_value,custom_fields.enabled,custom_fields.enum_options,custom_fields.enum_options.color,custom_fields.enum_options.enabled,custom_fields.enum_options.name,custom_fields.enum_value,custom_fields.enum_value.color,custom_fields.enum_value.enabled,custom_fields.enum_value.name,custom_fields.id_prefix,custom_fields.input_restrictions,custom_fields.is_formula_field,custom_fields.multi_enum_values,custom_fields.multi_enum_values.color,custom_fields.multi_enum_values.enabled,custom_fields.multi_enum_values.name,custom_fields.name,custom_fields.number_value,custom_fields.representation_type,custom_fields.text_value,custom_fields.type,email,name,photo,photo.image_1024x1024,photo.image_128x128,photo.image_21x21,photo.image_27x27,photo.image_36x36,photo.image_60x60,workspaces,workspaces.name\"\n};\nusersApiInstance.getUsersForWorkspace(workspace_gid, opts).then((result) => {\n console.log('API called successfully. Returned data: ' + JSON.stringify(result.data, null, 2));\n}, (error) => {\n console.error(error.response.body);\n});",
"name": "node-sdk-v3"
},
{
"language": "node",
"install": "npm install asana@1.0.5",
"code": "const asana = require('asana');\n\nconst client = asana.Client.create().useAccessToken('PERSONAL_ACCESS_TOKEN');\n\nclient.users.getUsersForWorkspace(workspaceGid, {param: \"value\", param: \"value\", opt_pretty: true})\n .then((result) => {\n console.log(result);\n });",
"name": "node-sdk-v1"
},
{
"language": "python",
"install": "pip install asana",
"code": "import asana\nfrom asana.rest import ApiException\nfrom pprint import pprint\n\nconfiguration = asana.Configuration()\nconfiguration.access_token = '<YOUR_ACCESS_TOKEN>'\napi_client = asana.ApiClient(configuration)\n\n# create an instance of the API class\nusers_api_instance = asana.UsersApi(api_client)\nworkspace_gid = \"12345\" # str | Globally unique identifier for the workspace or organization.\nopts = {\n 'offset': \"eyJ0eXAiOJiKV1iQLCJhbGciOiJIUzI1NiJ9\", # str | 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.*\n 'opt_fields': \"custom_fields,custom_fields.date_value,custom_fields.date_value.date,custom_fields.date_value.date_time,custom_fields.display_value,custom_fields.enabled,custom_fields.enum_options,custom_fields.enum_options.color,custom_fields.enum_options.enabled,custom_fields.enum_options.name,custom_fields.enum_value,custom_fields.enum_value.color,custom_fields.enum_value.enabled,custom_fields.enum_value.name,custom_fields.id_prefix,custom_fields.input_restrictions,custom_fields.is_formula_field,custom_fields.multi_enum_values,custom_fields.multi_enum_values.color,custom_fields.multi_enum_values.enabled,custom_fields.multi_enum_values.name,custom_fields.name,custom_fields.number_value,custom_fields.representation_type,custom_fields.text_value,custom_fields.type,email,name,photo,photo.image_1024x1024,photo.image_128x128,photo.image_21x21,photo.image_27x27,photo.image_36x36,photo.image_60x60,workspaces,workspaces.name\", # list[str] | 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.\n}\n\ntry:\n # Get users in a workspace or organization\n api_response = users_api_instance.get_users_for_workspace(workspace_gid, opts)\n for data in api_response:\n pprint(data)\nexcept ApiException as e:\n print(\"Exception when calling UsersApi->get_users_for_workspace: %s\\n\" % e)",
"name": "python-sdk-v5"
},
{
"language": "python",
"install": "pip install asana==3.2.3",
"code": "import asana\n\nclient = asana.Client.access_token('PERSONAL_ACCESS_TOKEN')\n\nresult = client.users.get_users_for_workspace(workspace_gid, {'param': 'value', 'param': 'value'}, opt_pretty=True)",
"name": "python-sdk-v3"
},
{
"language": "php",
"install": "composer require asana/asana",
"code": "<?php\nrequire 'vendor/autoload.php';\n\n$client = Asana\\Client::accessToken('PERSONAL_ACCESS_TOKEN');\n\n$result = $client->users->getUsersForWorkspace($workspace_gid, array('param' => 'value', 'param' => 'value'), array('opt_pretty' => 'true'))"
},
{
"language": "ruby",
"install": "gem install asana",
"code": "require 'asana'\n\nclient = Asana::Client.new do |c|\n c.authentication :access_token, 'PERSONAL_ACCESS_TOKEN'\nend\n\nresult = client.users.get_users_for_workspace(workspace_gid: 'workspace_gid', param: \"value\", param: \"value\", options: {pretty: true})"
}
]
},
"x-purple-suite-runtime": "modeled-core",
"x-purple-suite-supported-query": [
"opt_pretty",
"offset",
"opt_fields"
],
"x-purple-suite-supported-response-fields": [
"gid",
"resource_type",
"resource_subtype",
"name",
"notes",
"completed",
"completed_at",
"created_at",
"modified_at",
"assignee",
"assignee_status",
"workspace",
"projects",
"memberships",
"parent",
"due_on",
"start_on",
"tags",
"dependencies",
"num_subtasks",
"archived",
"public",
"color",
"default_view",
"team",
"project",
"section",
"text",
"created_by",
"target",
"type",
"email",
"photo",
"is_organization"
]
}
GET /api/1.0/workspaces/{workspace_gid}/users/{user_gid}
Get a user in a workspace or organization
<b>Required scope: </b><code>users:read</code>
Returns the full user record for the single user with the provided ID in the specified workspace or organization.
This operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.
Authentication
[
{
"personalAccessToken": []
},
{
"oauth2": [
"users:read"
]
}
]
Path-level parameters and metadata
{
"parameters": [
{
"$ref": "#/components/parameters/workspace_path_gid"
},
{
"$ref": "#/components/parameters/user_path_gid"
},
{
"$ref": "#/components/parameters/pretty"
}
]
}
Request, responses and operation details
{
"summary": "Get a user in a workspace or organization",
"description": "<b>Required scope: </b><code>users:read</code>\n\nReturns the full user record for the single user with the provided ID in the specified workspace or organization.\n\nThis operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.",
"tags": [
"Users"
],
"operationId": "getUserForWorkspace",
"parameters": [
{
"name": "opt_fields",
"in": "query",
"description": "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. Properties can include nested fields. To learn more, see the [input/output options guide](/docs/inputoutput-options#selecting-nested-fields).",
"required": false,
"example": [
"custom_fields",
"custom_fields.date_value",
"custom_fields.date_value.date",
"custom_fields.date_value.date_time",
"custom_fields.display_value",
"custom_fields.enabled",
"custom_fields.enum_options",
"custom_fields.enum_options.color",
"custom_fields.enum_options.enabled",
"custom_fields.enum_options.name",
"custom_fields.enum_value",
"custom_fields.enum_value.color",
"custom_fields.enum_value.enabled",
"custom_fields.enum_value.name",
"custom_fields.id_prefix",
"custom_fields.input_restrictions",
"custom_fields.is_formula_field",
"custom_fields.multi_enum_values",
"custom_fields.multi_enum_values.color",
"custom_fields.multi_enum_values.enabled",
"custom_fields.multi_enum_values.name",
"custom_fields.name",
"custom_fields.number_value",
"custom_fields.representation_type",
"custom_fields.text_value",
"custom_fields.type",
"email",
"name",
"photo",
"photo.image_1024x1024",
"photo.image_128x128",
"photo.image_21x21",
"photo.image_27x27",
"photo.image_36x36",
"photo.image_60x60",
"workspaces",
"workspaces.name"
],
"schema": {
"type": "array",
"items": {
"type": "string",
"enum": [
"custom_fields",
"custom_fields.date_value",
"custom_fields.date_value.date",
"custom_fields.date_value.date_time",
"custom_fields.display_value",
"custom_fields.enabled",
"custom_fields.enum_options",
"custom_fields.enum_options.color",
"custom_fields.enum_options.enabled",
"custom_fields.enum_options.name",
"custom_fields.enum_value",
"custom_fields.enum_value.color",
"custom_fields.enum_value.enabled",
"custom_fields.enum_value.name",
"custom_fields.id_prefix",
"custom_fields.input_restrictions",
"custom_fields.is_formula_field",
"custom_fields.multi_enum_values",
"custom_fields.multi_enum_values.color",
"custom_fields.multi_enum_values.enabled",
"custom_fields.multi_enum_values.name",
"custom_fields.name",
"custom_fields.number_value",
"custom_fields.representation_type",
"custom_fields.text_value",
"custom_fields.type",
"email",
"name",
"photo",
"photo.image_1024x1024",
"photo.image_128x128",
"photo.image_21x21",
"photo.image_27x27",
"photo.image_36x36",
"photo.image_60x60",
"workspaces",
"workspaces.name"
]
}
},
"style": "form",
"explode": false
}
],
"responses": {
"200": {
"description": "Returns the user specified.",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"$ref": "#/components/schemas/UserResponse"
}
}
}
}
}
},
"400": {
"$ref": "#/components/responses/BadRequest"
},
"401": {
"$ref": "#/components/responses/Unauthorized"
},
"403": {
"$ref": "#/components/responses/Forbidden"
},
"404": {
"$ref": "#/components/responses/NotFound"
},
"500": {
"$ref": "#/components/responses/InternalServerError"
}
},
"security": [
{
"personalAccessToken": []
},
{
"oauth2": [
"users:read"
]
}
],
"x-readme": {
"code-samples": [
{
"language": "node",
"install": "npm install asana",
"code": "const Asana = require('asana');\n\nlet client = new Asana.ApiClient();\nclient.authentications.token.accessToken = '<YOUR_ACCESS_TOKEN>';\n\nlet usersApiInstance = new Asana.UsersApi(client);\nlet workspace_gid = \"12345\"; // String | Globally unique identifier for the workspace or organization.\nlet user_gid = \"me\"; // String | A string identifying a user. This can either be the string \\\"me\\\", an email, or the gid of a user.\nlet opts = { \n 'opt_fields': \"custom_fields,custom_fields.date_value,custom_fields.date_value.date,custom_fields.date_value.date_time,custom_fields.display_value,custom_fields.enabled,custom_fields.enum_options,custom_fields.enum_options.color,custom_fields.enum_options.enabled,custom_fields.enum_options.name,custom_fields.enum_value,custom_fields.enum_value.color,custom_fields.enum_value.enabled,custom_fields.enum_value.name,custom_fields.id_prefix,custom_fields.input_restrictions,custom_fields.is_formula_field,custom_fields.multi_enum_values,custom_fields.multi_enum_values.color,custom_fields.multi_enum_values.enabled,custom_fields.multi_enum_values.name,custom_fields.name,custom_fields.number_value,custom_fields.representation_type,custom_fields.text_value,custom_fields.type,email,name,photo,photo.image_1024x1024,photo.image_128x128,photo.image_21x21,photo.image_27x27,photo.image_36x36,photo.image_60x60,workspaces,workspaces.name\"\n};\nusersApiInstance.getUserForWorkspace(workspace_gid, user_gid, opts).then((result) => {\n console.log('API called successfully. Returned data: ' + JSON.stringify(result.data, null, 2));\n}, (error) => {\n console.error(error.response.body);\n});",
"name": "node-sdk-v3"
},
{
"language": "python",
"install": "pip install asana",
"code": "import asana\nfrom asana.rest import ApiException\nfrom pprint import pprint\n\nconfiguration = asana.Configuration()\nconfiguration.access_token = '<YOUR_ACCESS_TOKEN>'\napi_client = asana.ApiClient(configuration)\n\n# create an instance of the API class\nusers_api_instance = asana.UsersApi(api_client)\nworkspace_gid = \"12345\" # str | Globally unique identifier for the workspace or organization.\nuser_gid = \"me\" # str | A string identifying a user. This can either be the string \\\"me\\\", an email, or the gid of a user.\nopts = {\n 'opt_fields': \"custom_fields,custom_fields.date_value,custom_fields.date_value.date,custom_fields.date_value.date_time,custom_fields.display_value,custom_fields.enabled,custom_fields.enum_options,custom_fields.enum_options.color,custom_fields.enum_options.enabled,custom_fields.enum_options.name,custom_fields.enum_value,custom_fields.enum_value.color,custom_fields.enum_value.enabled,custom_fields.enum_value.name,custom_fields.id_prefix,custom_fields.input_restrictions,custom_fields.is_formula_field,custom_fields.multi_enum_values,custom_fields.multi_enum_values.color,custom_fields.multi_enum_values.enabled,custom_fields.multi_enum_values.name,custom_fields.name,custom_fields.number_value,custom_fields.representation_type,custom_fields.text_value,custom_fields.type,email,name,photo,photo.image_1024x1024,photo.image_128x128,photo.image_21x21,photo.image_27x27,photo.image_36x36,photo.image_60x60,workspaces,workspaces.name\", # list[str] | 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.\n}\n\ntry:\n # Get a user in a workspace or organization\n api_response = users_api_instance.get_user_for_workspace(workspace_gid, user_gid, opts)\n pprint(api_response)\nexcept ApiException as e:\n print(\"Exception when calling UsersApi->get_user_for_workspace: %s\\n\" % e)",
"name": "python-sdk-v5"
}
]
},
"x-purple-suite-runtime": "unavailable"
}
PUT /api/1.0/workspaces/{workspace_gid}/users/{user_gid}
Update a user in a workspace or organization
An existing user can be updated by making a PUT request on the URL for that user in the specified workspace or organization. Only the fields provided in the `data` block will be updated; any unspecified fields will remain unchanged.
This operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.
Authentication
[
{
"personalAccessToken": []
},
{
"oauth2": []
}
]
Path-level parameters and metadata
{
"parameters": [
{
"$ref": "#/components/parameters/workspace_path_gid"
},
{
"$ref": "#/components/parameters/user_path_gid"
},
{
"$ref": "#/components/parameters/pretty"
}
]
}
Request, responses and operation details
{
"summary": "Update a user in a workspace or organization",
"description": "An existing user can be updated by making a PUT request on the URL for that user in the specified workspace or organization. Only the fields provided in the `data` block will be updated; any unspecified fields will remain unchanged.\n\nThis operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.",
"tags": [
"Users"
],
"operationId": "updateUserForWorkspace",
"parameters": [
{
"name": "opt_fields",
"in": "query",
"description": "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. Properties can include nested fields. To learn more, see the [input/output options guide](/docs/inputoutput-options#selecting-nested-fields).",
"required": false,
"example": [
"custom_fields",
"custom_fields.date_value",
"custom_fields.date_value.date",
"custom_fields.date_value.date_time",
"custom_fields.display_value",
"custom_fields.enabled",
"custom_fields.enum_options",
"custom_fields.enum_options.color",
"custom_fields.enum_options.enabled",
"custom_fields.enum_options.name",
"custom_fields.enum_value",
"custom_fields.enum_value.color",
"custom_fields.enum_value.enabled",
"custom_fields.enum_value.name",
"custom_fields.id_prefix",
"custom_fields.input_restrictions",
"custom_fields.is_formula_field",
"custom_fields.multi_enum_values",
"custom_fields.multi_enum_values.color",
"custom_fields.multi_enum_values.enabled",
"custom_fields.multi_enum_values.name",
"custom_fields.name",
"custom_fields.number_value",
"custom_fields.representation_type",
"custom_fields.text_value",
"custom_fields.type",
"email",
"name",
"photo",
"photo.image_1024x1024",
"photo.image_128x128",
"photo.image_21x21",
"photo.image_27x27",
"photo.image_36x36",
"photo.image_60x60",
"workspaces",
"workspaces.name"
],
"schema": {
"type": "array",
"items": {
"type": "string",
"enum": [
"custom_fields",
"custom_fields.date_value",
"custom_fields.date_value.date",
"custom_fields.date_value.date_time",
"custom_fields.display_value",
"custom_fields.enabled",
"custom_fields.enum_options",
"custom_fields.enum_options.color",
"custom_fields.enum_options.enabled",
"custom_fields.enum_options.name",
"custom_fields.enum_value",
"custom_fields.enum_value.color",
"custom_fields.enum_value.enabled",
"custom_fields.enum_value.name",
"custom_fields.id_prefix",
"custom_fields.input_restrictions",
"custom_fields.is_formula_field",
"custom_fields.multi_enum_values",
"custom_fields.multi_enum_values.color",
"custom_fields.multi_enum_values.enabled",
"custom_fields.multi_enum_values.name",
"custom_fields.name",
"custom_fields.number_value",
"custom_fields.representation_type",
"custom_fields.text_value",
"custom_fields.type",
"email",
"name",
"photo",
"photo.image_1024x1024",
"photo.image_128x128",
"photo.image_21x21",
"photo.image_27x27",
"photo.image_36x36",
"photo.image_60x60",
"workspaces",
"workspaces.name"
]
}
},
"style": "form",
"explode": false
}
],
"requestBody": {
"description": "The user to update.",
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"$ref": "#/components/schemas/UserUpdateRequest"
}
}
}
}
}
},
"responses": {
"200": {
"description": "Successfully updated the specified user.",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"$ref": "#/components/schemas/UserResponse"
}
}
}
}
}
},
"400": {
"$ref": "#/components/responses/BadRequest"
},
"401": {
"$ref": "#/components/responses/Unauthorized"
},
"403": {
"$ref": "#/components/responses/Forbidden"
},
"404": {
"$ref": "#/components/responses/NotFound"
},
"500": {
"$ref": "#/components/responses/InternalServerError"
}
},
"security": [
{
"personalAccessToken": []
},
{
"oauth2": []
}
],
"x-readme": {
"code-samples": [
{
"language": "node",
"install": "npm install asana",
"code": "const Asana = require('asana');\n\nlet client = new Asana.ApiClient();\nclient.authentications.token.accessToken = '<YOUR_ACCESS_TOKEN>';\n\nlet usersApiInstance = new Asana.UsersApi(client);\nlet body = {\"data\": {\"<PARAM_1>\": \"<VALUE_1>\", \"<PARAM_2>\": \"<VALUE_2>\",}}; // Object | The user to update.\nlet workspace_gid = \"12345\"; // String | Globally unique identifier for the workspace or organization.\nlet user_gid = \"me\"; // String | A string identifying a user. This can either be the string \\\"me\\\", an email, or the gid of a user.\nlet opts = { \n 'opt_fields': \"custom_fields,custom_fields.date_value,custom_fields.date_value.date,custom_fields.date_value.date_time,custom_fields.display_value,custom_fields.enabled,custom_fields.enum_options,custom_fields.enum_options.color,custom_fields.enum_options.enabled,custom_fields.enum_options.name,custom_fields.enum_value,custom_fields.enum_value.color,custom_fields.enum_value.enabled,custom_fields.enum_value.name,custom_fields.id_prefix,custom_fields.input_restrictions,custom_fields.is_formula_field,custom_fields.multi_enum_values,custom_fields.multi_enum_values.color,custom_fields.multi_enum_values.enabled,custom_fields.multi_enum_values.name,custom_fields.name,custom_fields.number_value,custom_fields.representation_type,custom_fields.text_value,custom_fields.type,email,name,photo,photo.image_1024x1024,photo.image_128x128,photo.image_21x21,photo.image_27x27,photo.image_36x36,photo.image_60x60,workspaces,workspaces.name\"\n};\nusersApiInstance.updateUserForWorkspace(body, workspace_gid, user_gid, opts).then((result) => {\n console.log('API called successfully. Returned data: ' + JSON.stringify(result.data, null, 2));\n}, (error) => {\n console.error(error.response.body);\n});",
"name": "node-sdk-v3"
},
{
"language": "python",
"install": "pip install asana",
"code": "import asana\nfrom asana.rest import ApiException\nfrom pprint import pprint\n\nconfiguration = asana.Configuration()\nconfiguration.access_token = '<YOUR_ACCESS_TOKEN>'\napi_client = asana.ApiClient(configuration)\n\n# create an instance of the API class\nusers_api_instance = asana.UsersApi(api_client)\nbody = {\"data\": {\"<PARAM_1>\": \"<VALUE_1>\", \"<PARAM_2>\": \"<VALUE_2>\",}} # dict | The user to update.\nworkspace_gid = \"12345\" # str | Globally unique identifier for the workspace or organization.\nuser_gid = \"me\" # str | A string identifying a user. This can either be the string \\\"me\\\", an email, or the gid of a user.\nopts = {\n 'opt_fields': \"custom_fields,custom_fields.date_value,custom_fields.date_value.date,custom_fields.date_value.date_time,custom_fields.display_value,custom_fields.enabled,custom_fields.enum_options,custom_fields.enum_options.color,custom_fields.enum_options.enabled,custom_fields.enum_options.name,custom_fields.enum_value,custom_fields.enum_value.color,custom_fields.enum_value.enabled,custom_fields.enum_value.name,custom_fields.id_prefix,custom_fields.input_restrictions,custom_fields.is_formula_field,custom_fields.multi_enum_values,custom_fields.multi_enum_values.color,custom_fields.multi_enum_values.enabled,custom_fields.multi_enum_values.name,custom_fields.name,custom_fields.number_value,custom_fields.representation_type,custom_fields.text_value,custom_fields.type,email,name,photo,photo.image_1024x1024,photo.image_128x128,photo.image_21x21,photo.image_27x27,photo.image_36x36,photo.image_60x60,workspaces,workspaces.name\", # list[str] | 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.\n}\n\ntry:\n # Update a user in a workspace or organization\n api_response = users_api_instance.update_user_for_workspace(body, workspace_gid, user_gid, opts)\n pprint(api_response)\nexcept ApiException as e:\n print(\"Exception when calling UsersApi->update_user_for_workspace: %s\\n\" % e)",
"name": "python-sdk-v5"
}
]
},
"x-purple-suite-runtime": "unavailable"
}
GET /api/1.0/webhooks
Get multiple webhooks
<b>Required scope: </b><code>webhooks:read</code>
Get the compact representation of all webhooks your app has registered for the authenticated user in the given workspace.
This operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.
Authentication
[
{
"personalAccessToken": []
},
{
"oauth2": [
"webhooks:read"
]
}
]
Path-level parameters and metadata
{
"parameters": [
{
"$ref": "#/components/parameters/pretty"
}
]
}
Request, responses and operation details
{
"summary": "Get multiple webhooks",
"description": "<b>Required scope: </b><code>webhooks:read</code>\n\nGet the compact representation of all webhooks your app has registered for the authenticated user in the given workspace.\n\nThis operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.",
"tags": [
"Webhooks"
],
"operationId": "getWebhooks",
"parameters": [
{
"$ref": "#/components/parameters/limit"
},
{
"$ref": "#/components/parameters/offset"
},
{
"name": "workspace",
"in": "query",
"required": true,
"description": "The workspace to query for webhooks in.",
"schema": {
"type": "string"
},
"example": "1331"
},
{
"name": "resource",
"in": "query",
"description": "Only return webhooks for the given resource.",
"schema": {
"type": "string"
},
"example": "51648"
},
{
"name": "opt_fields",
"in": "query",
"description": "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. Properties can include nested fields. To learn more, see the [input/output options guide](/docs/inputoutput-options#selecting-nested-fields).",
"required": false,
"example": [
"active",
"created_at",
"delivery_retry_count",
"failure_deletion_timestamp",
"filters",
"filters.action",
"filters.fields",
"filters.resource_subtype",
"last_failure_at",
"last_failure_content",
"last_success_at",
"next_attempt_after",
"offset",
"path",
"resource",
"resource.name",
"target",
"uri"
],
"schema": {
"type": "array",
"items": {
"type": "string",
"enum": [
"active",
"created_at",
"delivery_retry_count",
"failure_deletion_timestamp",
"filters",
"filters.action",
"filters.fields",
"filters.resource_subtype",
"last_failure_at",
"last_failure_content",
"last_success_at",
"next_attempt_after",
"offset",
"path",
"resource",
"resource.name",
"target",
"uri"
]
}
},
"style": "form",
"explode": false
}
],
"responses": {
"200": {
"description": "Successfully retrieved the requested webhooks.",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"type": "array",
"items": {
"$ref": "#/components/schemas/WebhookResponse"
}
},
"next_page": {
"$ref": "#/components/schemas/NextPage"
}
}
}
}
}
},
"400": {
"$ref": "#/components/responses/BadRequest"
},
"401": {
"$ref": "#/components/responses/Unauthorized"
},
"403": {
"$ref": "#/components/responses/Forbidden"
},
"404": {
"$ref": "#/components/responses/NotFound"
},
"500": {
"$ref": "#/components/responses/InternalServerError"
}
},
"security": [
{
"personalAccessToken": []
},
{
"oauth2": [
"webhooks:read"
]
}
],
"x-readme": {
"code-samples": [
{
"language": "java",
"install": "<dependency><groupId>com.asana</groupId><artifactId>asana</artifactId><version>1.0.0</version></dependency>",
"code": "import com.asana.Client;\n\nClient client = Client.accessToken(\"PERSONAL_ACCESS_TOKEN\");\n\nList<Webhook> result = client.webhooks.getWebhooks(resource, workspace)\n .option(\"pretty\", true)\n .execute();"
},
{
"language": "node",
"install": "npm install asana",
"code": "const Asana = require('asana');\n\nlet client = new Asana.ApiClient();\nclient.authentications.token.accessToken = '<YOUR_ACCESS_TOKEN>';\n\nlet webhooksApiInstance = new Asana.WebhooksApi(client);\nlet workspace = \"1331\"; // String | The workspace to query for webhooks in.\nlet opts = { \n 'limit': 50, \n 'offset': \"eyJ0eXAiOJiKV1iQLCJhbGciOiJIUzI1NiJ9\", \n 'resource': \"51648\", \n 'opt_fields': \"active,created_at,delivery_retry_count,failure_deletion_timestamp,filters,filters.action,filters.fields,filters.resource_subtype,last_failure_at,last_failure_content,last_success_at,next_attempt_after,offset,path,resource,resource.name,target,uri\"\n};\nwebhooksApiInstance.getWebhooks(workspace, opts).then((result) => {\n console.log('API called successfully. Returned data: ' + JSON.stringify(result.data, null, 2));\n}, (error) => {\n console.error(error.response.body);\n});",
"name": "node-sdk-v3"
},
{
"language": "node",
"install": "npm install asana@1.0.5",
"code": "const asana = require('asana');\n\nconst client = asana.Client.create().useAccessToken('PERSONAL_ACCESS_TOKEN');\n\nclient.webhooks.getWebhooks({param: \"value\", param: \"value\", opt_pretty: true})\n .then((result) => {\n console.log(result);\n });",
"name": "node-sdk-v1"
},
{
"language": "python",
"install": "pip install asana",
"code": "import asana\nfrom asana.rest import ApiException\nfrom pprint import pprint\n\nconfiguration = asana.Configuration()\nconfiguration.access_token = '<YOUR_ACCESS_TOKEN>'\napi_client = asana.ApiClient(configuration)\n\n# create an instance of the API class\nwebhooks_api_instance = asana.WebhooksApi(api_client)\nworkspace = \"1331\" # str | The workspace to query for webhooks in.\nopts = {\n 'limit': 50, # int | Results per page. The number of objects to return per page. The value must be between 1 and 100.\n 'offset': \"eyJ0eXAiOJiKV1iQLCJhbGciOiJIUzI1NiJ9\", # str | 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.*\n 'resource': \"51648\", # str | Only return webhooks for the given resource.\n 'opt_fields': \"active,created_at,delivery_retry_count,failure_deletion_timestamp,filters,filters.action,filters.fields,filters.resource_subtype,last_failure_at,last_failure_content,last_success_at,next_attempt_after,offset,path,resource,resource.name,target,uri\", # list[str] | 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.\n}\n\ntry:\n # Get multiple webhooks\n api_response = webhooks_api_instance.get_webhooks(workspace, opts)\n for data in api_response:\n pprint(data)\nexcept ApiException as e:\n print(\"Exception when calling WebhooksApi->get_webhooks: %s\\n\" % e)",
"name": "python-sdk-v5"
},
{
"language": "python",
"install": "pip install asana==3.2.3",
"code": "import asana\n\nclient = asana.Client.access_token('PERSONAL_ACCESS_TOKEN')\n\nresult = client.webhooks.get_webhooks({'param': 'value', 'param': 'value'}, opt_pretty=True)",
"name": "python-sdk-v3"
},
{
"language": "php",
"install": "composer require asana/asana",
"code": "<?php\nrequire 'vendor/autoload.php';\n\n$client = Asana\\Client::accessToken('PERSONAL_ACCESS_TOKEN');\n\n$result = $client->webhooks->getWebhooks(array('param' => 'value', 'param' => 'value'), array('opt_pretty' => 'true'))"
},
{
"language": "ruby",
"install": "gem install asana",
"code": "require 'asana'\n\nclient = Asana::Client.new do |c|\n c.authentication :access_token, 'PERSONAL_ACCESS_TOKEN'\nend\n\nresult = client.webhooks.get_webhooks(workspace: ''workspace_example'', param: \"value\", param: \"value\", options: {pretty: true})"
}
]
},
"x-purple-suite-runtime": "unavailable"
}
POST /api/1.0/webhooks
Establish a webhook
<b>Required scope: </b><code>webhooks:write</code>
Establishing a webhook is a two-part process. First, a simple HTTP POST
request initiates the creation similar to creating any other resource.
Next, in the middle of this request comes the confirmation handshake.
When a webhook is created, we will send a test POST to the target with an
`X-Hook-Secret` header. The target must respond with a `200 OK` or `204
No Content` and a matching `X-Hook-Secret` header to confirm that this
webhook subscription is indeed expected. We strongly recommend storing
this secret to be used to verify future webhook event signatures.
The POST request to create the webhook will then return with the status
of the request. If you do not acknowledge the webhook’s confirmation
handshake it will fail to setup, and you will receive an error in
response to your attempt to create it. This means you need to be able to
receive and complete the webhook *while* the POST request is in-flight
(in other words, have a server that can handle requests asynchronously).
Invalid hostnames like localhost will receive a 403 Forbidden status code.
```
# Request
curl -H "Authorization: Bearer <personal_access_token>" \
-X POST https://app.asana.com/api/1.0/webhooks \
-d "resource=8675309" \
-d "target=https://example.com/receive-webhook/7654"
```
```
# Handshake sent to https://example.com/
POST /receive-webhook/7654
X-Hook-Secret: b537207f20cbfa02357cf448134da559e8bd39d61597dcd5631b8012eae53e81
```
```
# Handshake response sent by example.com
HTTP/1.1 200
X-Hook-Secret: b537207f20cbfa02357cf448134da559e8bd39d61597dcd5631b8012eae53e81
```
```
# Response
HTTP/1.1 201
{
"data": {
"gid": "43214",
"resource": {
"gid": "8675309",
"name": "Bugs"
},
"target": "https://example.com/receive-webhook/7654",
"active": false,
"last_success_at": null,
"last_failure_at": null,
"last_failure_content": null
},
"X-Hook-Secret": "b537207f20cbfa02357cf448134da559e8bd39d61597dcd5631b8012eae53e81"
}
```
This operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.
Authentication
[
{
"personalAccessToken": []
},
{
"oauth2": [
"webhooks:write"
]
}
]
Path-level parameters and metadata
{
"parameters": [
{
"$ref": "#/components/parameters/pretty"
}
]
}
Request, responses and operation details
{
"summary": "Establish a webhook",
"description": "<b>Required scope: </b><code>webhooks:write</code>\n\nEstablishing a webhook is a two-part process. First, a simple HTTP POST\nrequest initiates the creation similar to creating any other resource.\n\nNext, in the middle of this request comes the confirmation handshake.\nWhen a webhook is created, we will send a test POST to the target with an\n`X-Hook-Secret` header. The target must respond with a `200 OK` or `204\nNo Content` and a matching `X-Hook-Secret` header to confirm that this\nwebhook subscription is indeed expected. We strongly recommend storing\nthis secret to be used to verify future webhook event signatures.\n\nThe POST request to create the webhook will then return with the status\nof the request. If you do not acknowledge the webhook’s confirmation\nhandshake it will fail to setup, and you will receive an error in\nresponse to your attempt to create it. This means you need to be able to\nreceive and complete the webhook *while* the POST request is in-flight\n(in other words, have a server that can handle requests asynchronously).\n\nInvalid hostnames like localhost will receive a 403 Forbidden status code.\n\n```\n# Request\ncurl -H \"Authorization: Bearer <personal_access_token>\" \\\n-X POST https://app.asana.com/api/1.0/webhooks \\\n-d \"resource=8675309\" \\\n-d \"target=https://example.com/receive-webhook/7654\"\n```\n\n```\n# Handshake sent to https://example.com/\nPOST /receive-webhook/7654\nX-Hook-Secret: b537207f20cbfa02357cf448134da559e8bd39d61597dcd5631b8012eae53e81\n```\n\n```\n# Handshake response sent by example.com\nHTTP/1.1 200\nX-Hook-Secret: b537207f20cbfa02357cf448134da559e8bd39d61597dcd5631b8012eae53e81\n```\n\n```\n# Response\nHTTP/1.1 201\n{\n \"data\": {\n \"gid\": \"43214\",\n \"resource\": {\n \"gid\": \"8675309\",\n \"name\": \"Bugs\"\n },\n \"target\": \"https://example.com/receive-webhook/7654\",\n \"active\": false,\n \"last_success_at\": null,\n \"last_failure_at\": null,\n \"last_failure_content\": null\n },\n \"X-Hook-Secret\": \"b537207f20cbfa02357cf448134da559e8bd39d61597dcd5631b8012eae53e81\"\n}\n```\n\nThis operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.",
"tags": [
"Webhooks"
],
"operationId": "createWebhook",
"parameters": [
{
"name": "opt_fields",
"in": "query",
"description": "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. Properties can include nested fields. To learn more, see the [input/output options guide](/docs/inputoutput-options#selecting-nested-fields).",
"required": false,
"example": [
"active",
"created_at",
"delivery_retry_count",
"failure_deletion_timestamp",
"filters",
"filters.action",
"filters.fields",
"filters.resource_subtype",
"last_failure_at",
"last_failure_content",
"last_success_at",
"next_attempt_after",
"resource",
"resource.name",
"target"
],
"schema": {
"type": "array",
"items": {
"type": "string",
"enum": [
"active",
"created_at",
"delivery_retry_count",
"failure_deletion_timestamp",
"filters",
"filters.action",
"filters.fields",
"filters.resource_subtype",
"last_failure_at",
"last_failure_content",
"last_success_at",
"next_attempt_after",
"resource",
"resource.name",
"target"
]
}
},
"style": "form",
"explode": false
}
],
"requestBody": {
"description": "The webhook workspace and target.",
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"$ref": "#/components/schemas/WebhookRequest"
}
}
}
}
}
},
"responses": {
"201": {
"description": "Successfully created the requested webhook.",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"$ref": "#/components/schemas/WebhookResponse"
},
"X-Hook-Secret": {
"type": "string",
"description": "The secret to be used to verify future webhook event signatures.",
"example": "b537207f20cbfa02357cf448134da559e8bd39d61597dcd5631b8012eae53e81"
}
}
}
}
}
},
"400": {
"$ref": "#/components/responses/BadRequest"
},
"401": {
"$ref": "#/components/responses/Unauthorized"
},
"403": {
"$ref": "#/components/responses/Forbidden"
},
"404": {
"$ref": "#/components/responses/NotFound"
},
"500": {
"$ref": "#/components/responses/InternalServerError"
}
},
"security": [
{
"personalAccessToken": []
},
{
"oauth2": [
"webhooks:write"
]
}
],
"x-readme": {
"code-samples": [
{
"language": "java",
"install": "<dependency><groupId>com.asana</groupId><artifactId>asana</artifactId><version>1.0.0</version></dependency>",
"code": "import com.asana.Client;\n\nClient client = Client.accessToken(\"PERSONAL_ACCESS_TOKEN\");\n\nWebhook result = client.webhooks.createWebhook()\n .data(\"field\", \"value\")\n .data(\"field\", \"value\")\n .option(\"pretty\", true)\n .execute();"
},
{
"language": "node",
"install": "npm install asana",
"code": "const Asana = require('asana');\n\nlet client = new Asana.ApiClient();\nclient.authentications.token.accessToken = '<YOUR_ACCESS_TOKEN>';\n\nlet webhooksApiInstance = new Asana.WebhooksApi(client);\nlet body = {\"data\": {\"<PARAM_1>\": \"<VALUE_1>\", \"<PARAM_2>\": \"<VALUE_2>\",}}; // Object | The webhook workspace and target.\nlet opts = { \n 'opt_fields': \"active,created_at,delivery_retry_count,failure_deletion_timestamp,filters,filters.action,filters.fields,filters.resource_subtype,last_failure_at,last_failure_content,last_success_at,next_attempt_after,resource,resource.name,target\"\n};\nwebhooksApiInstance.createWebhook(body, opts).then((result) => {\n console.log('API called successfully. Returned data: ' + JSON.stringify(result.data, null, 2));\n}, (error) => {\n console.error(error.response.body);\n});",
"name": "node-sdk-v3"
},
{
"language": "node",
"install": "npm install asana@1.0.5",
"code": "const asana = require('asana');\n\nconst client = asana.Client.create().useAccessToken('PERSONAL_ACCESS_TOKEN');\n\nclient.webhooks.createWebhook({field: \"value\", field: \"value\", pretty: true})\n .then((result) => {\n console.log(result);\n });",
"name": "node-sdk-v1"
},
{
"language": "python",
"install": "pip install asana",
"code": "import asana\nfrom asana.rest import ApiException\nfrom pprint import pprint\n\nconfiguration = asana.Configuration()\nconfiguration.access_token = '<YOUR_ACCESS_TOKEN>'\napi_client = asana.ApiClient(configuration)\n\n# create an instance of the API class\nwebhooks_api_instance = asana.WebhooksApi(api_client)\nbody = {\"data\": {\"<PARAM_1>\": \"<VALUE_1>\", \"<PARAM_2>\": \"<VALUE_2>\",}} # dict | The webhook workspace and target.\nopts = {\n 'opt_fields': \"active,created_at,delivery_retry_count,failure_deletion_timestamp,filters,filters.action,filters.fields,filters.resource_subtype,last_failure_at,last_failure_content,last_success_at,next_attempt_after,resource,resource.name,target\", # list[str] | 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.\n}\n\ntry:\n # Establish a webhook\n api_response = webhooks_api_instance.create_webhook(body, opts)\n pprint(api_response)\nexcept ApiException as e:\n print(\"Exception when calling WebhooksApi->create_webhook: %s\\n\" % e)",
"name": "python-sdk-v5"
},
{
"language": "python",
"install": "pip install asana==3.2.3",
"code": "import asana\n\nclient = asana.Client.access_token('PERSONAL_ACCESS_TOKEN')\n\nresult = client.webhooks.create_webhook({'field': 'value', 'field': 'value'}, opt_pretty=True)",
"name": "python-sdk-v3"
},
{
"language": "php",
"install": "composer require asana/asana",
"code": "<?php\nrequire 'vendor/autoload.php';\n\n$client = Asana\\Client::accessToken('PERSONAL_ACCESS_TOKEN');\n\n$result = $client->webhooks->createWebhook(array('field' => 'value', 'field' => 'value'), array('opt_pretty' => 'true'))"
},
{
"language": "ruby",
"install": "gem install asana",
"code": "require 'asana'\n\nclient = Asana::Client.new do |c|\n c.authentication :access_token, 'PERSONAL_ACCESS_TOKEN'\nend\n\nresult = client.webhooks.create_webhook(field: \"value\", field: \"value\", options: {pretty: true})"
}
]
},
"x-purple-suite-runtime": "unavailable"
}
GET /api/1.0/webhooks/{webhook_gid}
Get a webhook
<b>Required scope: </b><code>webhooks:read</code>
Returns the full record for the given webhook.
This operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.
Authentication
[
{
"personalAccessToken": []
},
{
"oauth2": [
"webhooks:read"
]
}
]
Path-level parameters and metadata
{
"parameters": [
{
"$ref": "#/components/parameters/webhook_path_gid"
},
{
"$ref": "#/components/parameters/pretty"
}
]
}
Request, responses and operation details
{
"summary": "Get a webhook",
"description": "<b>Required scope: </b><code>webhooks:read</code>\n\nReturns the full record for the given webhook.\n\nThis operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.",
"tags": [
"Webhooks"
],
"operationId": "getWebhook",
"parameters": [
{
"name": "opt_fields",
"in": "query",
"description": "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. Properties can include nested fields. To learn more, see the [input/output options guide](/docs/inputoutput-options#selecting-nested-fields).",
"required": false,
"example": [
"active",
"created_at",
"delivery_retry_count",
"failure_deletion_timestamp",
"filters",
"filters.action",
"filters.fields",
"filters.resource_subtype",
"last_failure_at",
"last_failure_content",
"last_success_at",
"next_attempt_after",
"resource",
"resource.name",
"target"
],
"schema": {
"type": "array",
"items": {
"type": "string",
"enum": [
"active",
"created_at",
"delivery_retry_count",
"failure_deletion_timestamp",
"filters",
"filters.action",
"filters.fields",
"filters.resource_subtype",
"last_failure_at",
"last_failure_content",
"last_success_at",
"next_attempt_after",
"resource",
"resource.name",
"target"
]
}
},
"style": "form",
"explode": false
}
],
"responses": {
"200": {
"description": "Successfully retrieved the requested webhook.",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"$ref": "#/components/schemas/WebhookResponse"
}
}
}
}
}
},
"400": {
"$ref": "#/components/responses/BadRequest"
},
"401": {
"$ref": "#/components/responses/Unauthorized"
},
"403": {
"$ref": "#/components/responses/Forbidden"
},
"404": {
"$ref": "#/components/responses/NotFound"
},
"500": {
"$ref": "#/components/responses/InternalServerError"
}
},
"security": [
{
"personalAccessToken": []
},
{
"oauth2": [
"webhooks:read"
]
}
],
"x-readme": {
"code-samples": [
{
"language": "java",
"install": "<dependency><groupId>com.asana</groupId><artifactId>asana</artifactId><version>1.0.0</version></dependency>",
"code": "import com.asana.Client;\n\nClient client = Client.accessToken(\"PERSONAL_ACCESS_TOKEN\");\n\nWebhook result = client.webhooks.getWebhook(webhookGid)\n .option(\"pretty\", true)\n .execute();"
},
{
"language": "node",
"install": "npm install asana",
"code": "const Asana = require('asana');\n\nlet client = new Asana.ApiClient();\nclient.authentications.token.accessToken = '<YOUR_ACCESS_TOKEN>';\n\nlet webhooksApiInstance = new Asana.WebhooksApi(client);\nlet webhook_gid = \"12345\"; // String | Globally unique identifier for the webhook.\nlet opts = { \n 'opt_fields': \"active,created_at,delivery_retry_count,failure_deletion_timestamp,filters,filters.action,filters.fields,filters.resource_subtype,last_failure_at,last_failure_content,last_success_at,next_attempt_after,resource,resource.name,target\"\n};\nwebhooksApiInstance.getWebhook(webhook_gid, opts).then((result) => {\n console.log('API called successfully. Returned data: ' + JSON.stringify(result.data, null, 2));\n}, (error) => {\n console.error(error.response.body);\n});",
"name": "node-sdk-v3"
},
{
"language": "node",
"install": "npm install asana@1.0.5",
"code": "const asana = require('asana');\n\nconst client = asana.Client.create().useAccessToken('PERSONAL_ACCESS_TOKEN');\n\nclient.webhooks.getWebhook(webhookGid, {param: \"value\", param: \"value\", opt_pretty: true})\n .then((result) => {\n console.log(result);\n });",
"name": "node-sdk-v1"
},
{
"language": "python",
"install": "pip install asana",
"code": "import asana\nfrom asana.rest import ApiException\nfrom pprint import pprint\n\nconfiguration = asana.Configuration()\nconfiguration.access_token = '<YOUR_ACCESS_TOKEN>'\napi_client = asana.ApiClient(configuration)\n\n# create an instance of the API class\nwebhooks_api_instance = asana.WebhooksApi(api_client)\nwebhook_gid = \"12345\" # str | Globally unique identifier for the webhook.\nopts = {\n 'opt_fields': \"active,created_at,delivery_retry_count,failure_deletion_timestamp,filters,filters.action,filters.fields,filters.resource_subtype,last_failure_at,last_failure_content,last_success_at,next_attempt_after,resource,resource.name,target\", # list[str] | 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.\n}\n\ntry:\n # Get a webhook\n api_response = webhooks_api_instance.get_webhook(webhook_gid, opts)\n pprint(api_response)\nexcept ApiException as e:\n print(\"Exception when calling WebhooksApi->get_webhook: %s\\n\" % e)",
"name": "python-sdk-v5"
},
{
"language": "python",
"install": "pip install asana==3.2.3",
"code": "import asana\n\nclient = asana.Client.access_token('PERSONAL_ACCESS_TOKEN')\n\nresult = client.webhooks.get_webhook(webhook_gid, {'param': 'value', 'param': 'value'}, opt_pretty=True)",
"name": "python-sdk-v3"
},
{
"language": "php",
"install": "composer require asana/asana",
"code": "<?php\nrequire 'vendor/autoload.php';\n\n$client = Asana\\Client::accessToken('PERSONAL_ACCESS_TOKEN');\n\n$result = $client->webhooks->getWebhook($webhook_gid, array('param' => 'value', 'param' => 'value'), array('opt_pretty' => 'true'))"
},
{
"language": "ruby",
"install": "gem install asana",
"code": "require 'asana'\n\nclient = Asana::Client.new do |c|\n c.authentication :access_token, 'PERSONAL_ACCESS_TOKEN'\nend\n\nresult = client.webhooks.get_webhook(webhook_gid: 'webhook_gid', param: \"value\", param: \"value\", options: {pretty: true})"
}
]
},
"x-purple-suite-runtime": "unavailable"
}
PUT /api/1.0/webhooks/{webhook_gid}
Update a webhook
<b>Required scope: </b><code>webhooks:write</code>
An existing webhook's filters can be updated by making a PUT request on the URL for that webhook. Note that the webhook's previous `filters` array will be completely overwritten by the `filters` sent in the PUT request.
This operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.
Authentication
[
{
"personalAccessToken": []
},
{
"oauth2": [
"webhooks:write"
]
}
]
Path-level parameters and metadata
{
"parameters": [
{
"$ref": "#/components/parameters/webhook_path_gid"
},
{
"$ref": "#/components/parameters/pretty"
}
]
}
Request, responses and operation details
{
"summary": "Update a webhook",
"description": "<b>Required scope: </b><code>webhooks:write</code>\n\nAn existing webhook's filters can be updated by making a PUT request on the URL for that webhook. Note that the webhook's previous `filters` array will be completely overwritten by the `filters` sent in the PUT request.\n\nThis operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.",
"tags": [
"Webhooks"
],
"operationId": "updateWebhook",
"parameters": [
{
"name": "opt_fields",
"in": "query",
"description": "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. Properties can include nested fields. To learn more, see the [input/output options guide](/docs/inputoutput-options#selecting-nested-fields).",
"required": false,
"example": [
"active",
"created_at",
"delivery_retry_count",
"failure_deletion_timestamp",
"filters",
"filters.action",
"filters.fields",
"filters.resource_subtype",
"last_failure_at",
"last_failure_content",
"last_success_at",
"next_attempt_after",
"resource",
"resource.name",
"target"
],
"schema": {
"type": "array",
"items": {
"type": "string",
"enum": [
"active",
"created_at",
"delivery_retry_count",
"failure_deletion_timestamp",
"filters",
"filters.action",
"filters.fields",
"filters.resource_subtype",
"last_failure_at",
"last_failure_content",
"last_success_at",
"next_attempt_after",
"resource",
"resource.name",
"target"
]
}
},
"style": "form",
"explode": false
}
],
"requestBody": {
"description": "The updated filters for the webhook.",
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"$ref": "#/components/schemas/WebhookUpdateRequest"
}
}
}
}
}
},
"responses": {
"200": {
"description": "Successfully updated the webhook.",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"$ref": "#/components/schemas/WebhookResponse"
}
}
}
}
}
},
"400": {
"$ref": "#/components/responses/BadRequest"
},
"401": {
"$ref": "#/components/responses/Unauthorized"
},
"403": {
"$ref": "#/components/responses/Forbidden"
},
"404": {
"$ref": "#/components/responses/NotFound"
},
"500": {
"$ref": "#/components/responses/InternalServerError"
}
},
"security": [
{
"personalAccessToken": []
},
{
"oauth2": [
"webhooks:write"
]
}
],
"x-readme": {
"code-samples": [
{
"language": "java",
"install": "<dependency><groupId>com.asana</groupId><artifactId>asana</artifactId><version>1.0.0</version></dependency>",
"code": "import com.asana.Client;\n\nClient client = Client.accessToken(\"PERSONAL_ACCESS_TOKEN\");\n\nWebhook result = client.webhooks.updateWebhook(webhookGid)\n .data(\"field\", \"value\")\n .data(\"field\", \"value\")\n .option(\"pretty\", true)\n .execute();"
},
{
"language": "node",
"install": "npm install asana",
"code": "const Asana = require('asana');\n\nlet client = new Asana.ApiClient();\nclient.authentications.token.accessToken = '<YOUR_ACCESS_TOKEN>';\n\nlet webhooksApiInstance = new Asana.WebhooksApi(client);\nlet body = {\"data\": {\"<PARAM_1>\": \"<VALUE_1>\", \"<PARAM_2>\": \"<VALUE_2>\",}}; // Object | The updated filters for the webhook.\nlet webhook_gid = \"12345\"; // String | Globally unique identifier for the webhook.\nlet opts = { \n 'opt_fields': \"active,created_at,delivery_retry_count,failure_deletion_timestamp,filters,filters.action,filters.fields,filters.resource_subtype,last_failure_at,last_failure_content,last_success_at,next_attempt_after,resource,resource.name,target\"\n};\nwebhooksApiInstance.updateWebhook(body, webhook_gid, opts).then((result) => {\n console.log('API called successfully. Returned data: ' + JSON.stringify(result.data, null, 2));\n}, (error) => {\n console.error(error.response.body);\n});",
"name": "node-sdk-v3"
},
{
"language": "node",
"install": "npm install asana@1.0.5",
"code": "const asana = require('asana');\n\nconst client = asana.Client.create().useAccessToken('PERSONAL_ACCESS_TOKEN');\n\nclient.webhooks.updateWebhook(webhookGid, {field: \"value\", field: \"value\", pretty: true})\n .then((result) => {\n console.log(result);\n });",
"name": "node-sdk-v1"
},
{
"language": "python",
"install": "pip install asana",
"code": "import asana\nfrom asana.rest import ApiException\nfrom pprint import pprint\n\nconfiguration = asana.Configuration()\nconfiguration.access_token = '<YOUR_ACCESS_TOKEN>'\napi_client = asana.ApiClient(configuration)\n\n# create an instance of the API class\nwebhooks_api_instance = asana.WebhooksApi(api_client)\nbody = {\"data\": {\"<PARAM_1>\": \"<VALUE_1>\", \"<PARAM_2>\": \"<VALUE_2>\",}} # dict | The updated filters for the webhook.\nwebhook_gid = \"12345\" # str | Globally unique identifier for the webhook.\nopts = {\n 'opt_fields': \"active,created_at,delivery_retry_count,failure_deletion_timestamp,filters,filters.action,filters.fields,filters.resource_subtype,last_failure_at,last_failure_content,last_success_at,next_attempt_after,resource,resource.name,target\", # list[str] | 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.\n}\n\ntry:\n # Update a webhook\n api_response = webhooks_api_instance.update_webhook(body, webhook_gid, opts)\n pprint(api_response)\nexcept ApiException as e:\n print(\"Exception when calling WebhooksApi->update_webhook: %s\\n\" % e)",
"name": "python-sdk-v5"
},
{
"language": "python",
"install": "pip install asana==3.2.3",
"code": "import asana\n\nclient = asana.Client.access_token('PERSONAL_ACCESS_TOKEN')\n\nresult = client.webhooks.update_webhook(webhook_gid, {'field': 'value', 'field': 'value'}, opt_pretty=True)",
"name": "python-sdk-v3"
},
{
"language": "php",
"install": "composer require asana/asana",
"code": "<?php\nrequire 'vendor/autoload.php';\n\n$client = Asana\\Client::accessToken('PERSONAL_ACCESS_TOKEN');\n\n$result = $client->webhooks->updateWebhook($webhook_gid, array('field' => 'value', 'field' => 'value'), array('opt_pretty' => 'true'))"
},
{
"language": "ruby",
"install": "gem install asana",
"code": "require 'asana'\n\nclient = Asana::Client.new do |c|\n c.authentication :access_token, 'PERSONAL_ACCESS_TOKEN'\nend\n\nresult = client.webhooks.update_webhook(webhook_gid: 'webhook_gid', field: \"value\", field: \"value\", options: {pretty: true})"
}
]
},
"x-purple-suite-runtime": "unavailable"
}
DELETE /api/1.0/webhooks/{webhook_gid}
Delete a webhook
<b>Required scope: </b><code>webhooks:delete</code>
This method *permanently* removes a webhook. Note that it may be possible to receive a request that was already in flight after deleting the webhook, but no further requests will be issued.
This operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.
Authentication
[
{
"personalAccessToken": []
},
{
"oauth2": [
"webhooks:delete"
]
}
]
Path-level parameters and metadata
{
"parameters": [
{
"$ref": "#/components/parameters/webhook_path_gid"
},
{
"$ref": "#/components/parameters/pretty"
}
]
}
Request, responses and operation details
{
"summary": "Delete a webhook",
"description": "<b>Required scope: </b><code>webhooks:delete</code>\n\nThis method *permanently* removes a webhook. Note that it may be possible to receive a request that was already in flight after deleting the webhook, but no further requests will be issued.\n\nThis operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.",
"tags": [
"Webhooks"
],
"operationId": "deleteWebhook",
"responses": {
"200": {
"description": "Successfully retrieved the requested webhook.",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"$ref": "#/components/schemas/EmptyResponse"
}
}
}
}
}
},
"400": {
"$ref": "#/components/responses/BadRequest"
},
"401": {
"$ref": "#/components/responses/Unauthorized"
},
"403": {
"$ref": "#/components/responses/Forbidden"
},
"404": {
"$ref": "#/components/responses/NotFound"
},
"500": {
"$ref": "#/components/responses/InternalServerError"
}
},
"security": [
{
"personalAccessToken": []
},
{
"oauth2": [
"webhooks:delete"
]
}
],
"x-readme": {
"code-samples": [
{
"language": "java",
"install": "<dependency><groupId>com.asana</groupId><artifactId>asana</artifactId><version>1.0.0</version></dependency>",
"code": "import com.asana.Client;\n\nClient client = Client.accessToken(\"PERSONAL_ACCESS_TOKEN\");\n\nJsonElement result = client.webhooks.deleteWebhook(webhookGid)\n .option(\"pretty\", true)\n .execute();"
},
{
"language": "node",
"install": "npm install asana",
"code": "const Asana = require('asana');\n\nlet client = new Asana.ApiClient();\nclient.authentications.token.accessToken = '<YOUR_ACCESS_TOKEN>';\n\nlet webhooksApiInstance = new Asana.WebhooksApi(client);\nlet webhook_gid = \"12345\"; // String | Globally unique identifier for the webhook.\n\nwebhooksApiInstance.deleteWebhook(webhook_gid).then((result) => {\n console.log('API called successfully. Returned data: ' + JSON.stringify(result.data, null, 2));\n}, (error) => {\n console.error(error.response.body);\n});",
"name": "node-sdk-v3"
},
{
"language": "node",
"install": "npm install asana@1.0.5",
"code": "const asana = require('asana');\n\nconst client = asana.Client.create().useAccessToken('PERSONAL_ACCESS_TOKEN');\n\nclient.webhooks.deleteWebhook(webhookGid)\n .then((result) => {\n console.log(result);\n });",
"name": "node-sdk-v1"
},
{
"language": "python",
"install": "pip install asana",
"code": "import asana\nfrom asana.rest import ApiException\nfrom pprint import pprint\n\nconfiguration = asana.Configuration()\nconfiguration.access_token = '<YOUR_ACCESS_TOKEN>'\napi_client = asana.ApiClient(configuration)\n\n# create an instance of the API class\nwebhooks_api_instance = asana.WebhooksApi(api_client)\nwebhook_gid = \"12345\" # str | Globally unique identifier for the webhook.\n\n\ntry:\n # Delete a webhook\n api_response = webhooks_api_instance.delete_webhook(webhook_gid)\n pprint(api_response)\nexcept ApiException as e:\n print(\"Exception when calling WebhooksApi->delete_webhook: %s\\n\" % e)",
"name": "python-sdk-v5"
},
{
"language": "python",
"install": "pip install asana==3.2.3",
"code": "import asana\n\nclient = asana.Client.access_token('PERSONAL_ACCESS_TOKEN')\n\nresult = client.webhooks.delete_webhook(webhook_gid, opt_pretty=True)",
"name": "python-sdk-v3"
},
{
"language": "php",
"install": "composer require asana/asana",
"code": "<?php\nrequire 'vendor/autoload.php';\n\n$client = Asana\\Client::accessToken('PERSONAL_ACCESS_TOKEN');\n\n$result = $client->webhooks->deleteWebhook($webhook_gid, array('opt_pretty' => 'true'))"
},
{
"language": "ruby",
"install": "gem install asana",
"code": "require 'asana'\n\nclient = Asana::Client.new do |c|\n c.authentication :access_token, 'PERSONAL_ACCESS_TOKEN'\nend\n\nresult = client.webhooks.delete_webhook(webhook_gid: 'webhook_gid', options: {pretty: true})"
}
]
},
"x-purple-suite-runtime": "unavailable"
}
GET /api/1.0/workspace_memberships/{workspace_membership_gid}
Get a workspace membership
Returns the complete workspace record for a single workspace membership.
This operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.
Authentication
[
{
"personalAccessToken": []
},
{
"oauth2": []
}
]
Path-level parameters and metadata
{
"parameters": [
{
"$ref": "#/components/parameters/workspace_membership_path_gid"
},
{
"$ref": "#/components/parameters/pretty"
}
]
}
Request, responses and operation details
{
"summary": "Get a workspace membership",
"description": "Returns the complete workspace record for a single workspace membership.\n\nThis operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.",
"tags": [
"Workspace memberships"
],
"operationId": "getWorkspaceMembership",
"parameters": [
{
"name": "opt_fields",
"in": "query",
"description": "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. Properties can include nested fields. To learn more, see the [input/output options guide](/docs/inputoutput-options#selecting-nested-fields).",
"required": false,
"example": [
"created_at",
"is_active",
"is_admin",
"is_guest",
"is_view_only",
"user",
"user.name",
"user_task_list",
"user_task_list.name",
"user_task_list.owner",
"user_task_list.workspace",
"vacation_dates",
"vacation_dates.end_on",
"vacation_dates.start_on",
"workspace",
"workspace.name"
],
"schema": {
"type": "array",
"items": {
"type": "string",
"enum": [
"created_at",
"is_active",
"is_admin",
"is_guest",
"is_view_only",
"user",
"user.name",
"user_task_list",
"user_task_list.name",
"user_task_list.owner",
"user_task_list.workspace",
"vacation_dates",
"vacation_dates.end_on",
"vacation_dates.start_on",
"workspace",
"workspace.name"
]
}
},
"style": "form",
"explode": false
}
],
"responses": {
"200": {
"description": "Successfully retrieved the requested workspace membership.",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"$ref": "#/components/schemas/WorkspaceMembershipResponse"
}
}
}
}
}
},
"400": {
"$ref": "#/components/responses/BadRequest"
},
"401": {
"$ref": "#/components/responses/Unauthorized"
},
"403": {
"$ref": "#/components/responses/Forbidden"
},
"404": {
"$ref": "#/components/responses/NotFound"
},
"500": {
"$ref": "#/components/responses/InternalServerError"
}
},
"security": [
{
"personalAccessToken": []
},
{
"oauth2": []
}
],
"x-readme": {
"code-samples": [
{
"language": "java",
"install": "<dependency><groupId>com.asana</groupId><artifactId>asana</artifactId><version>1.0.0</version></dependency>",
"code": "import com.asana.Client;\n\nClient client = Client.accessToken(\"PERSONAL_ACCESS_TOKEN\");\n\nJsonElement result = client.workspacememberships.getWorkspaceMembership(workspaceMembershipGid)\n .option(\"pretty\", true)\n .execute();"
},
{
"language": "node",
"install": "npm install asana",
"code": "const Asana = require('asana');\n\nlet client = new Asana.ApiClient();\nclient.authentications.token.accessToken = '<YOUR_ACCESS_TOKEN>';\n\nlet workspaceMembershipsApiInstance = new Asana.WorkspaceMembershipsApi(client);\nlet workspace_membership_gid = \"12345\"; // String | \nlet opts = { \n 'opt_fields': \"created_at,is_active,is_admin,is_guest,is_view_only,user,user.name,user_task_list,user_task_list.name,user_task_list.owner,user_task_list.workspace,vacation_dates,vacation_dates.end_on,vacation_dates.start_on,workspace,workspace.name\"\n};\nworkspaceMembershipsApiInstance.getWorkspaceMembership(workspace_membership_gid, opts).then((result) => {\n console.log('API called successfully. Returned data: ' + JSON.stringify(result.data, null, 2));\n}, (error) => {\n console.error(error.response.body);\n});",
"name": "node-sdk-v3"
},
{
"language": "node",
"install": "npm install asana@1.0.5",
"code": "const asana = require('asana');\n\nconst client = asana.Client.create().useAccessToken('PERSONAL_ACCESS_TOKEN');\n\nclient.workspacememberships.getWorkspaceMembership(workspaceMembershipGid, {param: \"value\", param: \"value\", opt_pretty: true})\n .then((result) => {\n console.log(result);\n });",
"name": "node-sdk-v1"
},
{
"language": "python",
"install": "pip install asana",
"code": "import asana\nfrom asana.rest import ApiException\nfrom pprint import pprint\n\nconfiguration = asana.Configuration()\nconfiguration.access_token = '<YOUR_ACCESS_TOKEN>'\napi_client = asana.ApiClient(configuration)\n\n# create an instance of the API class\nworkspace_memberships_api_instance = asana.WorkspaceMembershipsApi(api_client)\nworkspace_membership_gid = \"12345\" # str | \nopts = {\n 'opt_fields': \"created_at,is_active,is_admin,is_guest,is_view_only,user,user.name,user_task_list,user_task_list.name,user_task_list.owner,user_task_list.workspace,vacation_dates,vacation_dates.end_on,vacation_dates.start_on,workspace,workspace.name\", # list[str] | 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.\n}\n\ntry:\n # Get a workspace membership\n api_response = workspace_memberships_api_instance.get_workspace_membership(workspace_membership_gid, opts)\n pprint(api_response)\nexcept ApiException as e:\n print(\"Exception when calling WorkspaceMembershipsApi->get_workspace_membership: %s\\n\" % e)",
"name": "python-sdk-v5"
},
{
"language": "python",
"install": "pip install asana==3.2.3",
"code": "import asana\n\nclient = asana.Client.access_token('PERSONAL_ACCESS_TOKEN')\n\nresult = client.workspace_memberships.get_workspace_membership(workspace_membership_gid, {'param': 'value', 'param': 'value'}, opt_pretty=True)",
"name": "python-sdk-v3"
},
{
"language": "php",
"install": "composer require asana/asana",
"code": "<?php\nrequire 'vendor/autoload.php';\n\n$client = Asana\\Client::accessToken('PERSONAL_ACCESS_TOKEN');\n\n$result = $client->workspacememberships->getWorkspaceMembership($workspace_membership_gid, array('param' => 'value', 'param' => 'value'), array('opt_pretty' => 'true'))"
},
{
"language": "ruby",
"install": "gem install asana",
"code": "require 'asana'\n\nclient = Asana::Client.new do |c|\n c.authentication :access_token, 'PERSONAL_ACCESS_TOKEN'\nend\n\nresult = client.workspace_memberships.get_workspace_membership(workspace_membership_gid: 'workspace_membership_gid', param: \"value\", param: \"value\", options: {pretty: true})"
}
]
},
"x-purple-suite-runtime": "unavailable"
}
GET /api/1.0/users/{user_gid}/workspace_memberships
Get workspace memberships for a user
Returns the compact workspace membership records for the user.
This operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.
Authentication
[
{
"personalAccessToken": []
},
{
"oauth2": []
}
]
Path-level parameters and metadata
{
"parameters": [
{
"$ref": "#/components/parameters/user_path_gid"
},
{
"$ref": "#/components/parameters/pretty"
},
{
"$ref": "#/components/parameters/limit"
},
{
"$ref": "#/components/parameters/offset"
}
]
}
Request, responses and operation details
{
"summary": "Get workspace memberships for a user",
"description": "Returns the compact workspace membership records for the user.\n\nThis operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.",
"tags": [
"Workspace memberships"
],
"operationId": "getWorkspaceMembershipsForUser",
"parameters": [
{
"name": "opt_fields",
"in": "query",
"description": "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. Properties can include nested fields. To learn more, see the [input/output options guide](/docs/inputoutput-options#selecting-nested-fields).",
"required": false,
"example": [
"created_at",
"is_active",
"is_admin",
"is_guest",
"is_view_only",
"offset",
"path",
"uri",
"user",
"user.name",
"user_task_list",
"user_task_list.name",
"user_task_list.owner",
"user_task_list.workspace",
"vacation_dates",
"vacation_dates.end_on",
"vacation_dates.start_on",
"workspace",
"workspace.name"
],
"schema": {
"type": "array",
"items": {
"type": "string",
"enum": [
"created_at",
"is_active",
"is_admin",
"is_guest",
"is_view_only",
"offset",
"path",
"uri",
"user",
"user.name",
"user_task_list",
"user_task_list.name",
"user_task_list.owner",
"user_task_list.workspace",
"vacation_dates",
"vacation_dates.end_on",
"vacation_dates.start_on",
"workspace",
"workspace.name"
]
}
},
"style": "form",
"explode": false
}
],
"responses": {
"200": {
"description": "Successfully retrieved the requested user's workspace memberships.",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"type": "array",
"items": {
"$ref": "#/components/schemas/WorkspaceMembershipCompact"
}
},
"next_page": {
"$ref": "#/components/schemas/NextPage"
}
}
}
}
}
},
"400": {
"$ref": "#/components/responses/BadRequest"
},
"401": {
"$ref": "#/components/responses/Unauthorized"
},
"403": {
"$ref": "#/components/responses/Forbidden"
},
"404": {
"$ref": "#/components/responses/NotFound"
},
"500": {
"$ref": "#/components/responses/InternalServerError"
}
},
"security": [
{
"personalAccessToken": []
},
{
"oauth2": []
}
],
"x-readme": {
"code-samples": [
{
"language": "java",
"install": "<dependency><groupId>com.asana</groupId><artifactId>asana</artifactId><version>1.0.0</version></dependency>",
"code": "import com.asana.Client;\n\nClient client = Client.accessToken(\"PERSONAL_ACCESS_TOKEN\");\n\nList<JsonElement> result = client.workspacememberships.getWorkspaceMembershipsForUser(userGid)\n .option(\"pretty\", true)\n .execute();"
},
{
"language": "node",
"install": "npm install asana",
"code": "const Asana = require('asana');\n\nlet client = new Asana.ApiClient();\nclient.authentications.token.accessToken = '<YOUR_ACCESS_TOKEN>';\n\nlet workspaceMembershipsApiInstance = new Asana.WorkspaceMembershipsApi(client);\nlet user_gid = \"me\"; // String | A string identifying a user. This can either be the string \\\"me\\\", an email, or the gid of a user.\nlet opts = { \n 'limit': 50, \n 'offset': \"eyJ0eXAiOJiKV1iQLCJhbGciOiJIUzI1NiJ9\", \n 'opt_fields': \"created_at,is_active,is_admin,is_guest,is_view_only,offset,path,uri,user,user.name,user_task_list,user_task_list.name,user_task_list.owner,user_task_list.workspace,vacation_dates,vacation_dates.end_on,vacation_dates.start_on,workspace,workspace.name\"\n};\nworkspaceMembershipsApiInstance.getWorkspaceMembershipsForUser(user_gid, opts).then((result) => {\n console.log('API called successfully. Returned data: ' + JSON.stringify(result.data, null, 2));\n}, (error) => {\n console.error(error.response.body);\n});",
"name": "node-sdk-v3"
},
{
"language": "node",
"install": "npm install asana@1.0.5",
"code": "const asana = require('asana');\n\nconst client = asana.Client.create().useAccessToken('PERSONAL_ACCESS_TOKEN');\n\nclient.workspacememberships.getWorkspaceMembershipsForUser(userGid, {param: \"value\", param: \"value\", opt_pretty: true})\n .then((result) => {\n console.log(result);\n });",
"name": "node-sdk-v1"
},
{
"language": "python",
"install": "pip install asana",
"code": "import asana\nfrom asana.rest import ApiException\nfrom pprint import pprint\n\nconfiguration = asana.Configuration()\nconfiguration.access_token = '<YOUR_ACCESS_TOKEN>'\napi_client = asana.ApiClient(configuration)\n\n# create an instance of the API class\nworkspace_memberships_api_instance = asana.WorkspaceMembershipsApi(api_client)\nuser_gid = \"me\" # str | A string identifying a user. This can either be the string \\\"me\\\", an email, or the gid of a user.\nopts = {\n 'limit': 50, # int | Results per page. The number of objects to return per page. The value must be between 1 and 100.\n 'offset': \"eyJ0eXAiOJiKV1iQLCJhbGciOiJIUzI1NiJ9\", # str | 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.*\n 'opt_fields': \"created_at,is_active,is_admin,is_guest,is_view_only,offset,path,uri,user,user.name,user_task_list,user_task_list.name,user_task_list.owner,user_task_list.workspace,vacation_dates,vacation_dates.end_on,vacation_dates.start_on,workspace,workspace.name\", # list[str] | 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.\n}\n\ntry:\n # Get workspace memberships for a user\n api_response = workspace_memberships_api_instance.get_workspace_memberships_for_user(user_gid, opts)\n for data in api_response:\n pprint(data)\nexcept ApiException as e:\n print(\"Exception when calling WorkspaceMembershipsApi->get_workspace_memberships_for_user: %s\\n\" % e)",
"name": "python-sdk-v5"
},
{
"language": "python",
"install": "pip install asana==3.2.3",
"code": "import asana\n\nclient = asana.Client.access_token('PERSONAL_ACCESS_TOKEN')\n\nresult = client.workspace_memberships.get_workspace_memberships_for_user(user_gid, {'param': 'value', 'param': 'value'}, opt_pretty=True)",
"name": "python-sdk-v3"
},
{
"language": "php",
"install": "composer require asana/asana",
"code": "<?php\nrequire 'vendor/autoload.php';\n\n$client = Asana\\Client::accessToken('PERSONAL_ACCESS_TOKEN');\n\n$result = $client->workspacememberships->getWorkspaceMembershipsForUser($user_gid, array('param' => 'value', 'param' => 'value'), array('opt_pretty' => 'true'))"
},
{
"language": "ruby",
"install": "gem install asana",
"code": "require 'asana'\n\nclient = Asana::Client.new do |c|\n c.authentication :access_token, 'PERSONAL_ACCESS_TOKEN'\nend\n\nresult = client.workspace_memberships.get_workspace_memberships_for_user(user_gid: 'user_gid', param: \"value\", param: \"value\", options: {pretty: true})"
}
]
},
"x-purple-suite-runtime": "unavailable"
}
GET /api/1.0/workspaces/{workspace_gid}/workspace_memberships
Get the workspace memberships for a workspace
Returns the compact workspace membership records for the workspace.
This operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.
Authentication
[
{
"personalAccessToken": []
},
{
"oauth2": []
}
]
Path-level parameters and metadata
{
"parameters": [
{
"$ref": "#/components/parameters/workspace_path_gid"
},
{
"$ref": "#/components/parameters/user_query_param"
},
{
"$ref": "#/components/parameters/pretty"
},
{
"$ref": "#/components/parameters/limit"
},
{
"$ref": "#/components/parameters/offset"
}
]
}
Request, responses and operation details
{
"summary": "Get the workspace memberships for a workspace",
"description": "Returns the compact workspace membership records for the workspace.\n\nThis operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.",
"tags": [
"Workspace memberships"
],
"operationId": "getWorkspaceMembershipsForWorkspace",
"parameters": [
{
"name": "opt_fields",
"in": "query",
"description": "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. Properties can include nested fields. To learn more, see the [input/output options guide](/docs/inputoutput-options#selecting-nested-fields).",
"required": false,
"example": [
"created_at",
"is_active",
"is_admin",
"is_guest",
"is_view_only",
"offset",
"path",
"uri",
"user",
"user.name",
"user_task_list",
"user_task_list.name",
"user_task_list.owner",
"user_task_list.workspace",
"vacation_dates",
"vacation_dates.end_on",
"vacation_dates.start_on",
"workspace",
"workspace.name"
],
"schema": {
"type": "array",
"items": {
"type": "string",
"enum": [
"created_at",
"is_active",
"is_admin",
"is_guest",
"is_view_only",
"offset",
"path",
"uri",
"user",
"user.name",
"user_task_list",
"user_task_list.name",
"user_task_list.owner",
"user_task_list.workspace",
"vacation_dates",
"vacation_dates.end_on",
"vacation_dates.start_on",
"workspace",
"workspace.name"
]
}
},
"style": "form",
"explode": false
}
],
"responses": {
"200": {
"description": "Successfully retrieved the requested workspace's memberships.",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"type": "array",
"items": {
"$ref": "#/components/schemas/WorkspaceMembershipCompact"
}
},
"next_page": {
"$ref": "#/components/schemas/NextPage"
}
}
}
}
}
},
"403": {
"$ref": "#/components/responses/Forbidden"
}
},
"security": [
{
"personalAccessToken": []
},
{
"oauth2": []
}
],
"x-readme": {
"code-samples": [
{
"language": "java",
"install": "<dependency><groupId>com.asana</groupId><artifactId>asana</artifactId><version>1.0.0</version></dependency>",
"code": "import com.asana.Client;\n\nClient client = Client.accessToken(\"PERSONAL_ACCESS_TOKEN\");\n\nList<JsonElement> result = client.workspacememberships.getWorkspaceMembershipsForWorkspace(workspaceGid, user)\n .option(\"pretty\", true)\n .execute();"
},
{
"language": "node",
"install": "npm install asana",
"code": "const Asana = require('asana');\n\nlet client = new Asana.ApiClient();\nclient.authentications.token.accessToken = '<YOUR_ACCESS_TOKEN>';\n\nlet workspaceMembershipsApiInstance = new Asana.WorkspaceMembershipsApi(client);\nlet workspace_gid = \"12345\"; // String | Globally unique identifier for the workspace or organization.\nlet opts = { \n 'user': \"me\", \n 'limit': 50, \n 'offset': \"eyJ0eXAiOJiKV1iQLCJhbGciOiJIUzI1NiJ9\", \n 'opt_fields': \"created_at,is_active,is_admin,is_guest,is_view_only,offset,path,uri,user,user.name,user_task_list,user_task_list.name,user_task_list.owner,user_task_list.workspace,vacation_dates,vacation_dates.end_on,vacation_dates.start_on,workspace,workspace.name\"\n};\nworkspaceMembershipsApiInstance.getWorkspaceMembershipsForWorkspace(workspace_gid, opts).then((result) => {\n console.log('API called successfully. Returned data: ' + JSON.stringify(result.data, null, 2));\n}, (error) => {\n console.error(error.response.body);\n});",
"name": "node-sdk-v3"
},
{
"language": "node",
"install": "npm install asana@1.0.5",
"code": "const asana = require('asana');\n\nconst client = asana.Client.create().useAccessToken('PERSONAL_ACCESS_TOKEN');\n\nclient.workspacememberships.getWorkspaceMembershipsForWorkspace(workspaceGid, {param: \"value\", param: \"value\", opt_pretty: true})\n .then((result) => {\n console.log(result);\n });",
"name": "node-sdk-v1"
},
{
"language": "python",
"install": "pip install asana",
"code": "import asana\nfrom asana.rest import ApiException\nfrom pprint import pprint\n\nconfiguration = asana.Configuration()\nconfiguration.access_token = '<YOUR_ACCESS_TOKEN>'\napi_client = asana.ApiClient(configuration)\n\n# create an instance of the API class\nworkspace_memberships_api_instance = asana.WorkspaceMembershipsApi(api_client)\nworkspace_gid = \"12345\" # str | Globally unique identifier for the workspace or organization.\nopts = {\n 'user': \"me\", # str | A string identifying a user. This can either be the string \\\"me\\\", an email, or the gid of a user.\n 'limit': 50, # int | Results per page. The number of objects to return per page. The value must be between 1 and 100.\n 'offset': \"eyJ0eXAiOJiKV1iQLCJhbGciOiJIUzI1NiJ9\", # str | 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.*\n 'opt_fields': \"created_at,is_active,is_admin,is_guest,is_view_only,offset,path,uri,user,user.name,user_task_list,user_task_list.name,user_task_list.owner,user_task_list.workspace,vacation_dates,vacation_dates.end_on,vacation_dates.start_on,workspace,workspace.name\", # list[str] | 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.\n}\n\ntry:\n # Get the workspace memberships for a workspace\n api_response = workspace_memberships_api_instance.get_workspace_memberships_for_workspace(workspace_gid, opts)\n for data in api_response:\n pprint(data)\nexcept ApiException as e:\n print(\"Exception when calling WorkspaceMembershipsApi->get_workspace_memberships_for_workspace: %s\\n\" % e)",
"name": "python-sdk-v5"
},
{
"language": "python",
"install": "pip install asana==3.2.3",
"code": "import asana\n\nclient = asana.Client.access_token('PERSONAL_ACCESS_TOKEN')\n\nresult = client.workspace_memberships.get_workspace_memberships_for_workspace(workspace_gid, {'param': 'value', 'param': 'value'}, opt_pretty=True)",
"name": "python-sdk-v3"
},
{
"language": "php",
"install": "composer require asana/asana",
"code": "<?php\nrequire 'vendor/autoload.php';\n\n$client = Asana\\Client::accessToken('PERSONAL_ACCESS_TOKEN');\n\n$result = $client->workspacememberships->getWorkspaceMembershipsForWorkspace($workspace_gid, array('param' => 'value', 'param' => 'value'), array('opt_pretty' => 'true'))"
},
{
"language": "ruby",
"install": "gem install asana",
"code": "require 'asana'\n\nclient = Asana::Client.new do |c|\n c.authentication :access_token, 'PERSONAL_ACCESS_TOKEN'\nend\n\nresult = client.workspace_memberships.get_workspace_memberships_for_workspace(workspace_gid: 'workspace_gid', param: \"value\", param: \"value\", options: {pretty: true})"
}
]
},
"x-purple-suite-runtime": "unavailable"
}
GET /api/1.0/workspaces
Get multiple workspaces
<b>Required scope: </b><code>workspaces:read</code>
Returns the compact records for all workspaces visible to the authorized user.
The persistent core model supports the response and query fields named in x-purple-suite-supported-response-fields and x-purple-suite-supported-query. Other fields/options return an explicit 400 errors envelope.
Authentication
[
{
"personalAccessToken": []
},
{
"oauth2": [
"workspaces:read"
]
}
]
Path-level parameters and metadata
{
"parameters": [
{
"$ref": "#/components/parameters/pretty"
},
{
"$ref": "#/components/parameters/limit"
},
{
"$ref": "#/components/parameters/offset"
}
]
}
Request, responses and operation details
{
"summary": "Get multiple workspaces",
"description": "<b>Required scope: </b><code>workspaces:read</code>\n\nReturns the compact records for all workspaces visible to the authorized user.\n\nThe persistent core model supports the response and query fields named in x-purple-suite-supported-response-fields and x-purple-suite-supported-query. Other fields/options return an explicit 400 errors envelope.",
"tags": [
"Workspaces"
],
"operationId": "getWorkspaces",
"parameters": [
{
"name": "opt_fields",
"in": "query",
"description": "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. Properties can include nested fields. To learn more, see the [input/output options guide](/docs/inputoutput-options#selecting-nested-fields).",
"required": false,
"example": [
"email_domains",
"is_organization",
"name",
"offset",
"path",
"uri"
],
"schema": {
"type": "array",
"items": {
"type": "string",
"enum": [
"email_domains",
"is_organization",
"name",
"offset",
"path",
"uri"
]
}
},
"style": "form",
"explode": false
}
],
"responses": {
"200": {
"description": "Return all workspaces visible to the authorized user.",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"type": "array",
"items": {
"$ref": "#/components/schemas/WorkspaceCompact"
}
},
"next_page": {
"$ref": "#/components/schemas/NextPage"
}
}
}
}
}
},
"400": {
"$ref": "#/components/responses/BadRequest"
},
"401": {
"$ref": "#/components/responses/Unauthorized"
},
"403": {
"$ref": "#/components/responses/Forbidden"
},
"404": {
"$ref": "#/components/responses/NotFound"
},
"500": {
"$ref": "#/components/responses/InternalServerError"
}
},
"security": [
{
"personalAccessToken": []
},
{
"oauth2": [
"workspaces:read"
]
}
],
"x-readme": {
"code-samples": [
{
"language": "java",
"install": "<dependency><groupId>com.asana</groupId><artifactId>asana</artifactId><version>1.0.0</version></dependency>",
"code": "import com.asana.Client;\n\nClient client = Client.accessToken(\"PERSONAL_ACCESS_TOKEN\");\n\nList<Workspace> result = client.workspaces.getWorkspaces()\n .option(\"pretty\", true)\n .execute();"
},
{
"language": "node",
"install": "npm install asana",
"code": "const Asana = require('asana');\n\nlet client = new Asana.ApiClient();\nclient.authentications.token.accessToken = '<YOUR_ACCESS_TOKEN>';\n\nlet workspacesApiInstance = new Asana.WorkspacesApi(client);\nlet opts = { \n 'limit': 50, \n 'offset': \"eyJ0eXAiOJiKV1iQLCJhbGciOiJIUzI1NiJ9\", \n 'opt_fields': \"email_domains,is_organization,name,offset,path,uri\"\n};\nworkspacesApiInstance.getWorkspaces(opts).then((result) => {\n console.log('API called successfully. Returned data: ' + JSON.stringify(result.data, null, 2));\n}, (error) => {\n console.error(error.response.body);\n});",
"name": "node-sdk-v3"
},
{
"language": "node",
"install": "npm install asana@1.0.5",
"code": "const asana = require('asana');\n\nconst client = asana.Client.create().useAccessToken('PERSONAL_ACCESS_TOKEN');\n\nclient.workspaces.getWorkspaces({param: \"value\", param: \"value\", opt_pretty: true})\n .then((result) => {\n console.log(result);\n });",
"name": "node-sdk-v1"
},
{
"language": "python",
"install": "pip install asana",
"code": "import asana\nfrom asana.rest import ApiException\nfrom pprint import pprint\n\nconfiguration = asana.Configuration()\nconfiguration.access_token = '<YOUR_ACCESS_TOKEN>'\napi_client = asana.ApiClient(configuration)\n\n# create an instance of the API class\nworkspaces_api_instance = asana.WorkspacesApi(api_client)\nopts = {\n 'limit': 50, # int | Results per page. The number of objects to return per page. The value must be between 1 and 100.\n 'offset': \"eyJ0eXAiOJiKV1iQLCJhbGciOiJIUzI1NiJ9\", # str | 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.*\n 'opt_fields': \"email_domains,is_organization,name,offset,path,uri\", # list[str] | 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.\n}\n\ntry:\n # Get multiple workspaces\n api_response = workspaces_api_instance.get_workspaces(opts)\n for data in api_response:\n pprint(data)\nexcept ApiException as e:\n print(\"Exception when calling WorkspacesApi->get_workspaces: %s\\n\" % e)",
"name": "python-sdk-v5"
},
{
"language": "python",
"install": "pip install asana==3.2.3",
"code": "import asana\n\nclient = asana.Client.access_token('PERSONAL_ACCESS_TOKEN')\n\nresult = client.workspaces.get_workspaces({'param': 'value', 'param': 'value'}, opt_pretty=True)",
"name": "python-sdk-v3"
},
{
"language": "php",
"install": "composer require asana/asana",
"code": "<?php\nrequire 'vendor/autoload.php';\n\n$client = Asana\\Client::accessToken('PERSONAL_ACCESS_TOKEN');\n\n$result = $client->workspaces->getWorkspaces(array('param' => 'value', 'param' => 'value'), array('opt_pretty' => 'true'))"
},
{
"language": "ruby",
"install": "gem install asana",
"code": "require 'asana'\n\nclient = Asana::Client.new do |c|\n c.authentication :access_token, 'PERSONAL_ACCESS_TOKEN'\nend\n\nresult = client.workspaces.get_workspaces(param: \"value\", param: \"value\", options: {pretty: true})"
}
]
},
"x-purple-suite-runtime": "modeled-core",
"x-purple-suite-supported-query": [
"opt_pretty",
"limit",
"offset",
"opt_fields"
],
"x-purple-suite-supported-response-fields": [
"gid",
"resource_type",
"resource_subtype",
"name",
"notes",
"completed",
"completed_at",
"created_at",
"modified_at",
"assignee",
"assignee_status",
"workspace",
"projects",
"memberships",
"parent",
"due_on",
"start_on",
"tags",
"dependencies",
"num_subtasks",
"archived",
"public",
"color",
"default_view",
"team",
"project",
"section",
"text",
"created_by",
"target",
"type",
"email",
"photo",
"is_organization"
]
}
GET /api/1.0/workspaces/{workspace_gid}
Get a workspace
<b>Required scope: </b><code>workspaces:read</code>
Returns the full workspace record for a single workspace.
The persistent core model supports the response and query fields named in x-purple-suite-supported-response-fields and x-purple-suite-supported-query. Other fields/options return an explicit 400 errors envelope.
Authentication
[
{
"personalAccessToken": []
},
{
"oauth2": [
"workspaces:read"
]
}
]
Path-level parameters and metadata
{
"parameters": [
{
"$ref": "#/components/parameters/workspace_path_gid"
},
{
"$ref": "#/components/parameters/pretty"
}
]
}
Request, responses and operation details
{
"summary": "Get a workspace",
"description": "<b>Required scope: </b><code>workspaces:read</code>\n\nReturns the full workspace record for a single workspace.\n\nThe persistent core model supports the response and query fields named in x-purple-suite-supported-response-fields and x-purple-suite-supported-query. Other fields/options return an explicit 400 errors envelope.",
"tags": [
"Workspaces"
],
"operationId": "getWorkspace",
"parameters": [
{
"name": "opt_fields",
"in": "query",
"description": "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. Properties can include nested fields. To learn more, see the [input/output options guide](/docs/inputoutput-options#selecting-nested-fields).",
"required": false,
"example": [
"email_domains",
"is_organization",
"name"
],
"schema": {
"type": "array",
"items": {
"type": "string",
"enum": [
"email_domains",
"is_organization",
"name"
]
}
},
"style": "form",
"explode": false
}
],
"responses": {
"200": {
"description": "Return the full workspace record.",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"$ref": "#/components/schemas/WorkspaceResponse"
}
}
}
}
}
},
"400": {
"$ref": "#/components/responses/BadRequest"
},
"401": {
"$ref": "#/components/responses/Unauthorized"
},
"403": {
"$ref": "#/components/responses/Forbidden"
},
"404": {
"$ref": "#/components/responses/NotFound"
},
"500": {
"$ref": "#/components/responses/InternalServerError"
}
},
"security": [
{
"personalAccessToken": []
},
{
"oauth2": [
"workspaces:read"
]
}
],
"x-readme": {
"code-samples": [
{
"language": "java",
"install": "<dependency><groupId>com.asana</groupId><artifactId>asana</artifactId><version>1.0.0</version></dependency>",
"code": "import com.asana.Client;\n\nClient client = Client.accessToken(\"PERSONAL_ACCESS_TOKEN\");\n\nWorkspace result = client.workspaces.getWorkspace(workspaceGid)\n .option(\"pretty\", true)\n .execute();"
},
{
"language": "node",
"install": "npm install asana",
"code": "const Asana = require('asana');\n\nlet client = new Asana.ApiClient();\nclient.authentications.token.accessToken = '<YOUR_ACCESS_TOKEN>';\n\nlet workspacesApiInstance = new Asana.WorkspacesApi(client);\nlet workspace_gid = \"12345\"; // String | Globally unique identifier for the workspace or organization.\nlet opts = { \n 'opt_fields': \"email_domains,is_organization,name\"\n};\nworkspacesApiInstance.getWorkspace(workspace_gid, opts).then((result) => {\n console.log('API called successfully. Returned data: ' + JSON.stringify(result.data, null, 2));\n}, (error) => {\n console.error(error.response.body);\n});",
"name": "node-sdk-v3"
},
{
"language": "node",
"install": "npm install asana@1.0.5",
"code": "const asana = require('asana');\n\nconst client = asana.Client.create().useAccessToken('PERSONAL_ACCESS_TOKEN');\n\nclient.workspaces.getWorkspace(workspaceGid, {param: \"value\", param: \"value\", opt_pretty: true})\n .then((result) => {\n console.log(result);\n });",
"name": "node-sdk-v1"
},
{
"language": "python",
"install": "pip install asana",
"code": "import asana\nfrom asana.rest import ApiException\nfrom pprint import pprint\n\nconfiguration = asana.Configuration()\nconfiguration.access_token = '<YOUR_ACCESS_TOKEN>'\napi_client = asana.ApiClient(configuration)\n\n# create an instance of the API class\nworkspaces_api_instance = asana.WorkspacesApi(api_client)\nworkspace_gid = \"12345\" # str | Globally unique identifier for the workspace or organization.\nopts = {\n 'opt_fields': \"email_domains,is_organization,name\", # list[str] | 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.\n}\n\ntry:\n # Get a workspace\n api_response = workspaces_api_instance.get_workspace(workspace_gid, opts)\n pprint(api_response)\nexcept ApiException as e:\n print(\"Exception when calling WorkspacesApi->get_workspace: %s\\n\" % e)",
"name": "python-sdk-v5"
},
{
"language": "python",
"install": "pip install asana==3.2.3",
"code": "import asana\n\nclient = asana.Client.access_token('PERSONAL_ACCESS_TOKEN')\n\nresult = client.workspaces.get_workspace(workspace_gid, {'param': 'value', 'param': 'value'}, opt_pretty=True)",
"name": "python-sdk-v3"
},
{
"language": "php",
"install": "composer require asana/asana",
"code": "<?php\nrequire 'vendor/autoload.php';\n\n$client = Asana\\Client::accessToken('PERSONAL_ACCESS_TOKEN');\n\n$result = $client->workspaces->getWorkspace($workspace_gid, array('param' => 'value', 'param' => 'value'), array('opt_pretty' => 'true'))"
},
{
"language": "ruby",
"install": "gem install asana",
"code": "require 'asana'\n\nclient = Asana::Client.new do |c|\n c.authentication :access_token, 'PERSONAL_ACCESS_TOKEN'\nend\n\nresult = client.workspaces.get_workspace(workspace_gid: 'workspace_gid', param: \"value\", param: \"value\", options: {pretty: true})"
}
]
},
"x-purple-suite-runtime": "modeled-core",
"x-purple-suite-supported-query": [
"opt_pretty",
"opt_fields"
],
"x-purple-suite-supported-response-fields": [
"gid",
"resource_type",
"resource_subtype",
"name",
"notes",
"completed",
"completed_at",
"created_at",
"modified_at",
"assignee",
"assignee_status",
"workspace",
"projects",
"memberships",
"parent",
"due_on",
"start_on",
"tags",
"dependencies",
"num_subtasks",
"archived",
"public",
"color",
"default_view",
"team",
"project",
"section",
"text",
"created_by",
"target",
"type",
"email",
"photo",
"is_organization"
]
}
PUT /api/1.0/workspaces/{workspace_gid}
Update a workspace
A specific, existing workspace can be updated by making a PUT request on the URL for that workspace. Only the fields provided in the data block will be updated; any unspecified fields will remain unchanged.
Currently the only field that can be modified for a workspace is its name.
Returns the complete, updated workspace record.
This operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.
Authentication
[
{
"personalAccessToken": []
},
{
"oauth2": []
}
]
Path-level parameters and metadata
{
"parameters": [
{
"$ref": "#/components/parameters/workspace_path_gid"
},
{
"$ref": "#/components/parameters/pretty"
}
]
}
Request, responses and operation details
{
"summary": "Update a workspace",
"description": "A specific, existing workspace can be updated by making a PUT request on the URL for that workspace. Only the fields provided in the data block will be updated; any unspecified fields will remain unchanged.\nCurrently the only field that can be modified for a workspace is its name.\nReturns the complete, updated workspace record.\n\nThis operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.",
"tags": [
"Workspaces"
],
"operationId": "updateWorkspace",
"parameters": [
{
"name": "opt_fields",
"in": "query",
"description": "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. Properties can include nested fields. To learn more, see the [input/output options guide](/docs/inputoutput-options#selecting-nested-fields).",
"required": false,
"example": [
"email_domains",
"is_organization",
"name"
],
"schema": {
"type": "array",
"items": {
"type": "string",
"enum": [
"email_domains",
"is_organization",
"name"
]
}
},
"style": "form",
"explode": false
}
],
"requestBody": {
"description": "The workspace object with all updated properties.",
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"$ref": "#/components/schemas/WorkspaceRequest"
}
}
}
}
}
},
"responses": {
"200": {
"description": "Update for the workspace was successful.",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"$ref": "#/components/schemas/WorkspaceResponse"
}
}
}
}
}
},
"400": {
"$ref": "#/components/responses/BadRequest"
},
"401": {
"$ref": "#/components/responses/Unauthorized"
},
"403": {
"$ref": "#/components/responses/Forbidden"
},
"404": {
"$ref": "#/components/responses/NotFound"
},
"500": {
"$ref": "#/components/responses/InternalServerError"
}
},
"security": [
{
"personalAccessToken": []
},
{
"oauth2": []
}
],
"x-readme": {
"code-samples": [
{
"language": "java",
"install": "<dependency><groupId>com.asana</groupId><artifactId>asana</artifactId><version>1.0.0</version></dependency>",
"code": "import com.asana.Client;\n\nClient client = Client.accessToken(\"PERSONAL_ACCESS_TOKEN\");\n\nWorkspace result = client.workspaces.updateWorkspace(workspaceGid)\n .data(\"field\", \"value\")\n .data(\"field\", \"value\")\n .option(\"pretty\", true)\n .execute();"
},
{
"language": "node",
"install": "npm install asana",
"code": "const Asana = require('asana');\n\nlet client = new Asana.ApiClient();\nclient.authentications.token.accessToken = '<YOUR_ACCESS_TOKEN>';\n\nlet workspacesApiInstance = new Asana.WorkspacesApi(client);\nlet body = {\"data\": {\"<PARAM_1>\": \"<VALUE_1>\", \"<PARAM_2>\": \"<VALUE_2>\",}}; // Object | The workspace object with all updated properties.\nlet workspace_gid = \"12345\"; // String | Globally unique identifier for the workspace or organization.\nlet opts = { \n 'opt_fields': \"email_domains,is_organization,name\"\n};\nworkspacesApiInstance.updateWorkspace(body, workspace_gid, opts).then((result) => {\n console.log('API called successfully. Returned data: ' + JSON.stringify(result.data, null, 2));\n}, (error) => {\n console.error(error.response.body);\n});",
"name": "node-sdk-v3"
},
{
"language": "node",
"install": "npm install asana@1.0.5",
"code": "const asana = require('asana');\n\nconst client = asana.Client.create().useAccessToken('PERSONAL_ACCESS_TOKEN');\n\nclient.workspaces.updateWorkspace(workspaceGid, {field: \"value\", field: \"value\", pretty: true})\n .then((result) => {\n console.log(result);\n });",
"name": "node-sdk-v1"
},
{
"language": "python",
"install": "pip install asana",
"code": "import asana\nfrom asana.rest import ApiException\nfrom pprint import pprint\n\nconfiguration = asana.Configuration()\nconfiguration.access_token = '<YOUR_ACCESS_TOKEN>'\napi_client = asana.ApiClient(configuration)\n\n# create an instance of the API class\nworkspaces_api_instance = asana.WorkspacesApi(api_client)\nbody = {\"data\": {\"<PARAM_1>\": \"<VALUE_1>\", \"<PARAM_2>\": \"<VALUE_2>\",}} # dict | The workspace object with all updated properties.\nworkspace_gid = \"12345\" # str | Globally unique identifier for the workspace or organization.\nopts = {\n 'opt_fields': \"email_domains,is_organization,name\", # list[str] | 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.\n}\n\ntry:\n # Update a workspace\n api_response = workspaces_api_instance.update_workspace(body, workspace_gid, opts)\n pprint(api_response)\nexcept ApiException as e:\n print(\"Exception when calling WorkspacesApi->update_workspace: %s\\n\" % e)",
"name": "python-sdk-v5"
},
{
"language": "python",
"install": "pip install asana==3.2.3",
"code": "import asana\n\nclient = asana.Client.access_token('PERSONAL_ACCESS_TOKEN')\n\nresult = client.workspaces.update_workspace(workspace_gid, {'field': 'value', 'field': 'value'}, opt_pretty=True)",
"name": "python-sdk-v3"
},
{
"language": "php",
"install": "composer require asana/asana",
"code": "<?php\nrequire 'vendor/autoload.php';\n\n$client = Asana\\Client::accessToken('PERSONAL_ACCESS_TOKEN');\n\n$result = $client->workspaces->updateWorkspace($workspace_gid, array('field' => 'value', 'field' => 'value'), array('opt_pretty' => 'true'))"
},
{
"language": "ruby",
"install": "gem install asana",
"code": "require 'asana'\n\nclient = Asana::Client.new do |c|\n c.authentication :access_token, 'PERSONAL_ACCESS_TOKEN'\nend\n\nresult = client.workspaces.update_workspace(workspace_gid: 'workspace_gid', field: \"value\", field: \"value\", options: {pretty: true})"
}
]
},
"x-purple-suite-runtime": "unavailable"
}
POST /api/1.0/workspaces/{workspace_gid}/addUser
Add a user to a workspace or organization
Add a user to a workspace or organization.
The user can be referenced by their globally unique user ID or their email address. Returns the full user record for the invited user.
This operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.
Authentication
[
{
"personalAccessToken": []
},
{
"oauth2": []
}
]
Path-level parameters and metadata
{
"parameters": [
{
"$ref": "#/components/parameters/workspace_path_gid"
},
{
"$ref": "#/components/parameters/pretty"
}
]
}
Request, responses and operation details
{
"summary": "Add a user to a workspace or organization",
"description": "Add a user to a workspace or organization.\nThe user can be referenced by their globally unique user ID or their email address. Returns the full user record for the invited user.\n\nThis operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.",
"tags": [
"Workspaces"
],
"operationId": "addUserForWorkspace",
"parameters": [
{
"name": "opt_fields",
"in": "query",
"description": "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. Properties can include nested fields. To learn more, see the [input/output options guide](/docs/inputoutput-options#selecting-nested-fields).",
"required": false,
"example": [
"email",
"name",
"photo",
"photo.image_1024x1024",
"photo.image_128x128",
"photo.image_21x21",
"photo.image_27x27",
"photo.image_36x36",
"photo.image_60x60"
],
"schema": {
"type": "array",
"items": {
"type": "string",
"enum": [
"email",
"name",
"photo",
"photo.image_1024x1024",
"photo.image_128x128",
"photo.image_21x21",
"photo.image_27x27",
"photo.image_36x36",
"photo.image_60x60"
]
}
},
"style": "form",
"explode": false
}
],
"requestBody": {
"description": "The user to add to the workspace.",
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"$ref": "#/components/schemas/WorkspaceAddUserRequest"
}
}
}
}
}
},
"responses": {
"200": {
"description": "The user was added successfully to the workspace or organization.",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"$ref": "#/components/schemas/UserBaseResponse"
}
}
}
}
}
},
"400": {
"$ref": "#/components/responses/BadRequest"
},
"401": {
"$ref": "#/components/responses/Unauthorized"
},
"403": {
"$ref": "#/components/responses/Forbidden"
},
"404": {
"$ref": "#/components/responses/NotFound"
},
"500": {
"$ref": "#/components/responses/InternalServerError"
}
},
"security": [
{
"personalAccessToken": []
},
{
"oauth2": []
}
],
"x-readme": {
"code-samples": [
{
"language": "java",
"install": "<dependency><groupId>com.asana</groupId><artifactId>asana</artifactId><version>1.0.0</version></dependency>",
"code": "import com.asana.Client;\n\nClient client = Client.accessToken(\"PERSONAL_ACCESS_TOKEN\");\n\nJsonElement result = client.workspaces.addUserForWorkspace(workspaceGid)\n .data(\"field\", \"value\")\n .data(\"field\", \"value\")\n .option(\"pretty\", true)\n .execute();"
},
{
"language": "node",
"install": "npm install asana",
"code": "const Asana = require('asana');\n\nlet client = new Asana.ApiClient();\nclient.authentications.token.accessToken = '<YOUR_ACCESS_TOKEN>';\n\nlet workspacesApiInstance = new Asana.WorkspacesApi(client);\nlet body = {\"data\": {\"<PARAM_1>\": \"<VALUE_1>\", \"<PARAM_2>\": \"<VALUE_2>\",}}; // Object | The user to add to the workspace.\nlet workspace_gid = \"12345\"; // String | Globally unique identifier for the workspace or organization.\nlet opts = { \n 'opt_fields': \"email,name,photo,photo.image_1024x1024,photo.image_128x128,photo.image_21x21,photo.image_27x27,photo.image_36x36,photo.image_60x60\"\n};\nworkspacesApiInstance.addUserForWorkspace(body, workspace_gid, opts).then((result) => {\n console.log('API called successfully. Returned data: ' + JSON.stringify(result.data, null, 2));\n}, (error) => {\n console.error(error.response.body);\n});",
"name": "node-sdk-v3"
},
{
"language": "node",
"install": "npm install asana@1.0.5",
"code": "const asana = require('asana');\n\nconst client = asana.Client.create().useAccessToken('PERSONAL_ACCESS_TOKEN');\n\nclient.workspaces.addUserForWorkspace(workspaceGid, {field: \"value\", field: \"value\", pretty: true})\n .then((result) => {\n console.log(result);\n });",
"name": "node-sdk-v1"
},
{
"language": "python",
"install": "pip install asana",
"code": "import asana\nfrom asana.rest import ApiException\nfrom pprint import pprint\n\nconfiguration = asana.Configuration()\nconfiguration.access_token = '<YOUR_ACCESS_TOKEN>'\napi_client = asana.ApiClient(configuration)\n\n# create an instance of the API class\nworkspaces_api_instance = asana.WorkspacesApi(api_client)\nbody = {\"data\": {\"<PARAM_1>\": \"<VALUE_1>\", \"<PARAM_2>\": \"<VALUE_2>\",}} # dict | The user to add to the workspace.\nworkspace_gid = \"12345\" # str | Globally unique identifier for the workspace or organization.\nopts = {\n 'opt_fields': \"email,name,photo,photo.image_1024x1024,photo.image_128x128,photo.image_21x21,photo.image_27x27,photo.image_36x36,photo.image_60x60\", # list[str] | 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.\n}\n\ntry:\n # Add a user to a workspace or organization\n api_response = workspaces_api_instance.add_user_for_workspace(body, workspace_gid, opts)\n pprint(api_response)\nexcept ApiException as e:\n print(\"Exception when calling WorkspacesApi->add_user_for_workspace: %s\\n\" % e)",
"name": "python-sdk-v5"
},
{
"language": "python",
"install": "pip install asana==3.2.3",
"code": "import asana\n\nclient = asana.Client.access_token('PERSONAL_ACCESS_TOKEN')\n\nresult = client.workspaces.add_user_for_workspace(workspace_gid, {'field': 'value', 'field': 'value'}, opt_pretty=True)",
"name": "python-sdk-v3"
},
{
"language": "php",
"install": "composer require asana/asana",
"code": "<?php\nrequire 'vendor/autoload.php';\n\n$client = Asana\\Client::accessToken('PERSONAL_ACCESS_TOKEN');\n\n$result = $client->workspaces->addUserForWorkspace($workspace_gid, array('field' => 'value', 'field' => 'value'), array('opt_pretty' => 'true'))"
},
{
"language": "ruby",
"install": "gem install asana",
"code": "require 'asana'\n\nclient = Asana::Client.new do |c|\n c.authentication :access_token, 'PERSONAL_ACCESS_TOKEN'\nend\n\nresult = client.workspaces.add_user_for_workspace(workspace_gid: 'workspace_gid', field: \"value\", field: \"value\", options: {pretty: true})"
}
]
},
"x-purple-suite-runtime": "unavailable"
}
POST /api/1.0/workspaces/{workspace_gid}/removeUser
Remove a user from a workspace or organization
Remove a user from a workspace or organization.
The user making this call must be an admin in the workspace. The user can
be referenced by their globally unique user ID or their email address.
When invoked using a **Service Account Token (SAT)**, this endpoint follows the same behavior as the
[SCIM API Delete endpoint](/docs/scim).
To learn more about how Asana handles user deprovisioning, refer to our
[Help Center article on deprovisioning users](https://help.asana.com/s/article/user-deprovisioning).
When invoked using a **Personal Access Token (PAT)**, the endpoint behaves similarly, except that
ownership of the user’s resources is transferred to the **PAT owner** instead of the admin
[specified in the Admin Console](https://help.asana.com/s/article/user-deprovisioning#gl-deprovisioning).
**Note:** If you wish to retain access to a user’s private resources
(i.e., those visible only to that user), you have to make them public manually
(or ask the user to do so) before removal.
Returns an empty data record.
This operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.
Authentication
[
{
"personalAccessToken": []
},
{
"oauth2": []
}
]
Path-level parameters and metadata
{
"parameters": [
{
"$ref": "#/components/parameters/workspace_path_gid"
},
{
"$ref": "#/components/parameters/pretty"
}
]
}
Request, responses and operation details
{
"summary": "Remove a user from a workspace or organization",
"description": "Remove a user from a workspace or organization.\n\nThe user making this call must be an admin in the workspace. The user can\nbe referenced by their globally unique user ID or their email address.\n\nWhen invoked using a **Service Account Token (SAT)**, this endpoint follows the same behavior as the\n[SCIM API Delete endpoint](/docs/scim).\nTo learn more about how Asana handles user deprovisioning, refer to our\n[Help Center article on deprovisioning users](https://help.asana.com/s/article/user-deprovisioning).\n\nWhen invoked using a **Personal Access Token (PAT)**, the endpoint behaves similarly, except that\nownership of the user’s resources is transferred to the **PAT owner** instead of the admin\n[specified in the Admin Console](https://help.asana.com/s/article/user-deprovisioning#gl-deprovisioning).\n\n**Note:** If you wish to retain access to a user’s private resources\n(i.e., those visible only to that user), you have to make them public manually\n(or ask the user to do so) before removal.\n\nReturns an empty data record.\n\nThis operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.",
"tags": [
"Workspaces"
],
"operationId": "removeUserForWorkspace",
"requestBody": {
"description": "The user to remove from the workspace.",
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"$ref": "#/components/schemas/WorkspaceRemoveUserRequest"
}
}
}
}
}
},
"responses": {
"200": {
"description": "The user was removed successfully to the workspace or organization.",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"$ref": "#/components/schemas/EmptyResponse"
}
}
}
}
}
},
"400": {
"$ref": "#/components/responses/BadRequest"
},
"401": {
"$ref": "#/components/responses/Unauthorized"
},
"403": {
"$ref": "#/components/responses/Forbidden"
},
"404": {
"$ref": "#/components/responses/NotFound"
},
"500": {
"$ref": "#/components/responses/InternalServerError"
}
},
"security": [
{
"personalAccessToken": []
},
{
"oauth2": []
}
],
"x-readme": {
"code-samples": [
{
"language": "java",
"install": "<dependency><groupId>com.asana</groupId><artifactId>asana</artifactId><version>1.0.0</version></dependency>",
"code": "import com.asana.Client;\n\nClient client = Client.accessToken(\"PERSONAL_ACCESS_TOKEN\");\n\nJsonElement result = client.workspaces.removeUserForWorkspace(workspaceGid)\n .data(\"field\", \"value\")\n .data(\"field\", \"value\")\n .option(\"pretty\", true)\n .execute();"
},
{
"language": "node",
"install": "npm install asana",
"code": "const Asana = require('asana');\n\nlet client = new Asana.ApiClient();\nclient.authentications.token.accessToken = '<YOUR_ACCESS_TOKEN>';\n\nlet workspacesApiInstance = new Asana.WorkspacesApi(client);\nlet body = {\"data\": {\"<PARAM_1>\": \"<VALUE_1>\", \"<PARAM_2>\": \"<VALUE_2>\",}}; // Object | The user to remove from the workspace.\nlet workspace_gid = \"12345\"; // String | Globally unique identifier for the workspace or organization.\n\nworkspacesApiInstance.removeUserForWorkspace(body, workspace_gid).then((result) => {\n console.log('API called successfully. Returned data: ' + JSON.stringify(result.data, null, 2));\n}, (error) => {\n console.error(error.response.body);\n});",
"name": "node-sdk-v3"
},
{
"language": "node",
"install": "npm install asana@1.0.5",
"code": "const asana = require('asana');\n\nconst client = asana.Client.create().useAccessToken('PERSONAL_ACCESS_TOKEN');\n\nclient.workspaces.removeUserForWorkspace(workspaceGid, {field: \"value\", field: \"value\", pretty: true})\n .then((result) => {\n console.log(result);\n });",
"name": "node-sdk-v1"
},
{
"language": "python",
"install": "pip install asana",
"code": "import asana\nfrom asana.rest import ApiException\nfrom pprint import pprint\n\nconfiguration = asana.Configuration()\nconfiguration.access_token = '<YOUR_ACCESS_TOKEN>'\napi_client = asana.ApiClient(configuration)\n\n# create an instance of the API class\nworkspaces_api_instance = asana.WorkspacesApi(api_client)\nbody = {\"data\": {\"<PARAM_1>\": \"<VALUE_1>\", \"<PARAM_2>\": \"<VALUE_2>\",}} # dict | The user to remove from the workspace.\nworkspace_gid = \"12345\" # str | Globally unique identifier for the workspace or organization.\n\n\ntry:\n # Remove a user from a workspace or organization\n api_response = workspaces_api_instance.remove_user_for_workspace(body, workspace_gid)\n pprint(api_response)\nexcept ApiException as e:\n print(\"Exception when calling WorkspacesApi->remove_user_for_workspace: %s\\n\" % e)",
"name": "python-sdk-v5"
},
{
"language": "python",
"install": "pip install asana==3.2.3",
"code": "import asana\n\nclient = asana.Client.access_token('PERSONAL_ACCESS_TOKEN')\n\nresult = client.workspaces.remove_user_for_workspace(workspace_gid, {'field': 'value', 'field': 'value'}, opt_pretty=True)",
"name": "python-sdk-v3"
},
{
"language": "php",
"install": "composer require asana/asana",
"code": "<?php\nrequire 'vendor/autoload.php';\n\n$client = Asana\\Client::accessToken('PERSONAL_ACCESS_TOKEN');\n\n$result = $client->workspaces->removeUserForWorkspace($workspace_gid, array('field' => 'value', 'field' => 'value'), array('opt_pretty' => 'true'))"
},
{
"language": "ruby",
"install": "gem install asana",
"code": "require 'asana'\n\nclient = Asana::Client.new do |c|\n c.authentication :access_token, 'PERSONAL_ACCESS_TOKEN'\nend\n\nresult = client.workspaces.remove_user_for_workspace(workspace_gid: 'workspace_gid', field: \"value\", field: \"value\", options: {pretty: true})"
}
]
},
"x-purple-suite-runtime": "unavailable"
}
GET /api/1.0/workspaces/{workspace_gid}/events
Get workspace events
Returns the full record for all events that have occurred since the sync token was created.
The response is a list of events and the schema of each event is as described [here](/reference/events).
Asana limits a single sync token to 1000 events. If more than 1000 events exist for a given domain, `has_more: true` will be returned in the response, indicating that there are more events to pull.
This operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.
Authentication
[
{
"personalAccessToken": []
},
{
"oauth2": []
}
]
Path-level parameters and metadata
{
"parameters": [
{
"$ref": "#/components/parameters/workspace_path_gid"
},
{
"$ref": "#/components/parameters/pretty"
},
{
"name": "sync",
"in": "query",
"required": false,
"description": "A sync token received from the last request, or none on first sync. Events will be returned from the point in time that the sync token was generated.\n*Note: On your first request, omit the sync token. The response will be the same as for an expired sync token, and will include a new valid sync token. If the sync token is too old (which may happen from time to time) the API will return a `412 Precondition Failed` error, and include a fresh sync token in the response.*",
"schema": {
"type": "string"
},
"example": "de4774f6915eae04714ca93bb2f5ee81"
}
]
}
Request, responses and operation details
{
"summary": "Get workspace events",
"description": "Returns the full record for all events that have occurred since the sync token was created.\nThe response is a list of events and the schema of each event is as described [here](/reference/events).\nAsana limits a single sync token to 1000 events. If more than 1000 events exist for a given domain, `has_more: true` will be returned in the response, indicating that there are more events to pull.\n\nThis operation is outside the implemented core model; the route returns Asana's 403 errors envelope without mutating state.",
"tags": [
"Workspaces"
],
"operationId": "getWorkspaceEvents",
"responses": {
"200": {
"description": "Successfully retrieved events.",
"content": {
"application/json": {
"schema": {
"type": "object",
"description": "The full record for all events that have occurred since the sync token was created.",
"properties": {
"data": {
"type": "array",
"items": {
"$ref": "#/components/schemas/EventResponse"
}
},
"sync": {
"description": "A sync token to be used with the next call to the /events endpoint.",
"type": "string",
"example": "de4774f6915eae04714ca93bb2f5ee81"
},
"has_more": {
"description": "Indicates whether there are more events to pull.",
"type": "boolean",
"example": true
}
}
}
}
}
},
"400": {
"$ref": "#/components/responses/BadRequest"
},
"401": {
"$ref": "#/components/responses/Unauthorized"
},
"403": {
"$ref": "#/components/responses/Forbidden"
},
"404": {
"$ref": "#/components/responses/NotFound"
},
"500": {
"$ref": "#/components/responses/InternalServerError"
}
},
"security": [
{
"personalAccessToken": []
},
{
"oauth2": []
}
],
"x-readme": {
"code-samples": [
{
"language": "node",
"install": "npm install asana",
"code": "const Asana = require('asana');\n\nlet client = new Asana.ApiClient();\nclient.authentications.token.accessToken = '<YOUR_ACCESS_TOKEN>';\n\nlet workspacesApiInstance = new Asana.WorkspacesApi(client);\nlet workspace_gid = \"12345\"; // String | Globally unique identifier for the workspace or organization.\nlet opts = { \n 'sync': \"de4774f6915eae04714ca93bb2f5ee81\"\n};\nworkspacesApiInstance.getWorkspaceEvents(workspace_gid, opts).then((result) => {\n console.log('API called successfully. Returned data: ' + JSON.stringify(result.data, null, 2));\n}, (error) => {\n console.error(error.response.body);\n});",
"name": "node-sdk-v3"
},
{
"language": "python",
"install": "pip install asana",
"code": "import asana\nfrom asana.rest import ApiException\nfrom pprint import pprint\n\nconfiguration = asana.Configuration()\nconfiguration.access_token = '<YOUR_ACCESS_TOKEN>'\napi_client = asana.ApiClient(configuration)\n\n# create an instance of the API class\nworkspaces_api_instance = asana.WorkspacesApi(api_client)\nworkspace_gid = \"12345\" # str | Globally unique identifier for the workspace or organization.\nopts = {\n 'sync': \"de4774f6915eae04714ca93bb2f5ee81\", # str | A sync token received from the last request, or none on first sync. Events will be returned from the point in time that the sync token was generated. *Note: On your first request, omit the sync token. The response will be the same as for an expired sync token, and will include a new valid sync token. If the sync token is too old (which may happen from time to time) the API will return a `412 Precondition Failed` error, and include a fresh sync token in the response.*\n}\n\ntry:\n # Get workspace events\n api_response = workspaces_api_instance.get_workspace_events(workspace_gid, opts)\n for data in api_response:\n pprint(data)\nexcept ApiException as e:\n print(\"Exception when calling WorkspacesApi->get_workspace_events: %s\\n\" % e)",
"name": "python-sdk-v5"
}
]
},
"x-purple-suite-runtime": "unavailable"
}