createOrganizationPermissionsTokenV2()

API Stability Long-Term

The createOrganizationPermissionsTokenV2() GraphQL mutation field is used to creates an organization permissions token with the specified permissions.

Syntax

Below is the syntax for the createOrganizationPermissionsTokenV2() mutation field:

graphql
createOrganizationPermissionsTokenV2(
       input: CreateOrganizationPermissionsTokenV2Input!
    ): CreateOrganizationPermissionsTokenV2Output!

Below is an example of how this mutation field might be used:

Show:
graphql
mutation {
  createOrganizationPermissionsTokenV2(input:
         { name: "my-org-access-token",
          organizationPermissions: [ ManageUsers, ViewUsage ]
        })
  { token, tokenMetadata { id, expireAt } }
}
Example Responses
Show:
json
{
  "data": {
    "createOrganizationPermissionsTokenV2": {
      "token": "aeQOuK6TE5EZfSUEYt6igEzMhzrRJxXF~dElhiSYMbWiVV5Y3rXqMjSvPxD2kzQYlznYWun8QerNU",
      "tokenMetadata": {
        "id": "aeQOuK6TE5EZfSUEYt6igEzMhzrRJxXF",
        "expireAt": null
      }
    }
  }
}

Given Datatypes

For CreateOrganizationPermissionsTokenV2Input, there are a few parameters. Below is a list of them:

Table: CreateOrganizationPermissionsTokenV2Input

ParameterTypeRequiredDefaultStabilityDescription
Some arguments may be required, as indicated in the Required column. For some fields, this column indicates that a result will always be returned for this column.
Table last updated: Dec 10, 2024
namestringyes  The name of the organization permissions token.
expireAtlong   When the token expires.
ipFilterIdstring   The unique identifier of the filter to use.
organizationPermissions[OrganizationPermission]yes  A list of organization permissions. See OrganizationPermission.

Returned Datatypes

As indicated by the syntax above, this mutation will return data using the datatype, CreateOrganizationPermissionsTokenV2Output. Below is the parameter of that datatype:

Table: CreateOrganizationPermissionsTokenV2Output

ParameterTypeRequiredDefaultStabilityDescription
Some arguments may be required, as indicated in the Required column. For some fields, this column indicates that a result will always be returned for this column.
Table last updated: Mar 25, 2025
tokenstringyes Long-TermThe organization permissions token.
tokenMetadataOrganizationPermissionsTokenyes Long-TermMetadata about the token. See OrganizationPermissionsToken.