openapi: 3.1.0
info:
title: Asana Allocations Workspaces API
description: The Asana Allocations API allows users to manage and allocate resources within their Asana project management system. An allocation object represents how much of a resource (e.g. person, team) is dedicated to a specific work object (e.g. project, portfolio) over a specific period of time. The effort value can be a percentage or number of hours.
version: '1.0'
termsOfService: https://asana.com/terms
contact:
name: Asana Support
url: https://asana.com/support
license:
name: Apache 2.0
url: https://www.apache.org/licenses/LICENSE-2.0
servers:
- url: https://app.asana.com/api/1.0
description: Main endpoint.
security:
- personalAccessToken: []
- oauth2: []
tags:
- name: Workspaces
description: 'A *workspace* is the highest-level organizational unit in Asana. All projects and tasks have an associated workspace.
An *organization* is a special kind of workspace that represents a company. In an organization, you can group your projects into teams. You can read more about how organizations work on the Asana Guide. To tell if your workspace is an organization or not, check its `is_organization` property.
Over time, we intend to migrate most workspaces into organizations and to release more organization-specific functionality. We may eventually deprecate using workspace-based APIs for organizations. Currently, and until after some reasonable grace period following any further announcements, you can still reference organizations in any `workspace` parameter.'
paths:
/workspaces/{workspace_gid}/tags:
parameters:
- $ref: '#/components/parameters/workspace_path_gid'
- $ref: '#/components/parameters/pretty'
get:
summary: Asana Get tags in a workspace
description: Returns the compact tag records for some filtered set of tags. Use one or more of the parameters provided to filter the tags returned.
tags:
- Workspaces
operationId: getTagsForWorkspace
parameters:
- $ref: '#/components/parameters/limit'
- $ref: '#/components/parameters/offset'
- name: opt_fields
in: query
description: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include.
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'
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 = Asana.ApiClient.instance;\nlet token = client.authentications['token'];\ntoken.accessToken = '<YOUR_ACCESS_TOKEN>';\n\nlet tagsApiInstance = new Asana.TagsApi();\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 compact resource, which excludes some 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
client = asana.Client.access_token(''PERSONAL_ACCESS_TOKEN'')
result = 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
require ''vendor/autoload.php'';
$client = Asana\Client::accessToken(''PERSONAL_ACCESS_TOKEN'');
$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})"
post:
summary: Asana Create a tag in a workspace
description: '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.'
tags:
- Workspaces
operationId: createTagForWorkspace
parameters:
- name: opt_fields
in: query
description: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include.
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:
description: The tag to create.
required: true
content:
application/json:
schema:
type: object
properties:
data:
$ref: '#/components/schemas/TagCreateTagForWorkspaceRequest'
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'
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 = Asana.ApiClient.instance;\nlet token = client.authentications['token'];\ntoken.accessToken = '<YOUR_ACCESS_TOKEN>';\n\nlet tagsApiInstance = new Asana.TagsApi();\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 compact resource, which excludes some 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
client = asana.Client.access_token(''PERSONAL_ACCESS_TOKEN'')
result = 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
require ''vendor/autoload.php'';
$client = Asana\Client::accessToken(''PERSONAL_ACCESS_TOKEN'');
$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})"
/workspaces:
parameters:
- $ref: '#/components/parameters/pretty'
- $ref: '#/components/parameters/limit'
- $ref: '#/components/parameters/offset'
get:
summary: Asana Get multiple workspaces
description: Returns the compact records for all workspaces visible to the authorized user.
tags:
- Workspaces
operationId: getWorkspaces
parameters:
- name: opt_fields
in: query
description: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include.
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:
- 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<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 = Asana.ApiClient.instance;\nlet token = client.authentications['token'];\ntoken.accessToken = '<YOUR_ACCESS_TOKEN>';\n\nlet workspacesApiInstance = new Asana.WorkspacesApi();\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 compact resource, which excludes some 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
client = asana.Client.access_token(''PERSONAL_ACCESS_TOKEN'')
result = client.workspaces.get_workspaces({''param'': ''value'', ''param'': ''value''}, opt_pretty=True)'
name: python-sdk-v3
- language: php
install: composer require asana/asana
code: '<?php
require ''vendor/autoload.php'';
$client = Asana\Client::accessToken(''PERSONAL_ACCESS_TOKEN'');
$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})"
/workspaces/{workspace_gid}:
parameters:
- $ref: '#/components/parameters/workspace_path_gid'
- $ref: '#/components/parameters/pretty'
get:
summary: Asana Get a workspace
description: Returns the full workspace record for a single workspace.
tags:
- Workspaces
operationId: getWorkspace
parameters:
- name: opt_fields
in: query
description: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include.
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:
- 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\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 = Asana.ApiClient.instance;\nlet token = client.authentications['token'];\ntoken.accessToken = '<YOUR_ACCESS_TOKEN>';\n\nlet workspacesApiInstance = new Asana.WorkspacesApi();\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 compact resource, which excludes some 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
client = asana.Client.access_token(''PERSONAL_ACCESS_TOKEN'')
result = 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
require ''vendor/autoload.php'';
$client = Asana\Client::accessToken(''PERSONAL_ACCESS_TOKEN'');
$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})"
put:
summary: Asana 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.
Currently the only field that can be modified for a workspace is its name.
Returns the complete, updated workspace record.'
tags:
- Workspaces
operationId: updateWorkspace
parameters:
- name: opt_fields
in: query
description: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include.
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'
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 = Asana.ApiClient.instance;\nlet token = client.authentications['token'];\ntoken.accessToken = '<YOUR_ACCESS_TOKEN>';\n\nlet workspacesApiInstance = new Asana.WorkspacesApi();\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 compact resource, which excludes some 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
client = asana.Client.access_token(''PERSONAL_ACCESS_TOKEN'')
result = 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
require ''vendor/autoload.php'';
$client = Asana\Client::accessToken(''PERSONAL_ACCESS_TOKEN'');
$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})"
/workspaces/{workspace_gid}/addUser:
parameters:
- $ref: '#/components/parameters/workspace_path_gid'
- $ref: '#/components/parameters/pretty'
post:
summary: Asana Add a user to a workspace or organization
description: '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
# --- truncated at 32 KB (57 KB total) ---
# Full source: https://raw.githubusercontent.com/api-evangelist/asana/refs/heads/main/openapi/asana-workspaces-api-openapi.yml