Skip to content

Get one deployment by id (dep_… for a reported one, dpl_… for a g1t.page build), with every status it has had, oldest first.

GET/repos/{owner}/{name}/deployments/{id}

Needs the Read role.

statuses are oldest first. A g1t.page build’s (dpl_…) are read from the build: queued, building, how it ended, and inactive once a newer build replaced it or it was taken down.

  • Authentication: Optional. Public data can be read without a token; send one to see what is private.
  • MCP tool: workflow with action get_deployment, and the same inputs
  • Scope: An access token needs deployments:read.
Name Type Required Description
owner string Yes The workspace that owns the repository.
name string Yes The repository’s name.
id string Yes The deployment’s id: dep_… for a reported one, dpl_… for a g1t.page build.
curl https://api.g1t.sh/repos/flagon-io/g1t/deployments/dep_01kq8m3t5v7x9z1b3d5f7h9k2m \
-H "Authorization: Bearer $G1T_TOKEN"

A successful request answers 200 with:

{
"id": "dep_01kq8m3t5v7x9z1b3d5f7h9k2m",
"environment": "production",
"ref": "main",
"sha": "7c1e9a4b2d6f80135ac9e2b7d4f6a8c0e1b3d5f7",
"task": "deploy",
"description": "Deploy",
"payload": {},
"transient_environment": false,
"production_environment": true,
"state": "success",
"environment_url": "https://g1t.sh",
"log_url": "https://g1t.sh/flagon-io/g1t/actions/runs/run_01kq8m2r4t6v8x0z2b4d6f8h0k",
"creator": "syntaqx",
"source": "actions",
"run_id": "run_01kq8m2r4t6v8x0z2b4d6f8h0k",
"run_url": "https://g1t.sh/flagon-io/g1t/actions/runs/run_01kq8m2r4t6v8x0z2b4d6f8h0k",
"project": null,
"number": null,
"created_at": "2026-10-07T18:02:11.204Z",
"updated_at": "2026-10-07T18:19:47.881Z",
"statuses": [
{
"id": "dst_01kq8m3t5w0a2c4e6g8j0m2p4r",
"deployment_id": "dep_01kq8m3t5v7x9z1b3d5f7h9k2m",
"state": "in_progress",
"description": "Deploy is deploying",
"environment_url": "https://g1t.sh",
"log_url": "https://g1t.sh/flagon-io/g1t/actions/runs/run_01kq8m2r4t6v8x0z2b4d6f8h0k",
"creator": "syntaqx",
"created_at": "2026-10-07T18:02:11.204Z"
},
{
"id": "dst_01kq8n4v6x8z0b2d4f6h8k0m2p",
"deployment_id": "dep_01kq8m3t5v7x9z1b3d5f7h9k2m",
"state": "success",
"description": "Deploy deployed",
"environment_url": "https://g1t.sh",
"log_url": "https://g1t.sh/flagon-io/g1t/actions/runs/run_01kq8m2r4t6v8x0z2b4d6f8h0k",
"creator": "syntaqx",
"created_at": "2026-10-07T18:19:47.881Z"
}
]
}

A failed request answers with one of these statuses and a body like {"error": {"code": "not_found", "message": "Repository not found."}}. See errors.

Status Code When
401 unauthenticated A token is required, or the one sent is not valid.
403 forbidden The token is valid but not allowed to do this, such as a member-only change or an agent token outside its repository.
404 not_found It does not exist, or you cannot see it.
422 invalid The input is not valid. message says which field and why.