Skip to content

Commit 756a3a0

Browse files
committed
deployment GET api endpoints
1 parent 15d3783 commit 756a3a0

File tree

4 files changed

+184
-1
lines changed

4 files changed

+184
-1
lines changed

docs/docs.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,11 @@
272272
},
273273
{
274274
"group": "Deployments API",
275-
"pages": ["management/deployments/promote"]
275+
"pages": [
276+
"management/deployments/retrieve",
277+
"management/deployments/get-latest",
278+
"management/deployments/promote"
279+
]
276280
}
277281
]
278282
},
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
---
2+
title: "Get latest deployment"
3+
openapi: "v3-openapi GET /api/v1/deployments/latest"
4+
---
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
---
2+
title: "Get deployment"
3+
openapi: "v3-openapi GET /api/v1/deployments/{deploymentId}"
4+
---

docs/v3-openapi.yaml

Lines changed: 171 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -505,6 +505,177 @@ paths:
505505
506506
await runs.cancel("run_1234");
507507
508+
"/api/v1/deployments/{deploymentId}":
509+
parameters:
510+
- in: path
511+
name: deploymentId
512+
required: true
513+
schema:
514+
type: string
515+
description: The deployment ID.
516+
get:
517+
operationId: get_deployment_v1
518+
summary: Get deployment
519+
description: Retrieve information about a specific deployment by its ID.
520+
responses:
521+
"200":
522+
description: Successful request
523+
content:
524+
application/json:
525+
schema:
526+
type: object
527+
properties:
528+
id:
529+
type: string
530+
description: The deployment ID
531+
status:
532+
type: string
533+
enum: ["PENDING", "INSTALLING", "BUILDING", "DEPLOYING", "DEPLOYED", "FAILED", "CANCELED", "TIMED_OUT"]
534+
description: The current status of the deployment
535+
contentHash:
536+
type: string
537+
description: Hash of the deployment content
538+
shortCode:
539+
type: string
540+
description: The short code for the deployment
541+
version:
542+
type: string
543+
description: The deployment version (e.g., "20250228.1")
544+
imageReference:
545+
type: string
546+
nullable: true
547+
description: Reference to the deployment image
548+
imagePlatform:
549+
type: string
550+
description: Platform of the deployment image
551+
externalBuildData:
552+
type: object
553+
nullable: true
554+
description: External build data if applicable
555+
errorData:
556+
type: object
557+
nullable: true
558+
description: Error data if the deployment failed
559+
worker:
560+
type: object
561+
nullable: true
562+
description: Worker information if available
563+
properties:
564+
id:
565+
type: string
566+
version:
567+
type: string
568+
tasks:
569+
type: array
570+
items:
571+
type: object
572+
properties:
573+
id:
574+
type: string
575+
slug:
576+
type: string
577+
filePath:
578+
type: string
579+
exportName:
580+
type: string
581+
"401":
582+
description: Unauthorized - Access token is missing or invalid
583+
"404":
584+
description: Deployment not found
585+
tags:
586+
- deployments
587+
security:
588+
- personalAccessToken: []
589+
x-codeSamples:
590+
- lang: typescript
591+
source: |-
592+
// Note: This endpoint requires a personal access token, not a secret key
593+
const response = await fetch(
594+
`https://api.trigger.dev/api/v1/deployments/${deploymentId}`,
595+
{
596+
method: "GET",
597+
headers: {
598+
"Authorization": `Bearer ${personalAccessToken}`,
599+
},
600+
}
601+
);
602+
const deployment = await response.json();
603+
- lang: curl
604+
source: |-
605+
curl -X GET "https://api.trigger.dev/api/v1/deployments/deployment_1234" \
606+
-H "Authorization: Bearer your_personal_access_token"
607+
608+
"/api/v1/deployments/latest":
609+
get:
610+
operationId: get_latest_deployment_v1
611+
summary: Get latest deployment
612+
description: Retrieve information about the latest unmanaged deployment for the authenticated project.
613+
responses:
614+
"200":
615+
description: Successful request
616+
content:
617+
application/json:
618+
schema:
619+
type: object
620+
properties:
621+
id:
622+
type: string
623+
description: The deployment ID
624+
status:
625+
type: string
626+
enum: ["PENDING", "INSTALLING", "BUILDING", "DEPLOYING", "DEPLOYED", "FAILED", "CANCELED", "TIMED_OUT"]
627+
description: The current status of the deployment
628+
contentHash:
629+
type: string
630+
description: Hash of the deployment content
631+
shortCode:
632+
type: string
633+
description: The short code for the deployment
634+
version:
635+
type: string
636+
description: The deployment version (e.g., "20250228.1")
637+
imageReference:
638+
type: string
639+
nullable: true
640+
description: Reference to the deployment image
641+
imagePlatform:
642+
type: string
643+
description: Platform of the deployment image
644+
externalBuildData:
645+
type: object
646+
nullable: true
647+
description: External build data if applicable
648+
errorData:
649+
type: object
650+
nullable: true
651+
description: Error data if the deployment failed
652+
"401":
653+
description: Unauthorized - Access token is missing or invalid
654+
"404":
655+
description: No deployment found
656+
tags:
657+
- deployments
658+
security:
659+
- personalAccessToken: []
660+
x-codeSamples:
661+
- lang: typescript
662+
source: |-
663+
// Note: This endpoint requires a personal access token, not a secret key
664+
const response = await fetch(
665+
"https://api.trigger.dev/api/v1/deployments/latest",
666+
{
667+
method: "GET",
668+
headers: {
669+
"Authorization": `Bearer ${personalAccessToken}`,
670+
},
671+
}
672+
);
673+
const deployment = await response.json();
674+
- lang: curl
675+
source: |-
676+
curl -X GET "https://api.trigger.dev/api/v1/deployments/latest" \
677+
-H "Authorization: Bearer your_personal_access_token"
678+
508679
"/api/v1/deployments/{version}/promote":
509680
parameters:
510681
- in: path

0 commit comments

Comments
 (0)