---
title: "Create Deployment"
method: POST
path: "/v1/workflows/deployments"
tags: ["workflows.deployments"]
---

# Create Deployment

`POST /v1/workflows/deployments`

Create Deployment

## Request body

- CreateDeploymentRequest
  - `name` string, required
  - `spec` DeploymentWorkerSpecInput, required
    - `github_url` string, required
    - `revision` string, nullable
    - `backend_spec` union — Backend-specific configuration. The arm's 'type' picks where the worker runs: 'koyeb' (the default for a new deployment) or 'kubernetes'. Cannot be combined with the deprecated top-level 'entrypoint' and 'working_dir'.
      - DeploymentK8sBackendSpec — Worker configuration for the Kubernetes backend.
        - `type` 'kubernetes'
        - `entrypoint` string, nullable — Either a 'module:function' reference (e.g. 'worker:main') or a '.py' script path relative to 'working_dir'.
        - `working_dir` string, nullable — Path in the repo holding the worker's pyproject.toml, for monorepo layouts. Leave empty for single-package repos.
      - DeploymentKoyebBackendSpec — Worker configuration for the Koyeb backend.
        - `type` 'koyeb'
        - `build_directory` string, nullable — Docker build context, as a path in the repo. Defaults to the repo root.
        - `dockerfile_path` string, nullable — Path to the Dockerfile, relative to 'build_directory'. Defaults to 'Dockerfile'.
        - `secrets` DeploymentSecretBinding[], nullable — Secrets to bind to the worker, as 'secret:workspace:<NAME>' references. Each is available during build and run: as a Dockerfile build arg (declare a matching 'ARG') and as an env var. On update, the field carries the complete set: send the full list to rebind, an empty list to unbind all, omit it to leave the bindings unchanged.
          - `env_var_name` string, required — Environment variable the worker process reads; the secret's name lives in 'reference'.
          - `reference` string, required — Secret reference as 'secret:workspace:<NAME>'. Resolved at boot by the runtime-init container; the value never reaches the control plane.
    - `entrypoint` string, nullable — Kubernetes-only. Setting it without 'backend_spec' selects the kubernetes backend, which is not generally available; setting it alongside 'backend_spec' returns 422.
    - `working_dir` string, nullable — Kubernetes-only. Setting it without 'backend_spec' selects the kubernetes backend, which is not generally available; setting it alongside 'backend_spec' returns 422.
  - `resources` DeploymentResourceConfig
    - `replicas` integer, nullable
    - `cpu_request` string, nullable
    - `cpu_limit` string, nullable
    - `memory_request` string, nullable
    - `memory_limit` string, nullable
  - `hardened` boolean

## Response `202`

Successful Response

- ManagedDeploymentResponse
  - `service_id` string, required
  - `name` string, required
  - `spec` DeploymentWorkerSpecResponse, required
    - `github_url` string, required
    - `type` string
    - `revision` string, nullable
    - `backend_spec` union, required — Backend-specific configuration. The arm's 'type' says where the worker runs: 'koyeb' or 'kubernetes'.
      - DeploymentK8sBackendSpec — Worker configuration for the Kubernetes backend.
        - `type` 'kubernetes'
        - `entrypoint` string, nullable — Either a 'module:function' reference (e.g. 'worker:main') or a '.py' script path relative to 'working_dir'.
        - `working_dir` string, nullable — Path in the repo holding the worker's pyproject.toml, for monorepo layouts. Leave empty for single-package repos.
      - DeploymentKoyebBackendSpec — Worker configuration for the Koyeb backend.
        - `type` 'koyeb'
        - `build_directory` string, nullable — Docker build context, as a path in the repo. Defaults to the repo root.
        - `dockerfile_path` string, nullable — Path to the Dockerfile, relative to 'build_directory'. Defaults to 'Dockerfile'.
        - `secrets` DeploymentSecretBinding[], nullable — Secrets to bind to the worker, as 'secret:workspace:<NAME>' references. Each is available during build and run: as a Dockerfile build arg (declare a matching 'ARG') and as an env var. On update, the field carries the complete set: send the full list to rebind, an empty list to unbind all, omit it to leave the bindings unchanged.
          - `env_var_name` string, required — Environment variable the worker process reads; the secret's name lives in 'reference'.
          - `reference` string, required — Secret reference as 'secret:workspace:<NAME>'. Resolved at boot by the runtime-init container; the value never reaches the control plane.
    - `restarted_at` string, nullable
    - `commit` GitCommitMetadata
      - `sha` string, required
      - `message` string, nullable
      - `author` GitCommitAuthor
        - `name` string, nullable
        - `username` string, nullable
        - `html_url` string, nullable
      - `html_url` string, nullable
    - `commit_sha` string, nullable, required
    - `entrypoint` string, nullable, required
    - `working_dir` string, nullable, required
  - `resources` DeploymentResourceConfig, required
    - `replicas` integer, nullable
    - `cpu_request` string, nullable
    - `cpu_limit` string, nullable
    - `memory_request` string, nullable
    - `memory_limit` string, nullable
  - `status` DeploymentObservedState, required
    - `phase` string, nullable
    - `available_replicas` integer
    - `ready_replicas` integer
    - `endpoint` string, nullable
    - `message` string, nullable
    - `last_seen` string, date-time, nullable
    - `deployed_revision` string, nullable
    - `generation` integer, nullable
    - `build_state` DeploymentBuildState
      - `phase` string, nullable
      - `commit_sha` string, nullable
      - `image` string, nullable
      - `message` string, nullable
      - `started_at` string, date-time, nullable
      - `finished_at` string, date-time, nullable
  - `created_at` string, date-time, required
  - `updated_at` string, date-time, required
  - `stopped` boolean
  - `rollout_status` string, nullable
  - `created_by` string, nullable
  - `updated_by` string, nullable
  - `deployed_by` string, nullable
  - `deployed_at` string, date-time, nullable
  - `is_hardened` boolean
  - `runtime_credential_id` string, uuid, nullable
  - `runtime_principal_type` 'api_key' | 'service_account' | 'user'

## Other responses

- `422` — Validation Error

## Changes

- **2026-09-23** `fa73befe1c61` — 15 info
  - added the new optional request property `spec/backend_spec`
  - the `entrypoint` request property default value `worker:main` was removed
  - request property `spec/entrypoint` deprecated
  - request property `spec/working_dir` deprecated
  - …11 more
- **2026-08-14** `61436a496404` — 4 info
  - added the new optional request property `hardened`
  - added the optional property `is_hardened` to the response with the `202` status
  - added the optional property `spec/commit` to the response with the `202` status
  - response property `spec/commit_sha` deprecated
- **2026-07-26** `933c4ebdcd72` — 1 info
  - endpoint added

[Change history](https://skmtc.dev/mistral/apis/mistral-ai-api/changes/v1/workflows/deployments/post.md)

---

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