---
title: "Execute a deployment operation (deploy, mark_complete, take_screenshot)"
method: POST
path: "/projects/{project_id}/deployments/{deployment_id}/operations"
tags: ["Deployments"]
---

# Execute a deployment operation (deploy, mark_complete, take_screenshot)

`POST /projects/{project_id}/deployments/{deployment_id}/operations`

## Request

- Base URL: `/api` (relative, and the document was published on a file host, not at the API’s origin)
- URL: `/api/projects/{project_id}/deployments/{deployment_id}/operations`
- Auth: HTTP bearer

## Path parameters

- `project_id` integer, required
- `deployment_id` string, required

## Request body

- ExecuteOperationRequest
  - `operation` string, required

## Response `202`

Operation accepted. `take_screenshot` returns `status: pending` with `success: null`; poll the operation status for `completed` (with `screenshot_location`) or `failed` (with the reason)

- OperationResultResponse
  - `data` DeploymentOperationDetails, required: The project and deployment the record belongs to, plus the stored image once a `take_screenshot` has completed.
    - `deployment_id` string, required
    - `project_id` integer, required
    - `screenshot` DeploymentScreenshotCapture, nullable: A screenshot captured by a `take_screenshot` operation.
      - `captured_at` string, date-time, required
      - `screenshot_location` string, required: Image path relative to the static files directory, as recorded on the deployment's `screenshot_location`.
      - `url` string, required: Deployment URL that was captured.
  - `executed_at` string, date-time, required
  - `message` string, required
  - `operation` string, required
  - `status` 'pending' | 'completed' | 'failed', required: `pending` while background work (a screenshot capture) runs, then `completed` or `failed`. Poll `GET …/operations/{operation_type}` for the outcome.
  - `success` boolean, nullable: The outcome, final only once `status` is terminal: `null` while the operation is `pending`, `true` when it `completed`, `false` when it `failed`. Read `status` first; a `null` here is not a failure.

## Other responses

- `400`: Invalid operation or deployment ID
- `401`: Unauthorized
- `403`: Insufficient permissions
- `404`: Deployment not found in this project
- `409`: Screenshots are disabled (see `setup_path`), or a capture of this deployment is already running
- `500`: Internal server error
- `503`: The screenshot provider is unavailable; `detail` gives the reason and `setup_path` where to change it

## Changes

- **2026-11-09** `12896146b193`: 5 breaking
  - removed the required property `extensions` from the response with the `400` status
  - removed the required property `extensions` from the response with the `404` status
  - removed the required property `extensions` from the response with the `409` status
  - removed the required property `extensions` from the response with the `500` status
  - …1 more
- **2026-10-11** `1bfd419deb2f`: 2 breaking
  - the response property `success` became nullable for the status `202`
  - the response property `success` became optional for the status `202`
- **2026-10-10** `e75811e4d169`: 1 breaking, 10 info
  - the `data` response's property type changed from no type to `object` for status `202`
  - added the media type `application/json` for the response with the status `400`
  - added the media type `application/json` for the response with the status `404`
  - added the media type `application/json` for the response with the status `500`
  - …7 more
- **2026-07-01** `d83dcb738585`: 1 info
  - api tag `Deployments` added

[Operation history](https://skmtc.dev/gotempsh/apis/temps/changes/projects/:project_id/deployments/:deployment_id/operations/post.md)

---

[API](https://skmtc.dev/gotempsh/apis/temps.md) - [All operations](https://skmtc.dev/gotempsh/apis/temps/llms.txt) - [OpenAPI document](https://skmtc.dev/gotempsh/apis/temps/revisions/3b040526eb43?raw)
