Capy snapshots API

The snapshots API from Capy — 1 operation(s) for snapshots.

OpenAPI Specification

capy-snapshots-api-openapi.yml Raw ↑
openapi: 3.1.0
info:
  title: Capy automations snapshots API
  version: 1.0.0
servers:
- url: https://capy.ai/api
security:
- bearerAuth: []
tags:
- name: snapshots
paths:
  /v1/projects/{projectId}/snapshots:
    get:
      operationId: getSnapshots
      summary: Get snapshots setting
      description: Get whether optional Snapshots are enabled for the project. Snapshots are independent from Setup.
      tags:
      - snapshots
      security:
      - bearerAuth: []
      parameters:
      - name: projectId
        in: path
        required: true
        description: Project ID.
        schema:
          type: string
        example: proj_123
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Snapshots'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '422':
          $ref: '#/components/responses/ValidationError'
        '500':
          $ref: '#/components/responses/InternalError'
    patch:
      operationId: updateSnapshots
      summary: Update snapshots setting
      description: Enable or disable optional Snapshots. This does not gate saving or testing Setup.
      tags:
      - snapshots
      security:
      - bearerAuth: []
      parameters:
      - name: projectId
        in: path
        required: true
        description: Project ID.
        schema:
          type: string
        example: proj_123
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateSnapshotsBody'
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UpdateSnapshotsResponse'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '422':
          $ref: '#/components/responses/ValidationError'
        '500':
          $ref: '#/components/responses/InternalError'
components:
  schemas:
    UpdateSnapshotsBody:
      $schema: https://json-schema.org/draft/2020-12/schema
      type: object
      properties:
        enabled:
          type: boolean
      required:
      - enabled
      additionalProperties: false
    UpdateSnapshotsResponse:
      $schema: https://json-schema.org/draft/2020-12/schema
      type: object
      properties:
        enabled:
          type: boolean
        initialBuildId:
          type: string
        reusedSnapshot:
          type: object
          properties:
            snapshotId:
              type: string
            lane:
              type: string
          required:
          - snapshotId
          - lane
          additionalProperties: false
        queuedBehindActiveBuild:
          type: boolean
      required:
      - enabled
      additionalProperties: false
    ErrorResponse:
      $schema: https://json-schema.org/draft/2020-12/schema
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: string
            message:
              type: string
            details: {}
          required:
          - code
          - message
          additionalProperties: false
      required:
      - error
      additionalProperties: false
    Snapshots:
      $schema: https://json-schema.org/draft/2020-12/schema
      type: object
      properties:
        enabled:
          type: boolean
      required:
      - enabled
      additionalProperties: false
  responses:
    InternalError:
      description: Internal error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    Forbidden:
      description: Forbidden
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    ValidationError:
      description: Validation error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    NotFound:
      description: Not found
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    Unauthorized:
      description: Unauthorized
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: API token (capy_xxxx). Generate at capy.ai/settings/tokens