Skip to content

Commit 15d3783

Browse files
committed
promote deployment api
1 parent 34203d6 commit 15d3783

File tree

3 files changed

+76
-0
lines changed

3 files changed

+76
-0
lines changed

docs/docs.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -269,6 +269,10 @@
269269
"management/envvars/update",
270270
"management/envvars/delete"
271271
]
272+
},
273+
{
274+
"group": "Deployments API",
275+
"pages": ["management/deployments/promote"]
272276
}
273277
]
274278
},
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
---
2+
title: "Promote deployment"
3+
openapi: "v3-openapi POST /api/v1/deployments/{version}/promote"
4+
---

docs/v3-openapi.yaml

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -505,6 +505,74 @@ paths:
505505
506506
await runs.cancel("run_1234");
507507
508+
"/api/v1/deployments/{version}/promote":
509+
parameters:
510+
- in: path
511+
name: version
512+
required: true
513+
schema:
514+
type: string
515+
description: The deployment version to promote (e.g., "20250228.1").
516+
post:
517+
operationId: promote_deployment_v1
518+
summary: Promote deployment
519+
description: Promote a previously deployed version to be the current version for the environment. This makes the specified version active for new task runs.
520+
responses:
521+
"200":
522+
description: Deployment promoted successfully
523+
content:
524+
application/json:
525+
schema:
526+
type: object
527+
properties:
528+
id:
529+
type: string
530+
description: The deployment ID
531+
version:
532+
type: string
533+
description: The deployment version (e.g., "20250228.1")
534+
shortCode:
535+
type: string
536+
description: The short code for the deployment
537+
"400":
538+
description: Invalid request
539+
content:
540+
application/json:
541+
schema:
542+
type: object
543+
properties:
544+
error:
545+
type: string
546+
"401":
547+
description: Unauthorized - Access token is missing or invalid
548+
"404":
549+
description: Deployment not found
550+
tags:
551+
- deployments
552+
security:
553+
- personalAccessToken: []
554+
x-codeSamples:
555+
- lang: typescript
556+
source: |-
557+
// Note: This endpoint requires a personal access token, not a secret key
558+
// The SDK doesn't currently expose this endpoint, but you can call it directly:
559+
const response = await fetch(
560+
`https://api.trigger.dev/api/v1/deployments/${version}/promote`,
561+
{
562+
method: "POST",
563+
headers: {
564+
"Authorization": `Bearer ${personalAccessToken}`,
565+
"Content-Type": "application/json",
566+
},
567+
}
568+
);
569+
const result = await response.json();
570+
- lang: curl
571+
source: |-
572+
curl -X POST "https://api.trigger.dev/api/v1/deployments/20250228.1/promote" \
573+
-H "Authorization: Bearer your_personal_access_token" \
574+
-H "Content-Type: application/json"
575+
508576
"/api/v1/runs/{runId}/reschedule":
509577
parameters:
510578
- $ref: "#/components/parameters/runId"

0 commit comments

Comments
 (0)