Asana Users API

Asana Users API allows developers to interact with user data within the Asana project management platform. This API enables users to retrieve information about individual users, such as their names, email addresses, job titles, and profile pictures. Additionally, developers can use the Asana Users API to add or remove users from projects, update user details, and view users' assigned tasks and responsibilities within the platform.

OpenAPI Specification

asana-users-api-openapi.yml Raw ↑
openapi: 3.1.0
info:
  title: Asana Allocations Users 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: Users
  description: 'A user object represents an account in Asana that can be given access to various workspaces, projects, and tasks.


    Like other objects in the system, users are referred to by numerical IDs. However, the special string identifier `me` can be used anywhere a user ID is accepted, to refer to the current authenticated user (e.g, `GET /users/me`).'
paths:
  /users:
    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'
    get:
      summary: Asana Get multiple users
      description: '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.'
      tags:
      - Users
      operationId: getUsers
      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
        - 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:
            - 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:
      - 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 = Asana.ApiClient.instance;\nlet token = client.authentications['token'];\ntoken.accessToken = '<YOUR_ACCESS_TOKEN>';\n\nlet usersApiInstance = new Asana.UsersApi();\nlet opts = { \n    'workspace': \"1331\", \n    'team': \"15627\", \n    'limit': 50, \n    'offset': \"eyJ0eXAiOJiKV1iQLCJhbGciOiJIUzI1NiJ9\", \n    'opt_fields': \"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': \"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 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 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


            client = asana.Client.access_token(''PERSONAL_ACCESS_TOKEN'')


            result = client.users.get_users({''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->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})"
  /users/{user_gid}:
    parameters:
    - $ref: '#/components/parameters/user_path_gid'
    - $ref: '#/components/parameters/pretty'
    get:
      summary: Asana Get a user
      description: Returns the full user record for the single user with the provided ID.
      tags:
      - Users
      operationId: getUser
      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
        - 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:
            - 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:
      - 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 = Asana.ApiClient.instance;\nlet token = client.authentications['token'];\ntoken.accessToken = '<YOUR_ACCESS_TOKEN>';\n\nlet usersApiInstance = new Asana.UsersApi();\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': \"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    'opt_fields': \"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 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 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


            client = asana.Client.access_token(''PERSONAL_ACCESS_TOKEN'')


            result = 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

            require ''vendor/autoload.php'';


            $client = Asana\Client::accessToken(''PERSONAL_ACCESS_TOKEN'');


            $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})"
  /users/{user_gid}/favorites:
    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'
    get:
      summary: Asana Get a user's favorites
      description: 'Returns all of a user''s favorites in the given workspace, of the given type.

        Results are given in order (The same order as Asana''s sidebar).'
      tags:
      - Users
      operationId: getFavoritesForUser
      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:
        - 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:
      - 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 = Asana.ApiClient.instance;\nlet token = client.authentications['token'];\ntoken.accessToken = '<YOUR_ACCESS_TOKEN>';\n\nlet usersApiInstance = new Asana.UsersApi();\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 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 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


            client = asana.Client.access_token(''PERSONAL_ACCESS_TOKEN'')


            result = 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

            require ''vendor/autoload.php'';


            $client = Asana\Client::accessToken(''PERSONAL_ACCESS_TOKEN'');


            $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: '&#x27;resource_type_example&#x27;', workspace: '&#x27;workspace_example&#x27;', param: \"value\", param: \"value\", options: {pretty: true})"
  /teams/{team_gid}/users:
    parameters:
    - $ref: '#/components/parameters/team_path_gid'
    - $ref: '#/components/parameters/pretty'
    - $ref: '#/components/parameters/offset'
    get:
      summary: Asana Get users in a team
      description: '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.'
      tags:
      - Users
      operationId: getUsersForTeam
      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
        - 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:
            - 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:
      - 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 = Asana.ApiClient.instance;\nlet token = client.authentications['token'];\ntoken.accessToken = '<YOUR_ACCESS_TOKEN>';\n\nlet usersApiInstance = new Asana.UsersApi();\nlet team_gid = \"159874\"; // String | Globally unique identifier for the team.\nlet opts = { \n    'offset': \"eyJ0eXAiOJiKV1iQLCJhbGciOiJIUzI1NiJ9\", \n    'opt_fields': \"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': \"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 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 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


            client = asana.Client.access_token(''PERSONAL_ACCESS_TOKEN'')


            result = 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

            require ''vendor/autoload.php'';


            $client = Asana\Client::accessToken(''PERSONAL_ACCESS_TOKEN'');


            $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})"
  /workspaces/{workspace_gid}/users:
    parameters:
    - $ref: '#/components/parameters/workspace_path_gid'
    - $ref: '#/components/parameters/pretty'
    - $ref: '#/components/parameters/offset'
    get:
      summary: Asana Get users in a workspace or organization
      description: '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.'
      tags:
      - Users
      operationId: getUsersForWorkspace
      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
        - 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:
            - 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:
      - 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 = Asana.ApiClient.instance;\nlet token = client.authentications['token'];\ntoken.accessToken = '<YOUR_ACCESS_TOKEN>';\n\nlet usersApiInstance = new Asana.UsersApi();\nlet workspace_gid = \"12345\"; // String | Globally unique identifier for the workspace or organization.\nlet opts = { \n    'offset': \"eyJ0eXAiOJiKV1iQLCJhbGciOiJIUzI1NiJ9\", \n    'opt_fields': \"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 =

# --- truncated at 32 KB (45 KB total) ---
# Full source: https://raw.githubusercontent.com/api-evangelist/asana/refs/heads/main/openapi/asana-users-api-openapi.yml