Xano Metadata Auth & Access API

Identify the authenticated user and enumerate accessible workspaces. The Metadata API is authenticated with scoped Bearer access tokens generated from instance settings with CRUD permission scopes.

OpenAPI Specification

xano-openapi.yml Raw ↑
openapi: 3.0.1
info:
  title: Xano Metadata API
  description: >-
    The Xano Metadata API lets you programmatically manage the contents of a Xano
    workspace - database tables, column schema, indexes, table records (content),
    files, branches, API groups and their endpoints. It is served from each Xano
    instance at the templated host below, appended with the `/api:meta` path, and
    is authenticated with scoped Bearer access tokens generated from instance
    settings. Separately, each user-built API group in a workspace auto-generates
    its own OpenAPI/Swagger document served at that group's `/api:{token}` path;
    those generated, per-workspace specifications are not enumerated here.
  termsOfService: https://www.xano.com/legal/
  contact:
    name: Xano Support
    url: https://docs.xano.com/xano-features/metadata-api
  version: '1.0'
servers:
  - url: https://{instance}.xano.io/api:meta
    description: >-
      Per-instance Metadata API base URL. Replace {instance} with your Xano
      instance subdomain (for example, x1a2-b3c4-d5e6). The host varies per
      account and region; copy the exact instance domain from your Xano
      instance settings.
    variables:
      instance:
        default: your-instance
        description: Your Xano instance subdomain.
security:
  - bearerAuth: []
tags:
  - name: Auth
    description: Authenticated user and accessible workspaces.
  - name: Workspace
    description: Workspace details, branches, import/export.
  - name: Tables
    description: Database tables, schema, and indexes.
  - name: Content
    description: Table records (database content) CRUD and search.
  - name: Files
    description: Workspace file library.
  - name: API Groups
    description: API groups, their endpoints, and generated OpenAPI.
