Supabase Secrets API

Manage project secrets used by Edge Functions and other services.

OpenAPI Specification

supabase-secrets-api-openapi.yml Raw ↑
openapi: 3.1.0
info:
  title: Supabase Auth Admin Secrets 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: Secrets
  description: Manage project secrets used by Edge Functions and other services.
paths:
  /projects/{ref}/secrets:
    get:
      operationId: listSecrets
      summary: List project secrets
      description: Returns a list of all encrypted secrets stored for a project. Secret values are not returned, only their names.
      tags:
      - Secrets
      parameters:
      - $ref: '#/components/parameters/ProjectRef'
      responses:
        '200':
          description: Successfully retrieved secrets
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Secret'
        '401':
          description: Unauthorized
        '404':
          description: Project not found
    post:
      operationId: createSecrets
      summary: Create project secrets
      description: Creates one or more encrypted secrets for the project. These secrets are available to Edge Functions as environment variables.
      tags:
      - Secrets
      parameters:
      - $ref: '#/components/parameters/ProjectRef'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: array
              items:
                $ref: '#/components/schemas/CreateSecretRequest'
      responses:
        '201':
          description: Secrets created successfully
        '400':
          description: Bad request
        '401':
          description: Unauthorized
    delete:
      operationId: deleteSecrets
      summary: Delete project secrets
      description: Deletes one or more secrets from the project by their names.
      tags:
      - Secrets
      parameters:
      - $ref: '#/components/parameters/ProjectRef'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: array
              items:
                type: string
      responses:
        '200':
          description: Secrets deleted successfully
        '401':
          description: Unauthorized
components:
  parameters:
    ProjectRef:
      name: ref
      in: path
      required: true
      description: The unique reference ID for the project, found in the project settings or URL.
      schema:
        type: string
  schemas:
    CreateSecretRequest:
      type: object
      required:
      - name
      - value
      properties:
        name:
          type: string
          description: Name for the secret
        value:
          type: string
          description: Secret value
    Secret:
      type: object
      properties:
        name:
          type: string
          description: Name of the secret
  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