Sourcebot Enterprise (EE) API

Enterprise endpoints for user management and audit logging.

OpenAPI Specification

sourcebot-enterprise-ee-api-openapi.yml Raw ↑
openapi: 3.0.3
info:
  title: Sourcebot Public Enterprise (EE) Enterprise (EE) Enterprise (EE) API
  version: v5.1.3
  description: 'OpenAPI description for the public Sourcebot REST endpoints used for search, repository listing, and file browsing. Authentication is instance-dependent: API keys are the standard integration mechanism, OAuth bearer tokens are EE-only, and some instances may allow anonymous access.'
security:
- bearerToken: []
- apiKeyHeader: []
- {}
tags:
- name: Enterprise (EE)
  description: Enterprise endpoints for user management and audit logging.
paths:
  /api/ee/user:
    get:
      operationId: getUser
      tags:
      - Enterprise (EE)
      summary: Get a user
      description: Fetches details for a single organization member by `userId`. Only organization owners can access this endpoint.
      x-mint:
        content: '<Note>

          This API is only available with an active Sourcebot license. [More information](/docs/activating-a-subscription).

          </Note>'
      parameters:
      - schema:
          type: string
          description: The ID of the user to retrieve.
        required: true
        description: The ID of the user to retrieve.
        name: userId
        in: query
      responses:
        '200':
          description: User details.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicEeUser'
        '400':
          description: Missing userId parameter.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicApiServiceError'
        '403':
          description: Insufficient permissions or entitlement not enabled.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicApiServiceError'
        '404':
          description: User is not a member of this organization.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicApiServiceError'
        '500':
          description: Unexpected failure.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicApiServiceError'
    delete:
      operationId: deleteUser
      tags:
      - Enterprise (EE)
      summary: Remove a user from the organization
      description: Removes a user from the organization, revoking their access and their sessions. Only organization owners can access this endpoint.
      x-mint:
        content: '<Note>

          This API is only available with an active Sourcebot license. [More information](/docs/activating-a-subscription).

          </Note>'
      parameters:
      - schema:
          type: string
          description: The ID of the user to remove.
        required: true
        description: The ID of the user to remove.
        name: userId
        in: query
      responses:
        '200':
          description: User removed successfully.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicEeDeleteUserResponse'
        '400':
          description: Missing userId parameter.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicApiServiceError'
        '403':
          description: Insufficient permissions, the last active owner cannot be removed, or SCIM provisioning is enabled (membership is managed through your identity provider).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicApiServiceError'
        '404':
          description: User is not a member of this organization.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicApiServiceError'
        '500':
          description: Unexpected failure.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicApiServiceError'
  /api/ee/users:
    get:
      operationId: listUsers
      tags:
      - Enterprise (EE)
      summary: List users
      description: Returns all members of the organization. Only organization owners can access this endpoint.
      x-mint:
        content: '<Note>

          This API is only available with an active Sourcebot license. [More information](/docs/activating-a-subscription).

          </Note>'
      responses:
        '200':
          description: List of organization members.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicEeUsersResponse'
        '403':
          description: Insufficient permissions or entitlement not enabled.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicApiServiceError'
        '500':
          description: Unexpected failure.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicApiServiceError'
  /api/ee/audit:
    get:
      operationId: listAuditRecords
      tags:
      - Enterprise (EE)
      summary: List audit records
      description: Returns a paginated list of audit log entries. Only organization owners can access this endpoint.
      x-mint:
        content: '<Note>

          This API is only available with an active Sourcebot license. [More information](/docs/activating-a-subscription).

          </Note>'
      parameters:
      - schema:
          type: string
          format: date-time
          description: Return records at or after this timestamp (ISO 8601).
        required: false
        description: Return records at or after this timestamp (ISO 8601).
        name: since
        in: query
      - schema:
          type: string
          format: date-time
          description: Return records at or before this timestamp (ISO 8601).
        required: false
        description: Return records at or before this timestamp (ISO 8601).
        name: until
        in: query
      - schema:
          type: integer
          minimum: 0
          exclusiveMinimum: true
          default: 1
        required: false
        name: page
        in: query
      - schema:
          type: integer
          minimum: 0
          exclusiveMinimum: true
          maximum: 100
          default: 50
        required: false
        name: perPage
        in: query
      responses:
        '200':
          description: Paginated audit log.
          headers:
            X-Total-Count:
              description: Total number of audit records matching the query across all pages.
              schema:
                type: integer
            Link:
              description: Pagination links formatted per RFC 8288.
              schema:
                type: string
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicEeAuditResponse'
        '400':
          description: Invalid query parameters.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicApiServiceError'
        '403':
          description: Insufficient permissions or entitlement not enabled.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicApiServiceError'
        '500':
          description: Unexpected failure.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicApiServiceError'
components:
  schemas:
    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.
    PublicEeUser:
      type: object
      properties:
        id:
          type: string
        name:
          type: string
          nullable: true
        email:
          type: string
        role:
          type: string
          enum:
          - OWNER
          - MEMBER
        suspendedAt:
          type: string
          nullable: true
          format: date-time
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
        lastActivityAt:
          type: string
          nullable: true
          format: date-time
      required:
      - id
      - name
      - email
      - role
      - suspendedAt
      - createdAt
      - updatedAt
      - lastActivityAt
    PublicEeAuditResponse:
      type: array
      items:
        $ref: '#/components/schemas/PublicEeAuditRecord'
    PublicEeDeleteUserResponse:
      type: object
      properties:
        success:
          type: boolean
        message:
          type: string
      required:
      - success
      - message
    PublicEeAuditRecord:
      type: object
      properties:
        id:
          type: string
        timestamp:
          type: string
          format: date-time
        action:
          type: string
          description: The audited action (e.g. `user.read`, `user.delete`, `audit.fetch`).
        actorId:
          type: string
        actorType:
          type: string
        targetId:
          type: string
        targetType:
          type: string
        sourcebotVersion:
          type: string
        metadata:
          type: object
          nullable: true
          additionalProperties:
            nullable: true
        orgId:
          type: number
      required:
      - id
      - timestamp
      - action
      - actorId
      - actorType
      - targetId
      - targetType
      - sourcebotVersion
      - metadata
      - orgId
    PublicEeUsersResponse:
      type: array
      items:
        $ref: '#/components/schemas/PublicEeUser'
  securitySchemes:
    bearerToken:
      type: http
      scheme: bearer
      description: Bearer authentication header of the form `Bearer <token>`, where `<token>` is your API key.
    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.'