> ## Documentation Index
> Fetch the complete documentation index at: https://docs.rafftechnologies.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Create deployment

> Build and roll out a new deployment. Provide a `source_blob_key` from
a completed source upload, or an `image_ref` for a prebuilt image.
Git-connected services deploy their branch head when neither is given.




## OpenAPI

````yaml POST /api/v1/apps/services/{service_id}/deployments
openapi: 3.0.3
info:
  title: Raff API
  description: >
    REST API for managing cloud infrastructure on Raff.


    ## Authentication

    Most endpoints require authentication via API key. Catalog endpoints under
    `/api/v1/public/` are open and require no authentication.


    ### API Key Authentication

    Include your API key in the `X-API-Key` header:
      ```
      curl -H "X-API-Key: YOUR_API_KEY" https://api.rafftechnologies.com/api/v1/vms
      ```

    ## Catalog

    Use the public catalog endpoints to discover available regions, OS
    templates, and pricing plans before creating resources:

    - `GET /api/v1/public/regions` — list available regions

    - `GET /api/v1/public/templates` — list OS templates (use the `id` as
    `template_id` when creating a VM)

    - `GET /api/v1/public/pricing/vm` — list VM pricing plans (use the `id` as
    `pricing_id` when creating a VM)

    - `GET /api/v1/public/pricing/volume` — volume storage pricing

    - `GET /api/v1/public/pricing/snapshot` — snapshot storage pricing

    - `GET /api/v1/public/pricing/backup` — backup storage pricing

    - `GET /api/v1/public/pricing/ip` — IP address pricing

    - `GET /api/v1/public/pricing/database` — managed database pricing (plans,
    high availability, read replicas, extra storage)

    - `GET /api/v1/public/pricing/kubernetes` — managed Kubernetes pricing
    (worker node plans, HA control plane, storage nodes)
  version: 1.0.0
  contact:
    name: Raff Technologies
    url: https://rafftechnologies.com
servers:
  - url: https://api.rafftechnologies.com
    description: Production
security:
  - ApiKeyAuth: []
tags:
  - name: Catalog
    description: >-
      Discover available regions, OS templates, and pricing plans. No
      authentication required.
  - name: Health
    description: Health check endpoints
  - name: Projects
    description: Organize resources into projects for billing and access control
  - name: Virtual Machines
  - name: Kubernetes
    description: >-
      Managed Kubernetes clusters — HA control planes, autoscaling node pools,
      kubeconfig access
  - name: Functions
    description: Deploy and manage serverless functions
  - name: Raff Apps
    description: >-
      Push-to-deploy web services, private services, workers, cron jobs, and
      one-off jobs on the Raff PaaS — with custom domains, environment
      variables, autoscaling, and per-second billing with spend caps
  - name: Managed Databases
    description: >-
      Fully managed PostgreSQL and Valkey databases with private VPC networking,
      automatic backups, and metrics
  - name: Networking
    description: >-
      Attach and detach VPCs, floating IPs, and security groups to VM network
      interfaces
  - name: Snapshots
    description: Point-in-time copies of VMs and volumes for quick rollback or cloning
  - name: Backups
    description: Scheduled and on-demand VM backups with restore capability
  - name: Backup Schedules
    description: Recurring daily or weekly backup schedules attached to a VM
  - name: SSH Keys
    description: Manage account-level SSH keys for VM provisioning
  - name: Members
    description: Account-level members — invite, list, update role, remove
  - name: Project Members
    description: Members of a specific project — same model as Members but project-scoped
  - name: Roles
    description: Custom roles bundling account or project permissions
  - name: Permissions
    description: List the catalog of permission strings used by roles
  - name: API Keys
    description: Create and manage API keys for programmatic access
  - name: Invitations
    description: Create and cancel email-based invitations to join the account or a project
paths:
  /api/v1/apps/services/{service_id}/deployments:
    post:
      tags:
        - Raff Apps
      summary: Create deployment
      description: |
        Build and roll out a new deployment. Provide a `source_blob_key` from
        a completed source upload, or an `image_ref` for a prebuilt image.
        Git-connected services deploy their branch head when neither is given.
      operationId: createAppDeployment
      parameters:
        - $ref: '#/components/parameters/AppServiceRef'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateAppDeploymentRequest'
      responses:
        '201':
          description: Deployment queued
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                  deployment:
                    $ref: '#/components/schemas/AppDeployment'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
components:
  parameters:
    AppServiceRef:
      name: service_id
      in: path
      required: true
      description: App service ID (UUID) or short id (the `service_id` field)
      schema:
        type: string
  schemas:
    CreateAppDeploymentRequest:
      type: object
      description: >-
        Provide a source_blob_key or an image_ref. Git-connected services deploy
        their branch head when neither is given.
      properties:
        channel:
          type: string
          enum:
            - console
            - git_push
            - cli
            - compose
        source_blob_key:
          type: string
          description: Blob key from a completed source upload
        image_ref:
          type: string
          description: Prebuilt image reference
    AppDeployment:
      type: object
      properties:
        id:
          type: string
          format: uuid
        service_id:
          type: string
          format: uuid
        deployment_number:
          type: integer
        channel:
          type: string
          enum:
            - console
            - git_push
            - cli
            - compose
            - rollback
        status:
          type: string
          enum:
            - queued
            - building
            - deploying
            - live
            - superseded
            - failed
            - canceled
        rollback_of:
          type: string
          format: uuid
          description: Set when this deployment is a rollback
        image_digest:
          type: string
        commit_sha:
          type: string
        commit_message:
          type: string
        error:
          type: string
        build_duration_ms:
          type: integer
        started_at:
          type: string
          format: date-time
        finished_at:
          type: string
          format: date-time
        created_at:
          type: string
          format: date-time
    Error:
      type: object
      properties:
        error:
          type: string
        message:
          type: string
  responses:
    BadRequest:
      description: Invalid request parameters
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    Unauthorized:
      description: Authentication required
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    NotFound:
      description: Resource not found
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-API-Key
      description: API key for authentication. Each key is bound to a specific account.

````