> Agent-readable docs index: /llms.txt. Download /docs.zip to grep all markdown files locally.

---
title: "Create deployment"
description: "Create deployment"
api: "POST /api/v0/deployments"
gridGap: 30
---

<Aside full>
  <RequestExample>
    ```bash title="cURL" lines=false
    curl -X POST "https://api.example.com/api/v0/deployments" \
      -H "Content-Type: application/json" \
      -d '{
      "files": [
        {
          "path": "string",
          "hash": "string"
        }
      ],
      "projectId": "string",
      "branch": "string",
      "preview": true,
      "name": "string"
    }'
    ```
  </RequestExample>
</Aside>

<OpenAPIEndpoint {...{"method":"post","path":"/api/v0/deployments","summary":"Create deployment","parameters":[],"requestBody":{"required":true,"contentType":"application/json","schema":{"type":"object","required":["files"],"properties":{"files":{"type":"array","description":"File paths with SHA-256 content hashes","items":{"type":"object","required":["path","hash"],"properties":{"path":{"type":"string","minLength":1,"maxLength":512},"hash":{"type":"string","minLength":64,"maxLength":64,"pattern":"^[a-f0-9]+$"}}}},"projectId":{"type":"string","description":"Required for session auth; ignored for API key auth"},"branch":{"type":"string","description":"Branch name for preview deployments. Defaults to \"main\".","maxLength":200},"preview":{"type":"boolean","description":"Force preview deployment (e.g. from a PR). Never updates production pointer."},"name":{"type":"string","description":"Site name from docs.json. Updates the project name if provided.","minLength":1,"maxLength":200}}},"examples":[]},"responses":[{"status":"200","description":"","schema":{"type":"object","required":["deploymentId","version","existingHashes"],"properties":{"deploymentId":{"type":"string"},"version":{"type":"string"},"existingHashes":{"type":"array","description":"Hashes that already exist in KV — CLI can skip uploading these files","items":{"type":"string"}}}},"examples":[]},{"status":"default","description":"","examples":[]}],"security":[],"servers":[]}} />
