You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: website/docs/cloud-docs/api-docs/changelog.mdx
+4
Original file line number
Diff line number
Diff line change
@@ -9,6 +9,10 @@ description: >-
9
9
10
10
Keep track of changes to the API for HCP Terraform and Terraform Enterprise.
11
11
12
+
## 2025-03-20
13
+
* Add API documentation for multiple [team tokens](/terraform/cloud-docs/api-docs/api-tokens), and update documentation around [legacy team tokens](/terraform/cloud-docs/api-docs/team-tokens##legacy-team-tokens-api-reference).
14
+
* Update existing API documentation for [team tokens](/terraform/cloud-docs/api-docs/team-tokens) to distinguish multiple team tokens from [legacy team tokens](/terraform/cloud-docs/api-docs/team-tokens##legacy-team-tokens-api-reference).
15
+
12
16
## 2025-3-10
13
17
* Document unique pagination metadata given in the response of [Organization Runs Index API](/terraform/cloud-docs/api-docs/run##list-runs-in-an-organization).
Team API tokens grant access to a team's workspaces. Each team can have an API token that is not associated with a specific user. You can create and delete team tokens and list an organization's team tokens.
41
+
Team API tokens grant access to a team's workspaces. Teams are not limited to a single token, and can have multiple, valid tokens at a time. Team tokens are not are not associated with a specific user.
42
+
43
+
Teams relying on the [**legacy**](/terraform/cloud-docs/api-docs/team-tokens#legacy-team-tokens-api-reference) team token API (`/teams/authentication-token`), can only have a **single**, valid token at a time. Generating a new legacy token revokes any previously existing tokens, replacing it with the new team token.
44
+
45
+
You can create and delete team tokens and list an organization's team tokens.
46
+
47
+
## Generate a new team token
48
+
49
+
Generates a new team token.
50
+
51
+
| Method | Path |
52
+
| :----- | :----------------------------------- |
53
+
| POST | /teams/:team_id/authentication-tokens |
54
+
55
+
This endpoint returns the secret text of the new authentication token. You can only access this token when you create it and can not recover it later.
56
+
57
+
### Parameters
58
+
59
+
-`:team_id` (`string: <required>`) - specifies the team ID for generating the team token
60
+
61
+
### Request body
62
+
63
+
This POST endpoint requires a JSON object with the following properties as a request payload.
|`data.type`| string || Must be `"authentication-token"`. |
69
+
|`data.attributes.description`| string || The description of the team token. Each description **must** be unique within the context of the team. |
70
+
|`data.attributes.expired-at`| string |`null`| The UTC date and time that the Team Token will expire, in ISO 8601 format. If omitted or set to `null` the token will never expire. |
|`:organization_id`| The ID of the organization whose team tokens you want to list. |
159
+
160
+
This endpoint returns object metadata and does not include secret authentication details of tokens. You can only view a token when you create it and cannot recover it later.
|[200][]|[JSON API document][] (`type: "team-tokens"`) | The request was successful. |
165
+
|[200][]| Empty [JSON API document][]| The specified team has no team tokens. |
166
+
|[404][]|[JSON API error object][]| Team not found. |
167
+
168
+
### Query parameters
169
+
170
+
This endpoint supports pagination [with standard URL query parameters](/terraform/cloud-docs/api-docs#query-parameters) and searching with the `q` parameter. Remember to percent-encode `[` as `%5B` and `]` as `%5D` if your tooling doesn't automatically encode URLs.
|`page[number]`|**Optional.** If omitted, the endpoint returns the first page. |
175
+
|`page[size]`|**Optional.** If omitted, the endpoint returns 20 tokens per page. |
176
+
|`q`|**Optional.** A search query string. You can search for a team authentication token using the team name. |
177
+
|`sort`|**Optional.** Allows sorting the team tokens by `"created-by"`, `"expired-at"`, and `"last-used-at"`. Prepending a hyphen to the sort parameter reverses the order. If omitted, the default sort order ascending. |
Use this endpoint to display a particular [team token](/terraform/cloud-docs/users-teams-organizations/teams#api-tokens).
241
+
242
+
`GET /authentication-tokens/:token_id`
243
+
244
+
| Parameter | Description |
245
+
| ----------- | ------------------------- |
246
+
|`:token_id`| The ID of the Team Token. |
247
+
248
+
The object returned by this endpoint only contains metadata, and does not include the secret text of the authentication token. A token's secret test is only shown upon creation, and cannot be recovered later.
|`data.type`| string || Must be `"authentication-token"`. |
321
+
|`data.attributes.description`| string |`null`| The description of the team token, if supplied, otherwise the description will be `null`. The description **must** be unique within the context of the team, meaning legacy tokens may only have one `null` or one descriptive description at a time. |
65
322
|`data.attributes.expired-at`| string |`null`| The UTC date and time that the Team Token will expire, in ISO 8601 format. If omitted or set to `null` the token will never expire. |
@@ -234,19 +491,19 @@ This endpoint supports pagination [with standard URL query parameters](/terrafor
234
491
235
492
Use this endpoint to display a [team token](/terraform/cloud-docs/users-teams-organizations/teams#api-tokens) for a particular team.
236
493
237
-
`GET /teams/:team-id/authentication-token`
494
+
`GET /teams/:team_id/authentication-token`
238
495
239
496
| Parameter | Description |
240
497
| ---------- | ------------------------- |
241
-
|`:team-id`| The ID of the Team. |
498
+
|`:team_id`| The ID of the Team. |
242
499
243
500
You can also fetch a team token directly by using the token's ID with the `authentication-tokens/` endpoint.
244
501
245
-
`GET /authentication-tokens/:token-id`
502
+
`GET /authentication-tokens/:token_id`
246
503
247
504
| Parameter | Description |
248
505
| ----------- | ------------------------- |
249
-
|`:token-id`| The ID of the Team Token. |
506
+
|`:token_id`| The ID of the Team Token. |
250
507
251
508
The object returned by this endpoint only contains metadata, and does not include the secret text of the authentication token. A token's secret test is only shown upon creation, and cannot be recovered later.
Copy file name to clipboardExpand all lines: website/docs/cloud-docs/users-teams-organizations/api-tokens.mdx
+4-2
Original file line number
Diff line number
Diff line change
@@ -14,15 +14,17 @@ Refer to [Team Token API](/terraform/cloud-docs/api-docs/team-tokens) and [Organ
14
14
15
15
## User API Tokens
16
16
17
-
API tokens may belong directly to a user. User tokens are the most flexible token type because they inherit permissions from the user they are associated with. For more information on user tokens and how to generate them, see the [Users](/terraform/cloud-docs/users-teams-organizations/users#api-tokens) documentation.
17
+
API tokens may belong directly to a user. User tokens are the most flexible token type because they inherit permissions from the user they are associated with. For more information on user tokens and how to generate them, see the [Users](/terraform/cloud-docs/users-teams-organizations/users#tokens) documentation.
18
18
19
19
## Team API Tokens
20
20
21
21
API tokens may belong to a specific team. Team API tokens allow access to the workspaces that the team has access to, without being tied to any specific user.
22
22
23
23
Navigate to the **Organization settings > API Tokens > Team Token** tab to manage API tokens for a team or create new team tokens.
24
24
25
-
Each team can have **one** valid API token at a time. When a token is regenerated, the previous token immediately becomes invalid.
25
+
Each team can have multiple, valid API tokens at a time, unless the team is using the legacy team token API.
26
+
27
+
For teams relying on the [**legacy**](/terraform/cloud-docs/api-docs/team-tokens#legacy-team-tokens-api-reference) team token API, each team can only have **one** valid API token at a time. When a legacy team token is generated, the previous token immediately becomes invalid.
26
28
27
29
Owners and users with [manage teams](/terraform/cloud-docs/users-teams-organizations/permissions#manage-teams) permissions have the ability to enable and disable team token management for a team, which limits the actions that team members can take on a team token. Refer to [Allow Member Token Management](/terraform/cloud-docs/users-teams-organizations/permissions#allow-member-token-management) for more information.
Copy file name to clipboardExpand all lines: website/docs/cloud-docs/users-teams-organizations/permissions.mdx
+1-1
Original file line number
Diff line number
Diff line change
@@ -331,7 +331,7 @@ In order to remove a user from the organization, the holder of this permission m
331
331
332
332
#### Manage Teams
333
333
334
-
Allows members to create, update, and delete teams, and generate, regenerate, and revoke tokens.
334
+
Allows members to create, update, and delete teams, and generate, and revoke tokens.
335
335
336
336
This permission grants the ability to update a team's names, SSO IDs, and token management permissions, but does not allow access to organization settings. On its own, this permission does not allow users to create, update, delete, or otherwise access secret teams.
0 commit comments