> ## Documentation Index
> Fetch the complete documentation index at: https://docs.revstack.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Upsert auth configuration

> Creates or replaces the authentication provider configuration (JWKS/JWT) for an environment.



## OpenAPI

````yaml put /v1/auth
openapi: 3.0.0
info:
  title: Revstack API
  version: 1.0.0
  description: >-
    Open Source Billing OS for Developers. The scalable, developer-first billing
    engine with subscriptions, invoicing, usage metering, and entitlements.
servers:
  - url: http://localhost:6900
    description: Revstack API (Local Development)
security: []
paths:
  /v1/auth:
    put:
      tags:
        - Auth
      summary: Upsert auth configuration
      description: >-
        Creates or replaces the authentication provider configuration (JWKS/JWT)
        for an environment.
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                environmentId:
                  type: string
                  minLength: 1
                provider:
                  type: string
                  enum:
                    - clerk
                    - supabase
                    - firebase
                    - auth0
                    - custom
                strategy:
                  type: string
                  enum:
                    - jwt
                    - jwks
                jwksUri:
                  type: string
                  format: uri
                signingSecret:
                  type: string
                issuer:
                  type: string
                audience:
                  type: string
                userIdClaim:
                  type: string
                  minLength: 1
              required:
                - environmentId
                - provider
                - strategy
                - userIdClaim
      responses:
        '200':
          description: Auth config saved
          content:
            application/json:
              schema:
                nullable: true

````