---
title: "Create deployment"
method: POST
path: "/api/v1/functions/{function_id}/deployments"
tags: ["Functions"]
---

# Create deployment

`POST /api/v1/functions/{function_id}/deployments`

Build and roll out new source. Provide exactly one source:

- `source_blob_key` — from a completed source upload
- `template` — a starter template id (`python`, `typescript`, `node`, `go`)
- `files` — inline source files (small console edits)

Functions connected to GitHub deploy their branch head when no
source is given. Buildpacks detect the language; a `Dockerfile` at
the source root switches to a container build. The container must
listen on the `PORT` environment variable.

## Path parameters

- `function_id` string, required

## Request body

- CreateFunctionDeploymentRequest
  - `channel` 'console' | 'cli'
  - `source_blob_key` string — From a completed source upload
  - `template` 'python' | 'typescript' | 'node' | 'go' — Deploy a starter template instead of uploaded source
  - `files` FunctionSourceFile[] — Inline source files (small edits)
    - `name` string, required
    - `content` string, required
  - `message` string

## Response `201`

Deployment queued

- object
  - `success` boolean
  - `data` object
    - `deployment` FunctionDeployment
      - `id` string, uuid
      - `revision_id` string, uuid — Set when the deployment succeeds
      - `channel` 'console' | 'cli' | 'github'
      - `status` 'queued' | 'building' | 'deploying' | 'ready' | 'failed'
      - `commit_sha` string
      - `error` string
      - `build_duration_ms` integer
      - `started_at` string, date-time
      - `finished_at` string, date-time
      - `created_at` string, date-time

## Other responses

- `400` — Invalid request parameters
- `401` — Authentication required
- `404` — Resource not found

## Changes

- **2026-08-20** `efd3c11c5c92` — 1 info
  - endpoint added

[Change history](https://skmtc.dev/rafftechnologies/apis/raff-api/changes/api/v1/functions/:function_id/deployments/post.md)

---

[API](https://skmtc.dev/rafftechnologies/apis/raff-api.md) · [All operations](https://skmtc.dev/rafftechnologies/apis/raff-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/rafftechnologies/raff-api/revisions/2f4df56be77c/schema)
