---
title: "Redeploy source and deploy"
method: POST
path: "/deployments"
---

# Redeploy source and deploy

`POST /deployments`

## Request

- Base URL: `https://api.eurobase.dev`
- URL: `https://api.eurobase.dev/deployments`
- Auth: one of:
  - HTTP bearer
  - API key in cookie `__Host-eurobase_session` and API key in header `X-Eurobase-CSRF`

Queues a source deployment for a project. For the first release, appSource and startupSecrets atomically commit with the deployment and initial job before provider dispatch. When sourceDeploymentId is provided, Eurobase rereads bounded root/direct-static evidence at the resolved lineage deployment immutable commit and freezes a new direct-static-v1 or paketo-v1 route. The deployment action key is persisted on the created deployment row and replayed before source validation, quota, or in-flight checks.

## Headers

- `Idempotency-Key` string, required

## Request body

- DeploymentCreateRequest
  - `projectId` string, required
  - `blockedPushEventId` string: Retry a quota-blocked push through normal deploy admission, using its immutable commit and requiring the project repository and branch to match.
  - `sourceDeploymentId` string: Optional selected deployment id whose source, config, and commit should be replayed.
  - `commitSha` string: Optional explicit commit SHA for a normal project source deployment.
  - `sourceConfirmation` ProjectSourceConfirmation
    - `repository` string, required
    - `branch` string, required
    - `rootDirectory` string, required
    - `configurationHash` string, required: API-owned binding of the saved source defaults, excluding detector caches and unrelated project updates.
  - `sourceBuildEngineChange` SourceBuildEngineChange: Explicit confirmation of a project runtime switch (ADR 0076 D2), applied as compare-and-set under the project row lock: from is the stored engine and to the engine detected for the admitted commit. Refused on redeploys and never read from pushes.
    - `from` 'direct-static-v1' | 'paketo-v1' | 'workers-v1', required
    - `to` 'direct-static-v1' | 'paketo-v1' | 'workers-v1', required

## Response `201`

Deployment and initial pending build job persisted before external dispatch

- DeploymentActionResponse
  - `deployment` object, required
    - `id` string, required
    - `projectId` string, required
    - `status` string, required
    - `terminal` boolean, required
    - `statusReason` string, nullable
    - `statusView` object, required
      - `primaryLabel` string, required
      - `secondaryLabel` string, nullable
      - `tone` string, required
  - `job` object, required
    - `id` string, required
    - `status` string, required
    - `type` string, nullable

## Other responses

- `400`: Invalid deploy request, including a runtime change combined with sourceDeploymentId or appSource (reason source-build-engine-change-invalid)
- `404`: Source deployment not found for this project or caller
- `409`: Project source is not attached yet, selected source deployment cannot be redeployed, a visible non-terminal deployment is already in progress, the action key was reused for a different selected source, quota blocks deployment, or the commit needs a runtime other than the stored one (runtime-detection-changed, a direct-static-* stored-runtime blocker, workers-v1-admission-disabled or workers-v1-build-unavailable); a runtime refusal creates no deployment or job
- `503`: Quota evidence or the Jobs source-build release is temporarily unavailable, including a supply whose build Job cannot yet detect the Workers runtime (reason workers-detection-unavailable); no deployment or job is created

---

[API](https://skmtc.dev/eurobase/apis/eurobase-api.md) · [All operations](https://skmtc.dev/eurobase/apis/eurobase-api/llms.txt) · [OpenAPI document](https://skmtc.dev/eurobase/apis/eurobase-api/revisions/5266a299d18a?raw)
