openapi: 3.1.0
info:
  title: OpenID Bridge API
  description: OPENID BRIDGE API documentation
  contact:
    name: Procivis One Docs
    url: https://www.procivis.ch/en/procivis-one#signup
  version: v1.66.0
servers:
- url: https://bridge.test.procivis-one.com
  description: Generated server url
security:
- bearer: []
tags:
- name: provider-controller
  description: |
    Create and manage OpenID providers.

    Related guide: [Integrate OpenID Bridge](/openid-bridge/integrate)
  x-displayName: Providers
- name: history-controller
  description: |
    Retrieve event history.
  x-displayName: History
paths:
  /api/provider/v1:
    get:
      tags:
      - provider-controller
      summary: List OIDC providers
      description: Returns a list of OpenID Connect providers in the system.
      operationId: getProviders
      parameters:
      - name: lastModifiedBefore
        in: query
        description: |
          Return only OIDC providers which were last modified before this time.
          Timestamp in RFC3339 format.
        required: false
        schema:
          type: string
          format: date-time
          description: |
            Return only OIDC providers which were last modified before this time.
            Timestamp in RFC3339 format.
          example: 2023-06-09T14:19:57.000Z
        example: 2023-06-09T14:19:57.000Z
      - name: lastModifiedBAfter
        in: query
        description: |
          Return only OIDC providers which were last modified after this time.
          Timestamp in RFC3339 format.
        required: false
        schema:
          type: string
          format: date-time
          description: |
            Return only OIDC providers which were last modified after this time.
            Timestamp in RFC3339 format.
          example: 2023-06-09T14:19:57.000Z
        example: 2023-06-09T14:19:57.000Z
      - name: ids
        in: query
        description: |
          Specify providers to be returned by their UUID.
        required: false
        schema:
          $ref: "#/components/schemas/ids"
      - name: name
        in: query
        description: |
          Return only providers with a name starting with this string. Not case-sensitive.
        required: false
        schema:
          type: string
          description: |
            Return only providers with a name starting with this string. Not case-sensitive.
      - name: organisationId
        in: query
        required: false
        schema:
          type: string
          format: uuid
      - name: sort
        in: query
        required: false
        schema:
          type: string
          default: createdDate
      - name: sortDirection
        in: query
        required: false
        schema:
          type: string
          default: DESC
          enum:
          - ASC
          - DESC
      - name: page
        in: query
        description: |
          The page number to retrieve (0-based indexing).
        required: false
        schema:
          type: integer
          format: int32
          description: |
            The page number to retrieve (0-based indexing).
          minimum: 0
      - name: pageSize
        in: query
        description: |
          Number of items to return per page. If omitted, defaults to 30.
        required: false
        schema:
          type: integer
          format: int32
          description: |
            Number of items to return per page. If omitted, defaults to 30.
          maximum: 1000
          minimum: 1
      - name: createdDateBefore
        in: query
        description: |
          Return only OIDC providers which were created before this time.
          Timestamp in RFC3339 format.
        required: false
        schema:
          type: string
          format: date-time
          description: |
            Return only OIDC providers which were created before this time.
            Timestamp in RFC3339 format.
          example: 2023-06-09T14:19:57.000Z
        example: 2023-06-09T14:19:57.000Z
      - name: createdDateAfter
        in: query
        description: |
          Return only OIDC providers which were created after this time.
          Timestamp in RFC3339 format.
        required: false
        schema:
          type: string
          format: date-time
          description: |
            Return only OIDC providers which were created after this time.
            Timestamp in RFC3339 format.
          example: 2023-06-09T14:19:57.000Z
        example: 2023-06-09T14:19:57.000Z
      responses:
        "400":
          description: Business rule error
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponseDTO"
        "500":
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponseDTO"
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/SearchEntityResponseDTOListProviderResponseDTO"
    post:
      tags:
      - provider-controller
      summary: Create an OIDC provider
      description: "Creates a new OpenID Connect provider for OpenID Bridge. See the\
        \ [integration guide](/openid-bridge/integrate)."
      operationId: createProvider
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/ProviderRequestDTO"
        required: true
      responses:
        "400":
          description: Invalid Provider data
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponseDTO"
        "500":
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponseDTO"
        "201":
          description: Created
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ProviderResponseDTO"
  /api/provider/v1/{providerId}/regenerate-secret:
    post:
      tags:
      - provider-controller
      summary: Regenerate secret
      description: Regenerates the client secret for an OpenID Connect provider.
      operationId: regenerateSecretForProvider
      parameters:
      - name: providerId
        in: path
        required: true
        schema:
          type: string
          format: uuid
      responses:
        "400":
          description: Invalid Provider data
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponseDTO"
        "500":
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponseDTO"
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ProviderResponseDTO"
  /api/provider/v1/{providerId}:
    get:
      tags:
      - provider-controller
      summary: Retrieve an OIDC provider
      description: Returns detailed information about an OpenID Connect provider.
      operationId: getProviderById
      parameters:
      - name: providerId
        in: path
        required: true
        schema:
          type: string
          format: uuid
      responses:
        "400":
          description: Business rule error
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponseDTO"
        "500":
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponseDTO"
        "404":
          description: Provider not found
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponseDTO"
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/DetailProviderResponseDTO"
    delete:
      tags:
      - provider-controller
      summary: Delete an OIDC provider
      description: Deletes an OpenID Connect provider.
      operationId: deleteProvider
      parameters:
      - name: providerId
        in: path
        required: true
        schema:
          type: string
          format: uuid
      responses:
        "400":
          description: Business rule error
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponseDTO"
        "500":
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponseDTO"
        "404":
          description: Provider not found
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponseDTO"
        "204":
          description: No Content
    patch:
      tags:
      - provider-controller
      summary: Update an OIDC provider
      description: Updates an OpenID Connect provider.
      operationId: updateProvider
      parameters:
      - name: providerId
        in: path
        required: true
        schema:
          type: string
          format: uuid
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/UpdatedProviderRequestDTO"
        required: true
      responses:
        "400":
          description: Invalid Provider data
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponseDTO"
        "500":
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponseDTO"
        "204":
          description: No Content
  /api/history/v1:
    get:
      tags:
      - history-controller
      summary: List history events
      description: Returns a list of history events.
      operationId: getHistoryList
      parameters:
      - name: providerId
        in: query
        required: false
        schema:
          type: string
          format: uuid
      - name: entityId
        in: query
        required: false
        schema:
          type: string
      - name: actions
        in: query
        required: false
        schema:
          type: array
          items:
            type: string
            enum:
            - HistoryActionEnum.CLIENT_SECRET_REGENERATED(value=CLIENT_SECRET_REGENERATED)
            - HistoryActionEnum.CREATED(value=CREATED)
            - HistoryActionEnum.DELETED(value=DELETED)
            - HistoryActionEnum.ERRORED(value=ERRORED)
            - HistoryActionEnum.SUCCEEDED(value=SUCCEEDED)
            - HistoryActionEnum.UPDATED(value=UPDATED)
      - name: entityTypes
        in: query
        required: false
        schema:
          type: array
          items:
            type: string
            enum:
            - INTERACTION
            - PROVIDER
      - name: user
        in: query
        required: false
        schema:
          type: string
      - name: ids
        in: query
        description: |
          Specify providers to be returned by their UUID.
        required: false
        schema:
          $ref: "#/components/schemas/ids"
      - name: name
        in: query
        description: |
          Return only providers with a name starting with this string. Not case-sensitive.
        required: false
        schema:
          type: string
          description: |
            Return only providers with a name starting with this string. Not case-sensitive.
      - name: organisationId
        in: query
        required: false
        schema:
          type: string
          format: uuid
      - name: sort
        in: query
        required: false
        schema:
          type: string
          default: createdDate
      - name: sortDirection
        in: query
        required: false
        schema:
          type: string
          default: DESC
          enum:
          - ASC
          - DESC
      - name: page
        in: query
        description: |
          The page number to retrieve (0-based indexing).
        required: false
        schema:
          type: integer
          format: int32
          description: |
            The page number to retrieve (0-based indexing).
          minimum: 0
      - name: pageSize
        in: query
        description: |
          Number of items to return per page. If omitted, defaults to 30.
        required: false
        schema:
          type: integer
          format: int32
          description: |
            Number of items to return per page. If omitted, defaults to 30.
          maximum: 1000
          minimum: 1
      - name: createdDateBefore
        in: query
        description: |
          Return only OIDC providers which were created before this time.
          Timestamp in RFC3339 format.
        required: false
        schema:
          type: string
          format: date-time
          description: |
            Return only OIDC providers which were created before this time.
            Timestamp in RFC3339 format.
          example: 2023-06-09T14:19:57.000Z
        example: 2023-06-09T14:19:57.000Z
      - name: createdDateAfter
        in: query
        description: |
          Return only OIDC providers which were created after this time.
          Timestamp in RFC3339 format.
        required: false
        schema:
          type: string
          format: date-time
          description: |
            Return only OIDC providers which were created after this time.
            Timestamp in RFC3339 format.
          example: 2023-06-09T14:19:57.000Z
        example: 2023-06-09T14:19:57.000Z
      responses:
        "400":
          description: Business rule error
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponseDTO"
        "500":
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponseDTO"
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/SearchEntityResponseDTOListHistoryResponseDTO"
  /api/history/v1/{historyId}:
    get:
      tags:
      - history-controller
      summary: Retrieve history entry
      description: Returns details about a single event.
      operationId: getHistoryById
      parameters:
      - name: historyId
        in: path
        required: true
        schema:
          type: string
          format: uuid
      responses:
        "400":
          description: Business rule error
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponseDTO"
        "500":
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponseDTO"
        "404":
          description: History entry not found
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponseDTO"
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/DetailHistoryResponseDTO"
components:
  schemas:
    ProviderRequestDTO:
      type: object
      properties:
        proofSchemaId:
          type: string
          format: uuid
          description: The schema used to make the request.
        verifier:
          type: string
          format: uuid
          description: Identifier used for verification.
        acceptedIssuerId:
          type: string
          format: uuid
          description: UUID of the issuer's identifier. Shared credentials must be
            signed by this identifier or login will fail.
        redirectUris:
          type: array
          description: Redirect URI from the OIDC provider.
          items:
            type: string
        name:
          type: string
        organisationId:
          type: string
          format: uuid
        subjectMapping:
          type: string
        lastNameMapping:
          type: string
        firstNameMapping:
          type: string
        birthdateMapping:
          type: string
        emailMapping:
          type: string
        phoneNumberMapping:
          type: string
        postLogoutRedirectUris:
          type: array
          items:
            type: string
        displayName:
          type: string
        privacyUrl:
          type: string
        termsUrl:
          type: string
        clientId:
          type: string
          description: |
            If you have configured your OIDC provider first, use the client ID provided
            by that configuration. Otherwise one will be created.
        clientSecret:
          type: string
          description: |
            If you have configured your OIDC provider first, use the client secret
            provided by that configuration. Otherwise one will be created.
        scopes:
          type: array
          default: "[OPENID, PROFILE]"
          description: Specify OpenID scopes.
          items:
            type: string
            enum:
            - ADDRESS
            - EMAIL
            - OPENID
            - PHONE
            - PROFILE
        grantTypes:
          type: array
          default: AUTHORIZATION_CODE
          description: Specify grant types.
          items:
            type: string
            enum:
            - AUTHORIZATION_CODE
            - CLIENT_CREDENTIALS
            - REFRESH_TOKEN
        logo:
          type: string
      required:
      - acceptedIssuerId
      - name
      - proofSchemaId
      - redirectUris
      - verifier
    ErrorResponseDTO:
      type: object
      properties:
        timestamp:
          type: string
          format: date-time
        cause:
          $ref: "#/components/schemas/HttpErrorResponseDTO"
        code:
          type: string
        message:
          type: string
        data: {}
        stackTrace:
          type: string
      required:
      - code
      - message
    HttpErrorResponseDTO:
      type: object
      properties:
        url:
          type: string
        code:
          type: integer
          format: int32
        message:
          type: string
        cause:
          $ref: "#/components/schemas/ProcivisErrorCauseResponseDTO"
    ProcivisErrorCauseResponseDTO:
      type: object
      properties:
        url:
          type: string
        code:
          type: integer
          format: int32
        message:
          type: string
    ProviderResponseDTO:
      type: object
      properties:
        id:
          type: string
        clientId:
          type: string
        clientSecret:
          type: string
    UpdatedProviderRequestDTO:
      type: object
      properties:
        clientSecret:
          type: string
        verifier:
          type: string
          format: uuid
        redirectUris:
          type: array
          items:
            type: string
        scopes:
          type: array
          items:
            type: string
            enum:
            - ADDRESS
            - EMAIL
            - OPENID
            - PHONE
            - PROFILE
        grantTypes:
          type: array
          items:
            type: string
            enum:
            - AUTHORIZATION_CODE
            - CLIENT_CREDENTIALS
            - REFRESH_TOKEN
        subjectMapping:
          type: string
        lastNameMapping:
          type: string
        firstNameMapping:
          type: string
        birthdateMapping:
          type: string
        emailMapping:
          type: string
        phoneNumberMapping:
          type: string
        postLogoutRedirectUris:
          type: array
          items:
            type: string
        displayName:
          type: string
        privacyUrl:
          type: string
        termsUrl:
          type: string
        logo:
          type: string
        acceptedIssuerId:
          type: string
          format: uuid
    ids:
      type: array
      description: |
        Specify providers to be returned by their UUID.
      items:
        type: string
        description: |
          Specify providers to be returned by their UUID.
    ListProviderResponseDTO:
      type: object
      properties:
        proofSchemaId:
          type: string
          format: uuid
          description: The schema used to make the request.
        verifier:
          type: string
          format: uuid
          description: Identifier used for verification.
        acceptedIssuerId:
          type: string
          format: uuid
          description: UUID of the issuer's identifier. Shared credentials must be
            signed by this identifier or login will fail.
        redirectUris:
          type: array
          description: Redirect URI from the OIDC provider.
          items:
            type: string
        name:
          type: string
        organisationId:
          type: string
          format: uuid
        subjectMapping:
          type: string
        lastNameMapping:
          type: string
        firstNameMapping:
          type: string
        birthdateMapping:
          type: string
        emailMapping:
          type: string
        phoneNumberMapping:
          type: string
        postLogoutRedirectUris:
          type: array
          items:
            type: string
        displayName:
          type: string
        privacyUrl:
          type: string
        termsUrl:
          type: string
        id:
          type: string
          format: uuid
        clientId:
          type: string
        scopes:
          type: array
          items:
            type: string
            enum:
            - ADDRESS
            - EMAIL
            - OPENID
            - PHONE
            - PROFILE
        grantTypes:
          type: array
          items:
            type: string
            enum:
            - AUTHORIZATION_CODE
            - CLIENT_CREDENTIALS
            - REFRESH_TOKEN
        createdDate:
          type: string
          format: date-time
        lastModified:
          type: string
          format: date-time
      required:
      - acceptedIssuerId
      - clientId
      - grantTypes
      - id
      - name
      - proofSchemaId
      - redirectUris
      - scopes
      - verifier
    SearchEntityResponseDTOListProviderResponseDTO:
      type: object
      properties:
        values:
          type: array
          items:
            $ref: "#/components/schemas/ListProviderResponseDTO"
        totalItems:
          type: integer
          format: int64
        totalPages:
          type: integer
          format: int32
      required:
      - totalItems
      - totalPages
      - values
    DetailProviderResponseDTO:
      type: object
      properties:
        proofSchemaId:
          type: string
          format: uuid
          description: The schema used to make the request.
        verifier:
          type: string
          format: uuid
          description: Identifier used for verification.
        acceptedIssuerId:
          type: string
          format: uuid
          description: UUID of the issuer's identifier. Shared credentials must be
            signed by this identifier or login will fail.
        redirectUris:
          type: array
          description: Redirect URI from the OIDC provider.
          items:
            type: string
        name:
          type: string
        organisationId:
          type: string
          format: uuid
        subjectMapping:
          type: string
        lastNameMapping:
          type: string
        firstNameMapping:
          type: string
        birthdateMapping:
          type: string
        emailMapping:
          type: string
        phoneNumberMapping:
          type: string
        postLogoutRedirectUris:
          type: array
          items:
            type: string
        displayName:
          type: string
        privacyUrl:
          type: string
        termsUrl:
          type: string
        id:
          type: string
          format: uuid
        clientId:
          type: string
        scopes:
          type: array
          items:
            type: string
            enum:
            - ADDRESS
            - EMAIL
            - OPENID
            - PHONE
            - PROFILE
        grantTypes:
          type: array
          items:
            type: string
            enum:
            - AUTHORIZATION_CODE
            - CLIENT_CREDENTIALS
            - REFRESH_TOKEN
        createdDate:
          type: string
          format: date-time
        lastModified:
          type: string
          format: date-time
        logo:
          type: string
      required:
      - acceptedIssuerId
      - clientId
      - grantTypes
      - id
      - name
      - proofSchemaId
      - redirectUris
      - scopes
      - verifier
    ListHistoryResponseDTO:
      type: object
      properties:
        id:
          type: string
          format: uuid
        name:
          type: string
        entityType:
          type: string
          enum:
          - INTERACTION
          - PROVIDER
        action:
          type: string
          enum:
          - HistoryActionEnum.CLIENT_SECRET_REGENERATED(value=CLIENT_SECRET_REGENERATED)
          - HistoryActionEnum.CREATED(value=CREATED)
          - HistoryActionEnum.DELETED(value=DELETED)
          - HistoryActionEnum.ERRORED(value=ERRORED)
          - HistoryActionEnum.SUCCEEDED(value=SUCCEEDED)
          - HistoryActionEnum.UPDATED(value=UPDATED)
        createdDate:
          type: string
          format: date-time
        entityId:
          type: string
        organisationId:
          type: string
          format: uuid
        user:
          type: string
    SearchEntityResponseDTOListHistoryResponseDTO:
      type: object
      properties:
        values:
          type: array
          items:
            $ref: "#/components/schemas/ListHistoryResponseDTO"
        totalItems:
          type: integer
          format: int64
        totalPages:
          type: integer
          format: int32
      required:
      - totalItems
      - totalPages
      - values
    DetailHistoryResponseDTO:
      type: object
      properties:
        id:
          type: string
          format: uuid
        name:
          type: string
        entityType:
          type: string
          enum:
          - INTERACTION
          - PROVIDER
        action:
          type: string
          enum:
          - HistoryActionEnum.CLIENT_SECRET_REGENERATED(value=CLIENT_SECRET_REGENERATED)
          - HistoryActionEnum.CREATED(value=CREATED)
          - HistoryActionEnum.DELETED(value=DELETED)
          - HistoryActionEnum.ERRORED(value=ERRORED)
          - HistoryActionEnum.SUCCEEDED(value=SUCCEEDED)
          - HistoryActionEnum.UPDATED(value=UPDATED)
        createdDate:
          type: string
          format: date-time
        entityId:
          type: string
        organisationId:
          type: string
          format: uuid
        user:
          type: string
        metadata:
          type: string
  securitySchemes:
    bearer:
      type: http
      scheme: bearer
      bearerFormat: JWT
