Layero Logs API

The logs API from Layero — 5 operation(s) for logs.

GitHub OpenAPI

Operations 5

GET /deploys/{deploy_id}/logs Poll Deploy Logs #
POST /deploys/{deploy_id}/logs/stream-ticket Issue Log Stream Ticket #
GET /deploys/{deploy_id}/logs/stream Stream Logs #
GET /deploys/{deploy_id}/diagnosis Deploy Diagnosis #
GET /deploys/{deploy_id}/runtime/logs Runtime Deploy Logs #

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-logs-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-logs-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Layero Logs API
  version: 0.1.0
tags:
- name: Logs
paths:
  /deploys/{deploy_id}/logs:
    get:
      tags:
      - Logs
      summary: Poll Deploy Logs
      description: 'Инкрементальные логи деплоя для polling (прод, работает за API Gateway).


        `wait>0` → long-poll: hold the request open until a new line lands or the

        timeout elapses (NOTIFY-driven, see services/deploy_log_stream), giving

        near-live logs without fixed-interval client polling. No DB connection is

        held while waiting.


        NB: auth + every query run inside short-lived `connection()` blocks — we do

        NOT take `Depends(current_user)`/`Depends(get_conn)`, because those pin a

        pool connection for the WHOLE request (incl. the up-to-25s wait). That was

        the same pool-exhaustion footgun that took down the probe handler (INCIDENT

        2026-06-30): a connection held across a long wait, multiplied by every

        dashboard polling an in-flight deploy, drains the pool. `authenticate()` is

        invoked directly with our short-lived conn (identical auth, no held conn).'
      operationId: poll_deploy_logs_deploys__deploy_id__logs_get
      parameters:
      - name: deploy_id
        in: path
        required: true
        schema:
          type: string
          format: uuid
          title: Deploy Id
      - name: after_id
        in: query
        required: false
        schema:
          type: integer
          minimum: 0
          default: 0
          title: After Id
      - name: wait
        in: query
        required: false
        schema:
          type: integer
          maximum: 25
          minimum: 0
          description: seconds to hold the request open for new lines (0 = return immediately)
          default: 0
          title: Wait
        description: seconds to hold the request open for new lines (0 = return immediately)
      - 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/DeployLogsPollOut'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /deploys/{deploy_id}/logs/stream-ticket:
    post:
      tags:
      - Logs
      summary: Issue Log Stream Ticket
      description: 'Выдать короткоживущий билет для `GET …/logs/stream`.


        🚨 Зачем ручка вообще есть. Поток логов принимает токен query-параметром —

        уважительно, `EventSource` не умеет ставить заголовки. Но раньше это был

        обычный сессионный JWT на 168 часов, а nginx пишет полную строку запроса

        в `access_log`, который в контейнере уходит в /dev/stdout и оседает в

        docker-логах хоста открытым текстом, попадая в любую отгрузку логов.


        Замер на проде за сутки: вхождений `token=eyJ` — НОЛЬ. Панель ходит

        опросом, `EventSource` в исходниках фронтенда не встречается ни разу. То

        есть механизм был, дорогу не поехали. Чинится до того, как поедут: иначе

        вернувшийся SSE, CLI или MCP начали бы писать сессионные токены в логи

        молча, без единого признака.


        Билет живёт две минуты и годен ровно для этого деплоя. Выдаётся по

        `Authorization`-заголовку — то есть сессионный токен в query-строку не

        попадает никогда. ИБ-ревью 07.08.2026, T-20260807-33.'
      operationId: issue_log_stream_ticket_deploys__deploy_id__logs_stream_ticket_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/StreamTicketOut'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /deploys/{deploy_id}/logs/stream:
    get:
      tags:
      - Logs
      summary: Stream Logs
      operationId: stream_logs_deploys__deploy_id__logs_stream_get
      parameters:
      - name: deploy_id
        in: path
        required: true
        schema:
          type: string
          format: uuid
          title: Deploy Id
      - name: token
        in: query
        required: true
        schema:
          type: string
          description: Short-lived stream ticket from POST …/logs/stream-ticket (EventSource can't set headers). NOT a session JWT.
          title: Token
        description: Short-lived stream ticket from POST …/logs/stream-ticket (EventSource can't set headers). NOT a session JWT.
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /deploys/{deploy_id}/diagnosis:
    get:
      tags:
      - Logs
      summary: Deploy Diagnosis
      description: 'Почему деплой в таком состоянии — один вызов вместо четырёх.


        Собирает карточку деплоя, окрестность ошибки в логе сборки, хвост

        рантайм-лога и состояние инстанса. Ответ намеренно held в единицах

        килобайт: он предназначен агенту, у которого контекст конечен, а не

        человеку с бесконечной прокруткой.


        Рантайм берём из durable-истории, БЕЗ живого docker-tail: диагностика

        нужна ровно тогда, когда приложение не поднялось, то есть когда ноду

        спрашивать бесполезно, а история уже всё записала.'
      operationId: deploy_diagnosis_deploys__deploy_id__diagnosis_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/DeployDiagnosisOut'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /deploys/{deploy_id}/runtime/logs:
    get:
      tags:
      - Logs
      summary: Runtime Deploy Logs
      description: 'Логи runtime-приложения КОНКРЕТНОГО деплоя. runtime_logs и

        runtime_instances ключуются по deploy_id — окружения ни при чём: у каждого

        деплоя свои логи. durable-история (переживает контейнер) + живой

        docker-tail, если ЭТОТ деплой сейчас запущен, слитые в один терминал-поток;

        истории нет — cold.'
      operationId: runtime_deploy_logs_deploys__deploy_id__runtime_logs_get
      parameters:
      - name: deploy_id
        in: path
        required: true
        schema:
          type: string
          format: uuid
          title: Deploy Id
      - name: tail
        in: query
        required: false
        schema:
          type: integer
          maximum: 2000
          minimum: 1
          default: 100
          title: Tail
      - 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/RuntimeLogsOut'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    StreamTicketOut:
      properties:
        ticket:
          type: string
          title: Ticket
        expires_in:
          type: integer
          title: Expires In
      type: object
      required:
      - ticket
      - expires_in
      title: StreamTicketOut
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    DeployLogsPollOut:
      properties:
        lines:
          items:
            $ref: '#/components/schemas/LogLineOut'
          type: array
          title: Lines
        last_id:
          anyOf:
          - type: integer
          - type: 'null'
          title: Last Id
        status:
          type: string
          title: Status
        error_message:
          anyOf:
          - type: string
          - type: 'null'
          title: Error Message
        s3_path:
          anyOf:
          - type: string
          - type: 'null'
          title: S3 Path
        terminal:
          type: boolean
          title: Terminal
        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
        queue:
          anyOf:
          - additionalProperties: true
            type: object
          - type: 'null'
          title: Queue
        queue_message:
          anyOf:
          - type: string
          - type: 'null'
          title: Queue Message
      type: object
      required:
      - lines
      - last_id
      - status
      - error_message
      - s3_path
      - terminal
      - current_stage
      - stage_started_at
      title: DeployLogsPollOut
    DeployDiagnosisOut:
      properties:
        deploy_id:
          type: string
          title: Deploy Id
        status:
          anyOf:
          - type: string
          - type: 'null'
          title: Status
        stage:
          anyOf:
          - type: string
          - type: 'null'
          title: Stage
        verdict:
          anyOf:
          - type: string
          - type: 'null'
          title: Verdict
        build_log_excerpt:
          items:
            type: string
          type: array
          title: Build Log Excerpt
        build_error_found:
          type: boolean
          title: Build Error Found
        runtime_log_excerpt:
          items:
            type: string
          type: array
          title: Runtime Log Excerpt
        runtime_error_found:
          type: boolean
          title: Runtime Error Found
        runtime_state:
          anyOf:
          - type: string
          - type: 'null'
          title: Runtime State
        next_actions:
          items:
            type: string
          type: array
          title: Next Actions
        truncated:
          type: boolean
          title: Truncated
        queue:
          anyOf:
          - additionalProperties: true
            type: object
          - type: 'null'
          title: Queue
      type: object
      required:
      - deploy_id
      - status
      - stage
      - verdict
      - build_log_excerpt
      - build_error_found
      - runtime_log_excerpt
      - runtime_error_found
      - runtime_state
      - next_actions
      - truncated
      title: DeployDiagnosisOut
      description: Диагностика деплоя одним ответом (AGENT-07).
    LogLineOut:
      properties:
        id:
          type: integer
          title: Id
        stream:
          type: string
          title: Stream
        line:
          type: string
          title: Line
        stage:
          anyOf:
          - type: string
          - type: 'null'
          title: Stage
        created_at:
          type: string
          format: date-time
          title: Created At
      type: object
      required:
      - id
      - stream
      - line
      - created_at
      title: LogLineOut
    RuntimeLogLine:
      properties:
        ts:
          anyOf:
          - type: string
          - type: 'null'
          title: Ts
        text:
          type: string
          title: Text
      type: object
      required:
      - text
      title: RuntimeLogLine
    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
    RuntimeLogsOut:
      properties:
        status:
          type: string
          title: Status
        lines:
          items:
            $ref: '#/components/schemas/RuntimeLogLine'
          type: array
          title: Lines
      type: object
      required:
      - status
      - lines
      title: RuntimeLogsOut