Skip to content

Commit 1156940

Browse files
jkodroffclaude
andauthored
Restore missing REST API endpoints for teams and webhooks (#16639)
This restores 5 REST API endpoint sections that were accidentally omitted during the May 2025 documentation reorganization (commit 8343685): Organizations API: - Grant Stack Access to Team - Remove Stack Access from Team - List Team Access Tokens - Create Team Access Token - Delete Team Access Token Webhooks API: - List Webhook Deliveries These endpoints were originally documented from November 2021 and are still functional, but the documentation was lost when the large REST API page was split into separate topic-specific files. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude <[email protected]>
1 parent b8e81a3 commit 1156940

File tree

2 files changed

+280
-1
lines changed

2 files changed

+280
-1
lines changed

content/docs/reference/cloud-rest-api/organizations/_index.md

Lines changed: 217 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -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

401617
For 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/).

content/docs/reference/cloud-rest-api/webhooks/_index.md

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ The API provides endpoints for the following operations:
2424
- Getting webhook details
2525
- Updating webhook configuration
2626
- Testing webhooks with ping functionality
27+
- Viewing webhook delivery history
2728
- Deleting webhooks
2829

2930
## Create Webhook
@@ -265,3 +266,65 @@ curl \
265266
--request POST \
266267
https://api.pulumi.com/api/stacks/{organization}/{project}/{stack}/hooks/{webhookname}/ping
267268
```
269+
270+
## List Webhook Deliveries
271+
272+
List the delivery history for a webhook, showing details about each webhook invocation including payload, response, and timing information.
273+
274+
```plain
275+
// List organization webhook deliveries
276+
GET /api/orgs/{organization}/hooks/{webhookname}/deliveries
277+
278+
// List stack webhook deliveries
279+
GET /api/stacks/{organization}/{project}/{stack}/hooks/{webhookname}/deliveries
280+
```
281+
282+
### Parameters
283+
284+
| Parameter | Type | In | Description |
285+
|----------------|--------|------|--------------------------------------------------------|
286+
| `organization` | string | path | organization name |
287+
| `project` | string | path | project name (only for stack webhooks) |
288+
| `stack` | string | path | stack name (only for stack webhooks) |
289+
| `webhookname` | string | path | webhook name |
290+
291+
### Example
292+
293+
```bash
294+
# List organization webhook deliveries
295+
curl \
296+
-H "Accept: application/vnd.pulumi+8" \
297+
-H "Content-Type: application/json" \
298+
-H "Authorization: token $PULUMI_ACCESS_TOKEN" \
299+
https://api.pulumi.com/api/orgs/{organization}/hooks/{webhookname}/deliveries
300+
301+
# List stack webhook deliveries
302+
curl \
303+
-H "Accept: application/vnd.pulumi+8" \
304+
-H "Content-Type: application/json" \
305+
-H "Authorization: token $PULUMI_ACCESS_TOKEN" \
306+
https://api.pulumi.com/api/stacks/{organization}/{project}/{stack}/hooks/{webhookname}/deliveries
307+
```
308+
309+
### Default response
310+
311+
```plain
312+
Status: 200 OK
313+
```
314+
315+
```plain
316+
[
317+
{
318+
"id": "ea01abd2-90b4-4670-acce-15cc019ed6e4",
319+
"kind": "ping",
320+
"payload": "{\"timestamp\":1632735487,\"message\":\"🍹 Just a friendly ping from Pulumi 🍹\"}",
321+
"timestamp": 1632735487,
322+
"duration": 196,
323+
"requestUrl": "{webhookurl}",
324+
"requestHeaders": "Content-Type: application/json\r\nPulumi-Webhook-Id: ea01abd2-90b4-4670-acce-15cc019ed6e4\r\nPulumi-Webhook-Kind: ping\r\n",
325+
"responseCode": 200,
326+
"responseHeaders": "{headersfromwebhook}",
327+
"responseBody": "OK"
328+
}
329+
]
330+
```

0 commit comments

Comments
 (0)