Layero Deploys API

The deploys API from Layero — 9 operation(s) for deploys.

GitHub OpenAPI

Operations 9

GET /environments/{environment_id}/deploys List Deploys #
GET /projects/{project_id}/deploys List Project Deploys #
POST /projects/{project_id}/rollback Rollback Project #
GET /deploys/{deploy_id} Get Deploy #
POST /deploys/{deploy_id}/cancel Cancel Deploy #
POST /deploys/{deploy_id}/retry Retry Deploy #
POST /environments/{environment_id}/rollback Rollback Environment #
GET /environments/{environment_id}/probe Probe Environment #
GET /projects/{project_id}/deploys/{deploy_id}/source Deploy Source #

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/layero-ru:layero-ru-deploys-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. By signing up you are subscribing to the APIs.io and API Evangelist newsletters — you can unsubscribe from any issue. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

layero-ru-deploys-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Layero Deploys API
  version: 0.1.0
tags:
- name: deploys
paths:
  /environments/{environment_id}/deploys:
    get:
      tags:
      - deploys
      summary: List Deploys
      operationId: list_deploys_environments__environment_id__deploys_get
      parameters:
      - name: environment_id
        in: path
        required: true
        schema:
          type: string
          format: uuid
          title: Environment Id
      - name: authorization
        in: header
        required: false
        schema:
          anyOf:
          - type: string
          - type: 'null'
          title: Authorization
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/DeployOut'
                title: Response List Deploys Environments  Environment Id  Deploys Get
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /projects/{project_id}/deploys:
    get:
      tags:
      - deploys
      summary: List Project Deploys
      description: 'Project-level deploy listing.


        Without ?branch — returns deploys on the project''s default branch

        environment (production view). With ?branch — narrows to that branch

        environment. Used by `layero deploys list` so the CLI doesn''t have

        to chase environment_id first.


        ?all_environments=true — свежие деплои ВСЕХ окружений проекта одним

        запросом (явная ?branch по-прежнему важнее). Нужен странице «Деплои»

        панели: она опрашивала каждое окружение отдельно раз в 5 секунд, и у

        проекта с 201 окружением одна открытая вкладка давала ~40 запросов в

        секунду — 680 тыс. за 12.09.2026 и 391 тыс. за 20.09, каждый оплачен в

        API Gateway.


        Если окружения дефолтной ветки нет — отдаём деплои по всему проекту, а не

        пустой список. У проекта, залитого через CLI, единственное окружение

        зовётся `cli`, тогда как default_branch остаётся ''main'': выборка по ветке

        возвращала пусто при готовых деплоях, и интерфейс уверял, что деплоя нет

        (аудит отказывался стартовать, DeployWatcher не видел выкаток). Явный

        ?branch по-прежнему сужает строго: там пусто значит пусто.'
      operationId: list_project_deploys_projects__project_id__deploys_get
      parameters:
      - name: project_id
        in: path
        required: true
        schema:
          type: string
          format: uuid
          title: Project Id
      - name: branch
        in: query
        required: false
        schema:
          anyOf:
          - type: string
          - type: 'null'
          title: Branch
      - name: all_environments
        in: query
        required: false
        schema:
          type: boolean
          default: false
          title: All Environments
      - name: authorization
        in: header
        required: false
        schema:
          anyOf:
          - type: string
          - type: 'null'
          title: Authorization
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/DeployOut'
                title: Response List Project Deploys Projects  Project Id  Deploys Get
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /projects/{project_id}/rollback:
    post:
      tags:
      - deploys
      summary: Rollback Project
      description: 'Project-level rollback shortcut for CLI/dashboard.


        Resolves environment from `branch` (or default_branch) and delegates

        to the same rollback machinery as POST /environments/{id}/rollback.

        Lets `layero rollback` work without the CLI having to look up an

        environment_id first.'
      operationId: rollback_project_projects__project_id__rollback_post
      parameters:
      - name: project_id
        in: path
        required: true
        schema:
          type: string
          format: uuid
          title: Project Id
      - name: authorization
        in: header
        required: false
        schema:
          anyOf:
          - type: string
          - type: 'null'
          title: Authorization
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ProjectRollbackRequest'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DeployOut'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /deploys/{deploy_id}:
    get:
      tags:
      - deploys
      summary: Get Deploy
      operationId: get_deploy_deploys__deploy_id__get
      parameters:
      - name: deploy_id
        in: path
        required: true
        schema:
          type: string
          format: uuid
          title: Deploy Id
      - name: authorization
        in: header
        required: false
        schema:
          anyOf:
          - type: string
          - type: 'null'
          title: Authorization
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DeployOut'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /deploys/{deploy_id}/cancel:
    post:
      tags:
      - deploys
      summary: Cancel Deploy
      description: 'User-initiated cancellation of an in-flight deploy.


        Allowed only on `queued`/`building`. The builder process itself

        cannot be killed externally (it''s a YC Serverless Container with

        no public stop API), but `deploys.cancel` sets `finished_at`, and

        `set_status` has a terminal-state guard so the builder''s eventual

        `set_status(''ready'')`/`set_status(''failed'')` becomes a no-op. The

        next `internal/.../activate` call will also see `status=''failed''`

        and refuse to flip the environment, so a cancelled build never

        lands in production even if the builder finishes after the cancel.'
      operationId: cancel_deploy_deploys__deploy_id__cancel_post
      parameters:
      - name: deploy_id
        in: path
        required: true
        schema:
          type: string
          format: uuid
          title: Deploy Id
      - name: authorization
        in: header
        required: false
        schema:
          anyOf:
          - type: string
          - type: 'null'
          title: Authorization
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DeployOut'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /deploys/{deploy_id}/retry:
    post:
      tags:
      - deploys
      summary: Retry Deploy
      description: 'Manually re-queue a failed or cancelled deploy.


        Allowed on the terminal `failed` / `cancelled` states — refuses on

        `queued`/`building` (already in flight) and `ready` (active artifact,

        no sense in re-running). Resets `attempts` so the reaper grants a

        fresh retry budget. The same deploy row is reused (id stays),

        so existing UI links / logs stay valid.


        `cancelled` попал сюда вместе с выделением отмены в отдельный статус

        (08.08.2026): раньше отмена писалась как ''failed'' и повтор работал —

        новый статус не должен молча отбирать эту кнопку.'
      operationId: retry_deploy_deploys__deploy_id__retry_post
      parameters:
      - name: deploy_id
        in: path
        required: true
        schema:
          type: string
          format: uuid
          title: Deploy Id
      - name: authorization
        in: header
        required: false
        schema:
          anyOf:
          - type: string
          - type: 'null'
          title: Authorization
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DeployOut'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /environments/{environment_id}/rollback:
    post:
      tags:
      - deploys
      summary: Rollback Environment
      description: 'Re-activate an older deploy on this environment.


        Mechanics: flips environments.active_deploy_id to the chosen deploy

        (must be ''ready'' with an artifact). No rebuild — the artifact already

        sits in S3 from when the deploy first succeeded. The CDN cache for

        the environment hostname gets purged so users see the rolled-back

        version on the next request.


        Why not "redeploy the old commit": that would re-run npm install

        against today''s npm registry state, which can produce a different

        artifact than the one originally shipped (lockfile drift, transitive

        dep republish, etc). The whole point of rollback is "ship exactly

        what was working before"; rebuilding loses that guarantee.


        Auth: editor on the project. Idempotent on payload.deploy_id —

        rollback to current active is a 400 (caller bug), not a no-op.'
      operationId: rollback_environment_environments__environment_id__rollback_post
      parameters:
      - name: environment_id
        in: path
        required: true
        schema:
          type: string
          format: uuid
          title: Environment Id
      - name: authorization
        in: header
        required: false
        schema:
          anyOf:
          - type: string
          - type: 'null'
          title: Authorization
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RollbackRequest'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DeployOut'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /environments/{environment_id}/probe:
    get:
      tags:
      - deploys
      summary: Probe Environment
      operationId: probe_environment_environments__environment_id__probe_get
      parameters:
      - name: environment_id
        in: path
        required: true
        schema:
          type: string
          format: uuid
          title: Environment Id
      - name: authorization
        in: header
        required: false
        schema:
          anyOf:
          - type: string
          - type: 'null'
          title: Authorization
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProbeOut'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /projects/{project_id}/deploys/{deploy_id}/source:
    get:
      tags:
      - deploys
      summary: Deploy Source
      description: 'Короткая ссылка на ZIP с тем, из чего собран деплой.


        Отдаём ровно загруженное: архив из терминала или файлы из чата. Переменные

        окружения и файлы платформы в него не попадают — их там никогда не было.

        JSON, а не редирект: панель ходит через XHR с токеном, а XHR чужой origin не

        скачает. `?redirect=1` — 302 для curl и прямых ссылок.


        Соединение пула держим только на проверках: перепаковка в ZIP при первом

        скачивании идёт секунды, и держать слот всё это время нельзя.'
      operationId: deploy_source_projects__project_id__deploys__deploy_id__source_get
      parameters:
      - name: project_id
        in: path
        required: true
        schema:
          type: string
          format: uuid
          title: Project Id
      - name: deploy_id
        in: path
        required: true
        schema:
          type: string
          format: uuid
          title: Deploy Id
      - name: redirect
        in: query
        required: false
        schema:
          type: boolean
          default: false
          title: Redirect
      - name: authorization
        in: header
        required: false
        schema:
          anyOf:
          - type: string
          - type: 'null'
          title: Authorization
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DeploySourceOut'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    DeploySourceOut:
      properties:
        url:
          type: string
          title: Url
        filename:
          type: string
          title: Filename
        expires_in:
          type: integer
          title: Expires In
      type: object
      required:
      - url
      - filename
      - expires_in
      title: DeploySourceOut
    RollbackRequest:
      properties:
        deploy_id:
          anyOf:
          - type: string
            format: uuid
          - type: 'null'
          title: Deploy Id
      type: object
      title: RollbackRequest
    ProjectRollbackRequest:
      properties:
        branch:
          anyOf:
          - type: string
          - type: 'null'
          title: Branch
        deploy_id:
          anyOf:
          - type: string
            format: uuid
          - type: 'null'
          title: Deploy Id
      type: object
      title: ProjectRollbackRequest
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    DeployOut:
      properties:
        id:
          type: string
          format: uuid
          title: Id
        environment_id:
          type: string
          format: uuid
          title: Environment Id
        commit_sha:
          type: string
          title: Commit Sha
        commit_message:
          anyOf:
          - type: string
          - type: 'null'
          title: Commit Message
        status:
          type: string
          title: Status
        error_message:
          anyOf:
          - type: string
          - type: 'null'
          title: Error Message
        failure_stage:
          anyOf:
          - type: string
          - type: 'null'
          title: Failure Stage
        current_stage:
          anyOf:
          - type: string
          - type: 'null'
          title: Current Stage
        stage_started_at:
          anyOf:
          - type: string
            format: date-time
          - type: 'null'
          title: Stage Started At
        created_at:
          type: string
          format: date-time
          title: Created At
        started_at:
          anyOf:
          - type: string
            format: date-time
          - type: 'null'
          title: Started At
        finished_at:
          anyOf:
          - type: string
            format: date-time
          - type: 'null'
          title: Finished At
        source_type:
          type: string
          title: Source Type
          default: github
        triggered_by_user_id:
          anyOf:
          - type: string
            format: uuid
          - type: 'null'
          title: Triggered By User Id
        artifact_purged_at:
          anyOf:
          - type: string
            format: date-time
          - type: 'null'
          title: Artifact Purged At
        runtime_version:
          anyOf:
          - additionalProperties: true
            type: object
          - type: 'null'
          title: Runtime Version
        probe:
          anyOf:
          - additionalProperties: true
            type: object
          - type: 'null'
          title: Probe
        servable:
          anyOf:
          - type: boolean
          - type: 'null'
          title: Servable
        candidate_app_dirs:
          items:
            additionalProperties: true
            type: object
          type: array
          title: Candidate App Dirs
          default: []
        preview_evicted:
          items:
            additionalProperties: true
            type: object
          type: array
          title: Preview Evicted
          default: []
        source_download:
          anyOf:
          - additionalProperties: true
            type: object
          - type: 'null'
          title: Source Download
      type: object
      required:
      - id
      - environment_id
      - commit_sha
      - commit_message
      - status
      - error_message
      - failure_stage
      - created_at
      - started_at
      - finished_at
      title: DeployOut
    ProbeOut:
      properties:
        available:
          type: boolean
          title: Available
        status_code:
          anyOf:
          - type: integer
          - type: 'null'
          title: Status Code
        checked_url:
          type: string
          title: Checked Url
        preview_ready:
          type: boolean
          title: Preview Ready
          default: false
        cdn_ready:
          type: boolean
          title: Cdn Ready
          default: false
        cdn_progress:
          anyOf:
          - type: number
          - type: 'null'
          title: Cdn Progress
        cdn_eta_seconds:
          anyOf:
          - type: integer
          - type: 'null'
          title: Cdn Eta Seconds
        canonical_url:
          anyOf:
          - type: string
          - type: 'null'
          title: Canonical Url
        preview_url:
          anyOf:
          - type: string
          - type: 'null'
          title: Preview Url
        hostname_status:
          type: string
          title: Hostname Status
        reason:
          type: string
          title: Reason
      type: object
      required:
      - available
      - status_code
      - checked_url
      - hostname_status
      - reason
      title: ProbeOut
      description: 'Real-world reachability check for a branch''s preview URL.


        Used by the dashboard to gate the "open site" link and the screenshot

        preview: even after a deploy is `ready` in our DB, the CDN edge can

        take a few minutes to propagate the new hostname / artifact, and any

        link the user clicks during that window 404s. We poll this endpoint

        from the UI and only render the link/screenshot when `available=true`.'
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
            - type: string
            - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
      - loc
      - msg
      - type
      title: ValidationError