Lathe Actions API

The actions API from Lathe — 10 operation(s) for actions.

GitHub OpenAPI

Operations 10

POST /instances/{instance_id}/actions/reallocate Move memory between the engines now, as the advisor would (400 with the reason… #
POST /instances/{instance_id}/engines/{engine}/actions/restart Restart one engine; the others are untouched #
POST /instances/{instance_id}/engines/{engine}/actions/reset Wipe one engine's data and start it empty (an undo snapshot is kept); the… #
POST /instances/{instance_id}/actions/rotate Rotate a password: one engine's, or every engine's when no engine is named (the… #
POST /instances/{instance_id}/actions/resize Upgrade to a higher plan. #
POST /instances/{instance_id}/actions/downsize Move to a lower plan; the instance moves to a smaller machine, keeping its data… #
POST /instances/{instance_id}/actions/sleep Put an instance to sleep: its data, address and connection details are kept… #
POST /instances/{instance_id}/actions/wake Wake an asleep instance: its machine is built again from its newest snapshot… #
POST /instances/{instance_id}/actions/reset Wipe every engine's data and start empty (a snapshot is kept 7 days) #
POST /instances/{instance_id}/actions/restore Restore a backup in place (a snapshot of the current state is kept 7 days) #

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/lathe-live:lathe-live-actions-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

lathe-live-actions-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Lathe customer Actions API
  description: 'Manage your Lathe instances from code or from an AI agent.


    **Authentication.** Create an API key on the Access page of the portal and send it as

    `Authorization: Bearer lathe_…`. Keys act as the customer who created them; they cannot create or

    revoke other keys.


    **Creating an instance.** Where `GET /plans` offers Free, `POST /instances` with `tier: "free"` creates a $0 instance immediately, with no card or checkout; it returns `checkout_url: null`. Free has 1000 GB outbound traffic per month and no daily backups. A paid plan returns `checkout_url`:

    open it in a browser and pay; the instance is provisioned as soon as the payment page returns and

    the response''s `instance_id` is valid from the start (poll `GET /instances/{id}` - its `status` goes

    `awaiting_payment` → `pending` → `creating` → `running`; `payment_failed` if the card was declined,

    `error` if creation failed). A coupon that covers the whole first month skips the page. Every paid

    purchase goes through the hosted page, card on file or not. Where the trial is offered (`GET /plans` →

    `trial`), a customer''s first Mini starts with a 14-day free trial and the response says `trial: true`.

    With `trial.card = "later"` the instance is created at once (`status: pending`, no `checkout_url`) and it is kept

    from the portal''s billing page before the trial ends; without that it pauses and is deleted a week later. What

    keeping it costs depends on the gateway: where a card can be verified and held, adding one charges nothing and the

    first month is charged when the trial ends; where the provider holds the subscription itself there is no such page,

    so keeping the instance is the purchase and the first month is charged at once, ending the trial there. With

    `trial.card = "start"`, `checkout_url` verifies the card first (a temporary $1 authorisation that is released) and

    the first month is charged when the trial ends.


    **Slow operations are jobs.** Reset, restore, rotate, allowlist, upgrade, SQL console and delete

    answer `202` with a `job_id`; one job runs per instance at a time and the instance answers `409`

    while one is queued or running. Destructive actions (reset, restore, delete) require

    `confirm` to equal the instance id. (The portal asks for the instance''s name instead, since that is what a

    person knows; either is accepted.)


    The same operations are available to AI agents over MCP: the server is the MCP host itself, no path.'
  version: '1.0'
servers:
- url: /api/v1
tags:
- name: Actions
paths:
  /instances/{instance_id}/actions/reallocate:
    post:
      tags:
      - Actions
      summary: Move memory between the engines now, as the advisor would (400 with the reason…
      operationId: reallocate_instances__instance_id__actions_reallocate_post
      parameters:
      - name: instance_id
        in: path
        required: true
        schema:
          type: string
          title: Instance Id
      responses:
        '202':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Accepted'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /instances/{instance_id}/engines/{engine}/actions/restart:
    post:
      tags:
      - Actions
      summary: Restart one engine; the others are untouched
      operationId: engine_restart_instances__instance_id__engines__engine__actions_restart_post
      parameters:
      - name: instance_id
        in: path
        required: true
        schema:
          type: string
          title: Instance Id
      - name: engine
        in: path
        required: true
        schema:
          type: string
          title: Engine
      responses:
        '202':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Accepted'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /instances/{instance_id}/engines/{engine}/actions/reset:
    post:
      tags:
      - Actions
      summary: Wipe one engine's data and start it empty (an undo snapshot is kept); the…
      operationId: engine_reset_instances__instance_id__engines__engine__actions_reset_post
      parameters:
      - name: instance_id
        in: path
        required: true
        schema:
          type: string
          title: Instance Id
      - name: engine
        in: path
        required: true
        schema:
          type: string
          title: Engine
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ConfirmIn'
      responses:
        '202':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Accepted'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /instances/{instance_id}/actions/rotate:
    post:
      tags:
      - Actions
      summary: 'Rotate a password: one engine''s, or every engine''s when no engine is named (the…'
      operationId: rotate_instances__instance_id__actions_rotate_post
      parameters:
      - name: instance_id
        in: path
        required: true
        schema:
          type: string
          title: Instance Id
      requestBody:
        content:
          application/json:
            schema:
              anyOf:
              - $ref: '#/components/schemas/RotateIn'
              - type: 'null'
              title: Body
      responses:
        '202':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Accepted'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /instances/{instance_id}/actions/resize:
    post:
      tags:
      - Actions
      summary: Upgrade to a higher plan.
      operationId: resize_instances__instance_id__actions_resize_post
      parameters:
      - name: instance_id
        in: path
        required: true
        schema:
          type: string
          title: Instance Id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ResizeIn'
      responses:
        '202':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Accepted'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /instances/{instance_id}/actions/downsize:
    post:
      tags:
      - Actions
      summary: Move to a lower plan; the instance moves to a smaller machine, keeping its data…
      description: 'The machine cannot shrink, so the instance is moved onto a smaller one: its data is copied across and its

        address goes with it, so every connection string and every DNS record of yours keeps working. Expect the

        instance to be down for the length of the copy. The daily backups belong to the machine being left and do

        not come along; a snapshot of it is kept, and the new machine''s own daily backups start the next day. The

        unused part of the bigger plan comes back as credit on the

        next invoice, which is the payment provider''s proration and not a refund, and the smaller price applies from then on.'
      operationId: downsize_instances__instance_id__actions_downsize_post
      parameters:
      - name: instance_id
        in: path
        required: true
        schema:
          type: string
          title: Instance Id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DownsizeIn'
      responses:
        '202':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Accepted'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /instances/{instance_id}/actions/sleep:
    post:
      tags:
      - Actions
      summary: 'Put an instance to sleep: its data, address and connection details are kept…'
      description: 'Its engines stop in order, a copy of its whole disk is taken, and its machine is shut down; its address, its

        firewall and its connection details are kept. A client that connects while it sleeps waits and times out.

        Wake it with `actions/wake`, which takes about a minute. The price is the same asleep or awake. On a paid plan

        the daily backups start again at the wake, and the copy taken at the sleep is kept as an undo snapshot.'
      operationId: sleep_instances__instance_id__actions_sleep_post
      parameters:
      - name: instance_id
        in: path
        required: true
        schema:
          type: string
          title: Instance Id
      responses:
        '202':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Accepted'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /instances/{instance_id}/actions/wake:
    post:
      tags:
      - Actions
      summary: 'Wake an asleep instance: its machine is built again from its newest snapshot…'
      operationId: wake_instances__instance_id__actions_wake_post
      parameters:
      - name: instance_id
        in: path
        required: true
        schema:
          type: string
          title: Instance Id
      responses:
        '202':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Accepted'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /instances/{instance_id}/actions/reset:
    post:
      tags:
      - Actions
      summary: Wipe every engine's data and start empty (a snapshot is kept 7 days)
      operationId: reset_instances__instance_id__actions_reset_post
      parameters:
      - name: instance_id
        in: path
        required: true
        schema:
          type: string
          title: Instance Id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ConfirmIn'
      responses:
        '202':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Accepted'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /instances/{instance_id}/actions/restore:
    post:
      tags:
      - Actions
      summary: Restore a backup in place (a snapshot of the current state is kept 7 days)
      operationId: restore_instances__instance_id__actions_restore_post
      parameters:
      - name: instance_id
        in: path
        required: true
        schema:
          type: string
          title: Instance Id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RestoreIn'
      responses:
        '202':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Accepted'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    RestoreIn:
      properties:
        confirm:
          type: string
          title: Confirm
          description: The instance id, typed exactly.
        image_id:
          type: integer
          title: Image Id
          description: A backup or undo-snapshot image id from GET /instances/{id}/backups.
      type: object
      required:
      - confirm
      - image_id
      title: RestoreIn
    Accepted:
      properties:
        status:
          type: string
          enum:
          - queued
          - already_queued
          - removed
          - updated
          title: Status
          default: queued
        job_id:
          anyOf:
          - type: string
          - type: 'null'
          title: Job Id
        instance_id:
          type: string
          title: Instance Id
        message:
          type: string
          title: Message
        job_url:
          anyOf:
          - type: string
          - type: 'null'
          title: Job Url
        checkout_url:
          anyOf:
          - type: string
          - type: 'null'
          title: Checkout Url
          description: 'A free instance''s upgrade: open in a browser and pay the plan''s first month; the upgrade follows the payment.'
        verified:
          anyOf:
          - type: boolean
          - type: 'null'
          title: Verified
          description: 'Registry credentials only: whether the registry took them. Null when there was no image of yours there to try them on.'
        warning:
          anyOf:
          - type: string
          - type: 'null'
          title: Warning
          description: 'Registry credentials only: why the registry refused them, when it did. They are saved either way.'
        cidrs:
          anyOf:
          - items:
              type: string
            type: array
          - type: 'null'
          title: Cidrs
          description: The allowlist as normalised (allowlist only).
        settings:
          anyOf:
          - additionalProperties: true
            type: object
          - type: 'null'
          title: Settings
          description: 'Engine settings only: the whole engine as it will be once the job has run, secrets masked. A read before the job finishes still answers the previous values, so an `add` reads its result here.'
      type: object
      required:
      - job_id
      - instance_id
      - message
      title: Accepted
    RotateIn:
      properties:
        engine:
          anyOf:
          - type: string
          - type: 'null'
          title: Engine
          description: Rotate only this engine's password (postgres, redis, …); omit for every engine on the box.
        confirm:
          type: string
          title: Confirm
          description: The exact change string returned by a refused unconfirmed call. Binds the instance, action, resource and submitted values.
          default: ''
      type: object
      title: RotateIn
    DownsizeIn:
      properties:
        tier:
          type: string
          title: Tier
          description: A lower tier than the current one.
        confirm:
          type: string
          title: Confirm
          description: The instance's name, or its id, typed exactly.
      type: object
      required:
      - tier
      - confirm
      title: DownsizeIn
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ResizeIn:
      properties:
        tier:
          type: string
          title: Tier
          description: A higher tier than the current one.
      type: object
      required:
      - tier
      title: ResizeIn
    ConfirmIn:
      properties:
        confirm:
          type: string
          title: Confirm
          description: The instance id, typed exactly.
      type: object
      required:
      - confirm
      title: ConfirmIn
    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