Estuary Tenants API

The Tenants API from Estuary — 3 operation(s) for tenants.

OpenAPI Specification

estuary-tenants-api-openapi.yml Raw ↑
openapi: 3.0.1
info:
  title: Estuary Flow Control Plane Auth Tenants API
  description: Representative OpenAPI description of the Estuary Flow control plane, a Supabase deployment (Postgres + PostgREST + GoTrue) that exposes the public-facing REST API for Estuary Flow. Clients authenticate with an Authorization Bearer access token, which is obtained by exchanging a long-lived refresh token through the generate_access_token RPC. Most resources are PostgREST tables and RPCs; standard PostgREST query conventions (select, filter operators like eq./gt., order, limit) apply to the table endpoints. Publishing changes to the running data plane is an asynchronous, draft-then-publish workflow. This document is a faithful representative model and is not the vendor's canonical machine-readable contract.
  termsOfService: https://estuary.dev/terms/
  contact:
    name: Estuary Support
    email: support@estuary.dev
  version: '1.0'
servers:
- url: https://api.estuary.dev
  description: Estuary Flow control plane (Supabase/PostgREST)
security:
- bearerAuth: []
tags:
- name: Tenants
paths:
  /tenants:
    get:
      operationId: listTenants
      tags:
      - Tenants
      summary: List tenants (billing/ownership prefixes) the user can access.
      responses:
        '200':
          description: An array of tenants.
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Tenant'
  /catalog_stats:
    get:
      operationId: listCatalogStats
      tags:
      - Tenants
      summary: Read usage statistics (bytes and docs) per catalog entity and grain.
      parameters:
      - name: catalog_name
        in: query
        schema:
          type: string
      - name: grain
        in: query
        schema:
          type: string
          enum:
          - hourly
          - daily
          - monthly
      responses:
        '200':
          description: An array of catalog stat rows.
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/CatalogStat'
  /rpc/billing_report_202308:
    post:
      operationId: billingReport
      tags:
      - Tenants
      summary: Compute the monthly billing estimate for a tenant.
      description: RPC returning the data-movement GB, connector-instance line items, and total for a tenant and billed month.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/BillingReportRequest'
      responses:
        '200':
          description: The billing report.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BillingReport'
components:
  schemas:
    BillingReportRequest:
      type: object
      required:
      - billed_prefix
      - billed_month
      properties:
        billed_prefix:
          type: string
        billed_month:
          type: string
          format: date
    CatalogStat:
      type: object
      properties:
        catalog_name:
          type: string
        grain:
          type: string
          enum:
          - hourly
          - daily
          - monthly
        ts:
          type: string
          format: date-time
        bytes_written_by_me:
          type: integer
        bytes_read_by_me:
          type: integer
        docs_written_by_me:
          type: integer
        docs_read_by_me:
          type: integer
    BillingReport:
      type: object
      properties:
        billed_prefix:
          type: string
        billed_month:
          type: string
        line_items:
          type: array
          items:
            type: object
            properties:
              description:
                type: string
              count:
                type: number
              rate:
                type: number
              subtotal:
                type: number
        total_processed_data_gb:
          type: number
        subtotal:
          type: number
    Tenant:
      type: object
      properties:
        id:
          type: string
        tenant:
          type: string
          description: The tenant prefix, e.g. acmeCo/.
        tasks_quota:
          type: integer
        collections_quota:
          type: integer
        created_at:
          type: string
          format: date-time
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: 'Access token obtained from /rpc/generate_access_token by exchanging a refresh token. Sent as Authorization: Bearer <access_token>.'