paths:
  /auth/me:
    get:
      operationId: getAuthenticatedUser
      tags:
        - Auth
      summary: Retrieve the authenticated user.
      responses:
        '200':
          description: The user associated with the supplied access token.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/User'
        '401':
          $ref: '#/components/responses/Unauthorized'
  /workspace:
    get:
      operationId: listWorkspaces
      tags:
        - Workspace
      summary: List workspaces accessible to the token.
      responses:
        '200':
          description: An array of workspaces.
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Workspace'
        '401':
          $ref: '#/components/responses/Unauthorized'
  /workspace/{workspace_id}:
    get:
      operationId: getWorkspace
      tags:
        - Workspace
      summary: Retrieve workspace details.
      parameters:
        - $ref: '#/components/parameters/WorkspaceId'
      responses:
        '200':
          description: Workspace details.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Workspace'
        '404':
          $ref: '#/components/responses/NotFound'
  /workspace/{workspace_id}/branch:
    get:
      operationId: listBranches
      tags:
        - Workspace
      summary: List branches in the workspace.
      parameters:
        - $ref: '#/components/parameters/WorkspaceId'
      responses:
        '200':
          description: An array of branches.
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Branch'
  /workspace/{workspace_id}/branch/{branch_id}:
    delete:
      operationId: deleteBranch
      tags:
        - Workspace
      summary: Delete a branch.
      parameters:
        - $ref: '#/components/parameters/WorkspaceId'
        - $ref: '#/components/parameters/BranchId'
      responses:
        '200':
          $ref: '#/components/responses/Success'
        '404':
          $ref: '#/components/responses/NotFound'
  /workspace/{workspace_id}/export-schema:
    post:
      operationId: exportWorkspaceSchema
      tags:
        - Workspace
      summary: Export the workspace schema.
      parameters:
        - $ref: '#/components/parameters/WorkspaceId'
      responses:
        '200':
          $ref: '#/components/responses/Success'
  /workspace/{workspace_id}/export:
    post:
      operationId: exportWorkspace
      tags:
        - Workspace
      summary: Export the workspace schema and data as an archive.
      parameters:
        - $ref: '#/components/parameters/WorkspaceId'
      responses:
        '200':
          $ref: '#/components/responses/Success'
  /workspace/{workspace_id}/files:
    get:
      operationId: listFiles
      tags:
        - Files
      summary: List files in the workspace file library.
      parameters:
        - $ref: '#/components/parameters/WorkspaceId'
        - name: page
          in: query
          schema:
            type: integer
        - name: per_page
          in: query
          schema:
            type: integer
      responses:
        '200':
          description: A paginated list of files.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FileList'
  /workspace/{workspace_id}/files/upload:
    post:
      operationId: uploadFile
      tags:
        - Files
      summary: Upload a file to the workspace file library.
      parameters:
        - $ref: '#/components/parameters/WorkspaceId'
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              type: object
              properties:
                content:
                  type: string
                  format: binary
      responses:
        '200':
          description: The uploaded file resource.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/File'
  /workspace/{workspace_id}/files/{file_id}:
    delete:
      operationId: deleteFile
      tags:
        - Files
      summary: Delete a file.
      parameters:
        - $ref: '#/components/parameters/WorkspaceId'
        - name: file_id
          in: path
          required: true
          schema:
            type: integer
      responses:
        '200':
          $ref: '#/components/responses/Success'
  /workspace/{workspace_id}/files/delete-batch:
    post:
      operationId: deleteFilesBatch
      tags:
        - Files
      summary: Delete multiple files.
      parameters:
        - $ref: '#/components/parameters/WorkspaceId'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                file_ids:
                  type: array
                  items:
                    type: integer
      responses:
        '200':
          $ref: '#/components/responses/Success'
  /workspace/{workspace_id}/table:
    get:
      operationId: listTables
      tags:
        - Tables
      summary: List database tables in the workspace.
      parameters:
        - $ref: '#/components/parameters/WorkspaceId'
      responses:
        '200':
          description: An array of tables.
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Table'
    post:
      operationId: createTable
      tags:
        - Tables
      summary: Create a database table.
      parameters:
        - $ref: '#/components/parameters/WorkspaceId'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TableCreate'
      responses:
        '200':
          description: The created table.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Table'
        '400':
          $ref: '#/components/responses/BadRequest'
  /workspace/{workspace_id}/table/{table_id}:
    get:
      operationId: getTable
      tags:
        - Tables
      summary: Retrieve table details.
      parameters:
        - $ref: '#/components/parameters/WorkspaceId'
        - $ref: '#/components/parameters/TableId'
      responses:
        '200':
          description: Table details.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Table'
        '404':
          $ref: '#/components/responses/NotFound'
    patch:
      operationId: updateTable
      tags:
        - Tables
      summary: Update table properties.
      parameters:
        - $ref: '#/components/parameters/WorkspaceId'
        - $ref: '#/components/parameters/TableId'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TableCreate'
      responses:
        '200':
          description: The updated table.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Table'
    delete:
      operationId: deleteTable
      tags:
        - Tables
      summary: Delete a table.
      parameters:
        - $ref: '#/components/parameters/WorkspaceId'
        - $ref: '#/components/parameters/TableId'
      responses:
        '200':
          $ref: '#/components/responses/Success'
  /workspace/{workspace_id}/table/{table_id}/schema:
    get:
      operationId: getTableSchema
      tags:
        - Tables
      summary: Retrieve the full schema of a table.
      parameters:
        - $ref: '#/components/parameters/WorkspaceId'
        - $ref: '#/components/parameters/TableId'
      responses:
        '200':
          description: The table schema (array of columns).
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Column'
    put:
      operationId: replaceTableSchema
      tags:
        - Tables
      summary: Replace the entire schema of a table.
      parameters:
        - $ref: '#/components/parameters/WorkspaceId'
        - $ref: '#/components/parameters/TableId'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                schema:
                  type: array
                  items:
                    $ref: '#/components/schemas/Column'
      responses:
        '200':
          $ref: '#/components/responses/Success'
  /workspace/{workspace_id}/table/{table_id}/schema/{column_id}:
    get:
      operationId: getColumn
      tags:
        - Tables
      summary: Retrieve a single column.
      parameters:
        - $ref: '#/components/parameters/WorkspaceId'
        - $ref: '#/components/parameters/TableId'
        - $ref: '#/components/parameters/ColumnId'
      responses:
        '200':
          description: The column.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Column'
    patch:
      operationId: renameColumn
      tags:
        - Tables
      summary: Rename or update a column.
      parameters:
        - $ref: '#/components/parameters/WorkspaceId'
        - $ref: '#/components/parameters/TableId'
        - $ref: '#/components/parameters/ColumnId'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Column'
      responses:
        '200':
          $ref: '#/components/responses/Success'
    delete:
      operationId: deleteColumn
      tags:
        - Tables
      summary: Delete a column.
      parameters:
        - $ref: '#/components/parameters/WorkspaceId'
        - $ref: '#/components/parameters/TableId'
        - $ref: '#/components/parameters/ColumnId'
      responses:
        '200':
          $ref: '#/components/responses/Success'
  /workspace/{workspace_id}/table/{table_id}/index:
    get:
      operationId: listIndexes
      tags:
        - Tables
      summary: List the indexes of a table.
      parameters:
        - $ref: '#/components/parameters/WorkspaceId'
        - $ref: '#/components/parameters/TableId'
      responses:
        '200':
          description: An array of indexes.
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Index'
    put:
      operationId: replaceIndexes
      tags:
        - Tables
      summary: Replace the indexes of a table.
      parameters:
        - $ref: '#/components/parameters/WorkspaceId'
        - $ref: '#/components/parameters/TableId'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: array
              items:
                $ref: '#/components/schemas/Index'
      responses:
        '200':
          $ref: '#/components/responses/Success'
  /workspace/{workspace_id}/table/{table_id}/content:
    get:
      operationId: listRecords
      tags:
        - Content
      summary: Browse table records (paginated).
      parameters:
        - $ref: '#/components/parameters/WorkspaceId'
        - $ref: '#/components/parameters/TableId'
        - name: page
          in: query
          schema:
            type: integer
        - name: per_page
          in: query
          schema:
            type: integer
      responses:
        '200':
          description: A paginated list of records.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RecordList'
    post:
      operationId: createRecord
      tags:
        - Content
      summary: Create a table record.
      parameters:
        - $ref: '#/components/parameters/WorkspaceId'
        - $ref: '#/components/parameters/TableId'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Record'
      responses:
        '200':
          description: The created record.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Record'
  /workspace/{workspace_id}/table/{table_id}/content/bulk:
    post:
      operationId: createRecordsBulk
      tags:
        - Content
      summary: Create multiple records in one call.
      parameters:
        - $ref: '#/components/parameters/WorkspaceId'
        - $ref: '#/components/parameters/TableId'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                items:
                  type: array
                  items:
                    $ref: '#/components/schemas/Record'
      responses:
        '200':
          $ref: '#/components/responses/Success'
  /workspace/{workspace_id}/table/{table_id}/content/{record_id}:
    get:
      operationId: getRecord
      tags:
        - Content
      summary: Retrieve a single record.
      parameters:
        - $ref: '#/components/parameters/WorkspaceId'
        - $ref: '#/components/parameters/TableId'
        - $ref: '#/components/parameters/RecordId'
      responses:
        '200':
          description: The record.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Record'
        '404':
          $ref: '#/components/responses/NotFound'
    patch:
      operationId: updateRecord
      tags:
        - Content
      summary: Update a single record.
      parameters:
        - $ref: '#/components/parameters/WorkspaceId'
        - $ref: '#/components/parameters/TableId'
        - $ref: '#/components/parameters/RecordId'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Record'
      responses:
        '200':
          description: The updated record.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Record'
    delete:
      operationId: deleteRecord
      tags:
        - Content
      summary: Delete a single record.
      parameters:
        - $ref: '#/components/parameters/WorkspaceId'
        - $ref: '#/components/parameters/TableId'
        - $ref: '#/components/parameters/RecordId'
      responses:
        '200':
          $ref: '#/components/responses/Success'
  /workspace/{workspace_id}/table/{table_id}/content/search:
    post:
      operationId: searchRecords
      tags:
        - Content
      summary: Search records with filtering, sorting, and pagination.
      parameters:
        - $ref: '#/components/parameters/WorkspaceId'
        - $ref: '#/components/parameters/TableId'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SearchRequest'
      responses:
        '200':
          description: Matching records.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RecordList'
  /workspace/{workspace_id}/apigroup:
    get:
      operationId: listApiGroups
      tags:
        - API Groups
      summary: List API groups in the workspace.
      parameters:
        - $ref: '#/components/parameters/WorkspaceId'
      responses:
        '200':
          description: An array of API groups.
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/ApiGroup'
    post:
      operationId: createApiGroup
      tags:
        - API Groups
      summary: Create an API group.
      parameters:
        - $ref: '#/components/parameters/WorkspaceId'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ApiGroup'
      responses:
        '200':
          description: The created API group.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiGroup'
  /workspace/{workspace_id}/apigroup/{apigroup_id}:
    get:
      operationId: getApiGroup
      tags:
        - API Groups
      summary: Retrieve an API group.
      parameters:
        - $ref: '#/components/parameters/WorkspaceId'
        - $ref: '#/components/parameters/ApiGroupId'
      responses:
        '200':
          description: The API group.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiGroup'
    delete:
      operationId: deleteApiGroup
      tags:
        - API Groups
      summary: Delete an API group.
      parameters:
        - $ref: '#/components/parameters/WorkspaceId'
        - $ref: '#/components/parameters/ApiGroupId'
      responses:
        '200':
          $ref: '#/components/responses/Success'
  /workspace/{workspace_id}/apigroup/{apigroup_id}/openapi:
    get:
      operationId: getApiGroupOpenApi
      tags:
        - API Groups
      summary: Retrieve the auto-generated OpenAPI document for an API group.
      description: >-
        Returns the OpenAPI/Swagger specification that Xano generates for the
        user-built endpoints in this API group.
      parameters:
        - $ref: '#/components/parameters/WorkspaceId'
        - $ref: '#/components/parameters/ApiGroupId'
      responses:
        '200':
          description: The generated OpenAPI document.
          content:
            application/json:
              schema:
                type: object
                additionalProperties: true
  /workspace/{workspace_id}/apigroup/{apigroup_id}/api:
    get:
      operationId: listApiEndpoints
      tags:
        - API Groups
      summary: List endpoints in an API group.
      parameters:
        - $ref: '#/components/parameters/WorkspaceId'
        - $ref: '#/components/parameters/ApiGroupId'
      responses:
        '200':
          description: An array of endpoints.
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/ApiEndpoint'
    post:
      operationId: createApiEndpoint
      tags:
        - API Groups
      summary: Create an endpoint in an API group.
      parameters:
        - $ref: '#/components/parameters/WorkspaceId'
        - $ref: '#/components/parameters/ApiGroupId'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ApiEndpoint'
      responses:
        '200':
          description: The created endpoint.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiEndpoint'
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        Scoped Metadata API access token generated from your Xano instance
        settings (Instances > Metadata API > Manage Access Tokens). Sent as
        `Authorization: Bearer <token>`.
  parameters:
    WorkspaceId:
      name: workspace_id
      in: path
      required: true
      schema:
        type: integer
    BranchId:
      name: branch_id
      in: path
      required: true
      schema:
        type: string
    TableId:
      name: table_id
      in: path
      required: true
      schema:
        type: integer
    ColumnId:
      name: column_id
      in: path
      required: true
      schema:
        type: string
    RecordId:
      name: record_id
      in: path
      required: true
      schema:
        type: integer
    ApiGroupId:
      name: apigroup_id
      in: path
      required: true
      schema:
        type: integer
  responses:
    Success:
      description: The operation succeeded.
      content:
        application/json:
          schema:
            type: object
            additionalProperties: true
    BadRequest:
      description: Input error.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    Unauthorized:
      description: Missing or invalid access token.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    NotFound:
      description: Resource not found.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  schemas:
    User:
      type: object
      properties:
        id:
          type: integer
        name:
          type: string
        email:
          type: string
    Workspace:
      type: object
      properties:
        id:
          type: integer
        name:
          type: string
        description:
          type: string
    Branch:
      type: object
      properties:
        id:
          type: string
        label:
          type: string
        live:
          type: boolean
    Table:
      type: object
      properties:
        id:
          type: integer
        name:
          type: string
        description:
          type: string
        auth:
          type: boolean
        created_at:
          type: string
    TableCreate:
      type: object
      required:
        - name
      properties:
        name:
          type: string
        description:
          type: string
        auth:
          type: boolean
    Column:
      type: object
      properties:
        id:
          type: string
        name:
          type: string
        type:
          type: string
          description: Xano column type (text, int, decimal, bool, timestamp, email, json, etc.).
        nullable:
          type: boolean
        required:
          type: boolean
        default:
          nullable: true
    Index:
      type: object
      properties:
        type:
          type: string
          description: Index type (btree, gin, unique, primary, search, etc.).
        fields:
          type: array
          items:
            type: object
            properties:
              name:
                type: string
              op:
                type: string
    Record:
      type: object
      additionalProperties: true
      description: A table record; properties correspond to the table's columns.
    RecordList:
      type: object
      properties:
        items:
          type: array
          items:
            $ref: '#/components/schemas/Record'
        itemsReceived:
          type: integer
        itemsTotal:
          type: integer
        pageTotal:
          type: integer
        curPage:
          type: integer
        nextPage:
          type: integer
          nullable: true
        prevPage:
          type: integer
          nullable: true
    SearchRequest:
      type: object
      properties:
        page:
          type: integer
        per_page:
          type: integer
        sort:
          type: object
          additionalProperties:
            type: string
        search:
          type: array
          items:
            type: object
    FileList:
      type: object
      properties:
        items:
          type: array
          items:
            $ref: '#/components/schemas/File'
        itemsTotal:
          type: integer
    File:
      type: object
      properties:
        id:
          type: integer
        name:
          type: string
        path:
          type: string
        type:
          type: string
        size:
          type: integer
        mime:
          type: string
    ApiGroup:
      type: object
      properties:
        id:
          type: integer
        name:
          type: string
        description:
          type: string
        canonical:
          type: string
          description: "The /api: path token under which this group's endpoints are served."
        swagger:
          type: boolean
    ApiEndpoint:
      type: object
      properties:
        id:
          type: integer
        name:
          type: string
        verb:
          type: string
          description: HTTP method (GET, POST, PUT, PATCH, DELETE).
        path:
          type: string
    Error:
      type: object
      properties:
        code:
          type: string
        message:
          type: string
        payload:
          nullable: true