Supabase Invocation API

Invoke deployed Edge Functions via HTTP requests. Each function is accessible at its own URL path based on its slug.

OpenAPI Specification

supabase-invocation-api-openapi.yml Raw ↑
openapi: 3.1.0
info:
  title: Supabase Auth Admin Invocation API
  description: The Supabase Auth API (based on GoTrue) is a JWT-based API for managing users and issuing access tokens. It provides endpoints for user signup, signin with email/password, magic links, one-time passwords, OAuth social login, token refresh, user management, multi-factor authentication, and SAML-based single sign-on. When deployed on Supabase, the server requires an apikey header containing a valid Supabase-issued API key.
  version: 2.0.0
  contact:
    name: Supabase Support
    url: https://supabase.com/support
  termsOfService: https://supabase.com/terms
servers:
- url: https://{project_ref}.supabase.co/auth/v1
  description: Supabase Project Auth Server
  variables:
    project_ref:
      description: Your Supabase project reference ID
      default: your-project-ref
security:
- apiKeyAuth: []
tags:
- name: Invocation
  description: Invoke deployed Edge Functions via HTTP requests. Each function is accessible at its own URL path based on its slug.
paths:
  /{function_slug}:
    get:
      operationId: invokeEdgeFunctionGet
      summary: Invoke an Edge Function via GET
      description: Invokes a deployed Edge Function using an HTTP GET request. The function can read query parameters and headers from the request. Authorization is required by default unless JWT verification is disabled for the function.
      tags:
      - Invocation
      parameters:
      - $ref: '#/components/parameters/FunctionSlug'
      responses:
        '200':
          description: Function executed successfully
          content:
            application/json:
              schema:
                type: object
                description: Response from the Edge Function
            text/plain:
              schema:
                type: string
                description: Text response from the Edge Function
        '401':
          description: Unauthorized - missing or invalid JWT
        '404':
          description: Function not found
        '500':
          description: Internal function error
    post:
      operationId: invokeEdgeFunctionPost
      summary: Invoke an Edge Function via POST
      description: Invokes a deployed Edge Function using an HTTP POST request. The function can read the request body, query parameters, and headers. This is the most common invocation method for Edge Functions that process data or trigger actions.
      tags:
      - Invocation
      parameters:
      - $ref: '#/components/parameters/FunctionSlug'
      requestBody:
        content:
          application/json:
            schema:
              type: object
              description: JSON payload to pass to the Edge Function. Structure depends on the specific function implementation.
          text/plain:
            schema:
              type: string
              description: Plain text payload
          multipart/form-data:
            schema:
              type: object
              description: Form data payload
      responses:
        '200':
          description: Function executed successfully
          content:
            application/json:
              schema:
                type: object
                description: Response from the Edge Function
            text/plain:
              schema:
                type: string
        '400':
          description: Bad request - invalid input
        '401':
          description: Unauthorized - missing or invalid JWT
        '404':
          description: Function not found
        '500':
          description: Internal function error
components:
  parameters:
    FunctionSlug:
      name: function_slug
      in: path
      required: true
      description: The URL-friendly slug of the deployed Edge Function to invoke.
      schema:
        type: string
  securitySchemes:
    apiKeyAuth:
      type: apiKey
      in: header
      name: apikey
      description: Supabase project API key (anon key for public operations, service_role key for admin operations).
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: JWT access token obtained from a successful authentication.
externalDocs:
  description: Supabase Auth Documentation
  url: https://supabase.com/docs/guides/auth