openapi: 3.0.1
info:
  title: Plugin API
  version: 0.0.0
servers:
- description: The Plugin API REST endpoint
  url: https://api.btx.fr.banqup.com/core/plugin
- description: The Plugin API REST endpoint
  url: https://api.btx.eu.banqup.com/core/plugin
paths:
  /api/v1/extensionPoints/{extensionPointId}:
    get:
      tags:
      - extension-point-controller
      summary: Get extension point
      description: "<div class='my-preview'><span>Preview: The API is in development
        or testing phases and the interface could still change slightly.</span></div>
        <br/> Gets details about an extension point. <br/> Scope: []"
      operationId: getExtensionPoint
      parameters:
      - name: extensionPointId
        in: path
        required: true
        schema:
          type: string
          format: uuid
      responses:
        '200':
          description: Retrieved the extension point.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ExtensionPointResponse'
    put:
      tags:
      - extension-point-controller
      summary: Replace extension point
      description: "<div class='my-preview'><span>Preview: The API is in development
        or testing phases and the interface could still change slightly.</span></div>
        <br/> Fully replaces the existing extension point with new configuration.
        <br/> Scope: []"
      operationId: replaceExtensionPoint
      parameters:
      - name: extensionPointId
        in: path
        required: true
        schema:
          type: string
          format: uuid
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ExtensionPointRequest'
        required: true
      responses:
        '200':
          description: Updated/replaced the extension point.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ExtensionPointResponse'
        '403':
          description: "You must have the permission \u2018extension_point_manage\u2019
            on the extension point that is in your request. The creator of the extension
            point receives this permission automatically."
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ExtensionPointResponse'
        '409':
          description: Already exists.
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ProblemDetail'
    delete:
      tags:
      - extension-point-controller
      summary: Delete an extension point
      description: "<div class='my-preview'><span>Preview: The API is in development
        or testing phases and the interface could still change slightly.</span></div>
        <br/> Removes an existing extension point. This will also delete all registered
        extensions. <br/> Scope: []"
      operationId: deleteExtensionPoint
      parameters:
      - name: extensionPointId
        in: path
        required: true
        schema:
          type: string
          format: uuid
      responses:
        '204':
          description: Deleted the extension point.
        '403':
          description: You must have the permission 'extension_point_manage' on the
            extension point that is in your request. The creator of the extension
            point receives this permission automatically.
    patch:
      tags:
      - extension-point-controller
      summary: Update extension point
      description: "<div class='my-preview'><span>Preview: The API is in development
        or testing phases and the interface could still change slightly.</span></div>
        <br/> Applies the given JSON patch to the configuration of an existing extension
        point. The patch operation is applied to the data structure the client would
        receive on a Get extension point operation. <br/> Scope: []"
      operationId: updateExtensionPoint
      parameters:
      - name: extensionPointId
        in: path
        required: true
        schema:
          type: string
          format: uuid
      requestBody:
        content:
          application/json-patch+json:
            schema:
              $ref: '#/components/schemas/JsonPatch'
        required: true
      responses:
        '200':
          description: Updated/patched the extension point field(s).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ExtensionPointResponse'
        '403':
          description: You must have the permission 'extension_point_manage' on the
            extension point that is in your request. The creator of the extension
            point receives this permission automatically.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ExtensionPointResponse'
        '409':
          description: Already exists.
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ProblemDetail'
  /api/v1/extensionPoints/{extensionPointId}:reAuthorize:
    post:
      tags:
      - extension-point-controller
      summary: Reauthorize all extensions
      description: "<div class='my-preview'><span>Preview: The API is in development
        or testing phases and the interface could still change slightly.</span></div>
        <br/> Re-run this extension point's authorizer on each extension. This may
        result in one or more extensions being deleted if the authorizer disallows
        them. <br/> Scope: []"
      operationId: reAuthorizeExtensions
      parameters:
      - name: extensionPointId
        in: path
        required: true
        schema:
          type: string
          format: uuid
      responses:
        '204':
          description: Reauthorized all extensions.
        '403':
          description: You must have the permission 'extension_point_manage' on the
            extension point that is in your request. The creator of the extension
            point receives this permission automatically.
        '202':
          description: Accepted
  /api/v1/extensionPoints/{extensionPointId}/extensions:
    get:
      tags:
      - extension-controller
      summary: List extensions
      description: "<div class='my-preview'><span>Preview: The API is in development
        or testing phases and the interface could still change slightly.</span></div>
        <br/> Lists all extensions of a given extension point that the caller has
        access to. <br/> Scope: []"
      operationId: listExtensions
      parameters:
      - name: extensionPointId
        in: path
        required: true
        schema:
          type: string
          format: uuid
      responses:
        '200':
          description: Listed extensions.
          content:
            application/x-ndjson:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/ExtensionResponse'
            application/json:
              schema:
                $ref: '#/components/schemas/ExtensionResponseList'
    post:
      tags:
      - extension-controller
      summary: Register an extension
      description: "<div class='my-preview'><span>Preview: The API is in development
        or testing phases and the interface could still change slightly.</span></div>
        <br/> Registers an extension of an existing extension point. The creator of
        an extension also receives permissions to manage that extension. <br/> Scope:
        []"
      operationId: registerExtension
      parameters:
      - name: extensionPointId
        in: path
        required: true
        schema:
          type: string
          format: uuid
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ExtensionRequest'
        required: true
      responses:
        '201':
          description: Registered the extension.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ExtensionResponse'
  /api/v1/extensionPoints:
    get:
      tags:
      - extension-point-controller
      summary: List extension points
      description: "<div class='my-preview'><span>Preview: The API is in development
        or testing phases and the interface could still change slightly.</span></div>
        <br/> Lists all extension points. <br/> Scope: []"
      operationId: listExtensionPoints
      parameters:
      - name: namespace
        in: query
        required: false
        schema:
          type: string
      - name: name
        in: query
        required: false
        schema:
          type: string
      - name: version
        in: query
        required: false
        schema:
          type: string
      responses:
        '200':
          description: Listed extension points.
          content:
            application/x-ndjson:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/ExtensionPointResponse'
            application/json:
              schema:
                $ref: '#/components/schemas/ExtensionPointResponseList'
    post:
      tags:
      - extension-point-controller
      summary: Create a new extension point
      description: "<div class='my-preview'><span>Preview: The API is in development
        or testing phases and the interface could still change slightly.</span></div>
        <br/> Creates a new extension point and grants the creator permission to manage
        that extension point. <br/> Scope: []"
      operationId: createExtensionPoint
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ExtensionPointRequest'
        required: true
      responses:
        '403':
          description: You must have the permission 'extension_point_create' on the
            extension point that is in your request.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ExtensionPointResponse'
        '409':
          description: Already exists.
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ProblemDetail'
        '201':
          description: Created the extension point.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ExtensionPointResponse'
  /api/v1/extensionPoints/{extensionPointId}/extensions/{extensionId}:
    get:
      tags:
      - extension-controller
      summary: Get extension
      description: "<div class='my-preview'><span>Preview: The API is in development
        or testing phases and the interface could still change slightly.</span></div>
        <br/> Gets information about a registered extension of an extension point.
        <br/> Scope: []"
      operationId: getExtension
      parameters:
      - name: extensionPointId
        in: path
        required: true
        schema:
          type: string
          format: uuid
      - name: extensionId
        in: path
        required: true
        schema:
          type: string
          format: uuid
      responses:
        '200':
          description: Retrieved the extension.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ExtensionResponse'
    delete:
      tags:
      - extension-controller
      summary: Delete extension
      description: "<div class='my-preview'><span>Preview: The API is in development
        or testing phases and the interface could still change slightly.</span></div>
        <br/> Unregisters an extension. <br/> Scope: []"
      operationId: deleteExtension
      parameters:
      - name: extensionPointId
        in: path
        required: true
        schema:
          type: string
          format: uuid
      - name: extensionId
        in: path
        required: true
        schema:
          type: string
          format: uuid
      responses:
        '204':
          description: Deleted the extension.
