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

# Register a client

> Registers an OAuth client using Dynamic Client Registration (RFC 7591). The endpoint is unauthenticated. Every client is a public client, so no client secret is issued.

## Usage

Register a client once and store the returned `client_id`. Each redirect URI must match exactly when you call the authorization endpoint. Wildcards are not allowed.


## OpenAPI

````yaml /api-reference/sourcebot-public.openapi.json post /api/ee/oauth/register
openapi: 3.0.3
info:
  title: Sourcebot Public API
  version: v6.1.2
  description: >-
    OpenAPI description for the public Sourcebot REST endpoints used for search,
    repository listing, and file browsing. API keys are the standard integration
    mechanism, and OAuth bearer tokens are EE-only.
servers: []
security:
  - bearerToken: []
  - apiKeyHeader: []
  - {}
tags:
  - name: Search & Navigation
    description: Code search and symbol navigation endpoints.
  - name: Connections
    description: Code host connection metadata.
  - name: Repositories
    description: Repository listing and metadata endpoints.
  - name: Git
    description: Git history, diff, and file content endpoints.
  - name: Scoped Access Tokens
    description: >-
      Mint and revoke short-lived credentials restricted to specific
      repositories.
  - name: System
    description: System health and version endpoints.
  - name: OAuth
    description: >-
      OAuth 2.0 authorization server for apps that call Sourcebot on behalf of a
      user.
  - name: Enterprise (EE)
    description: Enterprise endpoints for user management and audit logging.
paths:
  /api/ee/oauth/register:
    post:
      tags:
        - OAuth
      summary: Register a client
      description: >-
        Registers an OAuth client using Dynamic Client Registration (RFC 7591).
        The endpoint is unauthenticated. Every client is a public client, so no
        client secret is issued.
      operationId: registerOAuthClient
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PublicOAuthRegisterClientRequest'
      responses:
        '201':
          description: Client registered.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicOAuthRegisterClientResponse'
        '400':
          description: >-
            Invalid client metadata (`invalid_client_metadata`), or a wildcard
            or unpermitted redirect URI (`invalid_redirect_uri`). Body
            validation errors use the standard service error format.
          content:
            application/json:
              schema:
                anyOf:
                  - $ref: '#/components/schemas/PublicOAuthError'
                  - $ref: '#/components/schemas/PublicApiServiceError'
        '403':
          description: OAuth is not available on this instance (`access_denied`).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicOAuthError'
        '415':
          description: The request `Content-Type` is not `application/json`.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicOAuthError'
      security: []
components:
  schemas:
    PublicOAuthRegisterClientRequest:
      type: object
      properties:
        client_name:
          type: string
          minLength: 1
          description: Name shown to the user on the consent screen.
        redirect_uris:
          type: array
          items:
            type: string
            format: uri
          minItems: 1
          maxItems: 100
          description: >-
            Exact redirect URIs the client may use. Wildcards and `javascript:`,
            `data:`, or `vbscript:` schemes are rejected.
        logo_uri:
          type: string
          nullable: true
          format: uri
          description: URL of a logo shown to the user on the consent screen.
      required:
        - client_name
        - redirect_uris
    PublicOAuthRegisterClientResponse:
      type: object
      properties:
        client_id:
          type: string
          description: >-
            Identifier to send as `client_id` to the authorization, token, and
            revocation endpoints.
        client_name:
          type: string
        logo_uri:
          type: string
          format: uri
        redirect_uris:
          type: array
          items:
            type: string
            format: uri
      required:
        - client_id
        - client_name
        - redirect_uris
    PublicOAuthError:
      type: object
      properties:
        error:
          type: string
          description: >-
            OAuth error code, such as `invalid_request`, `invalid_grant`, or
            `access_denied`.
        error_description:
          type: string
          description: Human-readable explanation of the error.
      required:
        - error
        - error_description
      description: >-
        Error response returned by the OAuth endpoints, as defined in RFC 6749
        Section 5.2.
    PublicApiServiceError:
      type: object
      properties:
        statusCode:
          type: number
        errorCode:
          type: string
        message:
          type: string
      required:
        - statusCode
        - errorCode
        - message
      description: Structured error response returned by Sourcebot public API endpoints.
  securitySchemes:
    bearerToken:
      type: http
      scheme: bearer
      description: >-
        Bearer authentication header of the form `Bearer <token>`. The token may
        be a Sourcebot API key, OAuth access token, or scoped access token,
        subject to endpoint requirements.
    apiKeyHeader:
      type: apiKey
      in: header
      name: X-Sourcebot-Api-Key
      description: >-
        Header of the form `X-Sourcebot-Api-Key: <token>`, where `<token>` is
        your API key.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.