xhostd Postgres API

The Postgres API from xhostd — 2 operation(s) for postgres.

GitHub OpenAPI
Pull this API's OpenAPI, operations, scores and pricing into your own code or AI agent with a free APIs.io key — sign in with GitHub, Google or LinkedIn. No form to fill in; signing in shares your email address with us (Privacy).

Operations 2

GET /postgres/restores/{restore_id} Get Postgres Restore #
GET /postgres/restores/{restore_id}.json Postgres Restore Json #

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/xhostd-com:xhostd-com-postgres-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

xhostd-com-postgres-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Xhostd Com Postgres API
  version: 0.1.0
  description: 'Operations tagged Postgres across 2 of this provider''s published API definitions: api.xhostd.com-openapi.json, console.xhostd.com-openapi.json. Each path carries the servers of the definition it was published in.'
tags:
- name: Postgres
paths:
  /postgres/restores/{restore_id}:
    get:
      summary: Get Postgres Restore
      description: 'Report one restore of a channel''s database.


        A member of the restore''s channel reads it. A restore that does not

        exist, that the 30-day ledger prune removed, whose channel is gone,

        or whose channel the caller cannot reach answers the same 404

        ``restore_not_found``, so the route confirms no other tenant''s

        restore. The route only reads, so it runs on ``run_read_in_thread``.'
      operationId: get_postgres_restore_postgres_restores__restore_id__get
      parameters:
      - name: restore_id
        in: path
        required: true
        schema:
          type: string
          format: uuid
          title: Restore 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/RestoreStatusResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      tags:
      - Postgres
  /postgres/restores/{restore_id}.json:
    get:
      summary: Postgres Restore Json
      description: 'JSON poll for one database restore (the ``exports.json`` precedent).


        The Database page polls it while a restore runs. xhostd authorizes

        the cookie-as-bearer by channel membership, so a restore the caller

        cannot read answers 404.'
      operationId: postgres_restore_json_postgres_restores__restore_id__json_get
      parameters:
      - name: restore_id
        in: path
        required: true
        schema:
          type: string
          format: uuid
          title: Restore Id
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      tags:
      - Postgres
components:
  schemas:
    RestoreProgress:
      properties:
        phase:
          anyOf:
          - type: string
          - type: 'null'
          title: Phase
        bytes:
          anyOf:
          - type: integer
          - type: 'null'
          title: Bytes
        segments:
          anyOf:
          - type: integer
          - type: 'null'
          title: Segments
        waiting:
          anyOf:
          - type: string
          - type: 'null'
          title: Waiting
        items_done:
          anyOf:
          - type: integer
          - type: 'null'
          title: Items Done
        items_total:
          anyOf:
          - type: integer
          - type: 'null'
          title: Items Total
      type: object
      required:
      - phase
      - bytes
      - segments
      - waiting
      - items_done
      - items_total
      title: RestoreProgress
      description: 'How far a restore''s current step got.


        While the restore extracts, ``phase`` names the extract''s phase:

        ``fetch``, ``refetch``, ``replay``, or ``dump``. ``bytes`` counts the

        bytes the database server has fetched from the backup, or written to

        the snapshot''s dump, so far, and ``segments`` counts the log files

        the ``replay`` phase has replayed. ``waiting`` names why the extract

        waits for the database server, such as ``extraction_busy``.

        ``items_done`` of ``items_total`` counts the snapshot''s entries

        loaded. A field the step does not report is null.'
    RestoreStatusResponse:
      properties:
        restore_id:
          type: string
          format: uuid
          title: Restore Id
        app_id:
          type: string
          format: uuid
          title: App Id
        channel_id:
          type: string
          format: uuid
          title: Channel Id
        snapshot_id:
          type: string
          format: uuid
          title: Snapshot Id
        during_restore:
          $ref: '#/components/schemas/DuringRestore'
        maintenance_channel_id:
          anyOf:
          - type: string
            format: uuid
          - type: 'null'
          title: Maintenance Channel Id
        status:
          type: string
          enum:
          - queued
          - extracting
          - loading
          - swapping
          - succeeded
          - failed
          title: Status
        waiting:
          anyOf:
          - type: string
          - type: 'null'
          title: Waiting
        queue_ahead:
          anyOf:
          - type: integer
          - type: 'null'
          title: Queue Ahead
        activity:
          anyOf:
          - type: string
          - type: 'null'
          title: Activity
        progress:
          anyOf:
          - $ref: '#/components/schemas/RestoreProgress'
          - type: 'null'
        error_code:
          anyOf:
          - type: string
          - type: 'null'
          title: Error Code
        message:
          anyOf:
          - type: string
          - type: 'null'
          title: Message
        notice:
          type: string
          title: Notice
        submitted_at:
          type: string
          format: date-time
          title: Submitted At
        started_at:
          anyOf:
          - type: string
            format: date-time
          - type: 'null'
          title: Started At
        updated_at:
          type: string
          format: date-time
          title: Updated At
        finished_at:
          anyOf:
          - type: string
            format: date-time
          - type: 'null'
          title: Finished At
      type: object
      required:
      - restore_id
      - app_id
      - channel_id
      - snapshot_id
      - during_restore
      - maintenance_channel_id
      - status
      - waiting
      - queue_ahead
      - activity
      - progress
      - error_code
      - message
      - notice
      - submitted_at
      - started_at
      - updated_at
      - finished_at
      title: RestoreStatusResponse
      description: 'One restore of a channel''s database.


        ``status`` is ``queued``, ``extracting``, ``loading``, ``swapping``,

        ``succeeded``, or ``failed``. ``queued`` also covers a restore that

        has started and puts the read-only hold on, so a surface shows

        ``activity`` and ``waiting`` rather than the word "queued".

        ``during_restore`` is the mode the request chose, ``read_only``,

        ``maintenance``, or ``live``, and ``maintenance_channel_id`` the

        static channel a ``maintenance`` restore''s page shows, null for the

        platform''s page. While the restore is active, ``waiting`` names why

        it waits, ``queue_ahead`` counts the restores before a ``received``

        one on its database server, and ``activity`` says in one plain

        sentence what it does now (``postgres/api.py::restore_queue_state``);

        each is null when it does not apply. ``error_code`` is set on a

        failed restore, and ``message`` says why in plain words. ``notice``

        is the mode''s sentence from :data:`RESTORE_MODE_NOTICES`.'
    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
    DuringRestore:
      type: string
      enum:
      - read_only
      - maintenance
      - live
      title: DuringRestore
      description: 'What the channel''s app can do with its database while the restore

        runs, from the claim to the swap.


        ``read_only``: the ``hold`` step makes every new transaction of

        ``r_<ch32>`` in ``ch_<ch32>`` read-only, so a write fails with

        SQLSTATE 25006 rather than vanish at the swap. ``maintenance``: the

        same hold, and the edge serves a page in place of the app

        (``restore_dispatch.py::project_maintenance``), the restore''s

        ``maintenance_channel_id`` parameter naming a static channel for the

        page or ``None`` for the platform''s own. ``live``: the app keeps writing, and the swap

        discards those writes.'
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
x-refined-from:
- api.xhostd.com-openapi.json
- console.xhostd.com-openapi.json