components:
  schemas:
    AuthorizationEndpoint:
      required:
      - url
      type: object
      properties:
        url:
          type: string
        authorizationHeader:
          type: string
        httpSignature:
          type: boolean
    ExtensionPointRequest:
      required:
      - name
      - namespace
      type: object
      properties:
        namespace:
          type: string
        name:
          type: string
        version:
          type: string
        authorizationEndpoint:
          $ref: '#/components/schemas/AuthorizationEndpoint'
        public:
          type: boolean
          default: false
    ProblemDetail:
      type: object
      properties:
        type:
          type: string
          format: uri
        title:
          type: string
        status:
          type: integer
          format: int32
        detail:
          type: string
        instance:
          type: string
          format: uri
        properties:
          type: object
          additionalProperties:
            type: object
    ExtensionPointResponse:
      required:
      - extensionPointId
      - name
      - namespace
      - public
      type: object
      properties:
        extensionPointId:
          type: string
          format: uuid
        namespace:
          type: string
        name:
          type: string
        version:
          type: string
        authorizationEndpoint:
          $ref: '#/components/schemas/AuthorizationEndpoint'
        public:
          type: boolean
    ExtensionRequest:
      type: object
      properties:
        data:
          $ref: '#/components/schemas/JsonNode'
    JsonNode:
      type: object
    ExtensionResponse:
      required:
      - extensionId
      type: object
      properties:
        extensionId:
          type: string
          format: uuid
        authorizationInfo:
          $ref: '#/components/schemas/JsonNode'
        data:
          $ref: '#/components/schemas/JsonNode'
    JsonPatch:
      type: object
    ExtensionResponseList:
      type: object
      properties:
        extensions:
          type: array
          items:
            $ref: '#/components/schemas/ExtensionResponse'
    ExtensionPointResponseList:
      type: object
      properties:
        extensionPoints:
          type: array
          items:
            $ref: '#/components/schemas/ExtensionPointResponse'
  securitySchemes:
    plugin-api:
      type: oauth2
      flows:
        authorizationCode:
          authorizationUrl: https://api.btx.fr.banqup.com/v1/oauth20/authorization
          tokenUrl: https://api.btx.fr.banqup.com/v1/oauth20/token_kc
          scopes: {}
