@@ -20,7 +20,7 @@ The API provides endpoints for the following categories of operations:
2020- Managing organization members (adding, updating, removing)
2121- Managing organization access tokens
2222- Creating and managing teams
23- - Managing team access tokens
23+ - Managing team membership, stack permissions, and access tokens
2424
2525## User Management
2626
@@ -396,6 +396,222 @@ curl \
396396 https://api.pulumi.com/api/orgs/{org}/teams/{teamName}
397397```
398398
399+ ### Grant Stack Access to Team
400+
401+ Grant a team permissions to access a specific stack.
402+
403+ ``` plain
404+ PATCH /api/orgs/{organization}/teams/{team}
405+ ```
406+
407+ #### Parameters
408+
409+ | Parameter | Type | In | Description |
410+ | -----------------------------------| ---------| --------| ----------------------------------------------------------------------------|
411+ | ` organization ` | string | path | organization name |
412+ | ` team ` | string | path | team name |
413+ | ` addStackPermission ` | object | body | object specifying stack and permissions - see following parameters |
414+ | ` addStackPermission.projectName ` | string | object | project name |
415+ | ` addStackPermission.stackName ` | string | object | stack name |
416+ | ` addStackPermission.permission ` | integer | object | number representing stack permissions: 101 (read), 102 (edit), 103 (admin) |
417+
418+ #### Example
419+
420+ ``` bash
421+ curl \
422+ -H " Accept: application/vnd.pulumi+8" \
423+ -H " Content-Type: application/json" \
424+ -H " Authorization: token $PULUMI_ACCESS_TOKEN " \
425+ --request PATCH \
426+ --data ' {"addStackPermission":{"projectName":"{projectName}","stackName":"{stackName}","permission":{permission}}}' \
427+ https://api.pulumi.com/api/orgs/{organization}/teams/{team}
428+ ```
429+
430+ #### Default response
431+
432+ ``` plain
433+ Status: 204 OK
434+ ```
435+
436+ ``` plain
437+ EMPTY RESPONSE BODY
438+ ```
439+
440+ ### Remove Stack Access from Team
441+
442+ Remove a team's access to a specific stack.
443+
444+ ``` plain
445+ PATCH /api/orgs/{organization}/teams/{team}
446+ ```
447+
448+ #### Parameters
449+
450+ | Parameter | Type | In | Description |
451+ | ----------------------------| --------| --------| --------------------------------------------------------------------|
452+ | ` organization ` | string | path | organization name |
453+ | ` team ` | string | path | team name |
454+ | ` removeStack ` | object | body | object specifying stack and permissions - see following parameters |
455+ | ` removeStack.projectName ` | string | object | project name |
456+ | ` removeStack.stackName ` | string | object | stack name |
457+
458+ #### Example
459+
460+ ``` bash
461+ curl \
462+ -H " Accept: application/vnd.pulumi+8" \
463+ -H " Content-Type: application/json" \
464+ -H " Authorization: token $PULUMI_ACCESS_TOKEN " \
465+ --request PATCH \
466+ --data ' {"removeStack":{"projectName":"{projectName}","stackName":"{stackName}"}}' \
467+ https://api.pulumi.com/api/orgs/{organization}/teams/{team}
468+ ```
469+
470+ #### Default response
471+
472+ ``` plain
473+ Status: 204 OK
474+ ```
475+
476+ ``` plain
477+ EMPTY RESPONSE BODY
478+ ```
479+
480+ ## Team Access Tokens
481+
482+ ### List Team Access Tokens
483+
484+ List all access tokens for a team.
485+
486+ ``` plain
487+ GET /api/orgs/{org}/teams/{team}/tokens
488+ ```
489+
490+ #### Parameters
491+
492+ | Parameter | Type | In | Description |
493+ | ----------------| --------| -------| --------------------------------------------------------------------------------------------|
494+ | ` organization ` | string | path | organization name |
495+ | ` team ` | string | path | team name |
496+ | ` show_expired ` | string | query | ** Optional.** whether to return previously expired tokens with results. Defaults to false. |
497+
498+ #### Example
499+
500+ ``` bash
501+ curl \
502+ -H " Accept: application/vnd.pulumi+8" \
503+ -H " Content-Type: application/json" \
504+ -H " Authorization: token $PULUMI_ACCESS_TOKEN " \
505+ https://api.pulumi.com/api/orgs/{org}/teams/{team}/tokens? show_expired=true
506+ ```
507+
508+ #### Default response
509+
510+ ``` plain
511+ Status: 200 OK
512+ ```
513+
514+ ``` plain
515+ {
516+ "tokens": [
517+ {
518+ "id": "b02514e2-ddf6-41dc-8e16-6abf3914e68f",
519+ "description": "CI/CD token for AI team - Feb 2024",
520+ "expires": 1719333788,
521+ "lastUsed": 1627590233,
522+ "name": "Feb2024CICD-AI"
523+ },
524+ {
525+ "id": "ad9f7508-493a-4fbe-9918-62f1f71a53f8",
526+ "description": "A team token for the AI team, created in Feb 2023",
527+ "expires": 0,
528+ "lastUsed": 1606860942,
529+ "name": "Feb2023CICD-AI"
530+ }
531+ ]
532+ }
533+ ```
534+
535+ ### Create Team Access Token
536+
537+ Create a new access token for a team.
538+
539+ ``` plain
540+ POST /api/orgs/{org}/teams/{team}/tokens
541+ ```
542+
543+ #### Parameters
544+
545+ | Parameter | Type | In | Description |
546+ | ----------------| --------| ------| ------------------------------------------------------------------------------------------------------------------------------------|
547+ | ` organization ` | string | path | organization name |
548+ | ` team ` | string | path | team name |
549+ | ` description ` | string | body | Description of the access token. |
550+ | ` name ` | string | body | Unique name of the access token, up to 40 characters. Must be unique across the org, including deleted tokens. |
551+ | ` expires ` | int | body | ** Optional.** unix epoch timestamp at which the token should expire, up to two years from present. 0 for no expiry. Defaults to 0. |
552+
553+ #### Example
554+
555+ ``` bash
556+ curl \
557+ -H " Accept: application/vnd.pulumi+8" \
558+ -H " Content-Type: application/json" \
559+ -H " Authorization: token $PULUMI_ACCESS_TOKEN " \
560+ --request POST \
561+ --data ' {"description": "{description}", "name": "{unique_name}", "expires": 0}' \
562+ https://api.pulumi.com/api/orgs/{org}/teams/{team}/tokens
563+ ```
564+
565+ #### Default response
566+
567+ ``` plain
568+ Status: 204 OK
569+ ```
570+
571+ ``` plain
572+ {
573+ "id": "74529ccd-27c0-40f7-bc4a-589f145ba67f",
574+ "tokenValue": "pul-75a564ac7f3a48079a0c448c1e1ec95c4cfed141"
575+ }
576+ ```
577+
578+ ### Delete Team Access Token
579+
580+ Delete a team access token.
581+
582+ ``` plain
583+ DELETE /api/orgs/{org}/teams/{team}/tokens/{tokenId}
584+ ```
585+
586+ #### Parameters
587+
588+ | Parameter | Type | In | Description |
589+ | ----------------| --------| ------| ----------------------|
590+ | ` organization ` | string | path | organization name |
591+ | ` team ` | string | path | team name |
592+ | ` tokenId ` | string | path | the token identifier |
593+
594+ #### Example
595+
596+ ``` bash
597+ curl \
598+ -H " Accept: application/vnd.pulumi+8" \
599+ -H " Content-Type: application/json" \
600+ -H " Authorization: token $PULUMI_ACCESS_TOKEN " \
601+ --request DELETE \
602+ https://api.pulumi.com/api/orgs/{org}/teams/{team}/tokens/{tokenId}
603+ ```
604+
605+ #### Default response
606+
607+ ``` plain
608+ Status: 204 OK
609+ ```
610+
611+ ``` plain
612+ EMPTY RESPONSE BODY
613+ ```
614+
399615## Webhooks
400616
401617For comprehensive information about webhooks including setup, configuration, event filtering, and complete API reference, see the [ Webhooks documentation] ( /docs/deployments/webhooks/ ) and [ Webhooks REST API reference] ( /docs/reference/cloud-rest-api/webhooks/ ) .
0 commit comments