> ## Documentation Index
> Fetch the complete documentation index at: https://vlyai-1c28d863.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Create deployment

> Trigger a new deployment for a project. Async — returns a Deployment record with status 'queued'.

Builds and deploys the current state of the project. Defaults to `environment: "preview"`; pass `"production"` to promote.

Use [Get deployment](/api-reference/deployments/get) to poll status, or subscribe to a webhook for `deployment.succeeded` / `deployment.failed`.

<Tip>
  For continuous deployment, prefer [GitHub integration](/integrations/github) — pushes to `main` auto-deploy.
</Tip>


## OpenAPI

````yaml POST /v1/projects/{id}/deployments
openapi: 3.1.0
info:
  title: vly.ai API
  version: 0.1.0
  description: >-
    REST API for the vly.ai AI app builder. v0, illustrative — endpoints, paths,
    and shapes may change before general availability. See the API Reference
    introduction for status.
  contact:
    name: vly.ai support
    email: support@vly.ai
    url: https://docs.vly.ai/api-reference/introduction
  license:
    name: vly.ai Terms
    url: https://vly.ai/terms
servers:
  - url: https://api.vly.ai
    description: Production
  - url: https://api.staging.vly.ai
    description: Staging
security:
  - bearerAuth: []
tags:
  - name: Projects
    description: Create, list, update, and delete vly projects.
  - name: Deployments
    description: Trigger and inspect deployments.
  - name: Agents
    description: Trigger an AI agent run on a project.
  - name: Files
    description: Upload assets to a project.
  - name: Billing
    description: Inspect plan usage and credits.
  - name: Webhooks
    description: Send and verify webhook events.
paths:
  /v1/projects/{id}/deployments:
    parameters:
      - name: id
        in: path
        required: true
        schema:
          type: string
    post:
      tags:
        - Deployments
      summary: Create deployment
      description: >-
        Deploys the current state of a project. Returns a deployment record you
        can poll for status.
      operationId: createDeployment
      requestBody:
        required: false
        content:
          application/json:
            schema:
              type: object
              properties:
                environment:
                  type: string
                  enum:
                    - preview
                    - production
                  default: preview
                branch:
                  type: string
                  example: main
      responses:
        '202':
          description: Accepted
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Deployment'
components:
  schemas:
    Deployment:
      type: object
      properties:
        id:
          type: string
          example: dpl_01JFA8N3Z1B6Y2K7Q3X4M5R8
        project_id:
          type: string
        environment:
          type: string
          enum:
            - preview
            - production
        status:
          type: string
          enum:
            - queued
            - building
            - ready
            - failed
        url:
          type: string
          format: uri
          nullable: true
        created_at:
          type: string
          format: date-time
      required:
        - id
        - project_id
        - environment
        - status
        - created_at
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: vly_live_...
      description: Workspace-scoped API key. Generate from Workspace settings → API keys.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.