openapi: 3.0.0
info:
  description: Raidiam Connect API
  license:
    name: MIT
    url: https://mit-license.org
  contact:
    email: support@raidiam.com
  title: Raidiam Connect
  version: "1.39.0"
servers:
  - description: Raidiam Directory Sandbox Environment
    url: https://matls-api.sandbox.raidiam.io

tags:
  - name: Users
    description: all operations relating to users
  - name: Software Statement Certifications
    description: all operations relating to software statement certifications
  - name: Certification Managers
    description: all operations relating to certification managers
  - name: Super Users
    description: all operations relating to super users
  - name: Organisation Admin Users
    description: all operations relating to organisation admins
  - name: Organisation Domain Users
    description: all operations relating to organisation domain users
  - name: Docusign
    description: all operations utilising docusign
  - name: Organisations
    description: all operations relating to organisations
  - name: Export
    description: all operations relating to data export
  - name: Participants
    description: all operations relating to the participants endpoint
  - name: Roles
    description: all operations relating to directory roles
  - name: Deprecated
    description: all depreciated operations
  - name: Conformance Suite
    description: all operations involving the conformance suite
  - name: Reference Data
    description: all operations relating to reference data
  - name: Authorities
    description: all operations relating to authorities
  - name: Authorisation Domains
    description: all operations relating to authorisation domains
  - name: Authorisation Domain Roles
    description: all operations relating to authorisation domain roles
  - name: Authorisation Domain Role Metadata
    description: all operations relating to authorisation domain role metadata
  - name: Authority Domain Mappings
    description: all operations relating to the mapping between authorities and authorisation domains
  - name: Terms and Conditions
    description: all operations relating to directory terms and conditions
  - name: Authority Domain Claims
    description: all operations relating to authority domain claims attached to an organisation
  - name: Authority Claims
    description: all operations relating to roles attached to an organisation
  - name: Authority Claims Authorisations
    description: all operations relating to authority claim authorisations
  - name: Contacts
    description: all operations relating to contacts
  - name: Authorisation Servers
    description: all operations relating to authorisation servers
  - name: Webhooks
    description: all operations relating to webhooks
  - name: API Resources
    description: all operations relating to api resources
  - name: API Discovery Endpoints
    description: all operations relating to api discovery endpoints listed on an api resource
  - name: Certifications
    description: all operations relating to the certifying of a directory resource
  - name: Software Statements
    description: all operations relating to software statements
  - name: Software Authority Claims
    description: all operations relating to authority claims attached to a software statement
  - name: Certificates
    description: all operations relating to certificates
  - name: Assertion
    description: all operations relating to the software statement assertion
  - name: Software Statement Metadata
    description: all operations relating to software statement metadata
  - name: OpenID Provider
    description: all operations relating to the openid provider
  - name: Client Registration
    description: all operations relating to the clients endpoint
  - name: Audit History
    description: all operations relating to fetching audit history
  - name: Federation
    description: all operations relating to federation
  - name: Certification Type
    description: all operations relating to certification types
  - name: Certification Type Variant
    description: all operations relating to certification type variants
  - name: Public
    description: all endpoints to be included in the public api documentation
  - name: Dashboard
    description: endpoints for the super user dashboard
  - name: Closed
    description: all endpoints to be included in the closed api documentation
  - name: Flags
    description: all endpoints relating to resource flags
  - name: Contact Types
    description: all endpoints relating to contact types

  - name: Api Families
    description: all endpoints relating to api family configurations

paths:
  '/audit':
    get:
      parameters:
        - $ref: '#/components/parameters/x-fapi-auth-date'
        - $ref: '#/components/parameters/x-fapi-customer-ip-address'
        - $ref: '#/components/parameters/x-fapi-interaction-id'
        - $ref: '#/components/parameters/x-customer-user-agent'
        - $ref: '#/components/parameters/ActionType'
        - $ref: '#/components/parameters/OrganisationIdQueryParameter'
        - $ref: '#/components/parameters/ResourceType'
        - $ref: '#/components/parameters/ResourceId'
        - $ref: '#/components/parameters/ParentResourceId'
        - $ref: '#/components/parameters/PerformedBy'
        - $ref: '#/components/parameters/startDate'
        - $ref: '#/components/parameters/endDate'
        - $ref: "#/components/parameters/PageNumber"
        - $ref: "#/components/parameters/PageSize"
        - $ref: "#/components/parameters/PageSort"
      summary: Fetches audit history based on query parameters
      description: Fetches audit history and parses based on query parameters
      operationId: getAuditDetails
      tags:
        - Audit History
        - Public
        - Closed
      responses:
        '200':
          $ref: '#/components/responses/AuditHistoryPage'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/InternalServerError'
        '501':
          $ref: '#/components/responses/NotImplemented'
        '502':
          $ref: '#/components/responses/BadGateway'
        '504':
          $ref: '#/components/responses/UpstreamTimeout'
        '429':
          $ref: '#/components/responses/TooManyRequests'
      security:
        - godir-authorizer: [ ]
        - oAuth:
            - directory:website
      x-amazon-apigateway-integration:
        uri: "${godir_directory_audit_invoke_arn}"
        passthroughBehavior: "when_no_match"
        httpMethod: "POST"
        timeoutInMillis: 5000
        type: "aws_proxy"

  '/users/{UserEmailOrID}':
    get:
      parameters:
        - $ref: '#/components/parameters/UserEmailOrID'
        - $ref: "#/components/parameters/x-fapi-auth-date"
        - $ref: "#/components/parameters/x-fapi-customer-ip-address"
        - $ref: "#/components/parameters/x-fapi-interaction-id"
        - $ref: "#/components/parameters/x-customer-user-agent"
      summary: Details of the user
      description: Get information on a specific user by their email
      operationId: getUserByEmail
      tags:
        - Users
        - Public
        - Closed
      responses:
        '200':
          $ref: '#/components/responses/UserDetail'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/InternalServerError'
        '502':
          $ref: '#/components/responses/BadGateway'
        '504':
          $ref: '#/components/responses/UpstreamTimeout'
        '429':
          $ref: '#/components/responses/TooManyRequests'
      security:
        - authorizer: [ ]
        - oAuth:
            - directory:website
      x-amazon-apigateway-integration:
        uri: "${directory_users_invoke_arn}"
        passthroughBehavior: "when_no_match"
        httpMethod: "POST"
        timeoutInMillis: 5000
        type: "aws_proxy"

  '/users/{UserEmailOrID}/history':
    get:
      parameters:
        - $ref: '#/components/parameters/UserEmailOrID'
        - $ref: "#/components/parameters/x-fapi-auth-date"
        - $ref: "#/components/parameters/x-fapi-customer-ip-address"
        - $ref: "#/components/parameters/x-fapi-interaction-id"
        - $ref: "#/components/parameters/x-customer-user-agent"
      summary: TnC history of the user
      description: Get historical data on TnCs signed by user
      operationId: getUserTncHistoryByEmail
      tags:
        - Users
        - Public
      responses:
        '200':
          $ref: '#/components/responses/UserTermsAndConditionsPage'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/InternalServerError'
        '502':
          $ref: '#/components/responses/BadGateway'
        '504':
          $ref: '#/components/responses/UpstreamTimeout'
        '429':
          $ref: '#/components/responses/TooManyRequests'
      security:
        - authorizer: [ ]
        - oAuth:
            - directory:website
      x-amazon-apigateway-integration:
        uri: "${organisation_read_arn}"
        passthroughBehavior: "when_no_match"
        httpMethod: "POST"
        timeoutInMillis: 15000
        type: "aws_proxy"

  '/users/certification':
    get:
      summary: All certification managers
      description: Get all certification manager users
      operationId: getCertificationManagers
      parameters:
        - $ref: "#/components/parameters/x-fapi-auth-date"
        - $ref: "#/components/parameters/x-fapi-customer-ip-address"
        - $ref: "#/components/parameters/x-fapi-interaction-id"
        - $ref: "#/components/parameters/x-customer-user-agent"
        - $ref: "#/components/parameters/PageNumber"
        - $ref: "#/components/parameters/PageSize"
        - $ref: "#/components/parameters/PageSort"
      tags:
        - Users
        - Certification Managers
      responses:
        '200':
          $ref: '#/components/responses/CertificationManagers'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '406':
          $ref: '#/components/responses/NotAcceptable'
        '500':
          $ref: '#/components/responses/InternalServerError'
        '502':
          $ref: '#/components/responses/BadGateway'
        '504':
          $ref: '#/components/responses/UpstreamTimeout'
        '429':
          $ref: '#/components/responses/TooManyRequests'
      security:
        - authorizer: [ ]
        - oAuth:
            - directory:admin
      x-amazon-apigateway-integration:
        uri: "${organisation_read_arn}"
        passthroughBehavior: "when_no_match"
        httpMethod: "POST"
        timeoutInMillis: 15000
        type: "aws_proxy"
    post:
      summary: Create a certification manager
      description: Create a new certification manager
      operationId: createCertificationManager
      parameters:
        - $ref: "#/components/parameters/x-fapi-auth-date"
        - $ref: "#/components/parameters/x-fapi-customer-ip-address"
        - $ref: "#/components/parameters/x-fapi-interaction-id"
        - $ref: "#/components/parameters/x-customer-user-agent"
      requestBody:
        $ref: '#/components/requestBodies/CertificationManagerCreationRequest'
      tags:
        - Users
        - Certification Managers
      responses:
        '201':
          $ref: '#/components/responses/CertificationManager'
        '400':
          $ref: '#/components/responses/BadRequest'
        '404':
          $ref: '#/components/responses/NotFound'
        '406':
          $ref: '#/components/responses/NotAcceptable'
        '500':
          $ref: '#/components/responses/InternalServerError'
        '502':
          $ref: '#/components/responses/BadGateway'
        '504':
          $ref: '#/components/responses/UpstreamTimeout'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '401':
          $ref: '#/components/responses/Unauthorized'
      security:
        - authorizer: [ ]
        - oAuth:
            - directory:admin
      x-amazon-apigateway-integration:
        uri: "${organisation_write_arn}"
        passthroughBehavior: "when_no_match"
        httpMethod: "POST"
        timeoutInMillis: 29000
        type: "aws_proxy"

  '/users/certification/{UserEmailOrID}':
    parameters:
      - $ref: '#/components/parameters/UserEmailOrID'
      - $ref: "#/components/parameters/x-fapi-auth-date"
      - $ref: "#/components/parameters/x-fapi-customer-ip-address"
      - $ref: "#/components/parameters/x-fapi-interaction-id"
      - $ref: "#/components/parameters/x-customer-user-agent"

    put:
      summary: Toggle active status of super user by their email
      description: Deactivate or reactivate a user
      operationId: updateUserByEmail
      parameters:
        - $ref: "#/components/parameters/x-fapi-auth-date"
        - $ref: "#/components/parameters/x-fapi-customer-ip-address"
        - $ref: "#/components/parameters/x-fapi-interaction-id"
        - $ref: "#/components/parameters/x-customer-user-agent"
      tags:
        - Users
        - Certification Managers
      requestBody:
        $ref: '#/components/requestBodies/UserUpdateRequest'
      responses:
        '200':
          $ref: '#/components/responses/CertificationManager'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '406':
          $ref: '#/components/responses/NotAcceptable'
        '500':
          $ref: '#/components/responses/InternalServerError'
        '502':
          $ref: '#/components/responses/BadGateway'
        '504':
          $ref: '#/components/responses/UpstreamTimeout'
        '429':
          $ref: '#/components/responses/TooManyRequests'
      security:
        - authorizer: [ ]
        - oAuth:
            - directory:admin
      x-amazon-apigateway-integration:
        uri: "${organisation_write_arn}"
        passthroughBehavior: "when_no_match"
        httpMethod: "POST"
        timeoutInMillis: 29000
        type: "aws_proxy"

  '/users/data-administrator':
    get:
      summary: All data administrators
      description: Get all users with the data administrator role
      operationId: getDataAdministrators
      parameters:
        - $ref: "#/components/parameters/x-fapi-auth-date"
        - $ref: "#/components/parameters/x-fapi-customer-ip-address"
        - $ref: "#/components/parameters/x-fapi-interaction-id"
        - $ref: "#/components/parameters/x-customer-user-agent"
        - $ref: "#/components/parameters/PageNumber"
        - $ref: "#/components/parameters/PageSize"
        - $ref: "#/components/parameters/PageSort"
      tags:
        - Users
        - Public
        - Closed
      responses:
        '200':
          $ref: '#/components/responses/DataAdministrators'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '406':
          $ref: '#/components/responses/NotAcceptable'
        '500':
          $ref: '#/components/responses/InternalServerError'
        '502':
          $ref: '#/components/responses/BadGateway'
        '504':
          $ref: '#/components/responses/UpstreamTimeout'
        '429':
          $ref: '#/components/responses/TooManyRequests'
      security:
        - authorizer: [ ]
        - oAuth:
            - directory:website
      x-amazon-apigateway-integration:
        uri: "${organisation_read_arn}"
        passthroughBehavior: "when_no_match"
        httpMethod: "POST"
        timeoutInMillis: 15000
        type: "aws_proxy"
    post:
      summary: Create a data administrator
      description: Grants a user the data administrator role
      operationId: createDataAdministrator
      parameters:
        - $ref: "#/components/parameters/x-fapi-auth-date"
        - $ref: "#/components/parameters/x-fapi-customer-ip-address"
        - $ref: "#/components/parameters/x-fapi-interaction-id"
        - $ref: "#/components/parameters/x-customer-user-agent"
      requestBody:
        $ref: '#/components/requestBodies/DataAdministratorCreationRequest'
      tags:
        - Users
        - Public
        - Closed
      responses:
        '201':
          $ref: '#/components/responses/DataAdministrator'
        '400':
          $ref: '#/components/responses/BadRequest'
        '404':
          $ref: '#/components/responses/NotFound'
        '406':
          $ref: '#/components/responses/NotAcceptable'
        '500':
          $ref: '#/components/responses/InternalServerError'
        '502':
          $ref: '#/components/responses/BadGateway'
        '504':
          $ref: '#/components/responses/UpstreamTimeout'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '401':
          $ref: '#/components/responses/Unauthorized'
      security:
        - authorizer: [ ]
        - oAuth:
            - directory:website
      x-amazon-apigateway-integration:
        uri: "${organisation_write_arn}"
        passthroughBehavior: "when_no_match"
        httpMethod: "POST"
        timeoutInMillis: 29000
        type: "aws_proxy"

  '/users/data-administrator/{UserEmailOrID}':
    parameters:
      - $ref: '#/components/parameters/UserEmailOrID'
      - $ref: "#/components/parameters/x-fapi-auth-date"
      - $ref: "#/components/parameters/x-fapi-customer-ip-address"
      - $ref: "#/components/parameters/x-fapi-interaction-id"
      - $ref: "#/components/parameters/x-customer-user-agent"

    put:
      summary: Toggle active status of users data administrator role
      description: Deactivate or reactivate a users data administrator role
      operationId: updateDataAdministrator
      parameters:
        - $ref: "#/components/parameters/x-fapi-auth-date"
        - $ref: "#/components/parameters/x-fapi-customer-ip-address"
        - $ref: "#/components/parameters/x-fapi-interaction-id"
        - $ref: "#/components/parameters/x-customer-user-agent"
      tags:
        - Users
        - Public
        - Closed
      requestBody:
        $ref: '#/components/requestBodies/UserUpdateRequest'
      responses:
        '200':
          $ref: '#/components/responses/DataAdministrator'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '406':
          $ref: '#/components/responses/NotAcceptable'
        '500':
          $ref: '#/components/responses/InternalServerError'
        '502':
          $ref: '#/components/responses/BadGateway'
        '504':
          $ref: '#/components/responses/UpstreamTimeout'
        '429':
          $ref: '#/components/responses/TooManyRequests'
      security:
        - authorizer: [ ]
        - oAuth:
            - directory:website
      x-amazon-apigateway-integration:
        uri: "${organisation_write_arn}"
        passthroughBehavior: "when_no_match"
        httpMethod: "POST"
        timeoutInMillis: 29000
        type: "aws_proxy"

  '/users/super':
    get:
      summary: All super users
      description: Get all super users
      operationId: getSuperUsers
      parameters:
        - $ref: "#/components/parameters/x-fapi-auth-date"
        - $ref: "#/components/parameters/x-fapi-customer-ip-address"
        - $ref: "#/components/parameters/x-fapi-interaction-id"
        - $ref: "#/components/parameters/x-customer-user-agent"
        - $ref: "#/components/parameters/PageNumber"
        - $ref: "#/components/parameters/PageSize"
        - $ref: "#/components/parameters/PageSort"
      tags:
        - Users
        - Super Users
        - Public
      responses:
        '200':
          $ref: '#/components/responses/SuperUsersPage'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '406':
          $ref: '#/components/responses/NotAcceptable'
        '500':
          $ref: '#/components/responses/InternalServerError'
        '502':
          $ref: '#/components/responses/BadGateway'
        '504':
          $ref: '#/components/responses/UpstreamTimeout'
        '429':
          $ref: '#/components/responses/TooManyRequests'
      security:
        - authorizer: [ ]
        - oAuth:
            - directory:admin
            - directory:website
      x-amazon-apigateway-integration:
        uri: "${organisation_read_arn}"
        passthroughBehavior: "when_no_match"
        httpMethod: "POST"
        timeoutInMillis: 15000
        type: "aws_proxy"
    post:
      summary: Create a super user
      description: Creates a new super user
      operationId: createSuperUser
      parameters:
        - $ref: "#/components/parameters/x-fapi-auth-date"
        - $ref: "#/components/parameters/x-fapi-customer-ip-address"
        - $ref: "#/components/parameters/x-fapi-interaction-id"
        - $ref: "#/components/parameters/x-customer-user-agent"
      requestBody:
        $ref: '#/components/requestBodies/SuperUserCreationRequest'
      tags:
        - Users
        - Super Users
      responses:
        '201':
          $ref: '#/components/responses/SuperUser'
        '400':
          $ref: '#/components/responses/BadRequest'
        '404':
          $ref: '#/components/responses/NotFound'
        '406':
          $ref: '#/components/responses/NotAcceptable'
        '500':
          $ref: '#/components/responses/InternalServerError'
        '502':
          $ref: '#/components/responses/BadGateway'
        '504':
          $ref: '#/components/responses/UpstreamTimeout'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '401':
          $ref: '#/components/responses/Unauthorized'
      security:
        - authorizer: [ ]
        - oAuth:
            - directory:admin
      x-amazon-apigateway-integration:
        uri: "${organisation_write_arn}"
        passthroughBehavior: "when_no_match"
        httpMethod: "POST"
        timeoutInMillis: 29000
        type: "aws_proxy"

  '/users/super/{UserEmailOrID}':
    parameters:
      - $ref: '#/components/parameters/UserEmailOrID'
      - $ref: "#/components/parameters/x-fapi-auth-date"
      - $ref: "#/components/parameters/x-fapi-customer-ip-address"
      - $ref: "#/components/parameters/x-fapi-interaction-id"
      - $ref: "#/components/parameters/x-customer-user-agent"

    put:
      summary: Toggle active status of super user by their email
      description: Reactivate or deactives a super user
      operationId: updateSuperUserByEmail
      parameters:
        - $ref: "#/components/parameters/x-fapi-auth-date"
        - $ref: "#/components/parameters/x-fapi-customer-ip-address"
        - $ref: "#/components/parameters/x-fapi-interaction-id"
        - $ref: "#/components/parameters/x-customer-user-agent"
      tags:
        - Users
        - Super Users
      requestBody:
        $ref: '#/components/requestBodies/UserUpdateRequest'
      responses:
        '200':
          $ref: '#/components/responses/SuperUser'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '406':
          $ref: '#/components/responses/NotAcceptable'
        '500':
          $ref: '#/components/responses/InternalServerError'
        '502':
          $ref: '#/components/responses/BadGateway'
        '504':
          $ref: '#/components/responses/UpstreamTimeout'
        '429':
          $ref: '#/components/responses/TooManyRequests'
      security:
        - authorizer: [ ]
        - oAuth:
            - directory:admin
      x-amazon-apigateway-integration:
        uri: "${organisation_write_arn}"
        passthroughBehavior: "when_no_match"
        httpMethod: "POST"
        timeoutInMillis: 29000
        type: "aws_proxy"

  '/search':
    get:
      summary: Get the top 10 results based on a partial/full match of identifier
      description: Get the top 10 results based on a partial/full match of identifier
      operationId: search
      parameters:
        - $ref: "#/components/parameters/x-fapi-auth-date"
        - $ref: "#/components/parameters/x-fapi-customer-ip-address"
        - $ref: "#/components/parameters/x-fapi-interaction-id"
        - $ref: "#/components/parameters/x-customer-user-agent"
        - $ref: '#/components/parameters/Identifier'
        - $ref: '#/components/parameters/ResourceTypes'
        - $ref: '#/components/parameters/GlobalSearchStatus'
      tags:
        - Global Search
        - Public
      responses:
        '200':
          $ref: '#/components/responses/GlobalSearchResponse'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '406':
          $ref: '#/components/responses/NotAcceptable'
        '500':
          $ref: '#/components/responses/InternalServerError'
        '502':
          $ref: '#/components/responses/BadGateway'
        '504':
          $ref: '#/components/responses/UpstreamTimeout'
        '429':
          $ref: '#/components/responses/TooManyRequests'
      security:
        - authorizer: [ ]
        - oAuth:
            - directory:website
      x-amazon-apigateway-integration:
        uri: "${organisation_read_arn}"
        passthroughBehavior: "when_no_match"
        httpMethod: "POST"
        timeoutInMillis: 29000
        type: "aws_proxy"

  '/organisations/{OrganisationId}/adminusers':
    parameters:
      - $ref: '#/components/parameters/OrganisationId'
      - $ref: "#/components/parameters/x-fapi-auth-date"
      - $ref: "#/components/parameters/x-fapi-customer-ip-address"
      - $ref: "#/components/parameters/x-fapi-interaction-id"
      - $ref: "#/components/parameters/x-customer-user-agent"

    get:
      summary: All admin users for the given organisation
      description: Lists all organisation admins
      parameters:
        - $ref: "#/components/parameters/PageNumber"
        - $ref: "#/components/parameters/PageSize"
        - $ref: "#/components/parameters/PageSort"
      operationId: getOrganisationAdmins
      tags:
        - Users
        - Organisation Admin Users
        - Public
        - Closed
      responses:
        '200':
          $ref: '#/components/responses/OrganisationAdminUsers'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/InternalServerError'
        '502':
          $ref: '#/components/responses/BadGateway'
        '504':
          $ref: '#/components/responses/UpstreamTimeout'
        '429':
          $ref: '#/components/responses/TooManyRequests'
      security:
        - authorizer: [ ]
        - oAuth:
            - directory:website
            - directory:servicedesk
      x-amazon-apigateway-integration:
        uri: "${organisation_read_arn}"
        passthroughBehavior: "when_no_match"
        httpMethod: "POST"
        timeoutInMillis: 15000
        type: "aws_proxy"

    post:
      summary: Create an organisation admin user
      description: Creates a new organisation admin
      operationId: createOrganisationAdmin
      parameters:
        - $ref: "#/components/parameters/x-fapi-auth-date"
        - $ref: "#/components/parameters/x-fapi-customer-ip-address"
        - $ref: "#/components/parameters/x-fapi-interaction-id"
        - $ref: "#/components/parameters/x-customer-user-agent"
      requestBody:
        $ref: '#/components/requestBodies/OrgAdminUserCreateRequest'
      tags:
        - Users
        - Organisation Admin Users
        - Public
        - Closed
      responses:
        '201':
          $ref: '#/components/responses/OrganisationAdminUser'
        '404':
          $ref: '#/components/responses/NotFound'
        '409':
          $ref: '#/components/responses/Conflict'
        '500':
          $ref: '#/components/responses/InternalServerError'
        '502':
          $ref: '#/components/responses/BadGateway'
        '504':
          $ref: '#/components/responses/UpstreamTimeout'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '401':
          $ref: '#/components/responses/Unauthorized'
      security:
        - authorizer: [ ]
        - oAuth:
            - directory:website
      x-amazon-apigateway-integration:
        uri: "${organisation_write_arn}"
        passthroughBehavior: "when_no_match"
        httpMethod: "POST"
        timeoutInMillis: 29000
        type: "aws_proxy"

  '/organisations/{OrganisationId}/adminusers/{UserEmailOrID}':
    parameters:
      - $ref: '#/components/parameters/OrganisationId'
      - $ref: '#/components/parameters/UserEmailOrID'
      - $ref: "#/components/parameters/x-fapi-auth-date"
      - $ref: "#/components/parameters/x-fapi-customer-ip-address"
      - $ref: "#/components/parameters/x-fapi-interaction-id"
      - $ref: "#/components/parameters/x-customer-user-agent"
    get:
      summary: Gets details of an organisation admin user by their email address
      description: Gets a specific organisation admin
      operationId: getOrganisationAdminByEmail
      tags:
        - Users
        - Organisation Admin Users
        - Public
        - Closed
      responses:
        '200':
          $ref: '#/components/responses/OrganisationAdminUser'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/InternalServerError'
        '502':
          $ref: '#/components/responses/BadGateway'
        '504':
          $ref: '#/components/responses/UpstreamTimeout'
        '429':
          $ref: '#/components/responses/TooManyRequests'
      security:
        - authorizer: [ ]
        - oAuth:
            - directory:website
            - directory:servicedesk
      x-amazon-apigateway-integration:
        uri: "${organisation_read_arn}"
        passthroughBehavior: "when_no_match"
        httpMethod: "POST"
        timeoutInMillis: 15000
        type: "aws_proxy"
    put:
      summary: reactivate or deactivate an organisation admin user by their email address
      description: reactivate or deactivate an organisation admin user
      operationId: updateOrganisationAdmin
      parameters:
        - $ref: "#/components/parameters/x-fapi-auth-date"
        - $ref: "#/components/parameters/x-fapi-customer-ip-address"
        - $ref: "#/components/parameters/x-fapi-interaction-id"
        - $ref: "#/components/parameters/x-customer-user-agent"
      tags:
        - Users
        - Organisation Admin Users
        - Public
        - Closed
      requestBody:
        $ref: '#/components/requestBodies/UserUpdateRequest'
      responses:
        '200':
          $ref: '#/components/responses/OrganisationAdminUser'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/InternalServerError'
        '502':
          $ref: '#/components/responses/BadGateway'
        '504':
          $ref: '#/components/responses/UpstreamTimeout'
        '429':
          $ref: '#/components/responses/TooManyRequests'
      security:
        - authorizer: [ ]
        - oAuth:
            - directory:website
      x-amazon-apigateway-integration:
        uri: "${organisation_write_arn}"
        passthroughBehavior: "when_no_match"
        httpMethod: "POST"
        timeoutInMillis: 29000
        type: "aws_proxy"

  '/organisations/{OrganisationId}/{AuthorisationDomainName}/users':
    parameters:
      - $ref: '#/components/parameters/OrganisationId'
      - $ref: '#/components/parameters/AuthorisationDomainName'
      - $ref: "#/components/parameters/x-fapi-auth-date"
      - $ref: "#/components/parameters/x-fapi-customer-ip-address"
      - $ref: "#/components/parameters/x-fapi-interaction-id"
      - $ref: "#/components/parameters/x-customer-user-agent"
    get:
      summary: All users for the given authorisation domain
      description: Get all organisation authorisation domain users
      operationId: getOrganisationAuthorisationDomainUsers
      tags:
        - Users
        - Organisation Domain Users
        - Public
      parameters:
        - $ref: "#/components/parameters/PageNumber"
        - $ref: "#/components/parameters/PageSize"
        - $ref: "#/components/parameters/PageSort"
        - $ref: "#/components/parameters/QueryAuthorisationDomainRoleName"
      responses:
        '200':
          $ref: '#/components/responses/AuthorisationDomainUsersPage'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/InternalServerError'
        '502':
          $ref: '#/components/responses/BadGateway'
        '504':
          $ref: '#/components/responses/UpstreamTimeout'
        '429':
          $ref: '#/components/responses/TooManyRequests'
      security:
        - authorizer: [ ]
        - oAuth:
            - directory:website
            - directory:software
            - directory:servicedesk
      x-amazon-apigateway-integration:
        uri: "${organisation_read_arn}"
        passthroughBehavior: "when_no_match"
        httpMethod: "POST"
        timeoutInMillis: 15000
        type: "aws_proxy"

    post:
      summary: Create an authorisation domain user
      description: creates an organisation authorisation domain user
      operationId: createOrganisationAuthorisationDomainUser
      parameters:
        - $ref: '#/components/parameters/AuthorisationDomainName'
        - $ref: "#/components/parameters/x-fapi-auth-date"
        - $ref: "#/components/parameters/x-fapi-customer-ip-address"
        - $ref: "#/components/parameters/x-fapi-interaction-id"
        - $ref: "#/components/parameters/x-customer-user-agent"
      requestBody:
        $ref: '#/components/requestBodies/AuthorisationDomainUserCreateRequest'
      tags:
        - Users
        - Organisation Domain Users
        - Public
      responses:
        '201':
          $ref: '#/components/responses/AuthorisationDomainUser'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '409':
          $ref: '#/components/responses/Conflict'
        '500':
          $ref: '#/components/responses/InternalServerError'
        '502':
          $ref: '#/components/responses/BadGateway'
        '504':
          $ref: '#/components/responses/UpstreamTimeout'
        '429':
          $ref: '#/components/responses/TooManyRequests'

      security:
        - authorizer: [ ]
        - oAuth:
            - directory:website
            - directory:software
      x-amazon-apigateway-integration:
        uri: "${organisation_write_arn}"
        passthroughBehavior: "when_no_match"
        httpMethod: "POST"
        timeoutInMillis: 29000
        type: "aws_proxy"

  '/organisations/{OrganisationId}/{AuthorisationDomainName}/users/{UserEmailOrID}':
    parameters:
      - $ref: '#/components/parameters/OrganisationId'
      - $ref: '#/components/parameters/AuthorisationDomainName'
      - $ref: '#/components/parameters/UserEmailOrID'
      - $ref: "#/components/parameters/x-fapi-auth-date"
      - $ref: "#/components/parameters/x-fapi-customer-ip-address"
      - $ref: "#/components/parameters/x-fapi-interaction-id"
      - $ref: "#/components/parameters/x-customer-user-agent"
    get:
      summary: Authorisation Domain user details
      description: Gets a specific authorisation domain users details
      operationId: getOrganisationAuthorisationDomainUserByEmail
      tags:
        - Users
        - Organisation Domain Users
        - Public
      parameters:
        - $ref: "#/components/parameters/PageNumber"
        - $ref: "#/components/parameters/PageSize"
        - $ref: "#/components/parameters/PageSort"
      responses:
        '200':
          $ref: '#/components/responses/AuthorisationDomainUsersPage'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/InternalServerError'
        '502':
          $ref: '#/components/responses/BadGateway'
        '504':
          $ref: '#/components/responses/UpstreamTimeout'
        '429':
          $ref: '#/components/responses/TooManyRequests'
      security:
        - authorizer: [ ]
        - oAuth:
            - directory:website
            - directory:software
            - directory:servicedesk
      x-amazon-apigateway-integration:
        uri: "${organisation_read_arn}"
        passthroughBehavior: "when_no_match"
        httpMethod: "POST"
        timeoutInMillis: 15000
        type: "aws_proxy"

  '/organisations/{OrganisationId}/{AuthorisationDomainName}/users/{UserEmailOrID}/{AuthorisationDomainUserId}':
    parameters:
      - $ref: '#/components/parameters/OrganisationId'
      - $ref: '#/components/parameters/AuthorisationDomainName'
      - $ref: '#/components/parameters/UserEmailOrID'
      - $ref: '#/components/parameters/AuthorisationDomainUserId'
      - $ref: "#/components/parameters/x-fapi-auth-date"
      - $ref: "#/components/parameters/x-fapi-customer-ip-address"
      - $ref: "#/components/parameters/x-fapi-interaction-id"
      - $ref: "#/components/parameters/x-customer-user-agent"
    put:
      summary: Update an authorisation domain user record by the unique identifier
      description: updates an organisation authorisation domain user
      operationId: updateOrganisationAuthorisationDomainUserByEmail
      tags:
        - Public
        - Users
        - Organisation Domain Users
      requestBody:
        $ref: '#/components/requestBodies/UserUpdateRequest'
      responses:
        '200':
          $ref: '#/components/responses/AuthorisationDomainUser'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '409':
          $ref: '#/components/responses/Conflict'
        '500':
          $ref: '#/components/responses/InternalServerError'
        '502':
          $ref: '#/components/responses/BadGateway'
        '504':
          $ref: '#/components/responses/UpstreamTimeout'
        '429':
          $ref: '#/components/responses/TooManyRequests'
      security:
        - authorizer: [ ]
        - oAuth:
            - directory:website
      x-amazon-apigateway-integration:
        uri: "${organisation_write_arn}"
        passthroughBehavior: "when_no_match"
        httpMethod: "POST"
        timeoutInMillis: 29000
        type: "aws_proxy"

  '/registration/docusign/webhook':
    post:
      summary: Webhook that listens for docusign post requests
      description: endpoint listening for docusign webhook callbacks
      operationId: processDocusignCallback
      parameters:
        - $ref: "#/components/parameters/x-fapi-auth-date"
        - $ref: "#/components/parameters/x-fapi-customer-ip-address"
        - $ref: "#/components/parameters/x-fapi-interaction-id"
        - $ref: "#/components/parameters/x-customer-user-agent"
      tags:
        - Docusign
      requestBody:
        $ref: '#/components/requestBodies/DocusignPost'
      responses:
        '200':
          $ref: '#/components/responses/Ok'
        '403':
          $ref: '#/components/responses/Forbidden'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '500':
          $ref: '#/components/responses/InternalServerError'
        '502':
          $ref: '#/components/responses/BadGateway'
        '504':
          $ref: '#/components/responses/UpstreamTimeout'

      security:
        - authorizer: [ ]
        - oAuth:
            - directory:admin
      x-amazon-apigateway-integration:
        uri: "${organisation_write_arn}"
        passthroughBehavior: "when_no_match"
        httpMethod: "POST"
        timeoutInMillis: 29000
        type: "aws_proxy"

  '/external/creation/docusign/organisations':
    head:
      summary: Organisation registration via docusign
      description: endpoint to recieve callbacks from docusign in order to registrer a new organisation
      operationId: createOrganisationFromDocusignCallback

      parameters:
        - $ref: "#/components/parameters/x-fapi-auth-date"
        - $ref: "#/components/parameters/x-fapi-customer-ip-address"
        - $ref: "#/components/parameters/x-fapi-interaction-id"
        - $ref: "#/components/parameters/x-customer-user-agent"
      tags:
        - Docusign
      responses:
        '200':
          $ref: '#/components/responses/Ok'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '502':
          $ref: '#/components/responses/InternalServerError'
        '504':
          $ref: '#/components/responses/UpstreamTimeout'

      security:
        - authorizer: [ ]
        - oAuth:
            - directory:website
      x-amazon-apigateway-integration:
        uri: "${organisation_write_arn}"
        passthroughBehavior: "when_no_match"
        httpMethod: "POST"
        timeoutInMillis: 29000
        type: "aws_proxy"

  '/organisations':
    get:
      summary: Get all organisations that the logged in user is authorised to retrieve from trusted services
      description: get all organisations the token is authorised to retrieve
      operationId: getOrganisations
      tags:
        - Organisations
        - Public
        - Closed

      parameters:
        - $ref: "#/components/parameters/PageNumber"
        - $ref: "#/components/parameters/PageSize"
        - $ref: "#/components/parameters/PageSort"
        - in: query
          name: displayMine
          deprecated: true
          schema:
            type: string
            default: ""
          required: false
          description: Deprecated - use 'member' instead
        - in: query
          name: filterBy
          schema:
            type: string
            default: ""
          required: false
          description: Will return organisations with data like the provided value
        - in: query
          name: hideInactive
          schema:
            type: boolean
            default: false
          description: Will return only active organisations
        - in: query
          name: authority
          schema:
            type: boolean
            default: false
          description: Will return only organisations with active authority configurations
        - in: query
          name: member
          schema:
            type: boolean
            default: false
          description: When set to true, filters the results to only those organisations that the current user is a member of.
        - $ref: "#/components/parameters/x-fapi-auth-date"
        - $ref: "#/components/parameters/x-fapi-customer-ip-address"
        - $ref: "#/components/parameters/x-fapi-interaction-id"
        - $ref: "#/components/parameters/x-customer-user-agent"
      responses:
        '200':
          $ref: '#/components/responses/OrganisationsPage'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '406':
          $ref: '#/components/responses/NotAcceptable'
        '500':
          $ref: '#/components/responses/InternalServerError'
        '502':
          $ref: '#/components/responses/BadGateway'
        '504':
          $ref: '#/components/responses/UpstreamTimeout'
        '429':
          $ref: '#/components/responses/TooManyRequests'

      security:
        - authorizer: [ ]
        - oAuth:
            - directory:website
            - directory:software
      x-amazon-apigateway-integration:
        uri: "${organisation_read_arn}"
        passthroughBehavior: "when_no_match"
        httpMethod: "POST"
        timeoutInMillis: 29000
        type: "aws_proxy"
    post:
      summary: Post a new organisation in the directory.
      description: creates a new organisation
      operationId: createOrganisation
      parameters:
        - $ref: "#/components/parameters/x-fapi-auth-date"
        - $ref: "#/components/parameters/x-fapi-customer-ip-address"
        - $ref: "#/components/parameters/x-fapi-interaction-id"
        - $ref: "#/components/parameters/x-customer-user-agent"
      tags:
        - Organisations
        - Public
        - Closed
      requestBody:
        $ref: '#/components/requestBodies/Organisation'

      responses:
        '201':
          $ref: '#/components/responses/OrganisationResponse'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '409':
          $ref: '#/components/responses/Conflict'
        '500':
          $ref: '#/components/responses/InternalServerError'
        '502':
          $ref: '#/components/responses/BadGateway'
        '504':
          $ref: '#/components/responses/UpstreamTimeout'
        '429':
          $ref: '#/components/responses/TooManyRequests'

      security:
        - authorizer: [ ]
        - oAuth:
            - directory:website
      x-amazon-apigateway-integration:
        uri: "${organisation_write_arn}"
        passthroughBehavior: "when_no_match"
        httpMethod: "POST"
        timeoutInMillis: 29000
        type: "aws_proxy"

  '/organisations/{OrganisationId}':
    parameters:
      - $ref: '#/components/parameters/OrganisationId'
      - $ref: "#/components/parameters/x-fapi-auth-date"
      - $ref: "#/components/parameters/x-fapi-customer-ip-address"
      - $ref: "#/components/parameters/x-fapi-interaction-id"
      - $ref: "#/components/parameters/x-customer-user-agent"
    get:
      summary: Get the given organisations details
      description: Get specific organisation with tnc details
      operationId: getOrganisationById
      tags:
        - Organisations
        - Public
        - Closed
      responses:
        '200':
          $ref: '#/components/responses/OrganisationWithTnc'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '406':
          $ref: '#/components/responses/NotAcceptable'
        '500':
          $ref: '#/components/responses/InternalServerError'
        '502':
          $ref: '#/components/responses/BadGateway'
        '504':
          $ref: '#/components/responses/UpstreamTimeout'
        '429':
          $ref: '#/components/responses/TooManyRequests'

      security:
        - authorizer: [ ]
        - oAuth:
            - directory:website
            - directory:software
      x-amazon-apigateway-integration:
        uri: "${organisation_read_arn}"
        passthroughBehavior: "when_no_match"
        httpMethod: "POST"
        timeoutInMillis: 15000
        type: "aws_proxy"
    put:
      summary: Amend the given organisations details
      description: Updates an organisation
      operationId: updateOrganisationById
      parameters:
        - $ref: "#/components/parameters/x-fapi-auth-date"
        - $ref: "#/components/parameters/x-fapi-customer-ip-address"
        - $ref: "#/components/parameters/x-fapi-interaction-id"
        - $ref: "#/components/parameters/x-customer-user-agent"
      tags:
        - Organisations
        - Public
        - Closed
      requestBody:
        $ref: '#/components/requestBodies/OrganisationUpdate'
      responses:
        '200':
          $ref: '#/components/responses/OrganisationResponse'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '406':
          $ref: '#/components/responses/NotAcceptable'
        '500':
          $ref: '#/components/responses/InternalServerError'
        '502':
          $ref: '#/components/responses/BadGateway'
        '504':
          $ref: '#/components/responses/UpstreamTimeout'
        '429':
          $ref: '#/components/responses/TooManyRequests'

      security:
        - authorizer: [ ]
        - oAuth:
            - directory:website
      x-amazon-apigateway-integration:
        uri: "${organisation_write_arn}"
        passthroughBehavior: "when_no_match"
        httpMethod: "POST"
        timeoutInMillis: 29000
        type: "aws_proxy"
    delete:
      summary: Delete an organisation by changing its status to "Withdrawn"
      description: deletes a specific organisation setting its status to "Withdrawn"
      operationId: deleteOrganisationById
      parameters:
        - $ref: "#/components/parameters/x-fapi-auth-date"
        - $ref: "#/components/parameters/x-fapi-customer-ip-address"
        - $ref: "#/components/parameters/x-fapi-interaction-id"
        - $ref: "#/components/parameters/x-customer-user-agent"
      tags:
        - Organisations
        - Public
        - Closed
      responses:
        '204':
          $ref: '#/components/responses/NoContent'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '406':
          $ref: '#/components/responses/NotAcceptable'
        '500':
          $ref: '#/components/responses/InternalServerError'
        '502':
          $ref: '#/components/responses/BadGateway'
        '504':
          $ref: '#/components/responses/UpstreamTimeout'
        '429':
          $ref: '#/components/responses/TooManyRequests'

      security:
        - authorizer: [ ]
        - oAuth:
            - directory:website
      x-amazon-apigateway-integration:
        uri: "${organisation_write_arn}"
        passthroughBehavior: "when_no_match"
        httpMethod: "POST"
        timeoutInMillis: 29000
        type: "aws_proxy"

  '/organisations/{OrganisationId}/authority-configuration':
    parameters:
      - $ref: '#/components/parameters/OrganisationId'
      - $ref: "#/components/parameters/x-fapi-auth-date"
      - $ref: "#/components/parameters/x-fapi-customer-ip-address"
      - $ref: "#/components/parameters/x-fapi-interaction-id"
      - $ref: "#/components/parameters/x-customer-user-agent"
    post:
      summary: Configures a given organisation as an authority
      description: Configures a given organisation to be able to act as an authority
      operationId: createOrganisationAuthorityConfiguration
      tags:
        - Organisations
        - Public
        - Closed
      requestBody:
        $ref: '#/components/requestBodies/AuthorityCreationRequest'
      responses:
        '200':
          $ref: '#/components/responses/AuthorityObject'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '406':
          $ref: '#/components/responses/NotAcceptable'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '500':
          $ref: '#/components/responses/InternalServerError'
        '502':
          $ref: '#/components/responses/BadGateway'
        '504':
          $ref: '#/components/responses/UpstreamTimeout'
      security:
        - authorizer: [ ]
        - oAuth:
            - directory:website
      x-amazon-apigateway-integration:
        uri: "${organisation_write_arn}"
        passthroughBehavior: "when_no_match"
        httpMethod: "POST"
        timeoutInMillis: 29000
        type: "aws_proxy"

  '/organisations/{OrganisationId}/authority-configuration/{AuthorityId}':
    parameters:
      - $ref: '#/components/parameters/OrganisationId'
      - $ref: '#/components/parameters/AuthorityId'
      - $ref: "#/components/parameters/x-fapi-auth-date"
      - $ref: "#/components/parameters/x-fapi-customer-ip-address"
      - $ref: "#/components/parameters/x-fapi-interaction-id"
      - $ref: "#/components/parameters/x-customer-user-agent"
    get:
      summary: Retrieves the authority configuration for a given organisation
      description: Retrieves the authority configuration for a given organisation
      operationId: getOrganisationAuthorityConfiguration
      tags:
        - Organisations
        - Public
        - Closed
      responses:
        '200':
          $ref: '#/components/responses/AuthorityObject'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '406':
          $ref: '#/components/responses/NotAcceptable'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '500':
          $ref: '#/components/responses/InternalServerError'
        '502':
          $ref: '#/components/responses/BadGateway'
        '504':
          $ref: '#/components/responses/UpstreamTimeout'
      security:
        - authorizer: [ ]
        - oAuth:
            - directory:website
            - directory:software
      x-amazon-apigateway-integration:
        uri: "${organisation_read_arn}"
        passthroughBehavior: "when_no_match"
        httpMethod: "POST"
        timeoutInMillis: 15000
        type: "aws_proxy"
    put:
      summary: Updates a given organisations authority configuration
      description: Updates the information of a given organisations authority configuration
      operationId: updateOrganisationAuthorityConfiguration
      tags:
        - Organisations
        - Public
        - Closed
      requestBody:
        $ref: '#/components/requestBodies/AuthorityUpdateRequest'
      responses:
        '200':
          $ref: '#/components/responses/AuthorityObject'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '406':
          $ref: '#/components/responses/NotAcceptable'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '500':
          $ref: '#/components/responses/InternalServerError'
        '502':
          $ref: '#/components/responses/BadGateway'
        '504':
          $ref: '#/components/responses/UpstreamTimeout'
      security:
        - authorizer: [ ]
        - oAuth:
            - directory:website
      x-amazon-apigateway-integration:
        uri: "${organisation_write_arn}"
        passthroughBehavior: "when_no_match"
        httpMethod: "POST"
        timeoutInMillis: 29000
        type: "aws_proxy"

  '/organisations/{OrganisationId}/ess/initiatesigning':
    post:
      summary: This API initiates ESS signing process by an org admin
      description: initiate signing of a tnc document
      operationId: initiateOrganisationTncSigning
      parameters:
        - $ref: '#/components/parameters/OrganisationId'
        - $ref: "#/components/parameters/x-fapi-auth-date"
        - $ref: "#/components/parameters/x-fapi-customer-ip-address"
        - $ref: "#/components/parameters/x-fapi-interaction-id"
        - $ref: "#/components/parameters/x-customer-user-agent"
      requestBody:
        $ref: '#/components/requestBodies/EssSignRequest'
      tags:
        - Organisations
        - Docusign
        - Public
      responses:
        '200':
          $ref: '#/components/responses/OrgTermsAndConditionsDetail'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/InternalServerError'
        '502':
          $ref: '#/components/responses/BadGateway'
        '504':
          $ref: '#/components/responses/UpstreamTimeout'
        '429':
          $ref: '#/components/responses/TooManyRequests'
      security:
        - authorizer: [ ]
        - oAuth:
            - directory:website
      x-amazon-apigateway-integration:
        uri: "${organisation_write_arn}"
        passthroughBehavior: "when_no_match"
        httpMethod: "POST"
        timeoutInMillis: 29000
        type: "aws_proxy"

  '/organisations/{OrganisationId}/ess/poll/{ExternalSigningServiceEnvelopeId}':
    get:
      parameters:
        - $ref: '#/components/parameters/OrganisationId'
        - $ref: '#/components/parameters/ExternalSigningServiceEnvelopeId'
        - $ref: "#/components/parameters/x-fapi-auth-date"
        - $ref: "#/components/parameters/x-fapi-customer-ip-address"
        - $ref: "#/components/parameters/x-fapi-interaction-id"
        - $ref: "#/components/parameters/x-customer-user-agent"
      summary: Polls the ESS to get the latest status of the signing request
      description: polls docusign for a specific envelopes status and updates the resources accordingly
      operationId: pollOrganisationTncEnvelope
      tags:
        - Organisations
        - Docusign
      responses:
        '200':
          $ref: '#/components/responses/EssPollResponse'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/InternalServerError'
        '502':
          $ref: '#/components/responses/BadGateway'
        '504':
          $ref: '#/components/responses/UpstreamTimeout'
        '429':
          $ref: '#/components/responses/TooManyRequests'

      security:
        - authorizer: [ ]
        - oAuth:
            - directory:website
            - directory:software
      x-amazon-apigateway-integration:
        uri: "${organisation_write_arn}"
        passthroughBehavior: "when_no_match"
        httpMethod: "POST"
        timeoutInMillis: 29000
        type: "aws_proxy"

  '/organisations/{OrganisationId}/ess/reissue/{ExternalSigningServiceEnvelopeId}':
    post:
      summary: This API marks the current envelope as reissued and allows a new one to be started
      description: mark envelope as reissued
      operationId: reissueEnvelope
      parameters:
        - $ref: '#/components/parameters/OrganisationId'
        - $ref: '#/components/parameters/ExternalSigningServiceEnvelopeId'
        - $ref: "#/components/parameters/x-fapi-auth-date"
        - $ref: "#/components/parameters/x-fapi-customer-ip-address"
        - $ref: "#/components/parameters/x-fapi-interaction-id"
        - $ref: "#/components/parameters/x-customer-user-agent"
      tags:
        - Organisations
        - Docusign
        - Public
      responses:
        '200':
          $ref: '#/components/responses/EssPollResponse'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/InternalServerError'
        '502':
          $ref: '#/components/responses/BadGateway'
        '504':
          $ref: '#/components/responses/UpstreamTimeout'
        '429':
          $ref: '#/components/responses/TooManyRequests'
      security:
        - authorizer: [ ]
        - oAuth:
            - directory:website
      x-amazon-apigateway-integration:
        uri: "${organisation_write_arn}"
        passthroughBehavior: "when_no_match"
        httpMethod: "POST"
        timeoutInMillis: 29000
        type: "aws_proxy"

  '/organisations/ess/poll':
    get:
      summary: Polls the ESS to get the latest status & update all envelopes that havent been sent or completed
      description: polls docusign for all envelope statuses and updates the resources accordingly
      operationId: pollAllOrganisationTncEnvelope
      parameters:
        - $ref: "#/components/parameters/x-fapi-auth-date"
        - $ref: "#/components/parameters/x-fapi-customer-ip-address"
        - $ref: "#/components/parameters/x-fapi-interaction-id"
        - $ref: "#/components/parameters/x-customer-user-agent"
      tags:
        - Organisations
        - Docusign
      responses:
        '200':
          $ref: '#/components/responses/EssPollAllResponse'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '500':
          $ref: '#/components/responses/InternalServerError'
        '502':
          $ref: '#/components/responses/BadGateway'
        '504':
          $ref: '#/components/responses/UpstreamTimeout'
        '429':
          $ref: '#/components/responses/TooManyRequests'

      security:
        - authorizer: [ ]
        - oAuth:
            - directory:website
            - directory:software
      x-amazon-apigateway-integration:
        uri: "${organisation_write_arn}"
        passthroughBehavior: "when_no_match"
        httpMethod: "POST"
        timeoutInMillis: 29000
        type: "aws_proxy"

  '/organisations/{OrganisationId}/tnchistory':
    get:
      parameters:
        - $ref: '#/components/parameters/OrganisationId'
        - $ref: "#/components/parameters/x-fapi-auth-date"
        - $ref: "#/components/parameters/x-fapi-customer-ip-address"
        - $ref: "#/components/parameters/x-fapi-interaction-id"
        - $ref: "#/components/parameters/x-customer-user-agent"
        - $ref: "#/components/parameters/PageNumber"
        - $ref: "#/components/parameters/PageSize"
        - $ref: "#/components/parameters/PageSort"
      summary: Get all TnC data of the given organisation
      description: returns all tnc data for a specific organisation
      operationId: getTncHistoryByOrganisationId
      tags:
        - Organisations
        - Public
      responses:
        '200':
          $ref: '#/components/responses/OrgTermsAndConditionsPage'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/InternalServerError'
        '502':
          $ref: '#/components/responses/BadGateway'
        '504':
          $ref: '#/components/responses/UpstreamTimeout'
        '429':
          $ref: '#/components/responses/TooManyRequests'

      security:
        - authorizer: [ ]
        - oAuth:
            - directory:website
            - directory:software
      x-amazon-apigateway-integration:
        uri: "${organisation_read_arn}"
        passthroughBehavior: "when_no_match"
        httpMethod: "POST"
        timeoutInMillis: 29000
        type: "aws_proxy"

  '/organisations/export/open-data':
    get:
      summary: Get the participant open-data and write to S3
      description: triggers an open data export generating the participants endpoint
      operationId: generateParticipantsEndpoint
      tags:
        - Organisations
        - Export
        - Participants
      parameters:
        - $ref: "#/components/parameters/x-fapi-interaction-id"
      responses:
        '200':
          $ref: '#/components/responses/OrganisationsExportOpenData'
        '403':
          $ref: '#/components/responses/Forbidden'
        '500':
          $ref: '#/components/responses/InternalServerError'
        '502':
          $ref: '#/components/responses/BadGateway'
        '504':
          $ref: '#/components/responses/UpstreamTimeout'
        '429':
          $ref: '#/components/responses/TooManyRequests'
      security:
        - authorizer: [ ]
        - oAuth:
            - directory:admin
      x-amazon-apigateway-integration:
        responses:
          default:
            statusCode: "403"
        passthroughBehavior: "when_no_match"
        requestTemplates:
          application/json: "{\"statusCode\": 403}"
        type: "mock"

  '/organisations/{OrganisationId}/conformancetest':
    parameters:
      - $ref: '#/components/parameters/OrganisationId'
      - $ref: "#/components/parameters/x-fapi-auth-date"
      - $ref: "#/components/parameters/x-fapi-customer-ip-address"
      - $ref: "#/components/parameters/x-fapi-interaction-id"
      - $ref: "#/components/parameters/x-customer-user-agent"
    post:
      summary: Create and execute a Conformance Suite test plan for the given organisation
      description: creates and runs a conformance suite test based on the configuration document
      operationId: createConformanceSuiteRunByOrganisationId
      tags:
        - Organisations
        - Conformance Suite
        - Public
      requestBody:
        $ref: '#/components/requestBodies/OrganisationConformanceTest'

      responses:
        '201':
          $ref: '#/components/responses/OrganisationConformanceTestResult'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '409':
          $ref: '#/components/responses/Conflict'
        '500':
          $ref: '#/components/responses/InternalServerError'
        '502':
          $ref: '#/components/responses/BadGateway'
        '504':
          $ref: '#/components/responses/UpstreamTimeout'
        '429':
          $ref: '#/components/responses/TooManyRequests'

      security:
        - authorizer: [ ]
        - oAuth:
            - directory:website
            - directory:software
      x-amazon-apigateway-integration:
        uri: "${organisation_read_arn}"
        passthroughBehavior: "when_no_match"
        httpMethod: "POST"
        timeoutInMillis: 29000
        type: "aws_proxy"

  '/references/resources/openid-provider-public-key':
    parameters:
      - $ref: "#/components/parameters/x-fapi-auth-date"
      - $ref: "#/components/parameters/x-fapi-customer-ip-address"
      - $ref: "#/components/parameters/x-fapi-interaction-id"
      - $ref: "#/components/parameters/x-customer-user-agent"
    get:
      summary: Returns public key for SSO integrations
      description: '''Returns an application/x-pem-file format public key. This is the public portion of the key used to sign requests to any IDP configured on the directory for SSO'''
      operationId: retrieveSsoPublicKey
      tags:
        - Reference Data
      responses:
        '200':
          $ref: '#/components/responses/PemFile'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '406':
          $ref: '#/components/responses/NotAcceptable'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '500':
          $ref: '#/components/responses/InternalServerError'
        '502':
          $ref: '#/components/responses/BadGateway'
        '504':
          $ref: '#/components/responses/UpstreamTimeout'
      security:
        - authorizer: [ ]
        - oAuth:
            - directory:website
      x-amazon-apigateway-integration:
        uri: "${organisation_read_arn}"
        passthroughBehavior: "when_no_match"
        httpMethod: "POST"
        timeoutInMillis: 29000
        type: "aws_proxy"

  '/references/users/sso-configurations':
    parameters:
      - $ref: "#/components/parameters/x-fapi-auth-date"
      - $ref: "#/components/parameters/x-fapi-customer-ip-address"
      - $ref: "#/components/parameters/x-fapi-interaction-id"
      - $ref: "#/components/parameters/x-customer-user-agent"
    get:
      summary: Lists all IDPs configured as sso providers in the platform
      description: '''Retrieves IDPs configured for SSO on the platform along with some basic identifiable information for further querying'''
      operationId: listSsoConfigurations
      parameters:
        - $ref: "#/components/parameters/PageNumber"
        - $ref: "#/components/parameters/PageSize"
        - $ref: "#/components/parameters/PageSort"
      tags:
        - Reference Data
        - Users
      responses:
        '200':
          $ref: '#/components/responses/HighLevelSsoConfigurationObjectPage'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '406':
          $ref: '#/components/responses/NotAcceptable'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '500':
          $ref: '#/components/responses/InternalServerError'
        '502':
          $ref: '#/components/responses/BadGateway'
        '504':
          $ref: '#/components/responses/UpstreamTimeout'
      security:
        - authorizer: [ ]
        - oAuth:
            - directory:website
      x-amazon-apigateway-integration:
        uri: "${organisation_read_arn}"
        passthroughBehavior: "when_no_match"
        httpMethod: "POST"
        timeoutInMillis: 29000
        type: "aws_proxy"

  '/references/users/sso-configurations/{ssoConfigurationId}':
    parameters:
      - $ref: "#/components/parameters/x-fapi-auth-date"
      - $ref: "#/components/parameters/x-fapi-customer-ip-address"
      - $ref: "#/components/parameters/x-fapi-interaction-id"
      - $ref: "#/components/parameters/x-customer-user-agent"
      - $ref: "#/components/parameters/SsoConfigurationIdPathParameter"
    get:
      summary: Retrieves a specific member of the set of all IDPs configured as sso providers in the platform
      description: '''Retrieves a specific member of the set of all IDPs configured for SSO on the platform along with some basic identifiable information for further querying'''
      operationId: getSsoConfiguration
      parameters:
        - $ref: "#/components/parameters/PageNumber"
        - $ref: "#/components/parameters/PageSize"
        - $ref: "#/components/parameters/PageSort"
      tags:
        - Reference Data
        - Users
      responses:
        '200':
          $ref: '#/components/responses/HighLevelSsoConfigurationObject'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '406':
          $ref: '#/components/responses/NotAcceptable'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '500':
          $ref: '#/components/responses/InternalServerError'
        '502':
          $ref: '#/components/responses/BadGateway'
        '504':
          $ref: '#/components/responses/UpstreamTimeout'
      security:
        - authorizer: [ ]
        - oAuth:
            - directory:website
      x-amazon-apigateway-integration:
        uri: "${organisation_read_arn}"
        passthroughBehavior: "when_no_match"
        httpMethod: "POST"
        timeoutInMillis: 29000
        type: "aws_proxy"

  '/references/users/groups':
    parameters:
      - $ref: "#/components/parameters/x-fapi-auth-date"
      - $ref: "#/components/parameters/x-fapi-customer-ip-address"
      - $ref: "#/components/parameters/x-fapi-interaction-id"
      - $ref: "#/components/parameters/x-customer-user-agent"
    get:
      summary: Lists all groups configured in the platform
      description: '''Retrieves all user groups configured for the current deployment. Filtering by management type is 
        supported where only users with Ecosystem-level permissions able to retrieve a set that may include raidiam-managed
        groups'''
      operationId: listUserGroups
      parameters:
        - $ref: "#/components/parameters/PageNumber"
        - $ref: "#/components/parameters/PageSize"
        - $ref: "#/components/parameters/PageSort"
        - in: query
          name: managementType
          required: false
          schema:
            $ref: "#/components/schemas/UserGroupManagementType"
          description: The management type of the groups to filter by
      tags:
        - Reference Data
        - Users
      responses:
        '200':
          $ref: '#/components/responses/UserGroupPage'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '406':
          $ref: '#/components/responses/NotAcceptable'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '500':
          $ref: '#/components/responses/InternalServerError'
        '502':
          $ref: '#/components/responses/BadGateway'
        '504':
          $ref: '#/components/responses/UpstreamTimeout'
      security:
        - authorizer: [ ]
        - oAuth:
            - directory:website
      x-amazon-apigateway-integration:
        uri: "${organisation_read_arn}"
        passthroughBehavior: "when_no_match"
        httpMethod: "POST"
        timeoutInMillis: 29000
        type: "aws_proxy"
    post:
      summary: Creates a new directory-managed user group
      description: '''Creates a new directory-managed user group'''
      operationId: createUserGroup
      tags:
        - Reference Data
        - Users
      requestBody:
        $ref: '#/components/requestBodies/UserGroupCreationRequest'
      responses:
        '201':
          $ref: '#/components/responses/UserGroupObject'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '406':
          $ref: '#/components/responses/NotAcceptable'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '500':
          $ref: '#/components/responses/InternalServerError'
        '502':
          $ref: '#/components/responses/BadGateway'
        '504':
          $ref: '#/components/responses/UpstreamTimeout'
      security:
        - authorizer: [ ]
        - oAuth:
            - directory:website
      x-amazon-apigateway-integration:
        uri: "${organisation_write_arn}"
        passthroughBehavior: "when_no_match"
        httpMethod: "POST"
        timeoutInMillis: 29000
        type: "aws_proxy"

  '/references/users/groups/{groupID}':
    parameters:
      - $ref: "#/components/parameters/x-fapi-auth-date"
      - $ref: "#/components/parameters/x-fapi-customer-ip-address"
      - $ref: "#/components/parameters/x-fapi-interaction-id"
      - $ref: "#/components/parameters/x-customer-user-agent"
      - in: path
        name: groupID
        required: true
        schema:
          $ref: "#/components/schemas/UserGroupID"
    get:
      summary: Retrieves a given user group configured in the platform
      description: '''Retrieves all user groups configured for the current deployment. Filtering by management type is 
        supported where only users with Ecosystem-level permissions able to retrieve a set that may include raidiam-managed
        groups'''
      operationId: getUserGroup
      tags:
        - Reference Data
        - Users
      responses:
        '200':
          $ref: '#/components/responses/UserGroupObject'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '406':
          $ref: '#/components/responses/NotAcceptable'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '500':
          $ref: '#/components/responses/InternalServerError'
        '502':
          $ref: '#/components/responses/BadGateway'
        '504':
          $ref: '#/components/responses/UpstreamTimeout'
      security:
        - authorizer: [ ]
        - oAuth:
            - directory:website
      x-amazon-apigateway-integration:
        uri: "${organisation_read_arn}"
        passthroughBehavior: "when_no_match"
        httpMethod: "POST"
        timeoutInMillis: 29000
        type: "aws_proxy"
    put:
      summary: Updates a directory-managed user group configured in the platform
      description: '''Updates an existing directory-managed user group'''
      operationId: updateUserGroup
      tags:
        - Reference Data
        - Users
      requestBody:
        $ref: '#/components/requestBodies/UserGroupUpdateRequest'
      responses:
        '201':
          $ref: '#/components/responses/UserGroupObject'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '406':
          $ref: '#/components/responses/NotAcceptable'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '500':
          $ref: '#/components/responses/InternalServerError'
        '502':
          $ref: '#/components/responses/BadGateway'
        '504':
          $ref: '#/components/responses/UpstreamTimeout'
      security:
        - authorizer: [ ]
        - oAuth:
            - directory:website
      x-amazon-apigateway-integration:
        uri: "${organisation_write_arn}"
        passthroughBehavior: "when_no_match"
        httpMethod: "POST"
        timeoutInMillis: 29000
        type: "aws_proxy"
    delete:
      summary: Deletes a directory-managed user group configured in the platform
      description: '''Deletes an existing directory-managed user group'''
      operationId: deleteUserGroup
      tags:
        - Reference Data
        - Users
      responses:
        '204':
          $ref: '#/components/responses/NoContent'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '406':
          $ref: '#/components/responses/NotAcceptable'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '500':
          $ref: '#/components/responses/InternalServerError'
        '502':
          $ref: '#/components/responses/BadGateway'
        '504':
          $ref: '#/components/responses/UpstreamTimeout'
      security:
        - authorizer: [ ]
        - oAuth:
            - directory:website
      x-amazon-apigateway-integration:
        uri: "${organisation_write_arn}"
        passthroughBehavior: "when_no_match"
        httpMethod: "POST"
        timeoutInMillis: 29000
        type: "aws_proxy"

  '/references/users/groups/{groupID}/idp-binding':
    parameters:
      - $ref: "#/components/parameters/x-fapi-auth-date"
      - $ref: "#/components/parameters/x-fapi-customer-ip-address"
      - $ref: "#/components/parameters/x-fapi-interaction-id"
      - $ref: "#/components/parameters/x-customer-user-agent"
      - in: path
        name: groupID
        required: true
        schema:
          $ref: "#/components/schemas/UserGroupID"
    get:
      summary: Lists all IDPs bound to a specific group
      description: '''Retrieves a paginated set of all IDP Configurations that are bound to a specific user group. Note
      that a given IDP may be bound to multiple groups'''
      operationId: listUserGroupIDPBindings
      parameters:
        - $ref: "#/components/parameters/PageNumber"
        - $ref: "#/components/parameters/PageSize"
        - $ref: "#/components/parameters/PageSort"
      tags:
        - Reference Data
        - Users
      responses:
        '200':
          $ref: '#/components/responses/UserGroupIDPBindingPage'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '406':
          $ref: '#/components/responses/NotAcceptable'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '500':
          $ref: '#/components/responses/InternalServerError'
        '502':
          $ref: '#/components/responses/BadGateway'
        '504':
          $ref: '#/components/responses/UpstreamTimeout'
      security:
        - authorizer: [ ]
        - oAuth:
            - directory:website
      x-amazon-apigateway-integration:
        uri: "${organisation_read_arn}"
        passthroughBehavior: "when_no_match"
        httpMethod: "POST"
        timeoutInMillis: 29000
        type: "aws_proxy"
    post:
      summary: Creates a new binding between an IDP and a Group
      description: '''Creates a new mapping between a given IDP Configuration and a user group. No group may have the 
      same IDP Configuration mapped to it multiple times.'''
      operationId: createUserGroupIDPBinding
      tags:
        - Reference Data
        - Users
      requestBody:
        $ref: '#/components/requestBodies/UserGroupIDPBindingCreationRequest'
      responses:
        '201':
          $ref: '#/components/responses/UserGroupIDPBindingObject'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '406':
          $ref: '#/components/responses/NotAcceptable'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '500':
          $ref: '#/components/responses/InternalServerError'
        '502':
          $ref: '#/components/responses/BadGateway'
        '504':
          $ref: '#/components/responses/UpstreamTimeout'
      security:
        - authorizer: [ ]
        - oAuth:
            - directory:website
      x-amazon-apigateway-integration:
        uri: "${organisation_write_arn}"
        passthroughBehavior: "when_no_match"
        httpMethod: "POST"
        timeoutInMillis: 29000
        type: "aws_proxy"

  '/references/users/groups/{groupID}/idp-binding/{bindingID}':
    parameters:
      - $ref: "#/components/parameters/x-fapi-auth-date"
      - $ref: "#/components/parameters/x-fapi-customer-ip-address"
      - $ref: "#/components/parameters/x-fapi-interaction-id"
      - $ref: "#/components/parameters/x-customer-user-agent"
      - in: path
        name: groupID
        required: true
        schema:
          $ref: "#/components/schemas/UserGroupID"
      - in: path
        name: bindingID
        required: true
        schema:
          $ref: "#/components/schemas/UserGroupIDPBindingID"
    delete:
      summary: Deletes a binding between an IDP and a user group
      description: '''Deletes a binding between a given IDP Configuration Entity and User Group'''
      operationId: deleteUserGroupIDPBinding
      tags:
        - Reference Data
        - Users
      responses:
        '204':
          $ref: '#/components/responses/NoContent'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '406':
          $ref: '#/components/responses/NotAcceptable'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '500':
          $ref: '#/components/responses/InternalServerError'
        '502':
          $ref: '#/components/responses/BadGateway'
        '504':
          $ref: '#/components/responses/UpstreamTimeout'
      security:
        - authorizer: [ ]
        - oAuth:
            - directory:website
      x-amazon-apigateway-integration:
        uri: "${organisation_write_arn}"
        passthroughBehavior: "when_no_match"
        httpMethod: "POST"
        timeoutInMillis: 29000
        type: "aws_proxy"

  '/references/users/groups/{groupID}/organisation-binding':
    parameters:
      - $ref: "#/components/parameters/x-fapi-auth-date"
      - $ref: "#/components/parameters/x-fapi-customer-ip-address"
      - $ref: "#/components/parameters/x-fapi-interaction-id"
      - $ref: "#/components/parameters/x-customer-user-agent"
      - in: path
        name: groupID
        required: true
        schema:
          $ref: "#/components/schemas/UserGroupID"
    get:
      summary: Lists all organisations mapped to a specific group
      description: '''Retrieves a paginated set of all Organisations that have a mapping to the subject User Group.
      Any users in this group will be able to assume the granted permissions in the specified organisation'''
      operationId: listUserGroupOrganisationBindings
      parameters:
        - $ref: "#/components/parameters/PageNumber"
        - $ref: "#/components/parameters/PageSize"
        - $ref: "#/components/parameters/PageSort"
      tags:
        - Reference Data
        - Users
      responses:
        '200':
          $ref: '#/components/responses/UserGroupOrganisationBindingPage'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '406':
          $ref: '#/components/responses/NotAcceptable'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '500':
          $ref: '#/components/responses/InternalServerError'
        '502':
          $ref: '#/components/responses/BadGateway'
        '504':
          $ref: '#/components/responses/UpstreamTimeout'
      security:
        - authorizer: [ ]
        - oAuth:
            - directory:website
      x-amazon-apigateway-integration:
        uri: "${organisation_read_arn}"
        passthroughBehavior: "when_no_match"
        httpMethod: "POST"
        timeoutInMillis: 29000
        type: "aws_proxy"
    post:
      summary: Creates a new binding between an Organisation and a Group
      description: '''Creates a new mapping between a given Organisation and a user group. No group may have the 
      same Organisation mapped to it multiple times.'''
      operationId: createUserGroupOrganisationBinding
      tags:
        - Reference Data
        - Users
      requestBody:
        $ref: '#/components/requestBodies/UserGroupOrganisationBindingCreationRequest'
      responses:
        '201':
          $ref: '#/components/responses/UserGroupOrganisationBindingObject'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '406':
          $ref: '#/components/responses/NotAcceptable'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '500':
          $ref: '#/components/responses/InternalServerError'
        '502':
          $ref: '#/components/responses/BadGateway'
        '504':
          $ref: '#/components/responses/UpstreamTimeout'
      security:
        - authorizer: [ ]
        - oAuth:
            - directory:website
      x-amazon-apigateway-integration:
        uri: "${organisation_write_arn}"
        passthroughBehavior: "when_no_match"
        httpMethod: "POST"
        timeoutInMillis: 29000
        type: "aws_proxy"

  '/references/users/groups/{groupID}/organisation-binding/{bindingID}':
    parameters:
      - $ref: "#/components/parameters/x-fapi-auth-date"
      - $ref: "#/components/parameters/x-fapi-customer-ip-address"
      - $ref: "#/components/parameters/x-fapi-interaction-id"
      - $ref: "#/components/parameters/x-customer-user-agent"
      - in: path
        name: groupID
        required: true
        schema:
          $ref: "#/components/schemas/UserGroupID"
      - in: path
        name: bindingID
        required: true
        schema:
          $ref: "#/components/schemas/UserGroupOrganisationBindingID"
    delete:
      summary: Deletes a binding between an Organisation and a user group
      description: '''Deletes a binding between a given Organisation and User Group'''
      operationId: deleteUserGroupOrganisationBinding
      tags:
        - Reference Data
        - Users
      responses:
        '204':
          $ref: '#/components/responses/NoContent'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '406':
          $ref: '#/components/responses/NotAcceptable'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '500':
          $ref: '#/components/responses/InternalServerError'
        '502':
          $ref: '#/components/responses/BadGateway'
        '504':
          $ref: '#/components/responses/UpstreamTimeout'
      security:
        - authorizer: [ ]
        - oAuth:
            - directory:website
      x-amazon-apigateway-integration:
        uri: "${organisation_write_arn}"
        passthroughBehavior: "when_no_match"
        httpMethod: "POST"
        timeoutInMillis: 29000
        type: "aws_proxy"

  '/references/users/groups/{groupID}/permissions':
    parameters:
      - $ref: "#/components/parameters/x-fapi-auth-date"
      - $ref: "#/components/parameters/x-fapi-customer-ip-address"
      - $ref: "#/components/parameters/x-fapi-interaction-id"
      - $ref: "#/components/parameters/x-customer-user-agent"
      - in: path
        name: groupID
        required: true
        schema:
          $ref: "#/components/schemas/UserGroupID"
    get:
      summary: Lists all permissions associated with a specific group
      description: '''Retrieves a paginated set of all permissions that members of a given user group will be assigned'''
      operationId: listUserGroupPermissions
      parameters:
        - $ref: "#/components/parameters/PageNumber"
        - $ref: "#/components/parameters/PageSize"
        - $ref: "#/components/parameters/PageSort"
      tags:
        - Reference Data
        - Users
      responses:
        '200':
          $ref: '#/components/responses/UserGroupPermissionPage'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '406':
          $ref: '#/components/responses/NotAcceptable'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '500':
          $ref: '#/components/responses/InternalServerError'
        '502':
          $ref: '#/components/responses/BadGateway'
        '504':
          $ref: '#/components/responses/UpstreamTimeout'
      security:
        - authorizer: [ ]
        - oAuth:
            - directory:website
      x-amazon-apigateway-integration:
        uri: "${organisation_read_arn}"
        passthroughBehavior: "when_no_match"
        httpMethod: "POST"
        timeoutInMillis: 29000
        type: "aws_proxy"
    post:
      summary: Assigns a new permission to the group
      description: '''Assigns a new permission to the group. Members of the group will be granted this permission.'''
      operationId: createUserGroupPermission
      tags:
        - Reference Data
        - Users
      requestBody:
        $ref: '#/components/requestBodies/UserGroupPermissionCreationRequest'
      responses:
        '201':
          $ref: '#/components/responses/UserGroupPermissionObject'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '406':
          $ref: '#/components/responses/NotAcceptable'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '500':
          $ref: '#/components/responses/InternalServerError'
        '502':
          $ref: '#/components/responses/BadGateway'
        '504':
          $ref: '#/components/responses/UpstreamTimeout'
      security:
        - authorizer: [ ]
        - oAuth:
            - directory:website
      x-amazon-apigateway-integration:
        uri: "${organisation_write_arn}"
        passthroughBehavior: "when_no_match"
        httpMethod: "POST"
        timeoutInMillis: 29000
        type: "aws_proxy"

  '/references/users/groups/{groupID}/permissions/{permissionID}':
    parameters:
      - $ref: "#/components/parameters/x-fapi-auth-date"
      - $ref: "#/components/parameters/x-fapi-customer-ip-address"
      - $ref: "#/components/parameters/x-fapi-interaction-id"
      - $ref: "#/components/parameters/x-customer-user-agent"
      - in: path
        name: groupID
        required: true
        schema:
          $ref: "#/components/schemas/UserGroupID"
      - in: path
        name: permissionID
        required: true
        schema:
          $ref: "#/components/schemas/UserGroupPermissionID"
    delete:
      summary: Removes a permission assignment from a group
      description: '''Deletes the assignment of a given permission to a user group'''
      operationId: deleteUserGroupPermission
      tags:
        - Reference Data
        - Users
      responses:
        '204':
          $ref: '#/components/responses/NoContent'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '406':
          $ref: '#/components/responses/NotAcceptable'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '500':
          $ref: '#/components/responses/InternalServerError'
        '502':
          $ref: '#/components/responses/BadGateway'
        '504':
          $ref: '#/components/responses/UpstreamTimeout'
      security:
        - authorizer: [ ]
        - oAuth:
            - directory:website
      x-amazon-apigateway-integration:
        uri: "${organisation_write_arn}"
        passthroughBehavior: "when_no_match"
        httpMethod: "POST"
        timeoutInMillis: 29000
        type: "aws_proxy"

  '/references/users/groups/{groupID}/membership':
    parameters:
      - $ref: "#/components/parameters/x-fapi-auth-date"
      - $ref: "#/components/parameters/x-fapi-customer-ip-address"
      - $ref: "#/components/parameters/x-fapi-interaction-id"
      - $ref: "#/components/parameters/x-customer-user-agent"
      - in: path
        name: groupID
        required: true
        schema:
          $ref: "#/components/schemas/UserGroupID"
    get:
      summary: Lists all user identifiers of current group members
      description: '''Returns a paginated set of all user identifiers representing users currently assigned to that group'''
      operationId: listUserGroupMembership
      parameters:
        - $ref: "#/components/parameters/PageNumber"
        - $ref: "#/components/parameters/PageSize"
        - $ref: "#/components/parameters/PageSort"
      tags:
        - Reference Data
        - Users
      responses:
        '200':
          $ref: '#/components/responses/UserGroupMembersPage'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '406':
          $ref: '#/components/responses/NotAcceptable'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '500':
          $ref: '#/components/responses/InternalServerError'
        '502':
          $ref: '#/components/responses/BadGateway'
        '504':
          $ref: '#/components/responses/UpstreamTimeout'
      security:
        - authorizer: [ ]
        - oAuth:
            - directory:website
      x-amazon-apigateway-integration:
        uri: "${organisation_read_arn}"
        passthroughBehavior: "when_no_match"
        httpMethod: "POST"
        timeoutInMillis: 29000
        type: "aws_proxy"

  '/references/users/groups/{groupID}/membership/{memberID}':
    parameters:
      - $ref: "#/components/parameters/x-fapi-auth-date"
      - $ref: "#/components/parameters/x-fapi-customer-ip-address"
      - $ref: "#/components/parameters/x-fapi-interaction-id"
      - $ref: "#/components/parameters/x-customer-user-agent"
      - in: path
        name: groupID
        required: true
        schema:
          $ref: "#/components/schemas/UserGroupID"
      - in: path
        name: memberID
        required: true
        schema:
          $ref: "#/components/schemas/UserGroupMembershipID"
    delete:
      summary: Deletes a user from a user group
      description: '''Removes a user from the target user group'''
      operationId: deleteUserGroupMember
      tags:
        - Reference Data
        - Users
      responses:
        '204':
          $ref: '#/components/responses/NoContent'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '406':
          $ref: '#/components/responses/NotAcceptable'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '500':
          $ref: '#/components/responses/InternalServerError'
        '502':
          $ref: '#/components/responses/BadGateway'
        '504':
          $ref: '#/components/responses/UpstreamTimeout'
      security:
        - authorizer: [ ]
        - oAuth:
            - directory:website
      x-amazon-apigateway-integration:
        uri: "${organisation_write_arn}"
        passthroughBehavior: "when_no_match"
        httpMethod: "POST"
        timeoutInMillis: 29000
        type: "aws_proxy"

  '/references/users/authorisationdomain/usertypes':
    get:
      summary: Reference Data of all authorisation domain user types
      description: get all authorisation domain user types
      operationId: getAuthorisationDomainUserTypes
      parameters:
        - $ref: "#/components/parameters/x-fapi-auth-date"
        - $ref: "#/components/parameters/x-fapi-customer-ip-address"
        - $ref: "#/components/parameters/x-fapi-interaction-id"
        - $ref: "#/components/parameters/x-customer-user-agent"
        - $ref: "#/components/parameters/PageNumber"
        - $ref: "#/components/parameters/PageSize"
        - $ref: "#/components/parameters/PageSort"
        - in: query
          name: parentRole
          schema:
            type: string
          description: The parent role of this domain role
        - in: query
          name: systemID
          schema:
            type: string
          description: The ID of the system to pair it with
        - in: query
          name: status
          schema:
            type: string
          description: The status of the user types
      tags:
        - Reference Data
        - Authorisation Domains
        - Users
        - Public
      responses:
        '200':
          $ref: '#/components/responses/AuthorisationDomainUserTypesPage'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '406':
          $ref: '#/components/responses/NotAcceptable'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '500':
          $ref: '#/components/responses/InternalServerError'
        '502':
          $ref: '#/components/responses/BadGateway'
        '504':
          $ref: '#/components/responses/UpstreamTimeout'
      security:
        - authorizer: [ ]
        - oAuth:
            - directory:website
            - directory:software
      x-amazon-apigateway-integration:
        uri: "${organisation_read_arn}"
        passthroughBehavior: "when_no_match"
        httpMethod: "POST"
        timeoutInMillis: 29000
        type: "aws_proxy"
    post:
      summary: Create Reference Data for a new authorisation domain user type
      description: create all authorisation domain user type
      operationId: createAuthorisationDomainUserType
      parameters:
        - $ref: "#/components/parameters/x-fapi-auth-date"
        - $ref: "#/components/parameters/x-fapi-customer-ip-address"
        - $ref: "#/components/parameters/x-fapi-interaction-id"
        - $ref: "#/components/parameters/x-customer-user-agent"
      tags:
        - Reference Data
        - Authorisation Domains
        - Users
        - Public
      requestBody:
        $ref: '#/components/requestBodies/AuthorisationDomainUserTypeRequest'
      responses:
        '201':
          $ref: '#/components/responses/AuthorisationDomainUserType'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '406':
          $ref: '#/components/responses/NotAcceptable'
        '409':
          $ref: '#/components/responses/Conflict'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '500':
          $ref: '#/components/responses/InternalServerError'
        '502':
          $ref: '#/components/responses/BadGateway'
        '504':
          $ref: '#/components/responses/UpstreamTimeout'
      security:
        - authorizer: [ ]
        - oAuth:
            - directory:website
      x-amazon-apigateway-integration:
        uri: "${organisation_write_arn}"
        passthroughBehavior: "when_no_match"
        httpMethod: "POST"
        timeoutInMillis: 29000
        type: "aws_proxy"


  '/references/users/authorisationdomain/usertypes/{AuthorisationDomainUserTypeID}':
    get:
      summary: Get specific record for authorisation domain user type
      description: get specific authorisation domain user type
      operationId: getAuthorisationDomainUserType
      parameters:
        - $ref: '#/components/parameters/AuthorisationDomainUserTypeID'
        - $ref: "#/components/parameters/x-fapi-auth-date"
        - $ref: "#/components/parameters/x-fapi-customer-ip-address"
        - $ref: "#/components/parameters/x-fapi-interaction-id"
        - $ref: "#/components/parameters/x-customer-user-agent"
      tags:
        - Reference Data
        - Authorisation Domains
        - Users
        - Public
      responses:
        '200':
          $ref: '#/components/responses/AuthorisationDomainUserType'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '406':
          $ref: '#/components/responses/NotAcceptable'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '500':
          $ref: '#/components/responses/InternalServerError'
        '502':
          $ref: '#/components/responses/BadGateway'
        '504':
          $ref: '#/components/responses/UpstreamTimeout'
      security:
        - authorizer: [ ]
        - oAuth:
            - directory:website
            - directory:software
      x-amazon-apigateway-integration:
        uri: "${organisation_read_arn}"
        passthroughBehavior: "when_no_match"
        httpMethod: "POST"
        timeoutInMillis: 29000
        type: "aws_proxy"
    put:
      summary: Update Reference Data for a new authorisation domain user type
      description: update authorisation domain user type
      operationId: updateAuthorisationDomainUserType
      parameters:
        - $ref: '#/components/parameters/AuthorisationDomainUserTypeID'
        - $ref: "#/components/parameters/x-fapi-auth-date"
        - $ref: "#/components/parameters/x-fapi-customer-ip-address"
        - $ref: "#/components/parameters/x-fapi-interaction-id"
        - $ref: "#/components/parameters/x-customer-user-agent"
      tags:
        - Reference Data
        - Authorisation Domains
        - Users
        - Public
      requestBody:
        $ref: '#/components/requestBodies/AuthorisationDomainUserTypeRequest'
      responses:
        '200':
          $ref: '#/components/responses/AuthorisationDomainUserType'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '406':
          $ref: '#/components/responses/NotAcceptable'
        '409':
          $ref: '#/components/responses/Conflict'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '500':
          $ref: '#/components/responses/InternalServerError'
        '502':
          $ref: '#/components/responses/BadGateway'
        '504':
          $ref: '#/components/responses/UpstreamTimeout'
      security:
        - authorizer: [ ]
        - oAuth:
            - directory:website
      x-amazon-apigateway-integration:
        uri: "${organisation_write_arn}"
        passthroughBehavior: "when_no_match"
        httpMethod: "POST"
        timeoutInMillis: 29000
        type: "aws_proxy"
    delete:
      summary: Remove Reference Data for a new authorisation domain user type
      description: delete an authorisation domain user type
      operationId: deleteAuthorisationDomainUserType
      parameters:
        - $ref: '#/components/parameters/AuthorisationDomainUserTypeID'
        - $ref: "#/components/parameters/x-fapi-auth-date"
        - $ref: "#/components/parameters/x-fapi-customer-ip-address"
        - $ref: "#/components/parameters/x-fapi-interaction-id"
        - $ref: "#/components/parameters/x-customer-user-agent"
      tags:
        - Reference Data
        - Authorisation Domains
        - Users
        - Public
      responses:
        '204':
          $ref: '#/components/responses/NoContent'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '406':
          $ref: '#/components/responses/NotAcceptable'
        '500':
          $ref: '#/components/responses/InternalServerError'
        '502':
          $ref: '#/components/responses/BadGateway'
        '504':
          $ref: '#/components/responses/UpstreamTimeout'
        '429':
          $ref: '#/components/responses/TooManyRequests'
      security:
        - authorizer: [ ]
        - oAuth:
            - directory:website
      x-amazon-apigateway-integration:
        uri: "${organisation_write_arn}"
        passthroughBehavior: "when_no_match"
        httpMethod: "POST"
        timeoutInMillis: 29000
        type: "aws_proxy"

  '/references/users/authorisationdomain/systems':
    get:
      summary: Reference Data of all authorisation domain systems
      description: get all authorisation domain systems
      operationId: getAuthorisationDomainSystems
      parameters:
        - $ref: "#/components/parameters/x-fapi-auth-date"
        - $ref: "#/components/parameters/x-fapi-customer-ip-address"
        - $ref: "#/components/parameters/x-fapi-interaction-id"
        - $ref: "#/components/parameters/x-customer-user-agent"
        - $ref: "#/components/parameters/PageNumber"
        - $ref: "#/components/parameters/PageSize"
        - $ref: "#/components/parameters/PageSort"
      tags:
        - Reference Data
        - Authorisation Domains
        - Users
        - Public
      responses:
        '200':
          $ref: '#/components/responses/AuthorisationDomainSystemsPage'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '406':
          $ref: '#/components/responses/NotAcceptable'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '500':
          $ref: '#/components/responses/InternalServerError'
        '502':
          $ref: '#/components/responses/BadGateway'
        '504':
          $ref: '#/components/responses/UpstreamTimeout'
      security:
        - authorizer: [ ]
        - oAuth:
            - directory:website
            - directory:software
      x-amazon-apigateway-integration:
        uri: "${organisation_read_arn}"
        passthroughBehavior: "when_no_match"
        httpMethod: "POST"
        timeoutInMillis: 29000
        type: "aws_proxy"
    post:
      summary: Create Reference Data for a new authorisation domain system
      description: create an authorisation system type
      operationId: createAuthorisationDomainSystem
      parameters:
        - $ref: "#/components/parameters/x-fapi-auth-date"
        - $ref: "#/components/parameters/x-fapi-customer-ip-address"
        - $ref: "#/components/parameters/x-fapi-interaction-id"
        - $ref: "#/components/parameters/x-customer-user-agent"
      tags:
        - Reference Data
        - Authorisation Domains
        - Users
        - Public
      requestBody:
        $ref: '#/components/requestBodies/AuthorisationDomainSystemRequest'
      responses:
        '201':
          $ref: '#/components/responses/AuthorisationDomainSystem'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '406':
          $ref: '#/components/responses/NotAcceptable'
        '409':
          $ref: '#/components/responses/Conflict'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '500':
          $ref: '#/components/responses/InternalServerError'
        '502':
          $ref: '#/components/responses/BadGateway'
        '504':
          $ref: '#/components/responses/UpstreamTimeout'
      security:
        - authorizer: [ ]
        - oAuth:
            - directory:website
      x-amazon-apigateway-integration:
        uri: "${organisation_write_arn}"
        passthroughBehavior: "when_no_match"
        httpMethod: "POST"
        timeoutInMillis: 29000
        type: "aws_proxy"


  '/references/users/authorisationdomain/systems/{AuthorisationDomainSystemID}':
    get:
      summary: Get specific record for authorisation domain system
      description: get specific authorisation domain system
      operationId: getAuthorisationDomainSystem
      parameters:
        - $ref: '#/components/parameters/AuthorisationDomainSystemID'
        - $ref: "#/components/parameters/x-fapi-auth-date"
        - $ref: "#/components/parameters/x-fapi-customer-ip-address"
        - $ref: "#/components/parameters/x-fapi-interaction-id"
        - $ref: "#/components/parameters/x-customer-user-agent"
      tags:
        - Reference Data
        - Authorisation Domains
        - Users
        - Public
      responses:
        '200':
          $ref: '#/components/responses/AuthorisationDomainSystem'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '406':
          $ref: '#/components/responses/NotAcceptable'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '500':
          $ref: '#/components/responses/InternalServerError'
        '502':
          $ref: '#/components/responses/BadGateway'
        '504':
          $ref: '#/components/responses/UpstreamTimeout'
      security:
        - authorizer: [ ]
        - oAuth:
            - directory:website
            - directory:software
      x-amazon-apigateway-integration:
        uri: "${organisation_read_arn}"
        passthroughBehavior: "when_no_match"
        httpMethod: "POST"
        timeoutInMillis: 29000
        type: "aws_proxy"
    put:
      summary: Update Reference Data for a new authorisation domain system
      description: update authorisation domain system
      operationId: updateAuthorisationDomainSystem
      parameters:
        - $ref: '#/components/parameters/AuthorisationDomainSystemID'
        - $ref: "#/components/parameters/x-fapi-auth-date"
        - $ref: "#/components/parameters/x-fapi-customer-ip-address"
        - $ref: "#/components/parameters/x-fapi-interaction-id"
        - $ref: "#/components/parameters/x-customer-user-agent"
      tags:
        - Reference Data
        - Authorisation Domains
        - Users
        - Public
      requestBody:
        $ref: '#/components/requestBodies/AuthorisationDomainSystemRequest'
      responses:
        '200':
          $ref: '#/components/responses/AuthorisationDomainSystem'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '406':
          $ref: '#/components/responses/NotAcceptable'
        '409':
          $ref: '#/components/responses/Conflict'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '500':
          $ref: '#/components/responses/InternalServerError'
        '502':
          $ref: '#/components/responses/BadGateway'
        '504':
          $ref: '#/components/responses/UpstreamTimeout'
      security:
        - authorizer: [ ]
        - oAuth:
            - directory:website
      x-amazon-apigateway-integration:
        uri: "${organisation_write_arn}"
        passthroughBehavior: "when_no_match"
        httpMethod: "POST"
        timeoutInMillis: 29000
        type: "aws_proxy"
    delete:
      summary: Remove Reference Data for a new authorisation domain system
      description: delete an authorisation domain system
      operationId: deleteAuthorisationDomainSystem
      parameters:
        - $ref: '#/components/parameters/AuthorisationDomainSystemID'
        - $ref: "#/components/parameters/x-fapi-auth-date"
        - $ref: "#/components/parameters/x-fapi-customer-ip-address"
        - $ref: "#/components/parameters/x-fapi-interaction-id"
        - $ref: "#/components/parameters/x-customer-user-agent"
      tags:
        - Reference Data
        - Authorisation Domains
        - Users
        - Public
      responses:
        '204':
          $ref: '#/components/responses/NoContent'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '406':
          $ref: '#/components/responses/NotAcceptable'
        '500':
          $ref: '#/components/responses/InternalServerError'
        '502':
          $ref: '#/components/responses/BadGateway'
        '504':
          $ref: '#/components/responses/UpstreamTimeout'
        '429':
          $ref: '#/components/responses/TooManyRequests'
      security:
        - authorizer: [ ]
        - oAuth:
            - directory:website
      x-amazon-apigateway-integration:
        uri: "${organisation_write_arn}"
        passthroughBehavior: "when_no_match"
        httpMethod: "POST"
        timeoutInMillis: 29000
        type: "aws_proxy"

  '/references/flags':
    get:
      summary: Returns all flags configured at a reference data level
      description: get all flags
      operationId: getFlags
      parameters:
        - $ref: "#/components/parameters/x-fapi-auth-date"
        - $ref: "#/components/parameters/x-fapi-customer-ip-address"
        - $ref: "#/components/parameters/x-fapi-interaction-id"
        - $ref: "#/components/parameters/x-customer-user-agent"
        - $ref: "#/components/parameters/PageNumber"
        - $ref: "#/components/parameters/PageSize"
        - $ref: "#/components/parameters/PageSort"
        - $ref: '#/components/parameters/FlagName'
        - $ref: '#/components/parameters/FlagType'
        - $ref: '#/components/parameters/FlagStatus'
      tags:
        - Reference Data
        - Flags
        - Public
      responses:
        '200':
          $ref: '#/components/responses/FlagsPage'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '406':
          $ref: '#/components/responses/NotAcceptable'
        '500':
          $ref: '#/components/responses/InternalServerError'
        '502':
          $ref: '#/components/responses/BadGateway'
        '504':
          $ref: '#/components/responses/UpstreamTimeout'
        '429':
          $ref: '#/components/responses/TooManyRequests'
      security:
        - authorizer: [ ]
        - oAuth:
            - directory:website
      x-amazon-apigateway-integration:
        uri: "${organisation_read_arn}"
        passthroughBehavior: "when_no_match"
        httpMethod: "POST"
        timeoutInMillis: 29000
        type: "aws_proxy"
    post:
      summary: Create a new flag
      description: Creates a new flag configuration
      operationId: createFlag
      parameters:
        - $ref: "#/components/parameters/x-fapi-auth-date"
        - $ref: "#/components/parameters/x-fapi-customer-ip-address"
        - $ref: "#/components/parameters/x-fapi-interaction-id"
        - $ref: "#/components/parameters/x-customer-user-agent"
      tags:
        - Reference Data
        - Flags
        - Public

      requestBody:
        $ref: '#/components/requestBodies/FlagRequest'

      responses:
        '201':
          $ref: '#/components/responses/Flag'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '409':
          $ref: '#/components/responses/Conflict'
        '500':
          $ref: '#/components/responses/InternalServerError'
        '502':
          $ref: '#/components/responses/BadGateway'
        '504':
          $ref: '#/components/responses/UpstreamTimeout'
        '429':
          $ref: '#/components/responses/TooManyRequests'
      security:
        - authorizer: [ ]
        - oAuth:
            - directory:website
      x-amazon-apigateway-integration:
        uri: "${organisation_write_arn}"
        passthroughBehavior: "when_no_match"
        httpMethod: "POST"
        timeoutInMillis: 29000
        type: "aws_proxy"

  '/references/contacttypes':
    parameters:
      - $ref: "#/components/parameters/x-fapi-auth-date"
      - $ref: "#/components/parameters/x-fapi-customer-ip-address"
      - $ref: "#/components/parameters/x-fapi-interaction-id"
      - $ref: "#/components/parameters/x-customer-user-agent"
    get:
      summary: Returns all contact types configured at a reference data level
      description: get all contact types
      operationId: getContactTypes
      parameters:
        - $ref: "#/components/parameters/PageNumber"
        - $ref: "#/components/parameters/PageSize"
        - $ref: "#/components/parameters/PageSort"
        - $ref: '#/components/parameters/ContactTypeName'
        - $ref: '#/components/parameters/ContactTypesAccessLevel'
        - $ref: '#/components/parameters/ContactTypeStatus'
      tags:
        - Reference Data
        - Contact Types
        - Public
      responses:
        '200':
          $ref: '#/components/responses/ContactTypesPage'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '406':
          $ref: '#/components/responses/NotAcceptable'
        '500':
          $ref: '#/components/responses/InternalServerError'
        '502':
          $ref: '#/components/responses/BadGateway'
        '504':
          $ref: '#/components/responses/UpstreamTimeout'
        '429':
          $ref: '#/components/responses/TooManyRequests'
      security:
        - authorizer: [ ]
        - oAuth:
            - directory:website
      x-amazon-apigateway-integration:
        uri: "${organisation_read_arn}"
        passthroughBehavior: "when_no_match"
        httpMethod: "POST"
        timeoutInMillis: 29000
        type: "aws_proxy"
    post:
      summary: Create a new contact type
      description: Creates a new contact type configuration
      operationId: createContactType
      tags:
        - Reference Data
        - Contact Types
        - Public

      requestBody:
        $ref: '#/components/requestBodies/ContactTypeRequest'

      responses:
        '201':
          $ref: '#/components/responses/ContactType'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '409':
          $ref: '#/components/responses/Conflict'
        '500':
          $ref: '#/components/responses/InternalServerError'
        '502':
          $ref: '#/components/responses/BadGateway'
        '504':
          $ref: '#/components/responses/UpstreamTimeout'
        '429':
          $ref: '#/components/responses/TooManyRequests'
      security:
        - authorizer: [ ]
        - oAuth:
            - directory:website
      x-amazon-apigateway-integration:
        uri: "${organisation_write_arn}"
        passthroughBehavior: "when_no_match"
        httpMethod: "POST"
        timeoutInMillis: 29000
        type: "aws_proxy"

  '/references/contacttypes/{ContactTypeID}':
    parameters:
      - $ref: "#/components/parameters/ContactTypeID"
      - $ref: "#/components/parameters/x-fapi-auth-date"
      - $ref: "#/components/parameters/x-fapi-customer-ip-address"
      - $ref: "#/components/parameters/x-fapi-interaction-id"
      - $ref: "#/components/parameters/x-customer-user-agent"
    get:
      summary: Returns a specific contact type configured at a reference data level
      description: get a specific contact type
      operationId: getContactType
      tags:
        - Reference Data
        - Contact Types
        - Public
      responses:
        '200':
          $ref: '#/components/responses/ContactType'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '406':
          $ref: '#/components/responses/NotAcceptable'
        '500':
          $ref: '#/components/responses/InternalServerError'
        '502':
          $ref: '#/components/responses/BadGateway'
        '504':
          $ref: '#/components/responses/UpstreamTimeout'
        '429':
          $ref: '#/components/responses/TooManyRequests'
      security:
        - authorizer: [ ]
        - oAuth:
            - directory:website
      x-amazon-apigateway-integration:
        uri: "${organisation_read_arn}"
        passthroughBehavior: "when_no_match"
        httpMethod: "POST"
        timeoutInMillis: 29000
        type: "aws_proxy"
    put:
      summary: Updates an existing contact type
      description: Updates an existing configuration
      operationId: updateContactType
      tags:
        - Reference Data
        - Contact Types
        - Public

      requestBody:
        $ref: '#/components/requestBodies/ContactTypeUpdateRequest'

      responses:
        '200':
          $ref: '#/components/responses/ContactType'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '409':
          $ref: '#/components/responses/Conflict'
        '500':
          $ref: '#/components/responses/InternalServerError'
        '502':
          $ref: '#/components/responses/BadGateway'
        '504':
          $ref: '#/components/responses/UpstreamTimeout'
        '429':
          $ref: '#/components/responses/TooManyRequests'
      security:
        - authorizer: [ ]
        - oAuth:
            - directory:website
      x-amazon-apigateway-integration:
        uri: "${organisation_write_arn}"
        passthroughBehavior: "when_no_match"
        httpMethod: "POST"
        timeoutInMillis: 29000
        type: "aws_proxy"
    delete:
      summary: Delete an existing contact type
      description: Delete an existing contact type
      operationId: deleteContactType
      tags:
        - Reference Data
        - Contact Types
        - Public

      responses:
        '204':
          $ref: '#/components/responses/NoContent'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '409':
          $ref: '#/components/responses/Conflict'
        '500':
          $ref: '#/components/responses/InternalServerError'
        '502':
          $ref: '#/components/responses/BadGateway'
        '504':
          $ref: '#/components/responses/UpstreamTimeout'
        '429':
          $ref: '#/components/responses/TooManyRequests'
      security:
        - authorizer: [ ]
        - oAuth:
            - directory:website
      x-amazon-apigateway-integration:
        uri: "${organisation_write_arn}"
        passthroughBehavior: "when_no_match"
        httpMethod: "POST"
        timeoutInMillis: 29000
        type: "aws_proxy"

  '/references/flags/{FlagID}':
    parameters:
      - $ref: "#/components/parameters/FlagID"
    get:
      summary: Returns a specific flag configured at a reference data level
      description: get all flags
      operationId: getFlag
      parameters:
        - $ref: "#/components/parameters/x-fapi-auth-date"
        - $ref: "#/components/parameters/x-fapi-customer-ip-address"
        - $ref: "#/components/parameters/x-fapi-interaction-id"
        - $ref: "#/components/parameters/x-customer-user-agent"
      tags:
        - Reference Data
        - Flags
        - Public
      responses:
        '200':
          $ref: '#/components/responses/Flag'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '406':
          $ref: '#/components/responses/NotAcceptable'
        '500':
          $ref: '#/components/responses/InternalServerError'
        '502':
          $ref: '#/components/responses/BadGateway'
        '504':
          $ref: '#/components/responses/UpstreamTimeout'
        '429':
          $ref: '#/components/responses/TooManyRequests'
      security:
        - authorizer: [ ]
        - oAuth:
            - directory:website
      x-amazon-apigateway-integration:
        uri: "${organisation_read_arn}"
        passthroughBehavior: "when_no_match"
        httpMethod: "POST"
        timeoutInMillis: 29000
        type: "aws_proxy"
    put:
      summary: Updates an existing flag
      description: Updates an existing configuration
      operationId: updateFlag
      parameters:
        - $ref: "#/components/parameters/x-fapi-auth-date"
        - $ref: "#/components/parameters/x-fapi-customer-ip-address"
        - $ref: "#/components/parameters/x-fapi-interaction-id"
        - $ref: "#/components/parameters/x-customer-user-agent"
      tags:
        - Reference Data
        - Flags
        - Public

      requestBody:
        $ref: '#/components/requestBodies/FlagUpdateRequest'

      responses:
        '200':
          $ref: '#/components/responses/Flag'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '409':
          $ref: '#/components/responses/Conflict'
        '500':
          $ref: '#/components/responses/InternalServerError'
        '502':
          $ref: '#/components/responses/BadGateway'
        '504':
          $ref: '#/components/responses/UpstreamTimeout'
        '429':
          $ref: '#/components/responses/TooManyRequests'
      security:
        - authorizer: [ ]
        - oAuth:
            - directory:website
      x-amazon-apigateway-integration:
        uri: "${organisation_write_arn}"
        passthroughBehavior: "when_no_match"
        httpMethod: "POST"
        timeoutInMillis: 29000
        type: "aws_proxy"
    delete:
      summary: Delete an existing flag
      description: Delete an existing flag
      operationId: deleteFlag
      parameters:
        - $ref: "#/components/parameters/x-fapi-auth-date"
        - $ref: "#/components/parameters/x-fapi-customer-ip-address"
        - $ref: "#/components/parameters/x-fapi-interaction-id"
        - $ref: "#/components/parameters/x-customer-user-agent"
      tags:
        - Reference Data
        - Flags
        - Public

      responses:
        '204':
          $ref: '#/components/responses/NoContent'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '409':
          $ref: '#/components/responses/Conflict'
        '500':
          $ref: '#/components/responses/InternalServerError'
        '502':
          $ref: '#/components/responses/BadGateway'
        '504':
          $ref: '#/components/responses/UpstreamTimeout'
        '429':
          $ref: '#/components/responses/TooManyRequests'
      security:
        - authorizer: [ ]
        - oAuth:
            - directory:website
      x-amazon-apigateway-integration:
        uri: "${organisation_write_arn}"
        passthroughBehavior: "when_no_match"
        httpMethod: "POST"
        timeoutInMillis: 29000
        type: "aws_proxy"

  '/references/apifamilies/init':
    post:
      summary: Initialize api families in a fresh environment
      description: instantiate api families based on /config/apiresources
      operationId: instantiateApiFamilies
      parameters:
        - $ref: "#/components/parameters/x-fapi-auth-date"
        - $ref: "#/components/parameters/x-fapi-customer-ip-address"
        - $ref: "#/components/parameters/x-fapi-interaction-id"
        - $ref: "#/components/parameters/x-customer-user-agent"
      tags:
        - Reference Data
        - Api Families
        - Public
      responses:
        '204':
          $ref: '#/components/responses/NoContent'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '409':
          $ref: '#/components/responses/Conflict'
        '500':
          $ref: '#/components/responses/InternalServerError'
        '502':
          $ref: '#/components/responses/BadGateway'
        '504':
          $ref: '#/components/responses/UpstreamTimeout'
        '429':
          $ref: '#/components/responses/TooManyRequests'
      security:
        - authorizer: [ ]
        - oAuth:
            - directory:website
      x-amazon-apigateway-integration:
        uri: "${organisation_write_arn}"
        passthroughBehavior: "when_no_match"
        httpMethod: "POST"
        timeoutInMillis: 29000
        type: "aws_proxy"

  '/references/apifamilies':
    parameters:
      - $ref: "#/components/parameters/x-fapi-auth-date"
      - $ref: "#/components/parameters/x-fapi-customer-ip-address"
      - $ref: "#/components/parameters/x-fapi-interaction-id"
      - $ref: "#/components/parameters/x-customer-user-agent"
    get:
      summary: Returns all api families configured at a reference data level
      description: get all api families
      operationId: getApiFamilies
      parameters:
        - $ref: "#/components/parameters/PageNumber"
        - $ref: "#/components/parameters/PageSize"
        - $ref: "#/components/parameters/PageSort"
        - $ref: '#/components/parameters/ApiFamilyName'
        - $ref: '#/components/parameters/ApiFamilyConformanceTest'
        - $ref: '#/components/parameters/ApiFamilyVersion'
        - $ref: '#/components/parameters/ApiFamilyStatus'
      tags:
        - Reference Data
        - Api Families
        - Public
      responses:
        '200':
          $ref: '#/components/responses/ApiFamiliesPage'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '406':
          $ref: '#/components/responses/NotAcceptable'
        '500':
          $ref: '#/components/responses/InternalServerError'
        '502':
          $ref: '#/components/responses/BadGateway'
        '504':
          $ref: '#/components/responses/UpstreamTimeout'
        '429':
          $ref: '#/components/responses/TooManyRequests'
      security:
        - authorizer: [ ]
        - oAuth:
            - directory:website
      x-amazon-apigateway-integration:
        uri: "${organisation_read_arn}"
        passthroughBehavior: "when_no_match"
        httpMethod: "POST"
        timeoutInMillis: 29000
        type: "aws_proxy"
    post:
      summary: Create a new api family
      description: Creates a new api family configuration
      operationId: createApiFamily
      tags:
        - Reference Data
        - Api Families
        - Public

      requestBody:
        $ref: '#/components/requestBodies/ApiFamilyRequest'

      responses:
        '201':
          $ref: '#/components/responses/ApiFamily'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '409':
          $ref: '#/components/responses/Conflict'
        '500':
          $ref: '#/components/responses/InternalServerError'
        '502':
          $ref: '#/components/responses/BadGateway'
        '504':
          $ref: '#/components/responses/UpstreamTimeout'
        '429':
          $ref: '#/components/responses/TooManyRequests'
      security:
        - authorizer: [ ]
        - oAuth:
            - directory:website
      x-amazon-apigateway-integration:
        uri: "${organisation_write_arn}"
        passthroughBehavior: "when_no_match"
        httpMethod: "POST"
        timeoutInMillis: 29000
        type: "aws_proxy"

  '/references/apifamilies/{ApiFamilyID}':
    parameters:
      - $ref: "#/components/parameters/ApiFamilyID"
      - $ref: "#/components/parameters/x-fapi-auth-date"
      - $ref: "#/components/parameters/x-fapi-customer-ip-address"
      - $ref: "#/components/parameters/x-fapi-interaction-id"
      - $ref: "#/components/parameters/x-customer-user-agent"
    get:
      summary: Returns a specific api family configured at a reference data level
      description: get api family
      operationId: getApifamily
      tags:
        - Reference Data
        - Api Families
        - Public
      responses:
        '200':
          $ref: '#/components/responses/ApiFamily'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '406':
          $ref: '#/components/responses/NotAcceptable'
        '500':
          $ref: '#/components/responses/InternalServerError'
        '502':
          $ref: '#/components/responses/BadGateway'
        '504':
          $ref: '#/components/responses/UpstreamTimeout'
        '429':
          $ref: '#/components/responses/TooManyRequests'
      security:
        - authorizer: [ ]
        - oAuth:
            - directory:website
      x-amazon-apigateway-integration:
        uri: "${organisation_read_arn}"
        passthroughBehavior: "when_no_match"
        httpMethod: "POST"
        timeoutInMillis: 29000
        type: "aws_proxy"
    put:
      summary: Updates an existing api family
      description: Updates an existing configuration
      operationId: updateApiFamily
      tags:
        - Reference Data
        - Api Families
        - Public

      requestBody:
        $ref: '#/components/requestBodies/ApiFamilyUpdateRequest'

      responses:
        '200':
          $ref: '#/components/responses/ApiFamily'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '409':
          $ref: '#/components/responses/Conflict'
        '500':
          $ref: '#/components/responses/InternalServerError'
        '502':
          $ref: '#/components/responses/BadGateway'
        '504':
          $ref: '#/components/responses/UpstreamTimeout'
        '429':
          $ref: '#/components/responses/TooManyRequests'
      security:
        - authorizer: [ ]
        - oAuth:
            - directory:website
      x-amazon-apigateway-integration:
        uri: "${organisation_write_arn}"
        passthroughBehavior: "when_no_match"
        httpMethod: "POST"
        timeoutInMillis: 29000
        type: "aws_proxy"
    delete:
      summary: Delete an existing api family
      description: Delete an existing api family
      operationId: deleteApiFamily
      tags:
        - Reference Data
        - Api Families
        - Public

      responses:
        '204':
          $ref: '#/components/responses/NoContent'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '409':
          $ref: '#/components/responses/Conflict'
        '500':
          $ref: '#/components/responses/InternalServerError'
        '502':
          $ref: '#/components/responses/BadGateway'
        '504':
          $ref: '#/components/responses/UpstreamTimeout'
        '429':
          $ref: '#/components/responses/TooManyRequests'
      security:
        - authorizer: [ ]
        - oAuth:
            - directory:website
      x-amazon-apigateway-integration:
        uri: "${organisation_write_arn}"
        passthroughBehavior: "when_no_match"
        httpMethod: "POST"
        timeoutInMillis: 29000
        type: "aws_proxy"

  '/references/apifamilies/{ApiFamilyID}/conformanceconfigurations':
      parameters:
        - $ref: '#/components/parameters/ApiFamilyID'
        - $ref: "#/components/parameters/x-fapi-auth-date"
        - $ref: "#/components/parameters/x-fapi-customer-ip-address"
        - $ref: "#/components/parameters/x-fapi-interaction-id"
        - $ref: "#/components/parameters/x-customer-user-agent"
      get:
        summary: Returns all conformance configurations linked to the given api family
        description: get all conformance configurations
        operationId: getConformanceConfigurations
        parameters:
          - $ref: "#/components/parameters/PageNumber"
          - $ref: "#/components/parameters/PageSize"
          - $ref: "#/components/parameters/PageSort"
        tags:
          - Reference Data
          - Api Families
          - Public
        responses:
          '200':
            $ref: '#/components/responses/ConformanceConfigurationsPage'
          '400':
            $ref: '#/components/responses/BadRequest'
          '401':
            $ref: '#/components/responses/Unauthorized'
          '403':
            $ref: '#/components/responses/Forbidden'
          '404':
            $ref: '#/components/responses/NotFound'
          '406':
            $ref: '#/components/responses/NotAcceptable'
          '500':
            $ref: '#/components/responses/InternalServerError'
          '502':
            $ref: '#/components/responses/BadGateway'
          '504':
            $ref: '#/components/responses/UpstreamTimeout'
          '429':
            $ref: '#/components/responses/TooManyRequests'
        security:
          - authorizer: [ ]
          - oAuth:
              - directory:website
        x-amazon-apigateway-integration:
          uri: "${organisation_read_arn}"
          passthroughBehavior: "when_no_match"
          httpMethod: "POST"
          timeoutInMillis: 29000
          type: "aws_proxy"
      post:
        summary: Create a new conformance configuration
        description: Creates a new conformance configuration
        operationId: createConformanceConfiguration
        tags:
          - Reference Data
          - Api Families
          - Public

        requestBody:
          $ref: '#/components/requestBodies/ConformanceConfigurationRequest'

        responses:
          '201':
            $ref: '#/components/responses/ConformanceConfiguration'
          '400':
            $ref: '#/components/responses/BadRequest'
          '401':
            $ref: '#/components/responses/Unauthorized'
          '403':
            $ref: '#/components/responses/Forbidden'
          '409':
            $ref: '#/components/responses/Conflict'
          '500':
            $ref: '#/components/responses/InternalServerError'
          '502':
            $ref: '#/components/responses/BadGateway'
          '504':
            $ref: '#/components/responses/UpstreamTimeout'
          '429':
            $ref: '#/components/responses/TooManyRequests'
        security:
          - authorizer: [ ]
          - oAuth:
              - directory:website
        x-amazon-apigateway-integration:
          uri: "${organisation_write_arn}"
          passthroughBehavior: "when_no_match"
          httpMethod: "POST"
          timeoutInMillis: 29000
          type: "aws_proxy"

  '/references/apifamilies/{ApiFamilyID}/conformanceconfigurations/{ConformanceConfigurationID}':
    parameters:
      - $ref: "#/components/parameters/ApiFamilyID"
      - $ref: "#/components/parameters/ConformanceConfigurationID"
      - $ref: "#/components/parameters/x-fapi-auth-date"
      - $ref: "#/components/parameters/x-fapi-customer-ip-address"
      - $ref: "#/components/parameters/x-fapi-interaction-id"
      - $ref: "#/components/parameters/x-customer-user-agent"
    get:
      summary: Returns a specific conformance configuration for the given api family
      description: get conformance configuration
      operationId: getConformanceConfiguration
      tags:
        - Reference Data
        - Api Families
        - Public
      responses:
        '200':
          $ref: '#/components/responses/ConformanceConfiguration'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '406':
          $ref: '#/components/responses/NotAcceptable'
        '500':
          $ref: '#/components/responses/InternalServerError'
        '502':
          $ref: '#/components/responses/BadGateway'
        '504':
          $ref: '#/components/responses/UpstreamTimeout'
        '429':
          $ref: '#/components/responses/TooManyRequests'
      security:
        - authorizer: [ ]
        - oAuth:
            - directory:website
      x-amazon-apigateway-integration:
        uri: "${organisation_read_arn}"
        passthroughBehavior: "when_no_match"
        httpMethod: "POST"
        timeoutInMillis: 29000
        type: "aws_proxy"
    put:
      summary: Updates an existing conformance configuration
      description: Updates an existing configuration
      operationId: updateConforanceConfiguration
      tags:
        - Reference Data
        - Api Families
        - Public

      requestBody:
        $ref: '#/components/requestBodies/ConformanceConfigurationRequest'

      responses:
        '200':
          $ref: '#/components/responses/ConformanceConfiguration'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '409':
          $ref: '#/components/responses/Conflict'
        '500':
          $ref: '#/components/responses/InternalServerError'
        '502':
          $ref: '#/components/responses/BadGateway'
        '504':
          $ref: '#/components/responses/UpstreamTimeout'
        '429':
          $ref: '#/components/responses/TooManyRequests'
      security:
        - authorizer: [ ]
        - oAuth:
            - directory:website
      x-amazon-apigateway-integration:
        uri: "${organisation_write_arn}"
        passthroughBehavior: "when_no_match"
        httpMethod: "POST"
        timeoutInMillis: 29000
        type: "aws_proxy"
    delete:
      summary: Delete an existing configuration
      description: Delete an existing configuration
      operationId: deleteConformanceConfiguration
      tags:
        - Reference Data
        - Api Families
        - Public

      responses:
        '204':
          $ref: '#/components/responses/NoContent'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '409':
          $ref: '#/components/responses/Conflict'
        '500':
          $ref: '#/components/responses/InternalServerError'
        '502':
          $ref: '#/components/responses/BadGateway'
        '504':
          $ref: '#/components/responses/UpstreamTimeout'
        '429':
          $ref: '#/components/responses/TooManyRequests'
      security:
        - authorizer: [ ]
        - oAuth:
            - directory:website
      x-amazon-apigateway-integration:
        uri: "${organisation_write_arn}"
        passthroughBehavior: "when_no_match"
        httpMethod: "POST"
        timeoutInMillis: 29000
        type: "aws_proxy"

  '/references/authorities':
    get:
      summary: Reference Data of all authorities
      description: get all authorities
      operationId: getAuthorities
      parameters:
        - $ref: "#/components/parameters/x-fapi-auth-date"
        - $ref: "#/components/parameters/x-fapi-customer-ip-address"
        - $ref: "#/components/parameters/x-fapi-interaction-id"
        - $ref: "#/components/parameters/x-customer-user-agent"
        - $ref: "#/components/parameters/PageNumber"
        - $ref: "#/components/parameters/PageSize"
        - $ref: "#/components/parameters/PageSort"
        - $ref: "#/components/parameters/OrganisationIdQueryParameter"
        - $ref: "#/components/parameters/Status"
        - in: query
          name: omitLegacy
          schema:
            type: boolean
            default: false
          required: false
          description: Filters the response to only include authorities configured under organisations
        - in: query
          name: authorityName
          schema:
            type: string
            default: ""
          required: false
          description: Will return authorities with names similar to the provided authorityName
        - in: query
          name: authorityCountry
          schema:
            type: string
            default: ""
          required: false
          description: Will return authorities with countries similar to the provided authorityCountry
      tags:
        - Reference Data
        - Authorities
        - Public
        - Closed

      responses:
        '200':
          $ref: '#/components/responses/AuthoritiesPage'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '406':
          $ref: '#/components/responses/NotAcceptable'
        '500':
          $ref: '#/components/responses/InternalServerError'
        '502':
          $ref: '#/components/responses/BadGateway'
        '504':
          $ref: '#/components/responses/UpstreamTimeout'
        '429':
          $ref: '#/components/responses/TooManyRequests'
      security:
        - authorizer: [ ]
        - oAuth:
            - directory:website
            - directory:software
      x-amazon-apigateway-integration:
        uri: "${organisation_read_arn}"
        passthroughBehavior: "when_no_match"
        httpMethod: "POST"
        timeoutInMillis: 29000
        type: "aws_proxy"

  '/references/authorities/{AuthorityId}':
    parameters:
      - $ref: '#/components/parameters/AuthorityId'
      - $ref: "#/components/parameters/x-fapi-auth-date"
      - $ref: "#/components/parameters/x-fapi-customer-ip-address"
      - $ref: "#/components/parameters/x-fapi-interaction-id"
      - $ref: "#/components/parameters/x-customer-user-agent"
    get:
      summary: Get a reference authority by Id
      description: get details of a specific authority
      operationId: getAuthoritiesByAuthorityId
      deprecated: true
      tags:
        - Reference Data
        - Authorities
        - Public
        - Closed
      responses:
        '200':
          $ref: '#/components/responses/AuthorityObject'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '406':
          $ref: '#/components/responses/NotAcceptable'
        '500':
          $ref: '#/components/responses/InternalServerError'
        '502':
          $ref: '#/components/responses/BadGateway'
        '504':
          $ref: '#/components/responses/UpstreamTimeout'
        '429':
          $ref: '#/components/responses/TooManyRequests'
      security:
        - authorizer: [ ]
        - oAuth:
            - directory:website
            - directory:software
      x-amazon-apigateway-integration:
        uri: "${organisation_read_arn}"
        passthroughBehavior: "when_no_match"
        httpMethod: "POST"
        timeoutInMillis: 15000
        type: "aws_proxy"
    put:
      summary: Update a reference authority by Id
      description: updates a specific authority
      operationId: updateAuthorityByAuthorityId
      deprecated: true
      tags:
        - Reference Data
        - Authorities
        - Public
        - Closed
      parameters:
        - $ref: "#/components/parameters/x-fapi-auth-date"
        - $ref: "#/components/parameters/x-fapi-customer-ip-address"
        - $ref: "#/components/parameters/x-fapi-interaction-id"
        - $ref: "#/components/parameters/x-customer-user-agent"
      requestBody:
        $ref: '#/components/requestBodies/AuthorityUpdateRequest'
      responses:
        '200':
          $ref: '#/components/responses/AuthorityObject'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '406':
          $ref: '#/components/responses/NotAcceptable'
        '500':
          $ref: '#/components/responses/InternalServerError'
        '502':
          $ref: '#/components/responses/BadGateway'
        '504':
          $ref: '#/components/responses/UpstreamTimeout'
        '429':
          $ref: '#/components/responses/TooManyRequests'
      security:
        - authorizer: [ ]
        - oAuth:
            - directory:website
      x-amazon-apigateway-integration:
        uri: "${organisation_write_arn}"
        passthroughBehavior: "when_no_match"
        httpMethod: "POST"
        timeoutInMillis: 29000
        type: "aws_proxy"

  '/references/authorisationdomains':
    parameters:
      - $ref: "#/components/parameters/x-fapi-auth-date"
      - $ref: "#/components/parameters/x-fapi-customer-ip-address"
      - $ref: "#/components/parameters/x-fapi-interaction-id"
      - $ref: "#/components/parameters/x-customer-user-agent"
    get:
      summary: Reference data of all authorisation domains
      description: get all authorisation domains
      operationId: getAuthorisationDomains
      parameters:
        - $ref: "#/components/parameters/PageNumber"
        - $ref: "#/components/parameters/PageSize"
        - $ref: "#/components/parameters/PageSort"
        - in: query
          name: domainName
          schema:
            type: string
            default: ""
          required: false
          description: Will return authorisation domains with data like the provided authorisationDomainName
        - in: query
          name: domainRegion
          schema:
            type: string
            default: ""
          required: false
          description: Will return authorisation domains with data like the provided authorisationDomainRegion
      tags:
        - Reference Data
        - Authorisation Domains
        - Public
        - Closed
      responses:
        '200':
          $ref: '#/components/responses/AuthorisationDomainsPage'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '406':
          $ref: '#/components/responses/NotAcceptable'
        '500':
          $ref: '#/components/responses/InternalServerError'
        '502':
          $ref: '#/components/responses/BadGateway'
        '504':
          $ref: '#/components/responses/UpstreamTimeout'
        '429':
          $ref: '#/components/responses/TooManyRequests'
      security:
        - authorizer: [ ]
        - oAuth:
            - directory:website
            - directory:software
      x-amazon-apigateway-integration:
        uri: "${organisation_read_arn}"
        passthroughBehavior: "when_no_match"
        httpMethod: "POST"
        timeoutInMillis: 29000
        type: "aws_proxy"
    post:
      summary: Create an authorisation domain
      description: creates an authorisation domain
      operationId: createAuthorisationDomain
      tags:
        - Reference Data
        - Authorisation Domains
        - Public
        - Closed
      requestBody:
        $ref: '#/components/requestBodies/AuthorisationDomainRequest'
      responses:
        '201':
          $ref: '#/components/responses/AuthorisationDomain'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '409':
          $ref: '#/components/responses/Conflict'
        '500':
          $ref: '#/components/responses/InternalServerError'
        '502':
          $ref: '#/components/responses/BadGateway'
        '504':
          $ref: '#/components/responses/UpstreamTimeout'
        '429':
          $ref: '#/components/responses/TooManyRequests'
      security:
        - authorizer: [ ]
        - oAuth:
            - directory:website
      x-amazon-apigateway-integration:
        uri: "${organisation_write_arn}"
        passthroughBehavior: "when_no_match"
        httpMethod: "POST"
        timeoutInMillis: 29000
        type: "aws_proxy"

  '/references/authorisationdomains/{AuthorisationDomainName}':
    parameters:
      - $ref: '#/components/parameters/AuthorisationDomainName'
      - $ref: "#/components/parameters/x-fapi-auth-date"
      - $ref: "#/components/parameters/x-fapi-customer-ip-address"
      - $ref: "#/components/parameters/x-fapi-interaction-id"
      - $ref: "#/components/parameters/x-customer-user-agent"
    get:
      summary: Get an authorisation domain by Name
      description: gets a specific authorisation domain
      operationId: getAuthorisationDomainByAuthorisationDomainName
      tags:
        - Reference Data
        - Authorisation Domains
        - Public
        - Closed
      responses:
        '200':
          $ref: '#/components/responses/AuthorisationDomain'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '406':
          $ref: '#/components/responses/NotAcceptable'
        '500':
          $ref: '#/components/responses/InternalServerError'
        '502':
          $ref: '#/components/responses/BadGateway'
        '504':
          $ref: '#/components/responses/UpstreamTimeout'
        '429':
          $ref: '#/components/responses/TooManyRequests'
      security:
        - authorizer: [ ]
        - oAuth:
            - directory:website
            - directory:software
      x-amazon-apigateway-integration:
        uri: "${organisation_read_arn}"
        passthroughBehavior: "when_no_match"
        httpMethod: "POST"
        timeoutInMillis: 15000
        type: "aws_proxy"
    put:
      summary: Update an authorisation domain by Name
      description: updates an authorisation domain
      operationId: updatesAuthorisationDomainByAuthorisationDomainName
      tags:
        - Reference Data
        - Authorisation Domains
        - Public
        - Closed
      requestBody:
        $ref: '#/components/requestBodies/AuthorisationDomainUpdateRequest'
      responses:
        '200':
          $ref: '#/components/responses/AuthorisationDomain'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '406':
          $ref: '#/components/responses/NotAcceptable'
        '500':
          $ref: '#/components/responses/InternalServerError'
        '502':
          $ref: '#/components/responses/BadGateway'
        '504':
          $ref: '#/components/responses/UpstreamTimeout'
        '429':
          $ref: '#/components/responses/TooManyRequests'
      security:
        - authorizer: [ ]
        - oAuth:
            - directory:website
      x-amazon-apigateway-integration:
        uri: "${organisation_write_arn}"
        passthroughBehavior: "when_no_match"
        httpMethod: "POST"
        timeoutInMillis: 29000
        type: "aws_proxy"

  '/references/authorisationdomains/{AuthorisationDomainName}/sub-domains':
    parameters:
      - $ref: '#/components/parameters/AuthorisationDomainName'
      - $ref: "#/components/parameters/x-fapi-auth-date"
      - $ref: "#/components/parameters/x-fapi-customer-ip-address"
      - $ref: "#/components/parameters/x-fapi-interaction-id"
      - $ref: "#/components/parameters/x-customer-user-agent"
    get:
      summary: List all sub-domains
      description: Lists all sub-domains for a given authorisation domain
      operationId: listSubDomains
      tags:
        - Public
        - Closed
      responses:
        '200':
          $ref: '#/components/responses/SubDomainList'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '406':
          $ref: '#/components/responses/NotAcceptable'
        '500':
          $ref: '#/components/responses/InternalServerError'
        '502':
          $ref: '#/components/responses/BadGateway'
        '504':
          $ref: '#/components/responses/UpstreamTimeout'
        '429':
          $ref: '#/components/responses/TooManyRequests'
      security:
        - authorizer: [ ]
        - oAuth:
            - directory:website
            - directory:software
      x-amazon-apigateway-integration:
        uri: "${organisation_read_arn}"
        passthroughBehavior: "when_no_match"
        httpMethod: "POST"
        timeoutInMillis: 15000
        type: "aws_proxy"
    post:
      summary: Register a sub domain
      description: Register an existing authorisation domain as a child domain of the subject domain
      operationId: registerSubDomain
      tags:
        - Public
        - Closed
      requestBody:
        $ref: '#/components/requestBodies/SubDomainCreationRequest'
      responses:
        '201':
          $ref: '#/components/responses/SubDomainObject'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '409':
          $ref: '#/components/responses/Conflict'
        '500':
          $ref: '#/components/responses/InternalServerError'
        '502':
          $ref: '#/components/responses/BadGateway'
        '504':
          $ref: '#/components/responses/UpstreamTimeout'
        '429':
          $ref: '#/components/responses/TooManyRequests'
      security:
        - authorizer: [ ]
        - oAuth:
            - directory:website
      x-amazon-apigateway-integration:
        uri: "${organisation_write_arn}"
        passthroughBehavior: "when_no_match"
        httpMethod: "POST"
        timeoutInMillis: 29000
        type: "aws_proxy"

  '/references/authorisationdomains/{AuthorisationDomainName}/sub-domains/{SubDomainID}':
    parameters:
      - $ref: '#/components/parameters/SubDomainID'
      - $ref: '#/components/parameters/AuthorisationDomainName'
      - $ref: "#/components/parameters/x-fapi-auth-date"
      - $ref: "#/components/parameters/x-fapi-customer-ip-address"
      - $ref: "#/components/parameters/x-fapi-interaction-id"
      - $ref: "#/components/parameters/x-customer-user-agent"
    get:
      summary: Retrieve a given sub-domain
      description: Retrieves information for a given sub-domain
      operationId: getSubDomain
      tags:
        - Public
        - Closed
      responses:
        '200':
          $ref: '#/components/responses/SubDomainObject'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '406':
          $ref: '#/components/responses/NotAcceptable'
        '500':
          $ref: '#/components/responses/InternalServerError'
        '502':
          $ref: '#/components/responses/BadGateway'
        '504':
          $ref: '#/components/responses/UpstreamTimeout'
        '429':
          $ref: '#/components/responses/TooManyRequests'
      security:
        - authorizer: [ ]
        - oAuth:
            - directory:website
            - directory:software
      x-amazon-apigateway-integration:
        uri: "${organisation_read_arn}"
        passthroughBehavior: "when_no_match"
        httpMethod: "POST"
        timeoutInMillis: 15000
        type: "aws_proxy"
    put:
      summary: Update a sub-domain registration
      description: Updates information on a sub-domain registration
      operationId: updateSubDomain
      tags:
        - Public
        - Closed
      requestBody:
        $ref: '#/components/requestBodies/SubDomainUpdateRequest'
      responses:
        '201':
          $ref: '#/components/responses/SubDomainObject'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '409':
          $ref: '#/components/responses/Conflict'
        '500':
          $ref: '#/components/responses/InternalServerError'
        '502':
          $ref: '#/components/responses/BadGateway'
        '504':
          $ref: '#/components/responses/UpstreamTimeout'
        '429':
          $ref: '#/components/responses/TooManyRequests'
      security:
        - authorizer: [ ]
        - oAuth:
            - directory:website
      x-amazon-apigateway-integration:
        uri: "${organisation_write_arn}"
        passthroughBehavior: "when_no_match"
        httpMethod: "POST"
        timeoutInMillis: 29000
        type: "aws_proxy"

  '/references/authorisationdomainroles':
    parameters:
      - $ref: "#/components/parameters/x-fapi-auth-date"
      - $ref: "#/components/parameters/x-fapi-customer-ip-address"
      - $ref: "#/components/parameters/x-fapi-interaction-id"
      - $ref: "#/components/parameters/x-customer-user-agent"
    get:
      summary: Reference data of all authorisation domain roles
      description: get all authorisation domain roles
      operationId: getAuthorisationdomainRoles
      deprecated: true
      parameters:
        - $ref: "#/components/parameters/PageNumber"
        - $ref: "#/components/parameters/PageSize"
        - $ref: "#/components/parameters/PageSort"
        - in: query
          name: domainRole
          schema:
            type: string
            default: ""
          required: false
          description: Will return authorisation domain roles with data like the provided authorisationDomainRole
        - in: query
          name: status
          schema:
            type: string
            default: ""
          required: false
          description: Will return roles matching the provided status
        - in: query
          name: domain
          schema:
            type: string
            default: ""
          required: false
          description: Will return authorisation domain roles with data like the provided authorisationDomain
        - in: query
          name: type
          schema:
            type: string
            default: ""
          required: false
          description: Will return authorisation domain roles with data like the provided roletype
      tags:
        - Reference Data
        - Authorisation Domain Roles
        - Public
        - Closed
      responses:
        '200':
          $ref: '#/components/responses/AuthorisationDomainRolesPage'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '406':
          $ref: '#/components/responses/NotAcceptable'
        '500':
          $ref: '#/components/responses/InternalServerError'
        '502':
          $ref: '#/components/responses/BadGateway'
        '504':
          $ref: '#/components/responses/UpstreamTimeout'
        '429':
          $ref: '#/components/responses/TooManyRequests'
      security:
        - authorizer: [ ]
        - oAuth:
            - directory:website
            - directory:software
      x-amazon-apigateway-integration:
        uri: "${organisation_read_arn}"
        passthroughBehavior: "when_no_match"
        httpMethod: "POST"
        timeoutInMillis: 29000
        type: "aws_proxy"
    post:
      summary: Create an authorisation domain role
      description: creates a new authorisation domain role
      operationId: createAuthorisationDomainRole
      deprecated: true
      tags:
        - Reference Data
        - Authorisation Domain Roles
        - Public
        - Closed
      requestBody:
        $ref: '#/components/requestBodies/AuthorisationDomainRoleRequest'
      responses:
        '201':
          $ref: '#/components/responses/AuthorisationDomainRole'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '409':
          $ref: '#/components/responses/Conflict'
        '500':
          $ref: '#/components/responses/InternalServerError'
        '502':
          $ref: '#/components/responses/BadGateway'
        '504':
          $ref: '#/components/responses/UpstreamTimeout'
        '429':
          $ref: '#/components/responses/TooManyRequests'
      security:
        - authorizer: [ ]
        - oAuth:
            - directory:website
      x-amazon-apigateway-integration:
        uri: "${organisation_write_arn}"
        passthroughBehavior: "when_no_match"
        httpMethod: "POST"
        timeoutInMillis: 29000
        type: "aws_proxy"

  '/references/authorisationdomainroles/{AuthorisationDomainRoleName}':
    parameters:
      - $ref: '#/components/parameters/AuthorisationDomainRoleName'
      - $ref: "#/components/parameters/x-fapi-auth-date"
      - $ref: "#/components/parameters/x-fapi-customer-ip-address"
      - $ref: "#/components/parameters/x-fapi-interaction-id"
      - $ref: "#/components/parameters/x-customer-user-agent"
    get:
      summary: Get an authorisation domain role by name
      description: get a specific authorisation domain role
      operationId: getAuthorisationdomainRoleByName
      deprecated: true
      tags:
        - Reference Data
        - Authorisation Domain Roles
        - Public
        - Closed
      responses:
        '200':
          $ref: '#/components/responses/AuthorisationDomainRole'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '406':
          $ref: '#/components/responses/NotAcceptable'
        '500':
          $ref: '#/components/responses/InternalServerError'
        '502':
          $ref: '#/components/responses/BadGateway'
        '504':
          $ref: '#/components/responses/UpstreamTimeout'
        '429':
          $ref: '#/components/responses/TooManyRequests'
      security:
        - authorizer: [ ]
        - oAuth:
            - directory:website
            - directory:software
      x-amazon-apigateway-integration:
        uri: "${organisation_read_arn}"
        passthroughBehavior: "when_no_match"
        httpMethod: "POST"
        timeoutInMillis: 15000
        type: "aws_proxy"
    put:
      summary: Update an authorisation domain role by name
      description: Updates a specific authorisation domain role
      operationId: updateAuthorisationDomainRoleByName
      deprecated: true
      tags:
        - Reference Data
        - Authorisation Domain Roles
        - Public
        - Closed
      requestBody:
        $ref: '#/components/requestBodies/AuthorisationDomainRoleUpdateRequest'
      responses:
        '200':
          $ref: '#/components/responses/AuthorisationDomainRole'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '409':
          $ref: '#/components/responses/Conflict'
        '500':
          $ref: '#/components/responses/InternalServerError'
        '502':
          $ref: '#/components/responses/BadGateway'
        '504':
          $ref: '#/components/responses/UpstreamTimeout'
        '429':
          $ref: '#/components/responses/TooManyRequests'
      security:
        - authorizer: [ ]
        - oAuth:
            - directory:website
      x-amazon-apigateway-integration:
        uri: "${organisation_write_arn}"
        passthroughBehavior: "when_no_match"
        httpMethod: "POST"
        timeoutInMillis: 29000
        type: "aws_proxy"
    delete:
      summary: Deactivate an authorisation domain role by Name
      description: deactivates an authorisation domain role
      operationId: deleteAuthorisationDomainRoleByName
      deprecated: true
      tags:
        - Reference Data
        - Authorisation Domain Roles
        - Public
        - Closed
      responses:
        '204':
          $ref: '#/components/responses/NoContent'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '406':
          $ref: '#/components/responses/NotAcceptable'
        '500':
          $ref: '#/components/responses/InternalServerError'
        '502':
          $ref: '#/components/responses/BadGateway'
        '504':
          $ref: '#/components/responses/UpstreamTimeout'
        '429':
          $ref: '#/components/responses/TooManyRequests'
      security:
        - authorizer: [ ]
        - oAuth:
            - directory:website
      x-amazon-apigateway-integration:
        uri: "${organisation_write_arn}"
        passthroughBehavior: "when_no_match"
        httpMethod: "POST"
        timeoutInMillis: 29000
        type: "aws_proxy"

  '/references/authorisationdomainroles/{AuthorisationDomainRoleName}/metadata':
    get:
      summary: Get metadata associated with an authorisation domain role
      description: get all metadata associated with an authorisation domain role
      operationId: getAuthorisationDomainRoleMetadata
      deprecated: true
      tags:
        - Reference Data
        - Authorisation Domain Role Metadata
        - Public
        - Closed
      parameters:
        - in: query
          name: type
          schema:
            type: string
            default: ""
          required: false
          description: Get all of a specific type of metadata
        - $ref: '#/components/parameters/AuthorisationDomainRoleName'
        - $ref: "#/components/parameters/x-fapi-auth-date"
        - $ref: "#/components/parameters/x-fapi-customer-ip-address"
        - $ref: "#/components/parameters/x-fapi-interaction-id"
        - $ref: "#/components/parameters/x-customer-user-agent"
        - $ref: "#/components/parameters/PageNumber"
        - $ref: "#/components/parameters/PageSize"
        - $ref: "#/components/parameters/PageSort"
      responses:
        '200':
          $ref: '#/components/responses/MetadataList'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '406':
          $ref: '#/components/responses/NotAcceptable'
        '500':
          $ref: '#/components/responses/InternalServerError'
        '502':
          $ref: '#/components/responses/BadGateway'
        '504':
          $ref: '#/components/responses/UpstreamTimeout'
        '429':
          $ref: '#/components/responses/TooManyRequests'
      security:
        - authorizer: [ ]
        - oAuth:
            - directory:software
            - directory:website
      x-amazon-apigateway-integration:
        uri: "${organisation_read_arn}"
        passthroughBehavior: "when_no_match"
        httpMethod: "POST"
        timeoutInMillis: 29000
        type: "aws_proxy"
    post:
      summary: Create a metadata record associated with an authorisation domain role
      description: creates a new metadata object attached to a role. Note this cascades to the client endpoint / directory clients depending on role type
      operationId: createAuthorisationDomainRoleMetadata
      deprecated: true
      tags:
        - Reference Data
        - Authorisation Domain Role Metadata
        - Public
        - Closed
      parameters:
        - $ref: '#/components/parameters/AuthorisationDomainRoleName'
        - $ref: "#/components/parameters/x-fapi-auth-date"
        - $ref: "#/components/parameters/x-fapi-customer-ip-address"
        - $ref: "#/components/parameters/x-fapi-interaction-id"
        - $ref: "#/components/parameters/x-customer-user-agent"
      requestBody:
        $ref: '#/components/requestBodies/MetadataRequest'

      responses:
        '201':
          $ref: '#/components/responses/Metadata'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '409':
          $ref: '#/components/responses/Conflict'
        '500':
          $ref: '#/components/responses/InternalServerError'
        '502':
          $ref: '#/components/responses/BadGateway'
        '504':
          $ref: '#/components/responses/UpstreamTimeout'
        '429':
          $ref: '#/components/responses/TooManyRequests'

      security:
        - authorizer: [ ]
        - oAuth:
            - directory:website
      x-amazon-apigateway-integration:
        uri: "${organisation_write_arn}"
        passthroughBehavior: "when_no_match"
        httpMethod: "POST"
        timeoutInMillis: 29000
        type: "aws_proxy"

  '/references/authorisationdomainroles/{AuthorisationDomainRoleName}/metadata/{MetadataId}':
    get:
      summary: Get metadata associated with an authorisation domain role
      description: get specific authorisation domain role metadata object
      operationId: getAuthorisationDomainRoleMetadataById
      deprecated: true
      tags:
        - Reference Data
        - Authorisation Domain Role Metadata
        - Public
        - Closed
      parameters:
        - $ref: '#/components/parameters/MetadataId'
        - $ref: '#/components/parameters/AuthorisationDomainRoleName'
        - $ref: "#/components/parameters/x-fapi-auth-date"
        - $ref: "#/components/parameters/x-fapi-customer-ip-address"
        - $ref: "#/components/parameters/x-fapi-interaction-id"
        - $ref: "#/components/parameters/x-customer-user-agent"
      responses:
        '200':
          $ref: '#/components/responses/Metadata'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '406':
          $ref: '#/components/responses/NotAcceptable'
        '500':
          $ref: '#/components/responses/InternalServerError'
        '502':
          $ref: '#/components/responses/BadGateway'
        '504':
          $ref: '#/components/responses/UpstreamTimeout'
        '429':
          $ref: '#/components/responses/TooManyRequests'
      security:
        - authorizer: [ ]
        - oAuth:
            - directory:software
            - directory:website
      x-amazon-apigateway-integration:
        uri: "${organisation_read_arn}"
        passthroughBehavior: "when_no_match"
        httpMethod: "POST"
        timeoutInMillis: 29000
        type: "aws_proxy"
    put:
      summary: Change the status of a metadata object that is associated with an authorisation domain role
      description: update a specific metadata object
      operationId: updateAuthorisationDomainRoleMetadataById
      deprecated: true
      tags:
        - Reference Data
        - Authorisation Domain Role Metadata
        - Public
        - Closed
      parameters:
        - $ref: '#/components/parameters/MetadataId'
        - $ref: '#/components/parameters/AuthorisationDomainRoleName'
        - $ref: "#/components/parameters/x-fapi-auth-date"
        - $ref: "#/components/parameters/x-fapi-customer-ip-address"
        - $ref: "#/components/parameters/x-fapi-interaction-id"
        - $ref: "#/components/parameters/x-customer-user-agent"
      requestBody:
        $ref: '#/components/requestBodies/MetadataRequest'
      responses:
        '200':
          $ref: '#/components/responses/Metadata'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '406':
          $ref: '#/components/responses/NotAcceptable'
        '500':
          $ref: '#/components/responses/InternalServerError'
        '502':
          $ref: '#/components/responses/BadGateway'
        '504':
          $ref: '#/components/responses/UpstreamTimeout'
        '429':
          $ref: '#/components/responses/TooManyRequests'
      security:
        - authorizer: [ ]
        - oAuth:
            - directory:website
      x-amazon-apigateway-integration:
        uri: "${organisation_write_arn}"
        passthroughBehavior: "when_no_match"
        httpMethod: "POST"
        timeoutInMillis: 29000
        type: "aws_proxy"
    delete:
      summary: Delete a metadata object that is associated with an authorisation domain role
      description: delete a specific metadata object
      operationId: deleteAuthorisationDomainRoleMetadataById
      deprecated: true
      tags:
        - Reference Data
        - Authorisation Domain Role Metadata
        - Public
        - Deprecated
      parameters:
        - $ref: '#/components/parameters/MetadataId'
        - $ref: '#/components/parameters/AuthorisationDomainRoleName'
        - $ref: "#/components/parameters/x-fapi-auth-date"
        - $ref: "#/components/parameters/x-fapi-customer-ip-address"
        - $ref: "#/components/parameters/x-fapi-interaction-id"
        - $ref: "#/components/parameters/x-customer-user-agent"
      responses:
        '204':
          $ref: '#/components/responses/NoContent'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '406':
          $ref: '#/components/responses/NotAcceptable'
        '500':
          $ref: '#/components/responses/InternalServerError'
        '502':
          $ref: '#/components/responses/BadGateway'
        '504':
          $ref: '#/components/responses/UpstreamTimeout'
        '429':
          $ref: '#/components/responses/TooManyRequests'
      security:
        - authorizer: [ ]
        - oAuth:
            - directory:website
      x-amazon-apigateway-integration:
        uri: "${organisation_write_arn}"
        passthroughBehavior: "when_no_match"
        httpMethod: "POST"
        timeoutInMillis: 29000
        type: "aws_proxy"

  '/references/authorisationdomains/{AuthorisationDomainName}/authorisationdomainroles':
    parameters:
      - $ref: "#/components/parameters/AuthorisationDomainName"
      - $ref: "#/components/parameters/x-fapi-auth-date"
      - $ref: "#/components/parameters/x-fapi-customer-ip-address"
      - $ref: "#/components/parameters/x-fapi-interaction-id"
      - $ref: "#/components/parameters/x-customer-user-agent"
    get:
      summary: Reference data of all authorisation domain roles
      description: get all authorisation domain roles
      operationId: getAuthorisationdomainRolesByDomain
      parameters:
        - $ref: "#/components/parameters/PageNumber"
        - $ref: "#/components/parameters/PageSize"
        - $ref: "#/components/parameters/PageSort"
        - in: query
          name: domainRole
          schema:
            type: string
            default: ""
          required: false
          description: Will return authorisation domain roles with data like the provided authorisationDomainRole
        - in: query
          name: status
          schema:
            type: string
            default: ""
          required: false
          description: Will return roles matching the provided status
        - in: query
          name: domain
          schema:
            type: string
            default: ""
          required: false
          description: Will return authorisation domain roles with data like the provided authorisationDomain
        - in: query
          name: type
          schema:
            type: string
            default: ""
          required: false
          description: Will return authorisation domain roles with data like the provided roletype
      tags:
        - Reference Data
        - Authorisation Domain Roles
        - Public
        - Closed
      responses:
        '200':
          $ref: '#/components/responses/AuthorisationDomainRolesPage'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '406':
          $ref: '#/components/responses/NotAcceptable'
        '500':
          $ref: '#/components/responses/InternalServerError'
        '502':
          $ref: '#/components/responses/BadGateway'
        '504':
          $ref: '#/components/responses/UpstreamTimeout'
        '429':
          $ref: '#/components/responses/TooManyRequests'
      security:
        - authorizer: [ ]
        - oAuth:
            - directory:website
            - directory:software
      x-amazon-apigateway-integration:
        uri: "${organisation_read_arn}"
        passthroughBehavior: "when_no_match"
        httpMethod: "POST"
        timeoutInMillis: 29000
        type: "aws_proxy"
    post:
      summary: Create an authorisation domain role
      description: creates a new authorisation domain role
      operationId: createAuthorisationDomainRoleByDomain
      tags:
        - Reference Data
        - Authorisation Domain Roles
        - Public
        - Closed
      requestBody:
        $ref: '#/components/requestBodies/DomainAuthorisationDomainRoleRequest'
      responses:
        '201':
          $ref: '#/components/responses/AuthorisationDomainRole'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '409':
          $ref: '#/components/responses/Conflict'
        '500':
          $ref: '#/components/responses/InternalServerError'
        '502':
          $ref: '#/components/responses/BadGateway'
        '504':
          $ref: '#/components/responses/UpstreamTimeout'
        '429':
          $ref: '#/components/responses/TooManyRequests'
      security:
        - authorizer: [ ]
        - oAuth:
            - directory:website
      x-amazon-apigateway-integration:
        uri: "${organisation_write_arn}"
        passthroughBehavior: "when_no_match"
        httpMethod: "POST"
        timeoutInMillis: 29000
        type: "aws_proxy"

  '/references/authorisationdomains/{AuthorisationDomainName}/authorisationdomainroles/{AuthorisationDomainRoleIdentifier}':
    parameters:
      - $ref: "#/components/parameters/AuthorisationDomainName"
      - $ref: '#/components/parameters/AuthorisationDomainRoleIdentifier'
      - $ref: "#/components/parameters/x-fapi-auth-date"
      - $ref: "#/components/parameters/x-fapi-customer-ip-address"
      - $ref: "#/components/parameters/x-fapi-interaction-id"
      - $ref: "#/components/parameters/x-customer-user-agent"
    get:
      summary: Get an authorisation domain role by name
      description: get a specific authorisation domain role
      operationId: getAuthorisationdomainRoleByDomainAndName
      tags:
        - Reference Data
        - Authorisation Domain Roles
        - Public
        - Closed
      responses:
        '200':
          $ref: '#/components/responses/AuthorisationDomainRole'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '406':
          $ref: '#/components/responses/NotAcceptable'
        '500':
          $ref: '#/components/responses/InternalServerError'
        '502':
          $ref: '#/components/responses/BadGateway'
        '504':
          $ref: '#/components/responses/UpstreamTimeout'
        '429':
          $ref: '#/components/responses/TooManyRequests'
      security:
        - authorizer: [ ]
        - oAuth:
            - directory:website
            - directory:software
      x-amazon-apigateway-integration:
        uri: "${organisation_read_arn}"
        passthroughBehavior: "when_no_match"
        httpMethod: "POST"
        timeoutInMillis: 15000
        type: "aws_proxy"
    put:
      summary: Update an authorisation domain role by name
      description: Updates a specific authorisation domain role
      operationId: updateAuthorisationDomainRoleByDomainAndName
      tags:
        - Reference Data
        - Authorisation Domain Roles
        - Public
        - Closed
      requestBody:
        $ref: '#/components/requestBodies/DomainAuthorisationDomainRoleUpdateRequest'
      responses:
        '200':
          $ref: '#/components/responses/AuthorisationDomainRole'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '409':
          $ref: '#/components/responses/Conflict'
        '500':
          $ref: '#/components/responses/InternalServerError'
        '502':
          $ref: '#/components/responses/BadGateway'
        '504':
          $ref: '#/components/responses/UpstreamTimeout'
        '429':
          $ref: '#/components/responses/TooManyRequests'
      security:
        - authorizer: [ ]
        - oAuth:
            - directory:website
      x-amazon-apigateway-integration:
        uri: "${organisation_write_arn}"
        passthroughBehavior: "when_no_match"
        httpMethod: "POST"
        timeoutInMillis: 29000
        type: "aws_proxy"
    delete:
      summary: Deactivate an authorisation domain role by Name
      description: deactivates an authorisation domain role
      operationId: deleteAuthorisationDomainRoleByDomainAndName
      tags:
        - Reference Data
        - Authorisation Domain Roles
        - Public
        - Closed
      responses:
        '204':
          $ref: '#/components/responses/NoContent'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '406':
          $ref: '#/components/responses/NotAcceptable'
        '500':
          $ref: '#/components/responses/InternalServerError'
        '502':
          $ref: '#/components/responses/BadGateway'
        '504':
          $ref: '#/components/responses/UpstreamTimeout'
        '429':
          $ref: '#/components/responses/TooManyRequests'
      security:
        - authorizer: [ ]
        - oAuth:
            - directory:website
      x-amazon-apigateway-integration:
        uri: "${organisation_write_arn}"
        passthroughBehavior: "when_no_match"
        httpMethod: "POST"
        timeoutInMillis: 29000
        type: "aws_proxy"

  '/references/authorisationdomains/{AuthorisationDomainName}/authorisationdomainroles/{AuthorisationDomainRoleIdentifier}/metadata':
    get:
      summary: Get metadata associated with an authorisation domain role
      description: get all metadata associated with an authorisation domain role
      operationId: getAuthorisationDomainRoleMetadataByDomain
      tags:
        - Reference Data
        - Authorisation Domain Role Metadata
        - Public
        - Closed
      parameters:
        - in: query
          name: type
          schema:
            type: string
            default: ""
          required: false
          description: Get all of a specific type of metadata
        - $ref: "#/components/parameters/AuthorisationDomainName"
        - $ref: '#/components/parameters/AuthorisationDomainRoleIdentifier'
        - $ref: "#/components/parameters/x-fapi-auth-date"
        - $ref: "#/components/parameters/x-fapi-customer-ip-address"
        - $ref: "#/components/parameters/x-fapi-interaction-id"
        - $ref: "#/components/parameters/x-customer-user-agent"
        - $ref: "#/components/parameters/PageNumber"
        - $ref: "#/components/parameters/PageSize"
        - $ref: "#/components/parameters/PageSort"
      responses:
        '200':
          $ref: '#/components/responses/MetadataList'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '406':
          $ref: '#/components/responses/NotAcceptable'
        '500':
          $ref: '#/components/responses/InternalServerError'
        '502':
          $ref: '#/components/responses/BadGateway'
        '504':
          $ref: '#/components/responses/UpstreamTimeout'
        '429':
          $ref: '#/components/responses/TooManyRequests'
      security:
        - authorizer: [ ]
        - oAuth:
            - directory:software
            - directory:website
      x-amazon-apigateway-integration:
        uri: "${organisation_read_arn}"
        passthroughBehavior: "when_no_match"
        httpMethod: "POST"
        timeoutInMillis: 29000
        type: "aws_proxy"
    post:
      summary: Create a metadata record associated with an authorisation domain role
      description: creates a new metadata object attached to a role. Note this cascades to the client endpoint / directory clients depending on role type
      operationId: createAuthorisationDomainRoleMetadataByDomain
      tags:
        - Reference Data
        - Authorisation Domain Role Metadata
        - Public
        - Closed
      parameters:
        - $ref: "#/components/parameters/AuthorisationDomainName"
        - $ref: '#/components/parameters/AuthorisationDomainRoleIdentifier'
        - $ref: "#/components/parameters/x-fapi-auth-date"
        - $ref: "#/components/parameters/x-fapi-customer-ip-address"
        - $ref: "#/components/parameters/x-fapi-interaction-id"
        - $ref: "#/components/parameters/x-customer-user-agent"
      requestBody:
        $ref: '#/components/requestBodies/MetadataRequest'

      responses:
        '201':
          $ref: '#/components/responses/Metadata'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '409':
          $ref: '#/components/responses/Conflict'
        '500':
          $ref: '#/components/responses/InternalServerError'
        '502':
          $ref: '#/components/responses/BadGateway'
        '504':
          $ref: '#/components/responses/UpstreamTimeout'
        '429':
          $ref: '#/components/responses/TooManyRequests'

      security:
        - authorizer: [ ]
        - oAuth:
            - directory:website
      x-amazon-apigateway-integration:
        uri: "${organisation_write_arn}"
        passthroughBehavior: "when_no_match"
        httpMethod: "POST"
        timeoutInMillis: 29000
        type: "aws_proxy"

  '/references/authorisationdomains/{AuthorisationDomainName}/authorisationdomainroles/{AuthorisationDomainRoleIdentifier}/metadata/{MetadataId}':
    get:
      summary: Get metadata associated with an authorisation domain role
      description: get specific authorisation domain role metadata object
      operationId: getAuthorisationDomainRoleMetadataByIdAndDomain
      tags:
        - Reference Data
        - Authorisation Domain Role Metadata
        - Public
        - Closed
      parameters:
        - $ref: "#/components/parameters/AuthorisationDomainName"
        - $ref: '#/components/parameters/MetadataId'
        - $ref: '#/components/parameters/AuthorisationDomainRoleIdentifier'
        - $ref: "#/components/parameters/x-fapi-auth-date"
        - $ref: "#/components/parameters/x-fapi-customer-ip-address"
        - $ref: "#/components/parameters/x-fapi-interaction-id"
        - $ref: "#/components/parameters/x-customer-user-agent"
      responses:
        '200':
          $ref: '#/components/responses/Metadata'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '406':
          $ref: '#/components/responses/NotAcceptable'
        '500':
          $ref: '#/components/responses/InternalServerError'
        '502':
          $ref: '#/components/responses/BadGateway'
        '504':
          $ref: '#/components/responses/UpstreamTimeout'
        '429':
          $ref: '#/components/responses/TooManyRequests'
      security:
        - authorizer: [ ]
        - oAuth:
            - directory:software
            - directory:website
      x-amazon-apigateway-integration:
        uri: "${organisation_read_arn}"
        passthroughBehavior: "when_no_match"
        httpMethod: "POST"
        timeoutInMillis: 29000
        type: "aws_proxy"
    put:
      summary: Change the status of a metadata object that is associated with an authorisation domain role
      description: update a specific metadata object
      operationId: updateAuthorisationDomainRoleMetadataByIdAndDomain
      tags:
        - Reference Data
        - Authorisation Domain Role Metadata
        - Public
        - Closed
      parameters:
        - $ref: "#/components/parameters/AuthorisationDomainName"
        - $ref: '#/components/parameters/MetadataId'
        - $ref: '#/components/parameters/AuthorisationDomainRoleIdentifier'
        - $ref: "#/components/parameters/x-fapi-auth-date"
        - $ref: "#/components/parameters/x-fapi-customer-ip-address"
        - $ref: "#/components/parameters/x-fapi-interaction-id"
        - $ref: "#/components/parameters/x-customer-user-agent"
      requestBody:
        $ref: '#/components/requestBodies/MetadataRequest'
      responses:
        '200':
          $ref: '#/components/responses/Metadata'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '406':
          $ref: '#/components/responses/NotAcceptable'
        '500':
          $ref: '#/components/responses/InternalServerError'
        '502':
          $ref: '#/components/responses/BadGateway'
        '504':
          $ref: '#/components/responses/UpstreamTimeout'
        '429':
          $ref: '#/components/responses/TooManyRequests'
      security:
        - authorizer: [ ]
        - oAuth:
            - directory:website
      x-amazon-apigateway-integration:
        uri: "${organisation_write_arn}"
        passthroughBehavior: "when_no_match"
        httpMethod: "POST"
        timeoutInMillis: 29000
        type: "aws_proxy"
    delete:
      summary: Delete a metadata object that is associated with an authorisation domain role
      description: delete a specific metadata object
      operationId: deleteAuthorisationDomainRoleMetadataByIdAndDomain
      deprecated: true
      tags:
        - Reference Data
        - Authorisation Domain Role Metadata
        - Public
        - Deprecated
      parameters:
        - $ref: "#/components/parameters/AuthorisationDomainName"
        - $ref: '#/components/parameters/MetadataId'
        - $ref: '#/components/parameters/AuthorisationDomainRoleIdentifier'
        - $ref: "#/components/parameters/x-fapi-auth-date"
        - $ref: "#/components/parameters/x-fapi-customer-ip-address"
        - $ref: "#/components/parameters/x-fapi-interaction-id"
        - $ref: "#/components/parameters/x-customer-user-agent"
      responses:
        '204':
          $ref: '#/components/responses/NoContent'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '406':
          $ref: '#/components/responses/NotAcceptable'
        '500':
          $ref: '#/components/responses/InternalServerError'
        '502':
          $ref: '#/components/responses/BadGateway'
        '504':
          $ref: '#/components/responses/UpstreamTimeout'
        '429':
          $ref: '#/components/responses/TooManyRequests'
      security:
        - authorizer: [ ]
        - oAuth:
            - directory:website
      x-amazon-apigateway-integration:
        uri: "${organisation_write_arn}"
        passthroughBehavior: "when_no_match"
        httpMethod: "POST"
        timeoutInMillis: 29000
        type: "aws_proxy"

  '/references/authorityauthorisationdomains':
    parameters:
      - $ref: "#/components/parameters/x-fapi-auth-date"
      - $ref: "#/components/parameters/x-fapi-customer-ip-address"
      - $ref: "#/components/parameters/x-fapi-interaction-id"
      - $ref: "#/components/parameters/x-customer-user-agent"
    get:
      summary: Reference data of all authority authorisation domain mappings
      description: get all authority authorisation domains mappings
      operationId: getAuthorityAuthorisationDomainMappings
      parameters:
        - $ref: "#/components/parameters/PageNumber"
        - $ref: "#/components/parameters/PageSize"
        - $ref: "#/components/parameters/PageSort"
        - $ref: "#/components/parameters/AuthorityIdQuery"
        - $ref: "#/components/parameters/AuthorisationDomainIdQuery"
      tags:
        - Reference Data
        - Authorisation Domains
        - Authorities
        - Authority Domain Mappings
        - Public
        - Closed
      responses:
        '200':
          $ref: '#/components/responses/AuthorityAuthorisationDomainsPage'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '406':
          $ref: '#/components/responses/NotAcceptable'
        '500':
          $ref: '#/components/responses/InternalServerError'
        '502':
          $ref: '#/components/responses/BadGateway'
        '504':
          $ref: '#/components/responses/UpstreamTimeout'
        '429':
          $ref: '#/components/responses/TooManyRequests'
      security:
        - authorizer: [ ]
        - oAuth:
            - directory:website
            - directory:software
      x-amazon-apigateway-integration:
        uri: "${organisation_read_arn}"
        passthroughBehavior: "when_no_match"
        httpMethod: "POST"
        timeoutInMillis: 15000
        type: "aws_proxy"
    post:
      summary: Map an authorisation domain to an authority
      description: creates a new mapping linking an authority to an authorisation domain
      operationId: createAuthorityDomainMappings
      tags:
        - Reference Data
        - Authorisation Domains
        - Authorities
        - Authority Domain Mappings
        - Public
        - Closed
      requestBody:
        $ref: '#/components/requestBodies/AuthorityAuthorisationDomainRequest'
      responses:
        '201':
          $ref: '#/components/responses/AuthorityAuthorisationDomain'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '409':
          $ref: '#/components/responses/Conflict'
        '500':
          $ref: '#/components/responses/InternalServerError'
        '502':
          $ref: '#/components/responses/BadGateway'
        '504':
          $ref: '#/components/responses/UpstreamTimeout'
        '429':
          $ref: '#/components/responses/TooManyRequests'
      security:
        - authorizer: [ ]
        - oAuth:
            - directory:website
      x-amazon-apigateway-integration:
        uri: "${organisation_write_arn}"
        passthroughBehavior: "when_no_match"
        httpMethod: "POST"
        timeoutInMillis: 29000
        type: "aws_proxy"

  '/references/authorityauthorisationdomains/{AuthorityAuthorisationDomainId}':
    parameters:
      - $ref: '#/components/parameters/AuthorityAuthorisationDomainId'
      - $ref: "#/components/parameters/x-fapi-auth-date"
      - $ref: "#/components/parameters/x-fapi-customer-ip-address"
      - $ref: "#/components/parameters/x-fapi-interaction-id"
      - $ref: "#/components/parameters/x-customer-user-agent"
    get:
      summary: Get an authority authorisation domain by Id
      description: get a specific mapping between an authority and authorisation domain
      operationId: getAuthorityDomainMappingById
      tags:
        - Reference Data
        - Authorisation Domains
        - Authorities
        - Authority Domain Mappings
        - Public
        - Closed
      responses:
        '200':
          $ref: '#/components/responses/AuthorityAuthorisationDomain'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '406':
          $ref: '#/components/responses/NotAcceptable'
        '500':
          $ref: '#/components/responses/InternalServerError'
        '502':
          $ref: '#/components/responses/BadGateway'
        '504':
          $ref: '#/components/responses/UpstreamTimeout'
        '429':
          $ref: '#/components/responses/TooManyRequests'
      security:
        - authorizer: [ ]
        - oAuth:
            - directory:website
            - directory:software
      x-amazon-apigateway-integration:
        uri: "${organisation_read_arn}"
        passthroughBehavior: "when_no_match"
        httpMethod: "POST"
        timeoutInMillis: 15000
        type: "aws_proxy"
    delete:
      summary: Deactivate an authority authorisation domain by Id
      description: delete a mapping between an authority and authorisation domain
      operationId: deleteAuthorityDomainMappingById
      tags:
        - Reference Data
        - Authorisation Domains
        - Authorities
        - Authority Domain Mappings
        - Public
        - Closed
      responses:
        '204':
          $ref: '#/components/responses/NoContent'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '406':
          $ref: '#/components/responses/NotAcceptable'
        '500':
          $ref: '#/components/responses/InternalServerError'
        '502':
          $ref: '#/components/responses/BadGateway'
        '504':
          $ref: '#/components/responses/UpstreamTimeout'
        '429':
          $ref: '#/components/responses/TooManyRequests'
      security:
        - authorizer: [ ]
        - oAuth:
            - directory:website
      x-amazon-apigateway-integration:
        uri: "${organisation_write_arn}"
        passthroughBehavior: "when_no_match"
        httpMethod: "POST"
        timeoutInMillis: 29000
        type: "aws_proxy"
    put:
      summary: Activate an authority authorisation domain mapping by Id
      description: update a mapping between an authority and authorisation domain
      operationId: updateAuthorityDomainMappingById
      tags:
        - Reference Data
        - Authorisation Domains
        - Authorities
        - Authority Domain Mappings
        - Public
        - Closed
      requestBody:
        $ref: '#/components/requestBodies/AuthorityAuthorisationDomainRequest'
      responses:
        '200':
          $ref: '#/components/responses/AuthorityAuthorisationDomain'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '406':
          $ref: '#/components/responses/NotAcceptable'
        '500':
          $ref: '#/components/responses/InternalServerError'
        '502':
          $ref: '#/components/responses/BadGateway'
        '504':
          $ref: '#/components/responses/UpstreamTimeout'
        '429':
          $ref: '#/components/responses/TooManyRequests'
      security:
        - authorizer: [ ]
        - oAuth:
            - directory:website
      x-amazon-apigateway-integration:
        uri: "${organisation_write_arn}"
        passthroughBehavior: "when_no_match"
        httpMethod: "POST"
        timeoutInMillis: 29000
        type: "aws_proxy"

  '/references/termsandconditions':
    get:
      summary: All terms and conditions
      description: Return all terms and conditions configured on the platform
      operationId: getTermsAndConditions
      parameters:
        - $ref: "#/components/parameters/x-fapi-auth-date"
        - $ref: "#/components/parameters/x-fapi-customer-ip-address"
        - $ref: "#/components/parameters/x-fapi-interaction-id"
        - $ref: "#/components/parameters/x-customer-user-agent"
        - $ref: "#/components/parameters/PageNumber"
        - $ref: "#/components/parameters/PageSize"
        - $ref: "#/components/parameters/PageSort"
      tags:
        - Reference Data
        - Terms and Conditions
        - Public
      responses:
        '200':
          $ref: '#/components/responses/TermsAndConditionsPage'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/InternalServerError'
        '502':
          $ref: '#/components/responses/BadGateway'
        '504':
          $ref: '#/components/responses/UpstreamTimeout'
        '429':
          $ref: '#/components/responses/TooManyRequests'
      security:
        - authorizer: [ ]
        - oAuth:
            - directory:website
            - directory:software
      x-amazon-apigateway-integration:
        uri: "${organisation_read_arn}"
        passthroughBehavior: "when_no_match"
        httpMethod: "POST"
        timeoutInMillis: 29000
        type: "aws_proxy"
    post:
      summary: Create TnC
      description: creates a new terms and conditions object available to be signed by organisation admins on the directory
      operationId: createTermsAndConditions
      parameters:
        - $ref: "#/components/parameters/x-fapi-auth-date"
        - $ref: "#/components/parameters/x-fapi-customer-ip-address"
        - $ref: "#/components/parameters/x-fapi-interaction-id"
        - $ref: "#/components/parameters/x-customer-user-agent"
      tags:
        - Reference Data
        - Terms and Conditions
        - Public
      requestBody:
        $ref: '#/components/requestBodies/TermsAndConditionsCreateRequest'
      responses:
        '201':
          $ref: '#/components/responses/TermsAndConditionsItem'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '409':
          $ref: '#/components/responses/Conflict'
        '500':
          $ref: '#/components/responses/InternalServerError'
        '502':
          $ref: '#/components/responses/BadGateway'
        '504':
          $ref: '#/components/responses/UpstreamTimeout'
        '429':
          $ref: '#/components/responses/TooManyRequests'
      security:
        - authorizer: [ ]
        - oAuth:
            - directory:website
      x-amazon-apigateway-integration:
        uri: "${organisation_write_arn}"
        passthroughBehavior: "when_no_match"
        httpMethod: "POST"
        timeoutInMillis: 29000
        type: "aws_proxy"

  '/references/termsandconditions/{TnCId}':
    get:
      summary: Get details for a TnC document
      description: get a specific terms and conditions object
      operationId: getTermsAndConditionsById
      parameters:
        - $ref: '#/components/parameters/TnCId'
        - $ref: "#/components/parameters/x-fapi-auth-date"
        - $ref: "#/components/parameters/x-fapi-customer-ip-address"
        - $ref: "#/components/parameters/x-fapi-interaction-id"
        - $ref: "#/components/parameters/x-customer-user-agent"
      tags:
        - Reference Data
        - Terms and Conditions
        - Public
      responses:
        '200':
          $ref: '#/components/responses/TermsAndConditionsItem'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/InternalServerError'
        '502':
          $ref: '#/components/responses/BadGateway'
        '504':
          $ref: '#/components/responses/UpstreamTimeout'
        '429':
          $ref: '#/components/responses/TooManyRequests'
      security:
        - authorizer: [ ]
        - oAuth:
            - directory:website
      x-amazon-apigateway-integration:
        uri: "${organisation_read_arn}"
        passthroughBehavior: "when_no_match"
        httpMethod: "POST"
        timeoutInMillis: 15000
        type: "aws_proxy"
    put:
      summary: Update the content of a TnC document
      description: When a template ID is updated, the corresponding version will auto increment. This results in an alert to the org admin to sign the new version of the template
      operationId: updateTermsAndConditionsById
      parameters:
        - $ref: '#/components/parameters/TnCId'
        - $ref: "#/components/parameters/x-fapi-auth-date"
        - $ref: "#/components/parameters/x-fapi-customer-ip-address"
        - $ref: "#/components/parameters/x-fapi-interaction-id"
        - $ref: "#/components/parameters/x-customer-user-agent"
      requestBody:
        $ref: '#/components/requestBodies/TermsAndConditionsUpdateRequest'
      tags:
        - Reference Data
        - Terms and Conditions
        - Public
      responses:
        '200':
          $ref: '#/components/responses/TermsAndConditionsItem'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/InternalServerError'
        '502':
          $ref: '#/components/responses/BadGateway'
        '504':
          $ref: '#/components/responses/UpstreamTimeout'
        '429':
          $ref: '#/components/responses/TooManyRequests'
      security:
        - authorizer: [ ]
        - oAuth:
            - directory:website
      x-amazon-apigateway-integration:
        uri: "${organisation_write_arn}"
        passthroughBehavior: "when_no_match"
        httpMethod: "POST"
        timeoutInMillis: 29000
        type: "aws_proxy"
    delete:
      summary: Deactivate a TnC document
      description: deactivates a terms and conditions object
      operationId: deleteTermsAndConditionsById
      parameters:
        - $ref: '#/components/parameters/TnCId'
        - $ref: "#/components/parameters/x-fapi-auth-date"
        - $ref: "#/components/parameters/x-fapi-customer-ip-address"
        - $ref: "#/components/parameters/x-fapi-interaction-id"
        - $ref: "#/components/parameters/x-customer-user-agent"
      tags:
        - Reference Data
        - Terms and Conditions
        - Public
      responses:
        '204':
          $ref: '#/components/responses/NoContent'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/InternalServerError'
        '502':
          $ref: '#/components/responses/BadGateway'
        '504':
          $ref: '#/components/responses/UpstreamTimeout'
        '429':
          $ref: '#/components/responses/TooManyRequests'
      security:
        - authorizer: [ ]
        - oAuth:
            - directory:website
      x-amazon-apigateway-integration:
        uri: "${organisation_write_arn}"
        passthroughBehavior: "when_no_match"
        httpMethod: "POST"
        timeoutInMillis: 29000
        type: "aws_proxy"

  '/references/federations':
    get:
      summary: Get all federations
      description: get all federations
      operationId: getFederations
      tags:
        - Reference Data
        - Federation
        - Public
      parameters:
        - $ref: "#/components/parameters/PageNumber"
        - $ref: "#/components/parameters/PageSize"
      responses:
        '200':
          $ref: '#/components/responses/FederationsPage'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/InternalServerError'
        '502':
          $ref: '#/components/responses/BadGateway'
        '504':
          $ref: '#/components/responses/UpstreamTimeout'
        '429':
          $ref: '#/components/responses/TooManyRequests'
      security:
        - authorizer: [ ]
        - oAuth:
            - directory:website
            - directory:software
      x-amazon-apigateway-integration:
        uri: "${organisation_read_arn}"
        passthroughBehavior: "when_no_match"
        httpMethod: "POST"
        timeoutInMillis: 15000
        type: "aws_proxy"
    post:
      summary: Create a new federation
      description: create a new federation
      operationId: createFederation
      tags:
        - Reference Data
        - Federation
        - Public
      requestBody:
        $ref: '#/components/requestBodies/FederationRequest'
      responses:
        '201':
          $ref: '#/components/responses/FederationItem'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '409':
          $ref: '#/components/responses/Conflict'
        '500':
          $ref: '#/components/responses/InternalServerError'
        '502':
          $ref: '#/components/responses/BadGateway'
        '504':
          $ref: '#/components/responses/UpstreamTimeout'
      security:
        - authorizer: [ ]
        - oAuth:
            - directory:website
      x-amazon-apigateway-integration:
        uri: "${organisation_write_arn}"
        passthroughBehavior: "when_no_match"
        httpMethod: "POST"
        timeoutInMillis: 15000
        type: "aws_proxy"

  '/references/federations/{FederationId}':
    parameters:
      - $ref: '#/components/parameters/FederationId'
    get:
      summary: Get a federation by id
      description: get a federation by id
      operationId: getFederationById
      tags:
        - Reference Data
        - Federation
        - Public
      responses:
        '200':
          $ref: '#/components/responses/FederationItem'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/InternalServerError'
        '502':
          $ref: '#/components/responses/BadGateway'
        '504':
          $ref: '#/components/responses/UpstreamTimeout'
      security:
        - authorizer: [ ]
        - oAuth:
            - directory:website
            - directory:software
      x-amazon-apigateway-integration:
        uri: "${organisation_read_arn}"
        passthroughBehavior: "when_no_match"
        httpMethod: "POST"
        timeoutInMillis: 15000
        type: "aws_proxy"
    put:
      summary: Update a federation
      description: update a federation
      operationId: updateFederation
      tags:
        - Reference Data
        - Federation
        - Public
      requestBody:
        $ref: '#/components/requestBodies/FederationRequest'
      responses:
        '200':
          $ref: '#/components/responses/FederationItem'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '409':
          $ref: '#/components/responses/Conflict'
        '500':
          $ref: '#/components/responses/InternalServerError'
        '502':
          $ref: '#/components/responses/BadGateway'
        '504':
          $ref: '#/components/responses/UpstreamTimeout'
      security:
        - authorizer: [ ]
        - oAuth:
            - directory:website
      x-amazon-apigateway-integration:
        uri: "${organisation_write_arn}"
        passthroughBehavior: "when_no_match"
        httpMethod: "POST"
        timeoutInMillis: 15000
        type: "aws_proxy"
    delete:
      summary: Delete a federation
      description: delete a federation
      operationId: deleteFederation
      tags:
        - Reference Data
        - Federation
        - Public
      responses:
        '204':
          $ref: '#/components/responses/NoContent'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '409':
          $ref: '#/components/responses/Conflict'
        '500':
          $ref: '#/components/responses/InternalServerError'
        '502':
          $ref: '#/components/responses/BadGateway'
        '504':
          $ref: '#/components/responses/UpstreamTimeout'
      security:
        - authorizer: [ ]
        - oAuth:
            - directory:website
      x-amazon-apigateway-integration:
        uri: "${organisation_write_arn}"
        passthroughBehavior: "when_no_match"
        httpMethod: "POST"
        timeoutInMillis: 15000
        type: "aws_proxy"

  '/references/federations/{FederationId}/metadata-policy':
    parameters:
      - $ref: '#/components/parameters/FederationId'
    get:
      summary: Get the metadata policy for a federation
      description: get the metadata policy for a federation
      operationId: getFederationMetadataPolicies
      parameters:
        - $ref: "#/components/parameters/MetadataPolicyType"
        - $ref: '#/components/parameters/PolicyApprovalStatusEnum'
        - $ref: '#/components/parameters/MetadataPolicyVersion'
        - $ref: "#/components/parameters/PageNumber"
        - $ref: "#/components/parameters/PageSize"
        - $ref: "#/components/parameters/PageSort"
      tags:
        - Reference Data
        - Federation
        - Public
      responses:
        '200':
          $ref: '#/components/responses/FederationMetadataPolicyPage'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/InternalServerError'
        '502':
          $ref: '#/components/responses/BadGateway'
        '504':
          $ref: '#/components/responses/UpstreamTimeout'
      security:
        - authorizer: [ ]
        - oAuth:
            - directory:website
            - directory:software
      x-amazon-apigateway-integration:
        uri: "${organisation_read_arn}"
        passthroughBehavior: "when_no_match"
        httpMethod: "POST"
        timeoutInMillis: 15000
        type: "aws_proxy"
    post:
      summary: Create a new metadata policy
      description: create a new metadata policy
      operationId: createFederationMetadataPolicy
      tags:
        - Reference Data
        - Federation
        - Public
      requestBody:
        $ref: '#/components/requestBodies/FederationMetadataPolicyRequest'
      responses:
        '201':
          $ref: '#/components/responses/FederationMetadataPolicyItem'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '409':
          $ref: '#/components/responses/Conflict'
        '500':
          $ref: '#/components/responses/InternalServerError'
        '502':
          $ref: '#/components/responses/BadGateway'
        '504':
          $ref: '#/components/responses/UpstreamTimeout'
      security:
        - authorizer: [ ]
        - oAuth:
            - directory:website
      x-amazon-apigateway-integration:
        uri: "${organisation_write_arn}"
        passthroughBehavior: "when_no_match"
        httpMethod: "POST"
        timeoutInMillis: 15000
        type: "aws_proxy"

  '/references/federations/{FederationId}/metadata-policy/{MetadataPolicyId}':
    parameters:
      - $ref: '#/components/parameters/FederationId'
      - $ref: '#/components/parameters/MetadataPolicyId'
    get:
      summary: Get a metadata policy
      description: get a metadata policy
      operationId: getFederationMetadataPolicy
      tags:
        - Reference Data
        - Federation
        - Public
      responses:
        '200':
          $ref: '#/components/responses/FederationMetadataPolicyItem'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/InternalServerError'
        '502':
          $ref: '#/components/responses/BadGateway'
        '504':
          $ref: '#/components/responses/UpstreamTimeout'
      security:
        - authorizer: [ ]
        - oAuth:
            - directory:website
            - directory:software
      x-amazon-apigateway-integration:
        uri: "${organisation_read_arn}"
        passthroughBehavior: "when_no_match"
        httpMethod: "POST"
        timeoutInMillis: 15000
        type: "aws_proxy"
    put:
      summary: Update a metadata policy
      description: update a metadata policy
      operationId: updateFederationMetadataPolicy
      tags:
        - Reference Data
        - Federation
        - Public
      requestBody:
        $ref: '#/components/requestBodies/FederationMetadataPolicyRequest'
      responses:
        '200':
          $ref: '#/components/responses/FederationMetadataPolicyItem'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '409':
          $ref: '#/components/responses/Conflict'
        '500':
          $ref: '#/components/responses/InternalServerError'
        '502':
          $ref: '#/components/responses/BadGateway'
        '504':
          $ref: '#/components/responses/UpstreamTimeout'
      security:
        - authorizer: [ ]
        - oAuth:
            - directory:website
      x-amazon-apigateway-integration:
        uri: "${organisation_write_arn}"
        passthroughBehavior: "when_no_match"
        httpMethod: "POST"
        timeoutInMillis: 15000
        type: "aws_proxy"
    delete:
      summary: Delete a metadata policy
      description: delete a metadata policy
      operationId: deleteFederationMetadataPolicy
      tags:
        - Reference Data
        - Federation
        - Public
      responses:
        '204':
          $ref: '#/components/responses/NoContent'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/InternalServerError'
        '502':
          $ref: '#/components/responses/BadGateway'
        '504':
          $ref: '#/components/responses/UpstreamTimeout'
      security:
        - authorizer: [ ]
        - oAuth:
            - directory:website
      x-amazon-apigateway-integration:
        uri: "${organisation_write_arn}"
        passthroughBehavior: "when_no_match"
        httpMethod: "POST"
        timeoutInMillis: 15000
        type: "aws_proxy"

  '/references/certificationtypes':
    parameters:
      - $ref: "#/components/parameters/x-fapi-auth-date"
      - $ref: "#/components/parameters/x-fapi-customer-ip-address"
      - $ref: "#/components/parameters/x-fapi-interaction-id"
      - $ref: "#/components/parameters/x-customer-user-agent"
    get:
      summary: Get certification types
      description: Get certification types
      operationId: getCertificationTypes
      tags:
        - Reference Data
        - Certification Type
        - Public
      parameters:
        - $ref: "#/components/parameters/PageNumber"
        - $ref: "#/components/parameters/PageSize"
        - $ref: "#/components/parameters/PageSort"
        - in: query
          name: resourceType
          schema:
            type: string
          description: The resource type to filter by
        - in: query
          name: typeName
          schema:
            type: string
          description: The type name to search by
        - in: query
          name: status
          schema:
            type: string
          description: The status to filter by

      responses:
        '200':
          $ref: '#/components/responses/CertificationTypes'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '409':
          $ref: '#/components/responses/Conflict'
        '406':
          $ref: '#/components/responses/NotAcceptable'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '500':
          $ref: '#/components/responses/InternalServerError'
        '502':
          $ref: '#/components/responses/BadGateway'
        '504':
          $ref: '#/components/responses/UpstreamTimeout'
      security:
        - authorizer: [ ]
        - oAuth:
            - directory:website
      x-amazon-apigateway-integration:
        uri: "${organisation_read_arn}"
        passthroughBehavior: "when_no_match"
        httpMethod: "POST"
        timeoutInMillis: 29000
        type: "aws_proxy"

    post:
      summary: Set certification types
      description: Set certification types
      operationId: createCertificationType
      tags:
        - Reference Data
        - Certification Type
        - Public
      requestBody:
        $ref: '#/components/requestBodies/CertificationTypeRequest'
      responses:
        '201':
          $ref: '#/components/responses/CertificationType'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '409':
          $ref: '#/components/responses/Conflict'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '500':
          $ref: '#/components/responses/InternalServerError'
        '502':
          $ref: '#/components/responses/BadGateway'
        '504':
          $ref: '#/components/responses/UpstreamTimeout'
      security:
        - authorizer: [ ]
        - oAuth:
            - directory:website
      x-amazon-apigateway-integration:
        uri: "${organisation_write_arn}"
        passthroughBehavior: "when_no_match"
        httpMethod: "POST"
        timeoutInMillis: 29000
        type: "aws_proxy"

  '/references/certificationtypes/{TypeID}':
    parameters:
      - $ref: "#/components/parameters/x-fapi-auth-date"
      - $ref: "#/components/parameters/x-fapi-customer-ip-address"
      - $ref: "#/components/parameters/x-fapi-interaction-id"
      - $ref: "#/components/parameters/x-customer-user-agent"
      - $ref: '#/components/parameters/TypeID'
    get:
      summary: Get a specific certification type by ID
      description: Get a specific certification type by ID
      operationId: getCertificationType
      tags:
        - Reference Data
        - Certification Type
        - Public
      responses:
        '200':
          $ref: '#/components/responses/CertificationType'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '406':
          $ref: '#/components/responses/NotAcceptable'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '500':
          $ref: '#/components/responses/InternalServerError'
        '502':
          $ref: '#/components/responses/BadGateway'
        '504':
          $ref: '#/components/responses/UpstreamTimeout'
      security:
        - authorizer: [ ]
        - oAuth:
            - directory:website
      x-amazon-apigateway-integration:
        uri: "${organisation_read_arn}"
        passthroughBehavior: "when_no_match"
        httpMethod: "POST"
        timeoutInMillis: 29000
        type: "aws_proxy"
    put:
      summary: Update certification types
      description: Update certification types
      operationId: updateCertificationType
      tags:
        - Reference Data
        - Certification Type
        - Public
      requestBody:
        $ref: '#/components/requestBodies/CertificationTypeRequest'
      responses:
        '200':
          $ref: '#/components/responses/CertificationType'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '409':
          $ref: '#/components/responses/Conflict'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '500':
          $ref: '#/components/responses/InternalServerError'
        '502':
          $ref: '#/components/responses/BadGateway'
        '504':
          $ref: '#/components/responses/UpstreamTimeout'
      security:
        - authorizer: [ ]
        - oAuth:
            - directory:website
      x-amazon-apigateway-integration:
        uri: "${organisation_write_arn}"
        passthroughBehavior: "when_no_match"
        httpMethod: "POST"
        timeoutInMillis: 29000
        type: "aws_proxy"

    delete:
      summary: Delete a certification type
      description: Delete a certification type
      operationId: deleteCertificationType
      tags:
        - Reference Data
        - Certification Type
        - Public
      responses:
        '204':
          $ref: '#/components/responses/NoContent'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '500':
          $ref: '#/components/responses/InternalServerError'
        '502':
          $ref: '#/components/responses/BadGateway'
        '504':
          $ref: '#/components/responses/UpstreamTimeout'
      security:
        - authorizer: [ ]
        - oAuth:
            - directory:website
      x-amazon-apigateway-integration:
        uri: "${organisation_write_arn}"
        passthroughBehavior: "when_no_match"
        httpMethod: "POST"
        timeoutInMillis: 29000
        type: "aws_proxy"

  '/references/certificationtypes/{TypeID}/variants':
    parameters:
      - $ref: "#/components/parameters/x-fapi-auth-date"
      - $ref: "#/components/parameters/x-fapi-customer-ip-address"
      - $ref: "#/components/parameters/x-fapi-interaction-id"
      - $ref: "#/components/parameters/x-customer-user-agent"
      - $ref: '#/components/parameters/TypeID'
    get:
      summary: Get certification type variants
      description: Get certification type variants
      operationId: getCertificationTypeVariants
      tags:
        - Reference Data
        - Certification Type
        - Certification Type Variant
        - Public
      parameters:
        - $ref: "#/components/parameters/PageNumber"
        - $ref: "#/components/parameters/PageSize"
        - $ref: "#/components/parameters/PageSort"
        - in: query
          name: resourceType
          schema:
            type: string
          description: The resource type to filter by
        - in: query
          name: status
          schema:
            type: string
          description: The status to filter by

      responses:
        '200':
          $ref: '#/components/responses/CertificationTypeVariantPage'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '406':
          $ref: '#/components/responses/NotAcceptable'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '500':
          $ref: '#/components/responses/InternalServerError'
        '502':
          $ref: '#/components/responses/BadGateway'
        '504':
          $ref: '#/components/responses/UpstreamTimeout'
      security:
        - authorizer: [ ]
        - oAuth:
            - directory:website
      x-amazon-apigateway-integration:
        uri: "${organisation_read_arn}"
        passthroughBehavior: "when_no_match"
        httpMethod: "POST"
        timeoutInMillis: 29000
        type: "aws_proxy"

    post:
      summary: Set certification type variant
      description: Set certification type variant
      operationId: createCertificationTypeVariant
      tags:
        - Reference Data
        - Certification Type
        - Certification Type Variant
        - Public
      requestBody:
        $ref: '#/components/requestBodies/CertificationTypeVariantRequest'
      responses:
        '201':
          $ref: '#/components/responses/CertificationTypeVariant'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '409':
          $ref: '#/components/responses/Conflict'
        '406':
          $ref: '#/components/responses/NotAcceptable'
        '500':
          $ref: '#/components/responses/InternalServerError'
        '502':
          $ref: '#/components/responses/BadGateway'
        '504':
          $ref: '#/components/responses/UpstreamTimeout'
      security:
        - authorizer: [ ]
        - oAuth:
            - directory:website
      x-amazon-apigateway-integration:
        uri: "${organisation_write_arn}"
        passthroughBehavior: "when_no_match"
        httpMethod: "POST"
        timeoutInMillis: 29000
        type: "aws_proxy"

  '/references/certificationtypes/{TypeID}/variants/{VariantID}':
    parameters:
      - $ref: "#/components/parameters/x-fapi-auth-date"
      - $ref: "#/components/parameters/x-fapi-customer-ip-address"
      - $ref: "#/components/parameters/x-fapi-interaction-id"
      - $ref: "#/components/parameters/x-customer-user-agent"
      - $ref: '#/components/parameters/TypeID'
      - $ref: '#/components/parameters/VariantID'
    get:
      summary: Get certification type variant by ID
      description: Get certification type variant by ID
      operationId: getCertificationTypeVariant
      tags:
        - Reference Data
        - Certification Type
        - Certification Type Variant
        - Public

      responses:
        '200':
          $ref: '#/components/responses/CertificationTypeVariant'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '406':
          $ref: '#/components/responses/NotAcceptable'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '500':
          $ref: '#/components/responses/InternalServerError'
        '502':
          $ref: '#/components/responses/BadGateway'
        '504':
          $ref: '#/components/responses/UpstreamTimeout'
      security:
        - authorizer: [ ]
        - oAuth:
            - directory:website
      x-amazon-apigateway-integration:
        uri: "${organisation_read_arn}"
        passthroughBehavior: "when_no_match"
        httpMethod: "POST"
        timeoutInMillis: 29000
        type: "aws_proxy"
    put:
      summary: Update certification type variant by ID
      description: Update certification type variant by ID
      operationId: updateCertificationTypeVariant
      tags:
        - Reference Data
        - Certification Type
        - Certification Type Variant
        - Public
      requestBody:
        $ref: '#/components/requestBodies/CertificationTypeVariantUpdateRequest'
      responses:
        '200':
          $ref: '#/components/responses/CertificationTypeVariant'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '406':
          $ref: '#/components/responses/NotAcceptable'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '500':
          $ref: '#/components/responses/InternalServerError'
        '502':
          $ref: '#/components/responses/BadGateway'
        '504':
          $ref: '#/components/responses/UpstreamTimeout'
      security:
        - authorizer: [ ]
        - oAuth:
            - directory:website
      x-amazon-apigateway-integration:
        uri: "${organisation_write_arn}"
        passthroughBehavior: "when_no_match"
        httpMethod: "POST"
        timeoutInMillis: 29000
        type: "aws_proxy"
    delete:
      summary: Delete a certification type variant
      description: Delete a certification type variant
      operationId: deleteCertificationTypeVariant
      tags:
        - Reference Data
        - Certification Type
        - Certification Type Variant
        - Public
      responses:
        '204':
          $ref: '#/components/responses/NoContent'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '406':
          $ref: '#/components/responses/NotAcceptable'
        '500':
          $ref: '#/components/responses/InternalServerError'
        '502':
          $ref: '#/components/responses/BadGateway'
        '504':
          $ref: '#/components/responses/UpstreamTimeout'
        '429':
          $ref: '#/components/responses/TooManyRequests'
      security:
        - authorizer: [ ]
        - oAuth:
            - directory:website
      x-amazon-apigateway-integration:
        uri: "${organisation_write_arn}"
        passthroughBehavior: "when_no_match"
        httpMethod: "POST"
        timeoutInMillis: 29000
        type: "aws_proxy"

  '/organisations/{OrganisationId}/authoritydomainclaims':
    parameters:
      - $ref: '#/components/parameters/OrganisationId'
      - $ref: "#/components/parameters/x-fapi-auth-date"
      - $ref: "#/components/parameters/x-fapi-customer-ip-address"
      - $ref: "#/components/parameters/x-fapi-interaction-id"
      - $ref: "#/components/parameters/x-customer-user-agent"
    get:
      summary: Get the authority domain claims for the given organisation
      description: get all authority domains claimed by this organisation
      operationId: getOrganisationAuthorityDomainClaims
      tags:
        - Organisations
        - Authority Domain Claims
        - Authorisation Domains
        - Authorities
        - Public
        - Closed
      parameters:
        - $ref: "#/components/parameters/PageNumber"
        - $ref: "#/components/parameters/PageSize"
        - $ref: "#/components/parameters/PageSort"
      responses:
        '200':
          $ref: '#/components/responses/OrganisationAuthorityDomainClaimsPage'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '406':
          $ref: '#/components/responses/NotAcceptable'
        '500':
          $ref: '#/components/responses/InternalServerError'
        '502':
          $ref: '#/components/responses/BadGateway'
        '504':
          $ref: '#/components/responses/UpstreamTimeout'
        '429':
          $ref: '#/components/responses/TooManyRequests'
      security:
        - authorizer: [ ]
        - oAuth:
            - directory:website
            - directory:software
      x-amazon-apigateway-integration:
        uri: "${organisation_read_arn}"
        passthroughBehavior: "when_no_match"
        httpMethod: "POST"
        timeoutInMillis: 15000
        type: "aws_proxy"
    post:
      summary: Post an authority domain claim
      description: creates a new mapping between an authority / authorisation domain mapping and an organisation
      operationId: createOrganisationAuthorityDomainClaim
      parameters:
        - $ref: "#/components/parameters/x-fapi-auth-date"
        - $ref: "#/components/parameters/x-fapi-customer-ip-address"
        - $ref: "#/components/parameters/x-fapi-interaction-id"
        - $ref: "#/components/parameters/x-customer-user-agent"
      tags:
        - Organisations
        - Authority Domain Claims
        - Authorisation Domains
        - Authorities
        - Public
        - Closed
      requestBody:
        $ref: '#/components/requestBodies/OrganisationAuthorityDomainClaimCreationRequest'
      responses:
        '201':
          $ref: '#/components/responses/OrganisationAuthorityDomainClaimObject'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '409':
          $ref: '#/components/responses/Conflict'
        '500':
          $ref: '#/components/responses/InternalServerError'
        '502':
          $ref: '#/components/responses/BadGateway'
        '504':
          $ref: '#/components/responses/UpstreamTimeout'
        '429':
          $ref: '#/components/responses/TooManyRequests'
      security:
        - authorizer: [ ]
        - oAuth:
            - directory:website
      x-amazon-apigateway-integration:
        uri: "${organisation_write_arn}"
        passthroughBehavior: "when_no_match"
        httpMethod: "POST"
        timeoutInMillis: 29000
        type: "aws_proxy"

  '/organisations/{OrganisationId}/authoritydomainclaims/{OrganisationAuthorityDomainClaimId}':
    parameters:
      - $ref: '#/components/parameters/OrganisationId'
      - $ref: '#/components/parameters/OrganisationAuthorityDomainClaimId'
      - $ref: "#/components/parameters/x-fapi-auth-date"
      - $ref: "#/components/parameters/x-fapi-customer-ip-address"
      - $ref: "#/components/parameters/x-fapi-interaction-id"
      - $ref: "#/components/parameters/x-customer-user-agent"
    get:
      summary: Get an authority domain claim by Id
      description: gets a specific authority domain claim
      operationId: getOrganisationAuthorityDomainClaimById
      tags:
        - Organisations
        - Authority Domain Claims
        - Authorisation Domains
        - Authorities
        - Public
        - Closed
      responses:
        '200':
          $ref: '#/components/responses/OrganisationAuthorityDomainClaimObject'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '406':
          $ref: '#/components/responses/NotAcceptable'
        '500':
          $ref: '#/components/responses/InternalServerError'
        '502':
          $ref: '#/components/responses/BadGateway'
        '504':
          $ref: '#/components/responses/UpstreamTimeout'
        '429':
          $ref: '#/components/responses/TooManyRequests'
      security:
        - authorizer: [ ]
        - oAuth:
            - directory:website
            - directory:software
      x-amazon-apigateway-integration:
        uri: "${organisation_read_arn}"
        passthroughBehavior: "when_no_match"
        httpMethod: "POST"
        timeoutInMillis: 15000
        type: "aws_proxy"
    delete:
      summary: Deactivate an authority domain claim by Id
      description: deactivate an organisations claim to an authority / authorisation domain mapping
      operationId: deleteOrganisationAuthorityDomainClaimById
      parameters:
        - $ref: "#/components/parameters/x-fapi-auth-date"
        - $ref: "#/components/parameters/x-fapi-customer-ip-address"
        - $ref: "#/components/parameters/x-fapi-interaction-id"
        - $ref: "#/components/parameters/x-customer-user-agent"
      tags:
        - Organisations
        - Authority Domain Claims
        - Authorisation Domains
        - Authorities
        - Public
        - Closed
      responses:
        '204':
          $ref: '#/components/responses/NoContent'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '406':
          $ref: '#/components/responses/NotAcceptable'
        '500':
          $ref: '#/components/responses/InternalServerError'
        '502':
          $ref: '#/components/responses/BadGateway'
        '504':
          $ref: '#/components/responses/UpstreamTimeout'
        '429':
          $ref: '#/components/responses/TooManyRequests'
      security:
        - authorizer: [ ]
        - oAuth:
            - directory:website
      x-amazon-apigateway-integration:
        uri: "${organisation_write_arn}"
        passthroughBehavior: "when_no_match"
        httpMethod: "POST"
        timeoutInMillis: 29000
        type: "aws_proxy"
    put:
      summary: Update an authority domain claim by Id
      description: updates the details of an organisations claim to an authority / authorisation domain mapping
      operationId: updateOrganisationAuthorityDomainClaimById
      parameters:
        - $ref: "#/components/parameters/x-fapi-auth-date"
        - $ref: "#/components/parameters/x-fapi-customer-ip-address"
        - $ref: "#/components/parameters/x-fapi-interaction-id"
        - $ref: "#/components/parameters/x-customer-user-agent"
      tags:
        - Organisations
        - Authority Domain Claims
        - Authorisation Domains
        - Authorities
        - Public
        - Closed
      requestBody:
        $ref: '#/components/requestBodies/OrganisationAuthorityDomainClaimUpdateRequest'
      responses:
        '200':
          $ref: '#/components/responses/OrganisationAuthorityDomainClaimObject'
        '204':
          $ref: '#/components/responses/NoContent'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '406':
          $ref: '#/components/responses/NotAcceptable'
        '500':
          $ref: '#/components/responses/InternalServerError'
        '502':
          $ref: '#/components/responses/BadGateway'
        '504':
          $ref: '#/components/responses/UpstreamTimeout'
        '429':
          $ref: '#/components/responses/TooManyRequests'
      security:
        - authorizer: [ ]
        - oAuth:
            - directory:website
      x-amazon-apigateway-integration:
        uri: "${organisation_write_arn}"
        passthroughBehavior: "when_no_match"
        httpMethod: "POST"
        timeoutInMillis: 29000
        type: "aws_proxy"

  '/organisations/{OrganisationId}/authorityclaims':
    parameters:
      - $ref: '#/components/parameters/OrganisationId'
      - $ref: "#/components/parameters/x-fapi-auth-date"
      - $ref: "#/components/parameters/x-fapi-customer-ip-address"
      - $ref: "#/components/parameters/x-fapi-interaction-id"
      - $ref: "#/components/parameters/x-customer-user-agent"
    get:
      summary: Get the authority claims for the given organisation
      description: get all authorisation domain roles an organisation has made claim to
      parameters:
        - $ref: "#/components/parameters/PageNumber"
        - $ref: "#/components/parameters/PageSize"
        - $ref: "#/components/parameters/PageSort"
      operationId: getOrganisationAuthorityClaims
      tags:
        - Organisations
        - Authority Claims
        - Authority Domain Claims
        - Authorisation Domain Roles
        - Authorisation Domains
        - Authorities
        - Public
        - Closed

      responses:
        '200':
          $ref: '#/components/responses/OrganisationAuthorityDomainRoleClaims'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '406':
          $ref: '#/components/responses/NotAcceptable'
        '500':
          $ref: '#/components/responses/InternalServerError'
        '502':
          $ref: '#/components/responses/BadGateway'
        '504':
          $ref: '#/components/responses/UpstreamTimeout'
        '429':
          $ref: '#/components/responses/TooManyRequests'

      security:
        - authorizer: [ ]
        - oAuth:
            - directory:website
            - directory:software
      x-amazon-apigateway-integration:
        uri: "${organisation_read_arn}"
        passthroughBehavior: "when_no_match"
        httpMethod: "POST"
        timeoutInMillis: 15000
        type: "aws_proxy"

    post:
      summary: Post an authority claim
      description: create a mapping between an organisation and an authorisation domain role
      operationId: createOrganisationAuthorityClaim
      parameters:
        - $ref: "#/components/parameters/x-fapi-auth-date"
        - $ref: "#/components/parameters/x-fapi-customer-ip-address"
        - $ref: "#/components/parameters/x-fapi-interaction-id"
        - $ref: "#/components/parameters/x-customer-user-agent"
      tags:
        - Organisations
        - Authority Claims
        - Authority Domain Claims
        - Authorisation Domain Roles
        - Authorisation Domains
        - Authorities
        - Public
        - Closed
      requestBody:
        $ref: '#/components/requestBodies/OrganisationAuthorityDomainRoleClaimCreationRequest'

      responses:
        '201':
          $ref: '#/components/responses/OrganisationAuthorityDomainRoleClaimObject'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '500':
          $ref: '#/components/responses/InternalServerError'
        '502':
          $ref: '#/components/responses/BadGateway'
        '504':
          $ref: '#/components/responses/UpstreamTimeout'
        '429':
          $ref: '#/components/responses/TooManyRequests'

      security:
        - authorizer: [ ]
        - oAuth:
            - directory:website
      x-amazon-apigateway-integration:
        uri: "${organisation_write_arn}"
        passthroughBehavior: "when_no_match"
        httpMethod: "POST"
        timeoutInMillis: 29000
        type: "aws_proxy"

  '/organisations/{OrganisationId}/authorityclaims/{OrganisationAuthorityClaimId}':
    parameters:
      - $ref: '#/components/parameters/OrganisationId'
      - $ref: '#/components/parameters/OrganisationAuthorityClaimId'
      - $ref: "#/components/parameters/x-fapi-auth-date"
      - $ref: "#/components/parameters/x-fapi-customer-ip-address"
      - $ref: "#/components/parameters/x-fapi-interaction-id"
      - $ref: "#/components/parameters/x-customer-user-agent"
    get:
      summary: Get an authority claim by Id
      description: get a specific authority claim object
      operationId: getOrganisationAuthorityClaimById
      tags:
        - Organisations
        - Authority Claims
        - Authority Domain Claims
        - Authorisation Domain Roles
        - Authorisation Domains
        - Authorities
        - Public
        - Closed
      responses:
        '200':
          $ref: '#/components/responses/OrganisationAuthorityDomainRoleClaimObject'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '406':
          $ref: '#/components/responses/NotAcceptable'
        '500':
          $ref: '#/components/responses/InternalServerError'
        '502':
          $ref: '#/components/responses/BadGateway'
        '504':
          $ref: '#/components/responses/UpstreamTimeout'
        '429':
          $ref: '#/components/responses/TooManyRequests'

      security:
        - authorizer: [ ]
        - oAuth:
            - directory:website
            - directory:software
      x-amazon-apigateway-integration:
        uri: "${organisation_read_arn}"
        passthroughBehavior: "when_no_match"
        httpMethod: "POST"
        timeoutInMillis: 15000
        type: "aws_proxy"

    put:
      summary: Update an organisation authority domain role claim for the given Id
      parameters:
        - $ref: "#/components/parameters/x-fapi-auth-date"
        - $ref: "#/components/parameters/x-fapi-customer-ip-address"
        - $ref: "#/components/parameters/x-fapi-interaction-id"
        - $ref: "#/components/parameters/x-customer-user-agent"
      description: You can only add unique technical identifiers, nothing else can be updated
      operationId: updateOrganisationAuthorityDomainRoleClaimById
      tags:
        - Organisations
        - Authority Claims
        - Authority Domain Claims
        - Authorisation Domain Roles
        - Authorisation Domains
        - Authorities
        - Public
        - Closed

      requestBody:
        $ref: '#/components/requestBodies/OrganisationAuthorityDomainRoleClaimUpdateRequest'
      responses:
        '200':
          $ref: '#/components/responses/OrganisationAuthorityDomainRoleClaimObject'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '406':
          $ref: '#/components/responses/NotAcceptable'
        '500':
          $ref: '#/components/responses/InternalServerError'
        '502':
          $ref: '#/components/responses/BadGateway'
        '504':
          $ref: '#/components/responses/UpstreamTimeout'
        '429':
          $ref: '#/components/responses/TooManyRequests'

      security:
        - authorizer: [ ]
        - oAuth:
            - directory:website
      x-amazon-apigateway-integration:
        uri: "${organisation_write_arn}"
        passthroughBehavior: "when_no_match"
        httpMethod: "POST"
        timeoutInMillis: 29000
        type: "aws_proxy"

    delete:
      summary: Delete an authority claim
      description: Deactivates a mapping between an organisation and an authorisation domain role
      operationId: deleteOrganisationAuthorityClaimById
      parameters:
        - $ref: "#/components/parameters/x-fapi-auth-date"
        - $ref: "#/components/parameters/x-fapi-customer-ip-address"
        - $ref: "#/components/parameters/x-fapi-interaction-id"
        - $ref: "#/components/parameters/x-customer-user-agent"
      tags:
        - Organisations
        - Authority Claims
        - Authority Domain Claims
        - Authorisation Domain Roles
        - Authorisation Domains
        - Authorities
        - Public

      responses:
        '204':
          $ref: '#/components/responses/NoContent'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '406':
          $ref: '#/components/responses/NotAcceptable'
        '500':
          $ref: '#/components/responses/InternalServerError'
        '502':
          $ref: '#/components/responses/BadGateway'
        '504':
          $ref: '#/components/responses/UpstreamTimeout'
        '429':
          $ref: '#/components/responses/TooManyRequests'

      security:
        - authorizer: [ ]
        - oAuth:
            - directory:website
      x-amazon-apigateway-integration:
        uri: "${organisation_write_arn}"
        passthroughBehavior: "when_no_match"
        httpMethod: "POST"
        timeoutInMillis: 29000
        type: "aws_proxy"

  '/organisations/{OrganisationId}/authorityclaims/{OrganisationAuthorityClaimId}/authorisations':
    parameters:
      - $ref: '#/components/parameters/OrganisationId'
      - $ref: '#/components/parameters/OrganisationAuthorityClaimId'
      - $ref: "#/components/parameters/x-fapi-auth-date"
      - $ref: "#/components/parameters/x-fapi-customer-ip-address"
      - $ref: "#/components/parameters/x-fapi-interaction-id"
      - $ref: "#/components/parameters/x-customer-user-agent"
    get:
      summary: Get an authority claims authorisations
      description: gets all authorisations connecting to an authority claim
      parameters:
        - $ref: "#/components/parameters/PageNumber"
        - $ref: "#/components/parameters/PageSize"
        - $ref: "#/components/parameters/PageSort"
      operationId: getOrganisationAuthorityClaimAuthorisations
      tags:
        - Organisations
        - Authority Claims
        - Authority Domain Claims
        - Authorisation Domain Roles
        - Authorisation Domains
        - Authorities
        - Authority Claims Authorisations
        - Public
        - Closed

      responses:
        '200':
          $ref: '#/components/responses/OrganisationAuthorityClaimAuthorisations'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '500':
          $ref: '#/components/responses/InternalServerError'
        '502':
          $ref: '#/components/responses/BadGateway'
        '504':
          $ref: '#/components/responses/UpstreamTimeout'
        '429':
          $ref: '#/components/responses/TooManyRequests'

      security:
        - authorizer: [ ]
        - oAuth:
            - directory:website
            - directory:software
      x-amazon-apigateway-integration:
        uri: "${organisation_read_arn}"
        passthroughBehavior: "when_no_match"
        httpMethod: "POST"
        timeoutInMillis: 15000
        type: "aws_proxy"

    post:
      summary: Post an authority claims authorisations
      description: creates a new authority claim authorisation
      operationId: createOrganisationAuthorityClaimAuthorisation
      parameters:
        - $ref: "#/components/parameters/x-fapi-auth-date"
        - $ref: "#/components/parameters/x-fapi-customer-ip-address"
        - $ref: "#/components/parameters/x-fapi-interaction-id"
        - $ref: "#/components/parameters/x-customer-user-agent"
      tags:
        - Organisations
        - Authority Claims
        - Authority Domain Claims
        - Authorisation Domain Roles
        - Authorisation Domains
        - Authorities
        - Authority Claims Authorisations
        - Public
        - Closed
      requestBody:
        $ref: '#/components/requestBodies/OrganisationAuthorityClaimAuthorisationRequest'

      responses:
        '201':
          $ref: '#/components/responses/OrganisationAuthorityClaimAuthorisation'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '406':
          $ref: '#/components/responses/NotAcceptable'
        '500':
          $ref: '#/components/responses/InternalServerError'
        '502':
          $ref: '#/components/responses/BadGateway'
        '504':
          $ref: '#/components/responses/UpstreamTimeout'
        '429':
          $ref: '#/components/responses/TooManyRequests'

      security:
        - authorizer: [ ]
        - oAuth:
            - directory:website
      x-amazon-apigateway-integration:
        uri: "${organisation_write_arn}"
        passthroughBehavior: "when_no_match"
        httpMethod: "POST"
        timeoutInMillis: 29000
        type: "aws_proxy"

  '/organisations/{OrganisationId}/authorityclaims/{OrganisationAuthorityClaimId}/authorisations/{OrganisationAuthorisationId}':
    parameters:
      - $ref: '#/components/parameters/OrganisationId'
      - $ref: '#/components/parameters/OrganisationAuthorityClaimId'
      - $ref: '#/components/parameters/OrganisationAuthorisationId'
      - $ref: "#/components/parameters/x-fapi-auth-date"
      - $ref: "#/components/parameters/x-fapi-customer-ip-address"
      - $ref: "#/components/parameters/x-fapi-interaction-id"
      - $ref: "#/components/parameters/x-customer-user-agent"
    get:
      summary: Get a claim authorisation
      description: gets a specific authority claim authorisation
      operationId: getOrganisationAuthorityClaimAuthorisationById
      tags:
        - Organisations
        - Authority Claims
        - Authority Domain Claims
        - Authorisation Domain Roles
        - Authorisation Domains
        - Authorities
        - Authority Claims Authorisations
        - Public
        - Closed

      responses:
        '200':
          $ref: '#/components/responses/OrganisationAuthorityClaimAuthorisation'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '406':
          $ref: '#/components/responses/NotAcceptable'
        '500':
          $ref: '#/components/responses/InternalServerError'
        '502':
          $ref: '#/components/responses/BadGateway'
        '504':
          $ref: '#/components/responses/UpstreamTimeout'
        '429':
          $ref: '#/components/responses/TooManyRequests'

      security:
        - authorizer: [ ]
        - oAuth:
            - directory:website
            - directory:software
      x-amazon-apigateway-integration:
        uri: "${organisation_read_arn}"
        passthroughBehavior: "when_no_match"
        httpMethod: "POST"
        timeoutInMillis: 15000
        type: "aws_proxy"

    delete:
      summary: Remove an authorisation from authority claims
      description: deletes an authority claim authorisation
      operationId: deleteOrganisationAuthorityClaimAuthorisationById
      parameters:
        - $ref: "#/components/parameters/x-fapi-auth-date"
        - $ref: "#/components/parameters/x-fapi-customer-ip-address"
        - $ref: "#/components/parameters/x-fapi-interaction-id"
        - $ref: "#/components/parameters/x-customer-user-agent"
      tags:
        - Organisations
        - Authority Claims
        - Authority Domain Claims
        - Authorisation Domain Roles
        - Authorisation Domains
        - Authorities
        - Authority Claims Authorisations
        - Public
        - Closed
      responses:
        '204':
          $ref: '#/components/responses/NoContent'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '406':
          $ref: '#/components/responses/NotAcceptable'
        '500':
          $ref: '#/components/responses/InternalServerError'
        '502':
          $ref: '#/components/responses/BadGateway'
        '504':
          $ref: '#/components/responses/UpstreamTimeout'
        '429':
          $ref: '#/components/responses/TooManyRequests'

      security:
        - authorizer: [ ]
        - oAuth:
            - directory:website
      x-amazon-apigateway-integration:
        uri: "${organisation_write_arn}"
        passthroughBehavior: "when_no_match"
        httpMethod: "POST"
        timeoutInMillis: 29000
        type: "aws_proxy"

  '/organisations/{OrganisationId}/contacts':
    parameters:
      - $ref: '#/components/parameters/OrganisationId'
      - $ref: "#/components/parameters/x-fapi-auth-date"
      - $ref: "#/components/parameters/x-fapi-customer-ip-address"
      - $ref: "#/components/parameters/x-fapi-interaction-id"
      - $ref: "#/components/parameters/x-customer-user-agent"
    get:
      summary: Get the contacts for the given organisation
      description: get all contacts for an organisations
      operationId: getOrganisationContacts
      parameters:
        - $ref: "#/components/parameters/PageNumber"
        - $ref: "#/components/parameters/PageSize"
        - $ref: "#/components/parameters/PageSort"
      tags:
        - Organisations
        - Contacts
        - Public
        - Closed
      responses:
        '200':
          $ref: '#/components/responses/ContactsPage'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '406':
          $ref: '#/components/responses/NotAcceptable'
        '500':
          $ref: '#/components/responses/InternalServerError'
        '502':
          $ref: '#/components/responses/BadGateway'
        '504':
          $ref: '#/components/responses/UpstreamTimeout'
        '429':
          $ref: '#/components/responses/TooManyRequests'

      security:
        - authorizer: [ ]
        - oAuth:
            - directory:website
            - directory:software
      x-amazon-apigateway-integration:
        uri: "${organisation_read_arn}"
        passthroughBehavior: "when_no_match"
        httpMethod: "POST"
        timeoutInMillis: 15000
        type: "aws_proxy"

    post:
      summary: Post a contact for the given organisation
      description: creates a contact for an organisation
      operationId: createOrganisationContact
      tags:
        - Organisations
        - Contacts
        - Public
        - Closed
      requestBody:
        $ref: '#/components/requestBodies/ContactRequest'
      responses:
        '201':
          $ref: '#/components/responses/Contact'
        '400':
          $ref: '#/components/responses/BadRequest'
        '403':
          $ref: '#/components/responses/Forbidden'
        '409':
          $ref: '#/components/responses/Conflict'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '406':
          $ref: '#/components/responses/NotAcceptable'
        '500':
          $ref: '#/components/responses/InternalServerError'
        '502':
          $ref: '#/components/responses/BadGateway'
        '504':
          $ref: '#/components/responses/UpstreamTimeout'
        '429':
          $ref: '#/components/responses/TooManyRequests'

      security:
        - authorizer: [ ]
        - oAuth:
            - directory:website
      x-amazon-apigateway-integration:
        uri: "${organisation_write_arn}"
        passthroughBehavior: "when_no_match"
        httpMethod: "POST"
        timeoutInMillis: 29000
        type: "aws_proxy"

  '/organisations/{OrganisationId}/contacts/{ContactId}':
    parameters:
      - $ref: '#/components/parameters/OrganisationId'
      - $ref: '#/components/parameters/ContactId'
      - $ref: "#/components/parameters/x-fapi-auth-date"
      - $ref: "#/components/parameters/x-fapi-customer-ip-address"
      - $ref: "#/components/parameters/x-fapi-interaction-id"
      - $ref: "#/components/parameters/x-customer-user-agent"
    get:
      summary: Get a contact by Id
      description: get a specific contact
      operationId: getOrganisationContactById
      tags:
        - Organisations
        - Contacts
        - Public
        - Closed
      responses:
        '200':
          $ref: '#/components/responses/Contact'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '406':
          $ref: '#/components/responses/NotAcceptable'
        '500':
          $ref: '#/components/responses/InternalServerError'
        '502':
          $ref: '#/components/responses/BadGateway'
        '504':
          $ref: '#/components/responses/UpstreamTimeout'
        '429':
          $ref: '#/components/responses/TooManyRequests'

      security:
        - authorizer: [ ]
        - oAuth:
            - directory:website
            - directory:software
      x-amazon-apigateway-integration:
        uri: "${organisation_read_arn}"
        passthroughBehavior: "when_no_match"
        httpMethod: "POST"
        timeoutInMillis: 15000
        type: "aws_proxy"

    put:
      summary: Update the contacts for the given organisation
      description: udpate a specific contact
      operationId: updateOrganisationContactById
      tags:
        - Organisations
        - Contacts
        - Public
        - Closed
      requestBody:
        $ref: '#/components/requestBodies/ContactRequest'
      responses:
        '200':
          $ref: '#/components/responses/Contact'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '406':
          $ref: '#/components/responses/NotAcceptable'
        '500':
          $ref: '#/components/responses/InternalServerError'
        '502':
          $ref: '#/components/responses/BadGateway'
        '504':
          $ref: '#/components/responses/UpstreamTimeout'
        '429':
          $ref: '#/components/responses/TooManyRequests'

      security:
        - authorizer: [ ]
        - oAuth:
            - directory:website
      x-amazon-apigateway-integration:
        uri: "${organisation_write_arn}"
        passthroughBehavior: "when_no_match"
        httpMethod: "POST"
        timeoutInMillis: 29000
        type: "aws_proxy"

    delete:
      summary: Remove a contact in an organisation with the given contact id
      description: delete a specific contact
      operationId: deleteOrganisationContactById
      parameters:
        - $ref: "#/components/parameters/x-fapi-auth-date"
        - $ref: "#/components/parameters/x-fapi-customer-ip-address"
        - $ref: "#/components/parameters/x-fapi-interaction-id"
        - $ref: "#/components/parameters/x-customer-user-agent"
      tags:
        - Organisations
        - Contacts
        - Public
        - Closed
      responses:
        '204':
          $ref: '#/components/responses/NoContent'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '406':
          $ref: '#/components/responses/NotAcceptable'
        '500':
          $ref: '#/components/responses/InternalServerError'
        '502':
          $ref: '#/components/responses/BadGateway'
        '504':
          $ref: '#/components/responses/UpstreamTimeout'
        '429':
          $ref: '#/components/responses/TooManyRequests'

      security:
        - authorizer: [ ]
        - oAuth:
            - directory:website
      x-amazon-apigateway-integration:
        uri: "${organisation_write_arn}"
        passthroughBehavior: "when_no_match"
        httpMethod: "POST"
        timeoutInMillis: 29000
        type: "aws_proxy"

  '/organisations/authorisationservers/webhooks':
    get:
      summary: Updates the status of all webhooks
      description: polls SNS and updates the status of all webhooks for all authorisation servers
      operationId: pollOrganisationAuthorisationServerWebhooks
      parameters:
        - $ref: "#/components/parameters/x-fapi-auth-date"
        - $ref: "#/components/parameters/x-fapi-customer-ip-address"
        - $ref: "#/components/parameters/x-fapi-interaction-id"
        - $ref: "#/components/parameters/x-customer-user-agent"
      tags:
        - Organisations
        - Authorisation Servers
        - Webhooks
        - Closed
      responses:
        '200':
          $ref: '#/components/responses/AllWebhooksResponse'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '500':
          $ref: '#/components/responses/InternalServerError'
        '502':
          $ref: '#/components/responses/BadGateway'
        '504':
          $ref: '#/components/responses/UpstreamTimeout'
        '429':
          $ref: '#/components/responses/TooManyRequests'

      security:
        - authorizer: [ ]
        - oAuth:
            - directory:admin
      x-amazon-apigateway-integration:
        uri: "${organisation_write_arn}"
        passthroughBehavior: "when_no_match"
        httpMethod: "POST"
        timeoutInMillis: 29000
        type: "aws_proxy"

  '/organisations/authorisationservers/webhooks/clean':
    get:
      summary: Updates the status of all orphaned webhooks
      description: checks everything in the orphaned webhook table and attempts to delete it
      operationId: cleanOldOrganisationAuthorisationServerWebhooks
      parameters:
        - $ref: "#/components/parameters/x-fapi-auth-date"
        - $ref: "#/components/parameters/x-fapi-customer-ip-address"
        - $ref: "#/components/parameters/x-fapi-interaction-id"
        - $ref: "#/components/parameters/x-customer-user-agent"
      tags:
        - Organisations
        - Authorisation Servers
        - Webhooks
      responses:
        '200':
          $ref: '#/components/responses/Ok'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '500':
          $ref: '#/components/responses/InternalServerError'
        '502':
          $ref: '#/components/responses/BadGateway'
        '504':
          $ref: '#/components/responses/UpstreamTimeout'
        '429':
          $ref: '#/components/responses/TooManyRequests'

      security:
        - authorizer: [ ]
        - oAuth:
            - directory:admin
      x-amazon-apigateway-integration:
        uri: "${organisation_write_arn}"
        passthroughBehavior: "when_no_match"
        httpMethod: "POST"
        timeoutInMillis: 29000
        type: "aws_proxy"

  '/organisations/{OrganisationId}/authorisationservers':
    parameters:
      - $ref: '#/components/parameters/OrganisationId'
      - $ref: "#/components/parameters/x-fapi-auth-date"
      - $ref: "#/components/parameters/x-fapi-customer-ip-address"
      - $ref: "#/components/parameters/x-fapi-interaction-id"
      - $ref: "#/components/parameters/x-customer-user-agent"
    get:
      summary: Get all Authorisation Servers for the given organisation
      description: get all authorisation servers attached to the specified organisation
      operationId: getOrganisationAuthorisationServers
      tags:
        - Organisations
        - Authorisation Servers
        - Public
        - Closed
      parameters:
        - $ref: "#/components/parameters/PageNumber"
        - $ref: "#/components/parameters/PageSize"
        - $ref: "#/components/parameters/PageSort"
        - $ref: "#/components/parameters/ContainsOpenIdDiscoveryDocument"
        - $ref: "#/components/parameters/OmitFromEcosystem"
        - $ref: "#/components/parameters/Status"
        - $ref: "#/components/parameters/FilterBy"
      responses:
        '200':
          $ref: '#/components/responses/AuthorisationServers'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '500':
          $ref: '#/components/responses/InternalServerError'
        '502':
          $ref: '#/components/responses/BadGateway'
        '504':
          $ref: '#/components/responses/UpstreamTimeout'
        '429':
          $ref: '#/components/responses/TooManyRequests'

      security:
        - authorizer: [ ]
        - oAuth:
            - directory:website
            - directory:software
      x-amazon-apigateway-integration:
        uri: "${organisation_read_arn}"
        passthroughBehavior: "when_no_match"
        httpMethod: "POST"
        timeoutInMillis: 15000
        type: "aws_proxy"

    post:
      summary: Create an Authorisation Server for the given organisation
      description: creates a new authorisation server
      operationId: createOrganisationAuthorisationServer
      parameters:
        - $ref: "#/components/parameters/x-fapi-auth-date"
        - $ref: "#/components/parameters/x-fapi-customer-ip-address"
        - $ref: "#/components/parameters/x-fapi-interaction-id"
        - $ref: "#/components/parameters/x-customer-user-agent"
      tags:
        - Organisations
        - Authorisation Servers
        - Public
        - Closed
      requestBody:
        $ref: '#/components/requestBodies/AuthorisationServerCreationRequest'
      responses:
        '201':
          $ref: '#/components/responses/AuthorisationServerResponse'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '500':
          $ref: '#/components/responses/InternalServerError'
        '502':
          $ref: '#/components/responses/BadGateway'
        '504':
          $ref: '#/components/responses/UpstreamTimeout'
        '429':
          $ref: '#/components/responses/TooManyRequests'

      security:
        - authorizer: [ ]
        - oAuth:
            - directory:website
      x-amazon-apigateway-integration:
        uri: "${organisation_write_arn}"
        passthroughBehavior: "when_no_match"
        httpMethod: "POST"
        timeoutInMillis: 29000
        type: "aws_proxy"

  '/organisations/{OrganisationId}/authorisationservers/{AuthorisationServerId}':
    parameters:
      - $ref: '#/components/parameters/OrganisationId'
      - $ref: '#/components/parameters/AuthorisationServerId'
      - $ref: "#/components/parameters/x-fapi-auth-date"
      - $ref: "#/components/parameters/x-fapi-customer-ip-address"
      - $ref: "#/components/parameters/x-fapi-interaction-id"
      - $ref: "#/components/parameters/x-customer-user-agent"
    get:
      summary: Get an authorisation server by Id
      description: get a specific authorisation server
      operationId: getOrganisationAuthorisationServerById
      tags:
        - Organisations
        - Authorisation Servers
        - Public
        - Closed
      responses:
        '200':
          $ref: '#/components/responses/AuthorisationServer'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/InternalServerError'
        '502':
          $ref: '#/components/responses/BadGateway'
        '504':
          $ref: '#/components/responses/UpstreamTimeout'
        '429':
          $ref: '#/components/responses/TooManyRequests'

      security:
        - authorizer: [ ]
        - oAuth:
            - directory:website
            - directory:software
      x-amazon-apigateway-integration:
        uri: "${organisation_write_arn}"
        passthroughBehavior: "when_no_match"
        httpMethod: "POST"
        timeoutInMillis: 15000
        type: "aws_proxy"

    put:
      summary: Update an authorisation server
      description: updates an existing authorisation server
      operationId: updateOrganisationAuthorisationServerById
      parameters:
        - $ref: "#/components/parameters/x-fapi-auth-date"
        - $ref: "#/components/parameters/x-fapi-customer-ip-address"
        - $ref: "#/components/parameters/x-fapi-interaction-id"
        - $ref: "#/components/parameters/x-customer-user-agent"
      tags:
        - Organisations
        - Authorisation Servers
        - Public
        - Closed
      requestBody:
        $ref: '#/components/requestBodies/AuthorisationServerUpdateRequest'
      responses:
        '200':
          $ref: '#/components/responses/AuthorisationServerResponse'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '406':
          $ref: '#/components/responses/NotAcceptable'
        '500':
          $ref: '#/components/responses/InternalServerError'
        '502':
          $ref: '#/components/responses/BadGateway'
        '504':
          $ref: '#/components/responses/UpstreamTimeout'
        '429':
          $ref: '#/components/responses/TooManyRequests'

      security:
        - authorizer: [ ]
        - oAuth:
            - directory:website
      x-amazon-apigateway-integration:
        uri: "${organisation_write_arn}"
        passthroughBehavior: "when_no_match"
        httpMethod: "POST"
        timeoutInMillis: 29000
        type: "aws_proxy"

    delete:
      summary: Delete an Authorisation Server
      description: deletes an authorisation server. Note we hard delete this resource - no inactive state
      operationId: deleteOrganisationAuthorisationServerbyId
      parameters:
        - $ref: "#/components/parameters/x-fapi-auth-date"
        - $ref: "#/components/parameters/x-fapi-customer-ip-address"
        - $ref: "#/components/parameters/x-fapi-interaction-id"
        - $ref: "#/components/parameters/x-customer-user-agent"
      tags:
        - Organisations
        - Authorisation Servers
        - Public
        - Closed
      responses:
        '204':
          $ref: '#/components/responses/NoContent'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '406':
          $ref: '#/components/responses/NotAcceptable'
        '500':
          $ref: '#/components/responses/InternalServerError'
        '502':
          $ref: '#/components/responses/BadGateway'
        '504':
          $ref: '#/components/responses/UpstreamTimeout'
        '429':
          $ref: '#/components/responses/TooManyRequests'

      security:
        - authorizer: [ ]
        - oAuth:
            - directory:website
      x-amazon-apigateway-integration:
        uri: "${organisation_write_arn}"
        passthroughBehavior: "when_no_match"
        httpMethod: "POST"
        timeoutInMillis: 29000
        type: "aws_proxy"

  '/organisations/{OrganisationId}/authorisationservers/{AuthorisationServerId}/authorityclaims':
    parameters:
      - $ref: '#/components/parameters/OrganisationId'
      - $ref: '#/components/parameters/AuthorisationServerId'
      - $ref: "#/components/parameters/x-fapi-auth-date"
      - $ref: "#/components/parameters/x-fapi-customer-ip-address"
      - $ref: "#/components/parameters/x-fapi-interaction-id"
      - $ref: "#/components/parameters/x-customer-user-agent"
    get:
      summary: Get the authority claims for the given server
      description: gets all authority claims attached to this server
      parameters:
        - $ref: "#/components/parameters/PageNumber"
        - $ref: "#/components/parameters/PageSize"
        - $ref: "#/components/parameters/PageSort"
      operationId: getOrganisationServerAuthorityClaims
      tags:
        - Organisations
        - Authorisation Servers
        - Authority Claims
        - Public
        - Closed

      responses:
        '200':
          $ref: '#/components/responses/ServerAuthorityClaimPage'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '500':
          $ref: '#/components/responses/InternalServerError'
        '502':
          $ref: '#/components/responses/BadGateway'
        '504':
          $ref: '#/components/responses/UpstreamTimeout'
        '429':
          $ref: '#/components/responses/TooManyRequests'

      security:
        - authorizer: [ ]
        - oAuth:
            - directory:website
            - directory:software
      x-amazon-apigateway-integration:
        uri: "${organisation_read_arn}"
        passthroughBehavior: "when_no_match"
        httpMethod: "POST"
        timeoutInMillis: 15000
        type: "aws_proxy"

    post:
      summary: Post an authority claim for a server
      description: attaches an authority claim to a server from the list of authority claims attached to the organisation
      parameters:
        - $ref: "#/components/parameters/x-fapi-auth-date"
        - $ref: "#/components/parameters/x-fapi-customer-ip-address"
        - $ref: "#/components/parameters/x-fapi-interaction-id"
        - $ref: "#/components/parameters/x-customer-user-agent"
      operationId: createOrganisationServerAuthorityClaim
      tags:
        - Organisations
        - Authorisation Servers
        - Authority Claims
        - Public
        - Closed
      requestBody:
        $ref: '#/components/requestBodies/ServerAuthorityClaimCreationRequest'

      responses:
        '201':
          $ref: '#/components/responses/ServerAuthorityClaim'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '409':
          $ref: '#/components/responses/Conflict'
        '500':
          $ref: '#/components/responses/InternalServerError'
        '502':
          $ref: '#/components/responses/BadGateway'
        '504':
          $ref: '#/components/responses/UpstreamTimeout'
        '429':
          $ref: '#/components/responses/TooManyRequests'

      security:
        - authorizer: [ ]
        - oAuth:
            - directory:website
      x-amazon-apigateway-integration:
        uri: "${organisation_write_arn}"
        passthroughBehavior: "when_no_match"
        httpMethod: "POST"
        timeoutInMillis: 29000
        type: "aws_proxy"

  '/organisations/{OrganisationId}/authorisationservers/{AuthorisationServerId}/authorityclaims/{ServerAuthorityClaimID}':
    parameters:
      - $ref: '#/components/parameters/OrganisationId'
      - $ref: '#/components/parameters/AuthorisationServerId'
      - $ref: '#/components/parameters/ServerAuthorityClaimID'
      - $ref: "#/components/parameters/x-fapi-auth-date"
      - $ref: "#/components/parameters/x-fapi-customer-ip-address"
      - $ref: "#/components/parameters/x-fapi-interaction-id"
      - $ref: "#/components/parameters/x-customer-user-agent"
    get:
      summary: Get an server authority claim by Id
      description: gets a specific server authority claim
      operationId: getOrganisationServerAuthorityClaimById
      tags:
        - Organisations
        - Authorisation Servers
        - Authority Claims
        - Public
        - Closed
      responses:
        '200':
          $ref: '#/components/responses/ServerAuthorityClaim'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '406':
          $ref: '#/components/responses/NotAcceptable'
        '500':
          $ref: '#/components/responses/InternalServerError'
        '502':
          $ref: '#/components/responses/BadGateway'
        '504':
          $ref: '#/components/responses/UpstreamTimeout'
        '429':
          $ref: '#/components/responses/TooManyRequests'

      security:
        - authorizer: [ ]
        - oAuth:
            - directory:website
            - directory:software
      x-amazon-apigateway-integration:
        uri: "${organisation_read_arn}"
        passthroughBehavior: "when_no_match"
        httpMethod: "POST"
        timeoutInMillis: 15000
        type: "aws_proxy"

    put:
      summary: Update a server authority claim for the given Id
      parameters:
        - $ref: "#/components/parameters/x-fapi-auth-date"
        - $ref: "#/components/parameters/x-fapi-customer-ip-address"
        - $ref: "#/components/parameters/x-fapi-interaction-id"
        - $ref: "#/components/parameters/x-customer-user-agent"
      description: Updates a given servers authority claim
      operationId: updateOrganisationServerAuthorityClaimById
      tags:
        - Organisations
        - Authorisation Servers
        - Authority Claims
        - Public
        - Closed
      requestBody:
        $ref: '#/components/requestBodies/ServerAuthorityClaimUpdateRequest'
      responses:
        '204':
          $ref: '#/components/responses/NoContent'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '406':
          $ref: '#/components/responses/NotAcceptable'
        '500':
          $ref: '#/components/responses/InternalServerError'
        '502':
          $ref: '#/components/responses/BadGateway'
        '504':
          $ref: '#/components/responses/UpstreamTimeout'
        '429':
          $ref: '#/components/responses/TooManyRequests'

      security:
        - authorizer: [ ]
        - oAuth:
            - directory:website
      x-amazon-apigateway-integration:
        uri: "${organisation_write_arn}"
        passthroughBehavior: "when_no_match"
        httpMethod: "POST"
        timeoutInMillis: 29000
        type: "aws_proxy"

    delete:
      summary: Delete a server authority claim
      parameters:
        - $ref: "#/components/parameters/x-fapi-auth-date"
        - $ref: "#/components/parameters/x-fapi-customer-ip-address"
        - $ref: "#/components/parameters/x-fapi-interaction-id"
        - $ref: "#/components/parameters/x-customer-user-agent"
      description: Deletes a specific server authority claim
      operationId: deleteOrganisationServerAuthorityClaimById
      tags:
        - Organisations
        - Authorisation Servers
        - Authority Claims
        - Public
        - Closed
      responses:
        '204':
          $ref: '#/components/responses/NoContent'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '406':
          $ref: '#/components/responses/NotAcceptable'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '500':
          $ref: '#/components/responses/InternalServerError'
        '502':
          $ref: '#/components/responses/BadGateway'
        '504':
          $ref: '#/components/responses/UpstreamTimeout'

      security:
        - authorizer: [ ]
        - oAuth:
            - directory:website
      x-amazon-apigateway-integration:
        uri: "${organisation_write_arn}"
        passthroughBehavior: "when_no_match"
        httpMethod: "POST"
        timeoutInMillis: 29000
        type: "aws_proxy"

  '/organisations/{OrganisationId}/authorisationservers/{AuthorisationServerId}/sso-configuration':
    parameters:
      - $ref: '#/components/parameters/OrganisationId'
      - $ref: '#/components/parameters/AuthorisationServerId'
      - $ref: "#/components/parameters/x-fapi-auth-date"
      - $ref: "#/components/parameters/x-fapi-customer-ip-address"
      - $ref: "#/components/parameters/x-fapi-interaction-id"
      - $ref: "#/components/parameters/x-customer-user-agent"
    get:
      summary: Retrieves all instances of sso configuration for a given authorisation server.
      description: '''Retrieves all instances of sso configuration for a given authorisation server. While a server is 
      unlikely to have multiple in production, it can be a useful mechanism for deprecating an old service'''
      operationId: getAllAuthorisationServerSsoConfiguration
      tags:
        - Organisations
        - Authorisation Servers
        - SSO
        - Public
        - Closed
      parameters:
        - $ref: "#/components/parameters/PageNumber"
        - $ref: "#/components/parameters/PageSize"
        - $ref: "#/components/parameters/PageSort"
      responses:
        '200':
          $ref: '#/components/responses/SsoConfigurationObjectPage'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '500':
          $ref: '#/components/responses/InternalServerError'
        '502':
          $ref: '#/components/responses/BadGateway'
        '504':
          $ref: '#/components/responses/UpstreamTimeout'

      security:
        - authorizer: [ ]
        - oAuth:
            - directory:website
      x-amazon-apigateway-integration:
        uri: "${organisation_read_arn}"
        passthroughBehavior: "when_no_match"
        httpMethod: "POST"
        timeoutInMillis: 15000
        type: "aws_proxy"

    post:
      summary: Creates an instance of sso configuration for a given authorisation server.
      description: '''Creates an instance of sso configuration for a given authorisation server. When combined with an 
        approved `SSO Configuration Version` the subject authorisation server is able to act as an SSO provider to the 
        platform'''
      operationId: createAuthorisationServerSsoConfiguration
      tags:
        - Organisations
        - Authorisation Servers
        - SSO
        - Public
        - Closed
      requestBody:
        $ref: '#/components/requestBodies/SsoConfigurationCreationRequest'
      responses:
        '201':
          $ref: '#/components/responses/SsoConfigurationObject'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '500':
          $ref: '#/components/responses/InternalServerError'
        '502':
          $ref: '#/components/responses/BadGateway'
        '504':
          $ref: '#/components/responses/UpstreamTimeout'

      security:
        - authorizer: [ ]
        - oAuth:
            - directory:website
      x-amazon-apigateway-integration:
        uri: "${organisation_write_arn}"
        passthroughBehavior: "when_no_match"
        httpMethod: "POST"
        timeoutInMillis: 29000
        type: "aws_proxy"

  '/organisations/{OrganisationId}/authorisationservers/{AuthorisationServerId}/sso-configuration/{ssoConfigurationId}':
    parameters:
      - $ref: '#/components/parameters/OrganisationId'
      - $ref: '#/components/parameters/AuthorisationServerId'
      - $ref: '#/components/parameters/SsoConfigurationIdPathParameter'
      - $ref: "#/components/parameters/x-fapi-auth-date"
      - $ref: "#/components/parameters/x-fapi-customer-ip-address"
      - $ref: "#/components/parameters/x-fapi-interaction-id"
      - $ref: "#/components/parameters/x-customer-user-agent"
    get:
      summary: Retrieves a specific instance of sso configuration for a given authorisation server.
      description: '''Retrieves a specific instance of sso configuration for a given authorisation server'''
      operationId: getAuthorisationServerSsoConfiguration
      tags:
        - Organisations
        - Authorisation Servers
        - SSO
        - Public
        - Closed
      responses:
        '200':
          $ref: '#/components/responses/SsoConfigurationObject'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '500':
          $ref: '#/components/responses/InternalServerError'
        '502':
          $ref: '#/components/responses/BadGateway'
        '504':
          $ref: '#/components/responses/UpstreamTimeout'

      security:
        - authorizer: [ ]
        - oAuth:
            - directory:website
      x-amazon-apigateway-integration:
        uri: "${organisation_read_arn}"
        passthroughBehavior: "when_no_match"
        httpMethod: "POST"
        timeoutInMillis: 15000
        type: "aws_proxy"

    put:
      summary: Updates a specific instance of sso configuration for a given authorisation server.
      description: '''Updates a specific instance of sso configuration for a given authorisation server.'''
      operationId: updateAuthorisationServerSsoConfiguration
      tags:
        - Organisations
        - Authorisation Servers
        - SSO
        - Public
        - Closed
      requestBody:
        $ref: '#/components/requestBodies/SsoConfigurationUpdateRequest'
      responses:
        '200':
          $ref: '#/components/responses/SsoConfigurationObject'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '406':
          $ref: '#/components/responses/NotAcceptable'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '500':
          $ref: '#/components/responses/InternalServerError'
        '502':
          $ref: '#/components/responses/BadGateway'
        '504':
          $ref: '#/components/responses/UpstreamTimeout'

      security:
        - authorizer: [ ]
        - oAuth:
            - directory:website
      x-amazon-apigateway-integration:
        uri: "${organisation_write_arn}"
        passthroughBehavior: "when_no_match"
        httpMethod: "POST"
        timeoutInMillis: 29000
        type: "aws_proxy"

    delete:
      summary: Deletes a specific instance of sso configuration for a given authorisation server.
      description: '''Deletes a specific instance of sso configuration for a given authorisation server. Only possible 
      for authorisation servers who have never had any approved configuration versions. For servers that have 
      historically had approved configuration versions deletion is no longer possible and instead the resource should 
      be deactivated '''
      operationId: deleteAuthorisationServerSsoConfiguration
      tags:
        - Organisations
        - Authorisation Servers
        - SSO
        - Public
        - Closed
      responses:
        '204':
          $ref: '#/components/responses/NoContent'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '406':
          $ref: '#/components/responses/NotAcceptable'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '500':
          $ref: '#/components/responses/InternalServerError'
        '502':
          $ref: '#/components/responses/BadGateway'
        '504':
          $ref: '#/components/responses/UpstreamTimeout'

      security:
        - authorizer: [ ]
        - oAuth:
            - directory:website
      x-amazon-apigateway-integration:
        uri: "${organisation_write_arn}"
        passthroughBehavior: "when_no_match"
        httpMethod: "POST"
        timeoutInMillis: 29000
        type: "aws_proxy"

  '/organisations/{OrganisationId}/authorisationservers/{AuthorisationServerId}/sso-configuration/{ssoConfigurationId}/versions':
    parameters:
      - $ref: '#/components/parameters/OrganisationId'
      - $ref: '#/components/parameters/AuthorisationServerId'
      - $ref: '#/components/parameters/SsoConfigurationIdPathParameter'
      - $ref: "#/components/parameters/x-fapi-auth-date"
      - $ref: "#/components/parameters/x-fapi-customer-ip-address"
      - $ref: "#/components/parameters/x-fapi-interaction-id"
      - $ref: "#/components/parameters/x-customer-user-agent"
    get:
      summary: Retrieves all historical configuration of a given sso configuration for a given authorisation server.
      description: '''Retrieves all historical configuration of a given sso configuration for a given authorisation server. 
      The response will by default by ordered by version in descending order'''
      operationId: getAllAuthorisationServerSsoConfigurationVersions
      tags:
        - Organisations
        - Authorisation Servers
        - SSO
        - Public
        - Closed
      parameters:
        - $ref: "#/components/parameters/PageNumber"
        - $ref: "#/components/parameters/PageSize"
        - $ref: "#/components/parameters/PageSort"
        - $ref: '#/components/parameters/ApprovalFlowStatusEnumQueryParameter'
      responses:
        '200':
          $ref: '#/components/responses/SsoConfigurationVersionObjectPage'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '500':
          $ref: '#/components/responses/InternalServerError'
        '502':
          $ref: '#/components/responses/BadGateway'
        '504':
          $ref: '#/components/responses/UpstreamTimeout'

      security:
        - authorizer: [ ]
        - oAuth:
            - directory:website
      x-amazon-apigateway-integration:
        uri: "${organisation_read_arn}"
        passthroughBehavior: "when_no_match"
        httpMethod: "POST"
        timeoutInMillis: 15000
        type: "aws_proxy"

    post:
      summary: Creates a new version of sso configuration for a given authorisation server.
      description: '''Creates a new version of sso configuration for a given sso configured authorisation server. The 
      new version will need approval before being considered active. A newly created unapproved version is suspended
      until approval.'''
      operationId: createAuthorisationServerSsoConfigurationVersion
      tags:
        - Organisations
        - Authorisation Servers
        - SSO
        - Public
        - Closed
      requestBody:
        $ref: '#/components/requestBodies/SsoConfigurationVersionCreationRequest'
      responses:
        '201':
          $ref: '#/components/responses/SsoConfigurationVersionObject'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '500':
          $ref: '#/components/responses/InternalServerError'
        '502':
          $ref: '#/components/responses/BadGateway'
        '504':
          $ref: '#/components/responses/UpstreamTimeout'

      security:
        - authorizer: [ ]
        - oAuth:
            - directory:website
      x-amazon-apigateway-integration:
        uri: "${organisation_write_arn}"
        passthroughBehavior: "when_no_match"
        httpMethod: "POST"
        timeoutInMillis: 29000
        type: "aws_proxy"

  '/organisations/{OrganisationId}/authorisationservers/{AuthorisationServerId}/sso-configuration/{ssoConfigurationId}/versions/{versionId}':
    parameters:
      - $ref: '#/components/parameters/OrganisationId'
      - $ref: '#/components/parameters/AuthorisationServerId'
      - $ref: '#/components/parameters/SsoConfigurationIdPathParameter'
      - $ref: '#/components/parameters/SsoConfigurationVersionIdPathParameter'
      - $ref: "#/components/parameters/x-fapi-auth-date"
      - $ref: "#/components/parameters/x-fapi-customer-ip-address"
      - $ref: "#/components/parameters/x-fapi-interaction-id"
      - $ref: "#/components/parameters/x-customer-user-agent"
    get:
      summary: Retrieves a specific version of sso configuration for a given sso configured authorisation server.
      description: '''Retrieves a specific version of sso configuration for a given sso configured authorisation 
      server'''
      operationId: getAuthorisationServerSsoConfigurationVersion
      tags:
        - Organisations
        - Authorisation Servers
        - SSO
        - Public
        - Closed
      responses:
        '200':
          $ref: '#/components/responses/SsoConfigurationVersionObject'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '500':
          $ref: '#/components/responses/InternalServerError'
        '502':
          $ref: '#/components/responses/BadGateway'
        '504':
          $ref: '#/components/responses/UpstreamTimeout'

      security:
        - authorizer: [ ]
        - oAuth:
            - directory:website
      x-amazon-apigateway-integration:
        uri: "${organisation_read_arn}"
        passthroughBehavior: "when_no_match"
        httpMethod: "POST"
        timeoutInMillis: 15000
        type: "aws_proxy"

    put:
      summary: Updates a specific instance of sso configuration for a given authorisation server.
      description: '''Updates a specific version of configuration for a given sso enabled authorisation server. Once 
      approved, changes to any field beyond status are no longer possible. Approval of a configuration version will set
       the status of a prior version to suspended automatically. Setting any approved version to active status suspends
        the currently active version. Only approved versions may be active.'''
      operationId: updateAuthorisationServerSsoConfigurationVersion
      tags:
        - Organisations
        - Authorisation Servers
        - SSO
        - Public
        - Closed
      requestBody:
        $ref: '#/components/requestBodies/SsoConfigurationVersionUpdateRequest'
      responses:
        '200':
          $ref: '#/components/responses/SsoConfigurationVersionObject'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '406':
          $ref: '#/components/responses/NotAcceptable'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '500':
          $ref: '#/components/responses/InternalServerError'
        '502':
          $ref: '#/components/responses/BadGateway'
        '504':
          $ref: '#/components/responses/UpstreamTimeout'

      security:
        - authorizer: [ ]
        - oAuth:
            - directory:website
      x-amazon-apigateway-integration:
        uri: "${organisation_write_arn}"
        passthroughBehavior: "when_no_match"
        httpMethod: "POST"
        timeoutInMillis: 29000
        type: "aws_proxy"

    delete:
      summary: Deletes a specific version of configuration for a given sso-enabled authorisation server.
      description: '''Deletes a specific version of sso configuration for a given sso-enabled authorisation server. 
      Only possible for versions that are unapproved. For approved versions, deactivate instead.'''
      operationId: deleteAuthorisationServerSsoConfigurationVersion
      tags:
        - Organisations
        - Authorisation Servers
        - SSO
        - Public
        - Closed
      responses:
        '204':
          $ref: '#/components/responses/NoContent'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '406':
          $ref: '#/components/responses/NotAcceptable'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '500':
          $ref: '#/components/responses/InternalServerError'
        '502':
          $ref: '#/components/responses/BadGateway'
        '504':
          $ref: '#/components/responses/UpstreamTimeout'

      security:
        - authorizer: [ ]
        - oAuth:
            - directory:website
      x-amazon-apigateway-integration:
        uri: "${organisation_write_arn}"
        passthroughBehavior: "when_no_match"
        httpMethod: "POST"
        timeoutInMillis: 29000
        type: "aws_proxy"

  '/organisations/{OrganisationId}/authorisationservers/{AuthorisationServerId}/apiresources':
    parameters:
      - $ref: '#/components/parameters/OrganisationId'
      - $ref: '#/components/parameters/AuthorisationServerId'
      - $ref: "#/components/parameters/x-fapi-auth-date"
      - $ref: "#/components/parameters/x-fapi-customer-ip-address"
      - $ref: "#/components/parameters/x-fapi-interaction-id"
      - $ref: "#/components/parameters/x-customer-user-agent"
    get:
      summary: Get all Api Resources for the given Authorisation Server
      description: gets all api resources attached to the given organisation authorisation server
      operationId: getOrganisationAuthorisationServerApiResources
      parameters:
        - $ref: "#/components/parameters/PageNumber"
        - $ref: "#/components/parameters/PageSize"
        - $ref: "#/components/parameters/PageSort"
        - in: query
          name: status
          schema:
            type: string
          description: The status of the api resource
      tags:
        - Organisations
        - Authorisation Servers
        - API Resources
        - Public
        - Closed
      responses:
        '200':
          $ref: '#/components/responses/ApiResources'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '500':
          $ref: '#/components/responses/InternalServerError'
        '502':
          $ref: '#/components/responses/BadGateway'
        '504':
          $ref: '#/components/responses/UpstreamTimeout'
        '429':
          $ref: '#/components/responses/TooManyRequests'

      security:
        - authorizer: [ ]
        - oAuth:
            - directory:website
            - directory:software
      x-amazon-apigateway-integration:
        uri: "${organisation_read_arn}"
        passthroughBehavior: "when_no_match"
        httpMethod: "POST"
        timeoutInMillis: 29000
        type: "aws_proxy"

    post:
      summary: Create an Api Resource for the given organisation and Authorisation Server
      description: creates a new api resource attached to the specified authorisation server
      operationId: createOrganisationAuthorisationServerApiResource
      parameters:
        - $ref: "#/components/parameters/x-fapi-auth-date"
        - $ref: "#/components/parameters/x-fapi-customer-ip-address"
        - $ref: "#/components/parameters/x-fapi-interaction-id"
        - $ref: "#/components/parameters/x-customer-user-agent"
      tags:
        - Organisations
        - Authorisation Servers
        - API Resources
        - Public
        - Closed
      requestBody:
        $ref: '#/components/requestBodies/ApiResourceRequest'
      responses:
        '201':
          $ref: '#/components/responses/ApiResource'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '500':
          $ref: '#/components/responses/InternalServerError'
        '502':
          $ref: '#/components/responses/BadGateway'
        '504':
          $ref: '#/components/responses/UpstreamTimeout'
        '429':
          $ref: '#/components/responses/TooManyRequests'

      security:
        - authorizer: [ ]
        - oAuth:
            - directory:website
      x-amazon-apigateway-integration:
        uri: "${organisation_write_arn}"
        passthroughBehavior: "when_no_match"
        httpMethod: "POST"
        timeoutInMillis: 29000
        type: "aws_proxy"

  '/organisations/{OrganisationId}/authorisationservers/{AuthorisationServerId}/apiresources/{ApiResourceId}':
    parameters:
      - $ref: '#/components/parameters/OrganisationId'
      - $ref: '#/components/parameters/AuthorisationServerId'
      - $ref: '#/components/parameters/ApiResourceId'
      - $ref: "#/components/parameters/x-fapi-auth-date"
      - $ref: "#/components/parameters/x-fapi-customer-ip-address"
      - $ref: "#/components/parameters/x-fapi-interaction-id"
      - $ref: "#/components/parameters/x-customer-user-agent"

    get:
      summary: Get an authorisation server API resource by Id
      description: gets a specific api resource
      operationId: getOrganisationAuthorisationServerApiResourceById
      tags:
        - Organisations
        - Authorisation Servers
        - API Resources
        - Public
        - Closed
      responses:
        '200':
          $ref: '#/components/responses/ApiResource'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/InternalServerError'
        '502':
          $ref: '#/components/responses/BadGateway'
        '504':
          $ref: '#/components/responses/UpstreamTimeout'
        '429':
          $ref: '#/components/responses/TooManyRequests'

      security:
        - authorizer: [ ]
        - oAuth:
            - directory:website
            - directory:software
      x-amazon-apigateway-integration:
        uri: "${organisation_read_arn}"
        passthroughBehavior: "when_no_match"
        httpMethod: "POST"
        timeoutInMillis: 15000
        type: "aws_proxy"

    put:
      summary: Update an Api Resource for the given organisation and Authorisation Server
      description: updates a specific api resource
      operationId: updateOrganisationAuthorisationServerApiResourceById
      parameters:
        - $ref: "#/components/parameters/x-fapi-auth-date"
        - $ref: "#/components/parameters/x-fapi-customer-ip-address"
        - $ref: "#/components/parameters/x-fapi-interaction-id"
        - $ref: "#/components/parameters/x-customer-user-agent"
      tags:
        - Organisations
        - Authorisation Servers
        - API Resources
        - Public
        - Closed
      requestBody:
        $ref: '#/components/requestBodies/ApiResourceUpdateRequest'
      responses:
        '200':
          $ref: '#/components/responses/ApiResource'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '500':
          $ref: '#/components/responses/InternalServerError'
        '502':
          $ref: '#/components/responses/BadGateway'
        '504':
          $ref: '#/components/responses/UpstreamTimeout'
        '429':
          $ref: '#/components/responses/TooManyRequests'

      security:
        - authorizer: [ ]
        - oAuth:
            - directory:website
      x-amazon-apigateway-integration:
        uri: "${organisation_write_arn}"
        passthroughBehavior: "when_no_match"
        httpMethod: "POST"
        timeoutInMillis: 29000
        type: "aws_proxy"

    delete:
      summary: Delete an authorisation server API resource by Id
      description: deletes a specific api resource
      operationId: deleteOrganisationAuthorisationServerApiResourceById
      parameters:
        - $ref: "#/components/parameters/x-fapi-auth-date"
        - $ref: "#/components/parameters/x-fapi-customer-ip-address"
        - $ref: "#/components/parameters/x-fapi-interaction-id"
        - $ref: "#/components/parameters/x-customer-user-agent"
      tags:
        - Organisations
        - Authorisation Servers
        - API Resources
        - Public
        - Closed
      responses:
        '204':
          $ref: '#/components/responses/NoContent'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/InternalServerError'
        '502':
          $ref: '#/components/responses/BadGateway'
        '504':
          $ref: '#/components/responses/UpstreamTimeout'
        '429':
          $ref: '#/components/responses/TooManyRequests'

      security:
        - authorizer: [ ]
        - oAuth:
            - directory:website
            - directory:software
      x-amazon-apigateway-integration:
        uri: "${organisation_write_arn}"
        passthroughBehavior: "when_no_match"
        httpMethod: "POST"
        timeoutInMillis: 29000
        type: "aws_proxy"

  '/organisations/{OrganisationId}/authorisationservers/{AuthorisationServerId}/apiresources/{ApiResourceId}/metadata':
    parameters:
      - $ref: '#/components/parameters/OrganisationId'
      - $ref: '#/components/parameters/AuthorisationServerId'
      - $ref: '#/components/parameters/ApiResourceId'
      - $ref: "#/components/parameters/x-fapi-auth-date"
      - $ref: "#/components/parameters/x-fapi-customer-ip-address"
      - $ref: "#/components/parameters/x-fapi-interaction-id"
      - $ref: "#/components/parameters/x-customer-user-agent"

    get:
      summary: Get an authorisation server API resource metadata
      description: Gets a specific api resources metadata
      operationId: getOrganisationAuthorisationServerApiResourceMetadata
      tags:
        - Organisations
        - Authorisation Servers
        - API Resources
        - Public
        - Closed
      responses:
        '200':
          $ref: '#/components/responses/ApiResourceMetadataItemResponse'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/InternalServerError'
        '502':
          $ref: '#/components/responses/BadGateway'
        '504':
          $ref: '#/components/responses/UpstreamTimeout'
        '429':
          $ref: '#/components/responses/TooManyRequests'

      security:
        - authorizer: [ ]
        - oAuth:
            - directory:website
      x-amazon-apigateway-integration:
        uri: "${organisation_read_arn}"
        passthroughBehavior: "when_no_match"
        httpMethod: "POST"
        timeoutInMillis: 5000
        type: "aws_proxy"

    put:
      summary: Edit an api resource metadata entry for the given api resource
      description: Edit an api resource metadata entry for the given api resource
      operationId: editOrganisationAuthorisationServerApiResourceMetadata
      parameters:
        - $ref: "#/components/parameters/x-fapi-auth-date"
        - $ref: "#/components/parameters/x-fapi-customer-ip-address"
        - $ref: "#/components/parameters/x-fapi-interaction-id"
        - $ref: "#/components/parameters/x-customer-user-agent"
      tags:
        - Organisations
        - Authorisation Servers
        - API Resources
        - Public
        - Closed
      requestBody:
        $ref: '#/components/requestBodies/ApiResourceMetadataRequest'
      responses:
        '201':
          $ref: '#/components/responses/ApiResourceMetadataItemResponse'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '409':
          $ref: '#/components/responses/Conflict'
        '500':
          $ref: '#/components/responses/InternalServerError'
        '502':
          $ref: '#/components/responses/BadGateway'
        '504':
          $ref: '#/components/responses/UpstreamTimeout'
        '429':
          $ref: '#/components/responses/TooManyRequests'

      security:
        - authorizer: [ ]
        - oAuth:
            - directory:website
      x-amazon-apigateway-integration:
        uri: "${organisation_write_arn}"
        passthroughBehavior: "when_no_match"
        httpMethod: "POST"
        timeoutInMillis: 29000
        type: "aws_proxy"

  '/organisations/{OrganisationId}/authorisationservers/{AuthorisationServerId}/familystatus':
    parameters:
      - $ref: '#/components/parameters/OrganisationId'
      - $ref: '#/components/parameters/AuthorisationServerId'
      - $ref: "#/components/parameters/x-fapi-auth-date"
      - $ref: "#/components/parameters/x-fapi-customer-ip-address"
      - $ref: "#/components/parameters/x-fapi-interaction-id"
      - $ref: "#/components/parameters/x-customer-user-agent"

    get:
      summary: Get an authorisation server API resource by Id and returns the latest family status
      description: refreshes the family status of all api resources attached to this authorisation server
      operationId: refreshOrganisationAuthorisationServerApiResourceFamilyStatus
      tags:
        - Organisations
        - Authorisation Servers
        - API Resources
        - Public
        - Closed
      responses:
        '200':
          $ref: '#/components/responses/ApiResources'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/InternalServerError'
        '502':
          $ref: '#/components/responses/BadGateway'
        '504':
          $ref: '#/components/responses/UpstreamTimeout'
        '429':
          $ref: '#/components/responses/TooManyRequests'

      security:
        - authorizer: [ ]
        - oAuth:
            - directory:website
            - directory:software
      x-amazon-apigateway-integration:
        uri: "${organisation_write_arn}"
        passthroughBehavior: "when_no_match"
        httpMethod: "POST"
        timeoutInMillis: 15000
        type: "aws_proxy"

  '/organisations/{OrganisationId}/authorisationservers/{AuthorisationServerId}/apiresources/{ApiResourceId}/apidiscoveryendpoints':
    parameters:
      - $ref: '#/components/parameters/OrganisationId'
      - $ref: '#/components/parameters/AuthorisationServerId'
      - $ref: '#/components/parameters/ApiResourceId'
      - $ref: "#/components/parameters/x-fapi-auth-date"
      - $ref: "#/components/parameters/x-fapi-customer-ip-address"
      - $ref: "#/components/parameters/x-fapi-interaction-id"
      - $ref: "#/components/parameters/x-customer-user-agent"

    get:
      summary: Get all Api Discovery Endpoints for the given Authorisation Server and Api Version
      description: get all api discovery endpoints listed for a specific api resource
      operationId: getOrganisationAuthorisationServerApiResourceApiDiscoveryEndpoints
      tags:
        - Organisations
        - Authorisation Servers
        - API Resources
        - API Discovery Endpoints
        - Public
        - Closed
      parameters:
        - $ref: "#/components/parameters/PageNumber"
        - $ref: "#/components/parameters/PageSize"
        - $ref: "#/components/parameters/PageSort"
      responses:
        '200':
          $ref: '#/components/responses/ApiDiscoveryEndpoints'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '500':
          $ref: '#/components/responses/InternalServerError'
        '502':
          $ref: '#/components/responses/BadGateway'
        '504':
          $ref: '#/components/responses/UpstreamTimeout'
        '429':
          $ref: '#/components/responses/TooManyRequests'

      security:
        - authorizer: [ ]
        - oAuth:
            - directory:website
            - directory:software
      x-amazon-apigateway-integration:
        uri: "${organisation_read_arn}"
        passthroughBehavior: "when_no_match"
        httpMethod: "POST"
        timeoutInMillis: 15000
        type: "aws_proxy"

    post:
      summary: Create an Api Discovery Endpoint for the given organisation and Authorisation Server and Api Version
      description: adds a new api discovery endpoint to an existing api resource
      parameters:
        - $ref: "#/components/parameters/x-fapi-auth-date"
        - $ref: "#/components/parameters/x-fapi-customer-ip-address"
        - $ref: "#/components/parameters/x-fapi-interaction-id"
        - $ref: "#/components/parameters/x-customer-user-agent"
      operationId: createOrganisationAuthorisationServerApiResourceApiDiscoveryEndpoints
      tags:
        - Organisations
        - Authorisation Servers
        - API Resources
        - API Discovery Endpoints
        - Public
        - Closed
      requestBody:
        $ref: '#/components/requestBodies/ApiDiscoveryEndpointRequest'
      responses:
        '201':
          $ref: '#/components/responses/ApiDiscoveryEndpointFamilyResponse'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '500':
          $ref: '#/components/responses/InternalServerError'
        '502':
          $ref: '#/components/responses/BadGateway'
        '504':
          $ref: '#/components/responses/UpstreamTimeout'
        '429':
          $ref: '#/components/responses/TooManyRequests'

      security:
        - authorizer: [ ]
        - oAuth:
            - directory:website
      x-amazon-apigateway-integration:
        uri: "${organisation_write_arn}"
        passthroughBehavior: "when_no_match"
        httpMethod: "POST"
        timeoutInMillis: 29000
        type: "aws_proxy"

  '/organisations/{OrganisationId}/authorisationservers/{AuthorisationServerId}/apiresources/{ApiResourceId}/apidiscoveryendpoints/{ApiDiscoveryEndpointId}':
    parameters:
      - $ref: '#/components/parameters/OrganisationId'
      - $ref: '#/components/parameters/AuthorisationServerId'
      - $ref: '#/components/parameters/ApiResourceId'
      - $ref: '#/components/parameters/ApiDiscoveryEndpointId'
      - $ref: "#/components/parameters/x-fapi-auth-date"
      - $ref: "#/components/parameters/x-fapi-customer-ip-address"
      - $ref: "#/components/parameters/x-fapi-interaction-id"
      - $ref: "#/components/parameters/x-customer-user-agent"

    get:
      summary: Get an authorisation server API discovery endpoint by Id
      description: gets a specific api discovery endpoint
      operationId: getOrganisationAuthorisationServerApiResourceApiDiscoveryEndpointsById
      tags:
        - Organisations
        - Authorisation Servers
        - API Resources
        - API Discovery Endpoints
        - Public
        - Closed
      responses:
        '200':
          $ref: '#/components/responses/ApiDiscoveryEndpoint'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/InternalServerError'
        '502':
          $ref: '#/components/responses/BadGateway'
        '504':
          $ref: '#/components/responses/UpstreamTimeout'
        '429':
          $ref: '#/components/responses/TooManyRequests'

      security:
        - authorizer: [ ]
        - oAuth:
            - directory:website
            - directory:software
      x-amazon-apigateway-integration:
        uri: "${organisation_read_arn}"
        passthroughBehavior: "when_no_match"
        httpMethod: "POST"
        timeoutInMillis: 15000
        type: "aws_proxy"

    put:
      summary: Update an Api Discovery Endpoint for the given organisation, Authorisation Server and Api Version
      description: updates an api discovery endpoint
      parameters:
        - $ref: "#/components/parameters/x-fapi-auth-date"
        - $ref: "#/components/parameters/x-fapi-customer-ip-address"
        - $ref: "#/components/parameters/x-fapi-interaction-id"
        - $ref: "#/components/parameters/x-customer-user-agent"
      operationId: updateOrganisationAuthorisationServerApiResourceApiDiscoveryEndpointsById
      tags:
        - Organisations
        - Authorisation Servers
        - API Resources
        - API Discovery Endpoints
        - Public
        - Closed
      requestBody:
        $ref: '#/components/requestBodies/ApiDiscoveryEndpointRequest'
      responses:
        '200':
          $ref: '#/components/responses/ApiDiscoveryEndpointFamilyResponse'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '500':
          $ref: '#/components/responses/InternalServerError'
        '502':
          $ref: '#/components/responses/BadGateway'
        '504':
          $ref: '#/components/responses/UpstreamTimeout'
        '429':
          $ref: '#/components/responses/TooManyRequests'

      security:
        - authorizer: [ ]
        - oAuth:
            - directory:website
      x-amazon-apigateway-integration:
        uri: "${organisation_write_arn}"
        passthroughBehavior: "when_no_match"
        httpMethod: "POST"
        timeoutInMillis: 29000
        type: "aws_proxy"

    delete:
      summary: Delete an Api Discovery Endpoint for the given organisation, Authorisation Server and Api Version
      description: deletes an api discovery endpoint
      parameters:
        - $ref: "#/components/parameters/x-fapi-auth-date"
        - $ref: "#/components/parameters/x-fapi-customer-ip-address"
        - $ref: "#/components/parameters/x-fapi-interaction-id"
        - $ref: "#/components/parameters/x-customer-user-agent"
      operationId: deleteOrganisationAuthorisationServerApiResourceApiDiscoveryEndpointsById
      tags:
        - Organisations
        - Authorisation Servers
        - API Resources
        - API Discovery Endpoints
        - Public
        - Closed
      responses:
        '204':
          $ref: '#/components/responses/NoContent'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/InternalServerError'
        '502':
          $ref: '#/components/responses/BadGateway'
        '504':
          $ref: '#/components/responses/UpstreamTimeout'
        '429':
          $ref: '#/components/responses/TooManyRequests'

      security:
        - authorizer: [ ]
        - oAuth:
            - directory:website
            - directory:software
      x-amazon-apigateway-integration:
        uri: "${organisation_write_arn}"
        passthroughBehavior: "when_no_match"
        httpMethod: "POST"
        timeoutInMillis: 29000
        type: "aws_proxy"

  '/organisations/{OrganisationId}/authorisationservers/{AuthorisationServerId}/certifications':
    parameters:
      - $ref: '#/components/parameters/OrganisationId'
      - $ref: '#/components/parameters/AuthorisationServerId'
      - $ref: "#/components/parameters/x-fapi-auth-date"
      - $ref: "#/components/parameters/x-fapi-customer-ip-address"
      - $ref: "#/components/parameters/x-fapi-interaction-id"
      - $ref: "#/components/parameters/x-customer-user-agent"
    get:
      summary: Get all certifications for given authorisation server
      description: lists all certifications attached to a specific authorisation server
      parameters:
        - $ref: "#/components/parameters/PageNumber"
        - $ref: "#/components/parameters/PageSize"
        - $ref: "#/components/parameters/PageSort"
      operationId: getOrganisationAuthorisationServerCertifications
      tags:
        - Organisations
        - Authorisation Servers
        - Certifications
        - Public
      responses:
        '200':
          $ref: '#/components/responses/AuthorisationServerCertifications'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/InternalServerError'
        '502':
          $ref: '#/components/responses/BadGateway'
        '504':
          $ref: '#/components/responses/UpstreamTimeout'
        '429':
          $ref: '#/components/responses/TooManyRequests'

      security:
        - authorizer: [ ]
        - oAuth:
            - directory:website
            - directory:software
      x-amazon-apigateway-integration:
        uri: "${organisation_read_arn}"
        passthroughBehavior: "when_no_match"
        httpMethod: "POST"
        timeoutInMillis: 29000
        type: "aws_proxy"

    post:
      summary: Post a certification for the given authorisation server
      description: creates a certification record for an authorisation server
      operationId: createOrganisationAuthorisationServerCertification
      tags:
        - Organisations
        - Authorisation Servers
        - Certifications
        - Public
      requestBody:
        $ref: '#/components/requestBodies/AuthorisationServerCertificationRequest'
      responses:
        '201':
          $ref: '#/components/responses/AuthorisationServerCertification'
        '400':
          $ref: '#/components/responses/BadRequest'
        '403':
          $ref: '#/components/responses/Forbidden'
        '409':
          $ref: '#/components/responses/Conflict'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '500':
          $ref: '#/components/responses/InternalServerError'
        '502':
          $ref: '#/components/responses/BadGateway'
        '504':
          $ref: '#/components/responses/UpstreamTimeout'
        '429':
          $ref: '#/components/responses/TooManyRequests'

      security:
        - authorizer: [ ]
        - oAuth:
            - directory:website
      x-amazon-apigateway-integration:
        uri: "${organisation_write_arn}"
        passthroughBehavior: "when_no_match"
        httpMethod: "POST"
        timeoutInMillis: 29000
        type: "aws_proxy"

  '/organisations/{OrganisationId}/authorisationservers/{AuthorisationServerId}/certifications/{AuthorisationServerCertificationId}':
    parameters:
      - $ref: '#/components/parameters/OrganisationId'
      - $ref: '#/components/parameters/AuthorisationServerId'
      - $ref: '#/components/parameters/AuthorisationServerCertificationId'
      - $ref: "#/components/parameters/x-fapi-auth-date"
      - $ref: "#/components/parameters/x-fapi-customer-ip-address"
      - $ref: "#/components/parameters/x-fapi-interaction-id"
      - $ref: "#/components/parameters/x-customer-user-agent"
    get:
      summary: Get a certification by Id
      description: get specific authorisation server certification
      operationId: getOrganisationAuthorisationServerCertificationsById
      tags:
        - Organisations
        - Authorisation Servers
        - Certifications
        - Public
      responses:
        '200':
          $ref: '#/components/responses/AuthorisationServerCertification'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/InternalServerError'
        '502':
          $ref: '#/components/responses/BadGateway'
        '504':
          $ref: '#/components/responses/UpstreamTimeout'
        '429':
          $ref: '#/components/responses/TooManyRequests'

      security:
        - authorizer: [ ]
        - oAuth:
            - directory:website
            - directory:software
      x-amazon-apigateway-integration:
        uri: "${organisation_read_arn}"
        passthroughBehavior: "when_no_match"
        httpMethod: "POST"
        timeoutInMillis: 29000
        type: "aws_proxy"

    put:
      summary: Update the given certification
      description: updates a specific authorisation server certification
      operationId: updateOrganisationAuthorisationServerCertificationsById
      tags:
        - Organisations
        - Authorisation Servers
        - Certifications
        - Public
      requestBody:
        $ref: '#/components/requestBodies/AuthorisationServerCertificationRequest'
      responses:
        '200':
          $ref: '#/components/responses/AuthorisationServerCertification'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/InternalServerError'
        '502':
          $ref: '#/components/responses/BadGateway'
        '504':
          $ref: '#/components/responses/UpstreamTimeout'
        '429':
          $ref: '#/components/responses/TooManyRequests'

      security:
        - authorizer: [ ]
        - oAuth:
            - directory:website
      x-amazon-apigateway-integration:
        uri: "${organisation_write_arn}"
        passthroughBehavior: "when_no_match"
        httpMethod: "POST"
        timeoutInMillis: 29000
        type: "aws_proxy"

    delete:
      summary: Remove a certification with the given certification Id
      description: deletes a certification record from an authorisation server
      parameters:
        - $ref: "#/components/parameters/x-fapi-auth-date"
        - $ref: "#/components/parameters/x-fapi-customer-ip-address"
        - $ref: "#/components/parameters/x-fapi-interaction-id"
        - $ref: "#/components/parameters/x-customer-user-agent"
      operationId: deleteOrganisationAuthorisationServerCertificationsById
      tags:
        - Organisations
        - Authorisation Servers
        - Certifications
        - Public
      responses:
        '204':
          $ref: '#/components/responses/NoContent'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/InternalServerError'
        '502':
          $ref: '#/components/responses/BadGateway'
        '504':
          $ref: '#/components/responses/UpstreamTimeout'
        '429':
          $ref: '#/components/responses/TooManyRequests'

      security:
        - authorizer: [ ]
        - oAuth:
            - directory:website
      x-amazon-apigateway-integration:
        uri: "${organisation_write_arn}"
        passthroughBehavior: "when_no_match"
        httpMethod: "POST"
        timeoutInMillis: 29000
        type: "aws_proxy"

  '/organisations/{OrganisationId}/softwarestatements':
    parameters:
      - $ref: '#/components/parameters/OrganisationId'
      - $ref: "#/components/parameters/x-fapi-auth-date"
      - $ref: "#/components/parameters/x-fapi-customer-ip-address"
      - $ref: "#/components/parameters/x-fapi-interaction-id"
      - $ref: "#/components/parameters/x-customer-user-agent"
    get:
      summary: Get all software statements for the given organisation
      description: get all software statements
      operationId: getOrganisationSoftwareStatements
      tags:
        - Organisations
        - Software Statements
        - Public
        - Closed
      parameters:
        - $ref: "#/components/parameters/PageNumber"
        - $ref: "#/components/parameters/PageSize"
        - $ref: "#/components/parameters/PageSort"
        - $ref: "#/components/parameters/SoftwareStatementStatus"
        - in: query
          name: filterBy
          schema:
            type: string
            default: ""
          required: false
          description: Filters software statements by the provided value doing a best-case match against client name and software statement ID
      responses:
        '200':
          $ref: '#/components/responses/SoftwareStatements'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '406':
          $ref: '#/components/responses/NotAcceptable'
        '500':
          $ref: '#/components/responses/InternalServerError'
        '502':
          $ref: '#/components/responses/BadGateway'
        '504':
          $ref: '#/components/responses/UpstreamTimeout'
        '429':
          $ref: '#/components/responses/TooManyRequests'

      security:
        - authorizer: [ ]
        - oAuth:
            - directory:website
            - directory:software
      x-amazon-apigateway-integration:
        uri: "${organisation_read_arn}"
        passthroughBehavior: "when_no_match"
        httpMethod: "POST"
        timeoutInMillis: 15000
        type: "aws_proxy"

    post:
      summary: Create a software statement
      description: Creates a software statement. Note that you can add roles as part of this update for a more convenient batch addition
      parameters:
        - $ref: "#/components/parameters/x-fapi-auth-date"
        - $ref: "#/components/parameters/x-fapi-customer-ip-address"
        - $ref: "#/components/parameters/x-fapi-interaction-id"
        - $ref: "#/components/parameters/x-customer-user-agent"
      operationId: createOrganisationSoftwareStatement
      tags:
        - Organisations
        - Software Statements
        - OpenID Provider
        - Public
        - Closed
      requestBody:
        $ref: '#/components/requestBodies/SoftwareStatementRequest'
      responses:
        '201':
          $ref: '#/components/responses/SoftwareStatementResponse'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '500':
          $ref: '#/components/responses/InternalServerError'
        '502':
          $ref: '#/components/responses/BadGateway'
        '504':
          $ref: '#/components/responses/UpstreamTimeout'
        '429':
          $ref: '#/components/responses/TooManyRequests'

      security:
        - authorizer: [ ]
        - oAuth:
            - directory:website
      x-amazon-apigateway-integration:
        uri: "${organisation_write_arn}"
        passthroughBehavior: "when_no_match"
        httpMethod: "POST"
        timeoutInMillis: 29000
        type: "aws_proxy"

  '/organisations/{OrganisationId}/softwarestatements/{SoftwareStatementId}':
    parameters:
      - $ref: '#/components/parameters/OrganisationId'
      - $ref: '#/components/parameters/SoftwareStatementId'
      - $ref: "#/components/parameters/x-fapi-auth-date"
      - $ref: "#/components/parameters/x-fapi-customer-ip-address"
      - $ref: "#/components/parameters/x-fapi-interaction-id"
      - $ref: "#/components/parameters/x-customer-user-agent"
    get:
      summary: Get a specific software statement
      description: gets a specific software statements
      operationId: getOrganisationSoftwareStatementById
      tags:
        - Organisations
        - Software Statements
        - Public
        - Closed

      responses:
        '200':
          $ref: '#/components/responses/SoftwareStatement'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '406':
          $ref: '#/components/responses/NotAcceptable'
        '500':
          $ref: '#/components/responses/InternalServerError'
        '502':
          $ref: '#/components/responses/BadGateway'
        '504':
          $ref: '#/components/responses/UpstreamTimeout'
        '429':
          $ref: '#/components/responses/TooManyRequests'

      security:
        - authorizer: [ ]
        - oAuth:
            - directory:website
            - directory:software
      x-amazon-apigateway-integration:
        uri: "${organisation_write_arn}"
        passthroughBehavior: "when_no_match"
        httpMethod: "POST"
        timeoutInMillis: 29000
        type: "aws_proxy"

    put:
      summary: Update a software statement by Id.
      parameters:
        - $ref: "#/components/parameters/x-fapi-auth-date"
        - $ref: "#/components/parameters/x-fapi-customer-ip-address"
        - $ref: "#/components/parameters/x-fapi-interaction-id"
        - $ref: "#/components/parameters/x-customer-user-agent"
      description: Can update all fields till an SSA is generated for statement. This is reflected on the 'locked' field. Once locked, you can only add new 'redirect uris'. Can also suspend/unsuspend a software statement with the status field. Note you cannot update roles via a PUT by design
      operationId: updateOrganisationSoftwareStatementById
      tags:
        - Organisations
        - Software Statements
        - OpenID Provider
        - Public
        - Closed
      requestBody:
        $ref: '#/components/requestBodies/SoftwareStatementUpdateRequest'

      responses:
        '200':
          $ref: '#/components/responses/SoftwareStatementResponse'
        '400':
          $ref: '#/components/responses/BadRequest'
        '404':
          $ref: '#/components/responses/NotFound'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '406':
          $ref: '#/components/responses/NotAcceptable'
        '500':
          $ref: '#/components/responses/InternalServerError'
        '502':
          $ref: '#/components/responses/BadGateway'
        '504':
          $ref: '#/components/responses/UpstreamTimeout'
        '429':
          $ref: '#/components/responses/TooManyRequests'

      security:
        - authorizer: [ ]
        - oAuth:
            - directory:website
            - directory:software
      x-amazon-apigateway-integration:
        uri: "${organisation_write_arn}"
        passthroughBehavior: "when_no_match"
        httpMethod: "POST"
        timeoutInMillis: 29000
        type: "aws_proxy"

    delete:
      summary: Delete or revoke a software statement with the given softwarestatementID
      description: revokes a software statement and sets the status to inactive
      parameters:
        - $ref: "#/components/parameters/x-fapi-auth-date"
        - $ref: "#/components/parameters/x-fapi-customer-ip-address"
        - $ref: "#/components/parameters/x-fapi-interaction-id"
        - $ref: "#/components/parameters/x-customer-user-agent"
      operationId: deleteOrganisationSoftwareStatementById
      tags:
        - Organisations
        - Software Statements
        - OpenID Provider
        - Public
        - Closed
      responses:
        '204':
          $ref: '#/components/responses/NoContent'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '406':
          $ref: '#/components/responses/NotAcceptable'
        '500':
          $ref: '#/components/responses/InternalServerError'
        '502':
          $ref: '#/components/responses/BadGateway'
        '504':
          $ref: '#/components/responses/UpstreamTimeout'
        '429':
          $ref: '#/components/responses/TooManyRequests'

      security:
        - authorizer: [ ]
        - oAuth:
            - directory:website
            - directory:software
      x-amazon-apigateway-integration:
        uri: "${organisation_write_arn}"
        passthroughBehavior: "when_no_match"
        httpMethod: "POST"
        timeoutInMillis: 29000
        type: "aws_proxy"

  '/organisations/{OrganisationId}/softwarestatements/{SoftwareStatementId}/unlock':
    put:
      parameters:
        - $ref: '#/components/parameters/OrganisationId'
        - $ref: '#/components/parameters/SoftwareStatementId'
        - $ref: "#/components/parameters/x-fapi-auth-date"
        - $ref: "#/components/parameters/x-fapi-customer-ip-address"
        - $ref: "#/components/parameters/x-fapi-interaction-id"
        - $ref: "#/components/parameters/x-customer-user-agent"
      summary: Unlock a software statement.
      description: Ecosystem administrator should be able to unlock a software statement.
      operationId: unlockOrganisationSoftwareStatementById
      tags:
        - Organisations
        - Software Statements
        - Public
        - Closed
      requestBody:
        $ref: '#/components/requestBodies/UnlockSoftwareStatementRequest'

      responses:
        '200':
          $ref: '#/components/responses/SoftwareStatement'
        '400':
          $ref: '#/components/responses/BadRequest'
        '404':
          $ref: '#/components/responses/NotFound'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '406':
          $ref: '#/components/responses/NotAcceptable'
        '500':
          $ref: '#/components/responses/InternalServerError'
        '502':
          $ref: '#/components/responses/BadGateway'
        '504':
          $ref: '#/components/responses/UpstreamTimeout'
        '429':
          $ref: '#/components/responses/TooManyRequests'

      security:
        - authorizer: [ ]
        - oAuth:
            - directory:website
            - directory:software
      x-amazon-apigateway-integration:
        uri: "${organisation_write_arn}"
        passthroughBehavior: "when_no_match"
        httpMethod: "POST"
        timeoutInMillis: 29000
        type: "aws_proxy"

  '/organisations/{OrganisationId}/softwarestatements/{SoftwareStatementId}/authorityclaims':
    parameters:
      - $ref: '#/components/parameters/OrganisationId'
      - $ref: '#/components/parameters/SoftwareStatementId'
      - $ref: "#/components/parameters/x-fapi-auth-date"
      - $ref: "#/components/parameters/x-fapi-customer-ip-address"
      - $ref: "#/components/parameters/x-fapi-interaction-id"
      - $ref: "#/components/parameters/x-customer-user-agent"
    get:
      summary: Get the authority claims for the given software statement
      description: gets all authority claims attached to this software statement
      parameters:
        - $ref: "#/components/parameters/PageNumber"
        - $ref: "#/components/parameters/PageSize"
        - $ref: "#/components/parameters/PageSort"
      operationId: getOrganisationSoftwareStatementAuthorityClaims
      tags:
        - Organisations
        - Software Statements
        - Authority Claims
        - Software Authority Claims
        - Public
        - Closed

      responses:
        '200':
          $ref: '#/components/responses/SoftwareAuthorityClaims'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '500':
          $ref: '#/components/responses/InternalServerError'
        '502':
          $ref: '#/components/responses/BadGateway'
        '504':
          $ref: '#/components/responses/UpstreamTimeout'
        '429':
          $ref: '#/components/responses/TooManyRequests'

      security:
        - authorizer: [ ]
        - oAuth:
            - directory:website
            - directory:software
      x-amazon-apigateway-integration:
        uri: "${organisation_read_arn}"
        passthroughBehavior: "when_no_match"
        httpMethod: "POST"
        timeoutInMillis: 15000
        type: "aws_proxy"

    post:
      summary: Post an authority claim for a software statement
      description: attaches an authority claim to a software statement from the list of authority claims attached to the organisation
      parameters:
        - $ref: "#/components/parameters/x-fapi-auth-date"
        - $ref: "#/components/parameters/x-fapi-customer-ip-address"
        - $ref: "#/components/parameters/x-fapi-interaction-id"
        - $ref: "#/components/parameters/x-customer-user-agent"
      operationId: createOrganisationSoftwareStatementAuthorityClaim
      tags:
        - Organisations
        - Software Statements
        - Authority Claims
        - Software Authority Claims
        - OpenID Provider
        - Public
        - Closed
      requestBody:
        $ref: '#/components/requestBodies/SoftwareAuthorityClaimCreationRequest'

      responses:
        '201':
          $ref: '#/components/responses/SoftwareAuthorityClaim'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '409':
          $ref: '#/components/responses/Conflict'
        '500':
          $ref: '#/components/responses/InternalServerError'
        '502':
          $ref: '#/components/responses/BadGateway'
        '504':
          $ref: '#/components/responses/UpstreamTimeout'
        '429':
          $ref: '#/components/responses/TooManyRequests'

      security:
        - authorizer: [ ]
        - oAuth:
            - directory:website
      x-amazon-apigateway-integration:
        uri: "${organisation_write_arn}"
        passthroughBehavior: "when_no_match"
        httpMethod: "POST"
        timeoutInMillis: 29000
        type: "aws_proxy"

  '/organisations/{OrganisationId}/softwarestatements/{SoftwareStatementId}/authorityclaims/{SoftwareAuthorityClaimId}':
    parameters:
      - $ref: '#/components/parameters/OrganisationId'
      - $ref: '#/components/parameters/SoftwareStatementId'
      - $ref: '#/components/parameters/SoftwareAuthorityClaimId'
      - $ref: "#/components/parameters/x-fapi-auth-date"
      - $ref: "#/components/parameters/x-fapi-customer-ip-address"
      - $ref: "#/components/parameters/x-fapi-interaction-id"
      - $ref: "#/components/parameters/x-customer-user-agent"
    get:
      summary: Get an authority claim by Id
      description: gets a specific software authority claim
      operationId: getOrganisationSoftwareStatementAuthorityClaimById
      tags:
        - Organisations
        - Software Statements
        - Authority Claims
        - Software Authority Claims
        - Public
        - Closed
      responses:
        '200':
          $ref: '#/components/responses/SoftwareAuthorityClaim'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '406':
          $ref: '#/components/responses/NotAcceptable'
        '500':
          $ref: '#/components/responses/InternalServerError'
        '502':
          $ref: '#/components/responses/BadGateway'
        '504':
          $ref: '#/components/responses/UpstreamTimeout'
        '429':
          $ref: '#/components/responses/TooManyRequests'

      security:
        - authorizer: [ ]
        - oAuth:
            - directory:website
            - directory:software
      x-amazon-apigateway-integration:
        uri: "${organisation_read_arn}"
        passthroughBehavior: "when_no_match"
        httpMethod: "POST"
        timeoutInMillis: 15000
        type: "aws_proxy"

    put:
      summary: Update an authority claim for the given Id
      parameters:
        - $ref: "#/components/parameters/x-fapi-auth-date"
        - $ref: "#/components/parameters/x-fapi-customer-ip-address"
        - $ref: "#/components/parameters/x-fapi-interaction-id"
        - $ref: "#/components/parameters/x-customer-user-agent"
      description: You can edit the claim till an SSA is generated on the software statement. Once generated, you cannot deactivate the claim. If parent software statement is revoked/deactivated then this claim cannot be activated
      operationId: updateOrganisationSoftwareStatementAuthorityClaimById
      tags:
        - Organisations
        - Software Statements
        - Authority Claims
        - Software Authority Claims
        - OpenID Provider
        - Public
        - Closed
      requestBody:
        $ref: '#/components/requestBodies/SoftwareAuthorityClaimUpdateRequest'
      responses:
        '204':
          $ref: '#/components/responses/NoContent'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '406':
          $ref: '#/components/responses/NotAcceptable'
        '500':
          $ref: '#/components/responses/InternalServerError'
        '502':
          $ref: '#/components/responses/BadGateway'
        '504':
          $ref: '#/components/responses/UpstreamTimeout'
        '429':
          $ref: '#/components/responses/TooManyRequests'

      security:
        - authorizer: [ ]
        - oAuth:
            - directory:website
      x-amazon-apigateway-integration:
        uri: "${organisation_write_arn}"
        passthroughBehavior: "when_no_match"
        httpMethod: "POST"
        timeoutInMillis: 29000
        type: "aws_proxy"

  '/organisations/{OrganisationId}/softwarestatements/{SoftwareStatementId}/certificates':
    parameters:
      - $ref: '#/components/parameters/OrganisationId'
      - $ref: '#/components/parameters/SoftwareStatementId'
      - $ref: "#/components/parameters/x-fapi-auth-date"
      - $ref: "#/components/parameters/x-fapi-customer-ip-address"
      - $ref: "#/components/parameters/x-fapi-interaction-id"
      - $ref: "#/components/parameters/x-customer-user-agent"
      - $ref: "#/components/parameters/PageNumber"
      - $ref: "#/components/parameters/PageSize"
      - $ref: "#/components/parameters/PageSort"
      - in: query
        name: showOrgLevelCertificates
        schema:
          type: boolean
          default: false
        description: Will return the organisation level certificates as well
    get:
      summary: Get certificates for the given software statement
      description: gets all certificates related to the software statement
      operationId: getOrganisationSoftwareStatementCertificates
      tags:
        - Organisations
        - Software Statements
        - Certificates
        - Public
        - Closed

      responses:
        '200':
          $ref: '#/components/responses/CertificatesOrKeys'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '406':
          $ref: '#/components/responses/NotAcceptable'
        '500':
          $ref: '#/components/responses/InternalServerError'
        '502':
          $ref: '#/components/responses/BadGateway'
        '504':
          $ref: '#/components/responses/UpstreamTimeout'
        '429':
          $ref: '#/components/responses/TooManyRequests'

      security:
        - authorizer: [ ]
        - oAuth:
            - directory:website
            - directory:software
      x-amazon-apigateway-integration:
        uri: "${organisation_read_arn}"
        passthroughBehavior: "when_no_match"
        httpMethod: "POST"
        timeoutInMillis: 29000
        type: "aws_proxy"

  '/organisations/{OrganisationId}/softwarestatements/{SoftwareStatementId}/certificates/{SoftwareStatementCertificateOrKeyType}':
    parameters:
      - $ref: '#/components/parameters/OrganisationId'
      - $ref: '#/components/parameters/SoftwareStatementId'
      - $ref: '#/components/parameters/SoftwareStatementCertificateOrKeyType'
      - $ref: "#/components/parameters/x-fapi-auth-date"
      - $ref: "#/components/parameters/x-fapi-customer-ip-address"
      - $ref: "#/components/parameters/x-fapi-interaction-id"
      - $ref: "#/components/parameters/x-customer-user-agent"
    post:
      summary: Add a key or create a new certificate for the given software statement
      description: creates a new key or certificate on the specified software statement
      operationId: createOrganisationSoftwareStatementCertificate
      tags:
        - Organisations
        - Software Statements
        - Certificates
        - Public
        - Closed
      requestBody:
        $ref: '#/components/requestBodies/CSROrKey'

      responses:
        '201':
          $ref: '#/components/responses/CertificatesOrKey'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '500':
          $ref: '#/components/responses/InternalServerError'
        '502':
          $ref: '#/components/responses/BadGateway'
        '504':
          $ref: '#/components/responses/UpstreamTimeout'
        '429':
          $ref: '#/components/responses/TooManyRequests'

      security:
        - authorizer: [ ]
        - oAuth:
            - directory:website
            - directory:software
      x-amazon-apigateway-integration:
        uri: "${organisation_write_arn}"
        passthroughBehavior: "when_no_match"
        httpMethod: "POST"
        timeoutInMillis: 29000
        type: "aws_proxy"

  '/organisations/{OrganisationId}/softwarestatements/{SoftwareStatementId}/certificates/{SoftwareStatementCertificateOrKeyType}/{CertificateOrKeyId}':
    parameters:
      - $ref: '#/components/parameters/OrganisationId'
      - $ref: '#/components/parameters/SoftwareStatementId'
      - $ref: '#/components/parameters/SoftwareStatementCertificateOrKeyType'
      - $ref: '#/components/parameters/CertificateOrKeyId'
      - $ref: "#/components/parameters/x-fapi-auth-date"
      - $ref: "#/components/parameters/x-fapi-customer-ip-address"
      - $ref: "#/components/parameters/x-fapi-interaction-id"
      - $ref: "#/components/parameters/x-customer-user-agent"

    get:
      summary: Get the certificate of the given type and ID for the given software statement
      description: gets a specific certificate attached to a software statement
      operationId: getOrganisationSoftwareStatementCertificateById
      tags:
        - Organisations
        - Software Statements
        - Certificates
        - Public
        - Closed

      responses:
        '200':
          $ref: '#/components/responses/CertificatesOrKey'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '406':
          $ref: '#/components/responses/NotAcceptable'
        '500':
          $ref: '#/components/responses/InternalServerError'
        '502':
          $ref: '#/components/responses/BadGateway'
        '504':
          $ref: '#/components/responses/UpstreamTimeout'
        '429':
          $ref: '#/components/responses/TooManyRequests'

      security:
        - authorizer: [ ]
        - oAuth:
            - directory:website
            - directory:software
      x-amazon-apigateway-integration:
        uri: "${organisation_read_arn}"
        passthroughBehavior: "when_no_match"
        httpMethod: "POST"
        timeoutInMillis: 29000
        type: "aws_proxy"

    put:
      summary: Update a software statement certificate with the given CertificateOrKeyId e.g. revoke reason
      description: revokes a software statement certificate with a specified reason
      parameters:
        - $ref: "#/components/parameters/x-fapi-auth-date"
        - $ref: "#/components/parameters/x-fapi-customer-ip-address"
        - $ref: "#/components/parameters/x-fapi-interaction-id"
        - $ref: "#/components/parameters/x-customer-user-agent"
      operationId: updateOrganisationSoftwareStatementCertificateById
      tags:
        - Organisations
        - Software Statements
        - Certificates
        - Public
        - Closed
      requestBody:
        $ref: '#/components/requestBodies/AmendCertificateRequest'

      responses:
        '200':
          $ref: '#/components/responses/CertificatesOrKey'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '406':
          $ref: '#/components/responses/NotAcceptable'
        '500':
          $ref: '#/components/responses/InternalServerError'
        '502':
          $ref: '#/components/responses/BadGateway'
        '504':
          $ref: '#/components/responses/UpstreamTimeout'
        '429':
          $ref: '#/components/responses/TooManyRequests'

      security:
        - authorizer: [ ]
        - oAuth:
            - directory:website
            - directory:software
      x-amazon-apigateway-integration:
        uri: "${organisation_write_arn}"
        passthroughBehavior: "when_no_match"
        httpMethod: "POST"
        timeoutInMillis: 29000
        type: "aws_proxy"

  '/organisations/{OrganisationId}/softwarestatements/{SoftwareStatementId}/certifications':
    parameters:
      - $ref: '#/components/parameters/OrganisationId'
      - $ref: '#/components/parameters/SoftwareStatementId'
      - $ref: "#/components/parameters/x-fapi-auth-date"
      - $ref: "#/components/parameters/x-fapi-customer-ip-address"
      - $ref: "#/components/parameters/x-fapi-interaction-id"
      - $ref: "#/components/parameters/x-customer-user-agent"
    get:
      summary: Get all certifications for given Software Statement.
      description: get all certifications for the software statement
      parameters:
        - $ref: "#/components/parameters/PageNumber"
        - $ref: "#/components/parameters/PageSize"
        - $ref: "#/components/parameters/PageSort"
      operationId: getOrganisationSoftwareStatementCertifications
      tags:
        - Organisations
        - Software Statements
        - Certifications
        - Public
      responses:
        '200':
          $ref: '#/components/responses/SoftwareStatementCertifications'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/InternalServerError'
        '502':
          $ref: '#/components/responses/BadGateway'
        '504':
          $ref: '#/components/responses/UpstreamTimeout'
        '429':
          $ref: '#/components/responses/TooManyRequests'

      security:
        - authorizer: [ ]
        - oAuth:
            - directory:website
            - directory:software
      x-amazon-apigateway-integration:
        uri: "${organisation_read_arn}"
        passthroughBehavior: "when_no_match"
        httpMethod: "POST"
        timeoutInMillis: 29000
        type: "aws_proxy"

    post:
      summary: Post a certification for the given Software Statement
      description: creates a new certification record for the software statement
      parameters:
        - $ref: "#/components/parameters/x-fapi-auth-date"
        - $ref: "#/components/parameters/x-fapi-customer-ip-address"
        - $ref: "#/components/parameters/x-fapi-interaction-id"
        - $ref: "#/components/parameters/x-customer-user-agent"
      operationId: createOrganisationSoftwareStatementCertification
      tags:
        - Organisations
        - Software Statements
        - Certifications
        - Public
      requestBody:
        $ref: '#/components/requestBodies/SoftwareStatementCertificationRequest'
      responses:
        '201':
          $ref: '#/components/responses/SoftwareStatementCertification'
        '400':
          $ref: '#/components/responses/BadRequest'
        '403':
          $ref: '#/components/responses/Forbidden'
        '409':
          $ref: '#/components/responses/Conflict'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '500':
          $ref: '#/components/responses/InternalServerError'
        '502':
          $ref: '#/components/responses/BadGateway'
        '504':
          $ref: '#/components/responses/UpstreamTimeout'
        '429':
          $ref: '#/components/responses/TooManyRequests'

      security:
        - authorizer: [ ]
        - oAuth:
            - directory:website
      x-amazon-apigateway-integration:
        uri: "${organisation_write_arn}"
        passthroughBehavior: "when_no_match"
        httpMethod: "POST"
        timeoutInMillis: 29000
        type: "aws_proxy"

  '/organisations/{OrganisationId}/softwarestatements/{SoftwareStatementId}/certifications/{SoftwareStatementCertificationId}':
    parameters:
      - $ref: '#/components/parameters/OrganisationId'
      - $ref: '#/components/parameters/SoftwareStatementId'
      - $ref: '#/components/parameters/SoftwareStatementCertificationId'
      - $ref: "#/components/parameters/x-fapi-auth-date"
      - $ref: "#/components/parameters/x-fapi-customer-ip-address"
      - $ref: "#/components/parameters/x-fapi-interaction-id"
      - $ref: "#/components/parameters/x-customer-user-agent"
    get:
      summary: Get a certification by Id
      description: Get a certification by Id
      operationId: getOrganisationSoftwareStatementCertificationById
      tags:
        - Organisations
        - Software Statements
        - Certifications
        - Public
      responses:
        '200':
          $ref: '#/components/responses/SoftwareStatementCertification'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/InternalServerError'
        '502':
          $ref: '#/components/responses/BadGateway'
        '504':
          $ref: '#/components/responses/UpstreamTimeout'
        '429':
          $ref: '#/components/responses/TooManyRequests'

      security:
        - authorizer: [ ]
        - oAuth:
            - directory:website
            - directory:software
      x-amazon-apigateway-integration:
        uri: "${organisation_read_arn}"
        passthroughBehavior: "when_no_match"
        httpMethod: "POST"
        timeoutInMillis: 29000
        type: "aws_proxy"

    put:
      summary: Update the given certification
      description: updates the state of a software statement certification
      operationId: updateOrganisationSoftwareStatementCertificationById
      tags:
        - Organisations
        - Software Statements
        - Certifications
        - Public
      requestBody:
        $ref: '#/components/requestBodies/SoftwareStatementCertificationRequest'
      responses:
        '200':
          $ref: '#/components/responses/SoftwareStatementCertification'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/InternalServerError'
        '502':
          $ref: '#/components/responses/BadGateway'
        '504':
          $ref: '#/components/responses/UpstreamTimeout'
        '429':
          $ref: '#/components/responses/TooManyRequests'

      security:
        - authorizer: [ ]
        - oAuth:
            - directory:website
      x-amazon-apigateway-integration:
        uri: "${organisation_write_arn}"
        passthroughBehavior: "when_no_match"
        httpMethod: "POST"
        timeoutInMillis: 29000
        type: "aws_proxy"

    delete:
      summary: Remove a certification with the given certification Id
      description: deletes a software statement certification
      parameters:
        - $ref: "#/components/parameters/x-fapi-auth-date"
        - $ref: "#/components/parameters/x-fapi-customer-ip-address"
        - $ref: "#/components/parameters/x-fapi-interaction-id"
        - $ref: "#/components/parameters/x-customer-user-agent"
      operationId: deleteOrganisationSoftwareStatementCertificationById
      tags:
        - Organisations
        - Software Statements
        - Certifications
        - Public
      responses:
        '204':
          $ref: '#/components/responses/NoContent'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/InternalServerError'
        '502':
          $ref: '#/components/responses/BadGateway'
        '504':
          $ref: '#/components/responses/UpstreamTimeout'
        '429':
          $ref: '#/components/responses/TooManyRequests'

      security:
        - authorizer: [ ]
        - oAuth:
            - directory:website
      x-amazon-apigateway-integration:
        uri: "${organisation_write_arn}"
        passthroughBehavior: "when_no_match"
        httpMethod: "POST"
        timeoutInMillis: 29000
        type: "aws_proxy"

  '/organisations/{OrganisationId}/softwarestatements/{SoftwareStatementId}/assertion':
    parameters:
      - $ref: '#/components/parameters/OrganisationId'
      - $ref: '#/components/parameters/SoftwareStatementId'
      - $ref: "#/components/parameters/x-fapi-auth-date"
      - $ref: "#/components/parameters/x-fapi-customer-ip-address"
      - $ref: "#/components/parameters/x-fapi-interaction-id"
      - $ref: "#/components/parameters/x-customer-user-agent"
    get:
      summary:
        Get a Software Statement Assertion for the given SoftwareStatementID.
      description: |
        The response body is a signed JWT and the values found in the header and the payload of the SSA are specified below
        # Terminology
          This specification uses the terms "access token", "authorization code", "authorization endpoint", "authorization grant", "authorization server", "client", "client identifier", "client secret", "grant type", "protected resource", "redirection URI", "refresh token", "resource owner", "resource server", "response type", and "token endpoint" defined by OAuth 2.0 [RFC6749] and uses the term "Claim" defined by JSON Web Token (JWT) [RFC7519].
          * __Organisation__ -- An organisation managing customer accounts (and operating banking APIs).
          * __Primary Technical Contact__ -- The person at the org who creates an SSA and invokes a registration mechanism. This is an example of an [RFC7591] Client Developer.
          * __Organisation ID__ -- The unique identifier for each directory participant.
          * __Role__ -- An implementation of an authority; acts as an Identity Provider, certificate authority, and registry governing the participants in the UK API scheme.
          * __Registration Endpoint__ -- OAuth 2.0 & [RFC7591] compliant endpoint
          * __Software Statement Assertion (SSA)__ -- An implementation of an [RFC7591] software statement, signed by the Directory.
          * __Trusted Third Party__ -- An organization working to initiate payments or consume account information.
          * __Client Software__ -- software implementing an OAuth2 client, interacting with an org's registration endpoint.
        # Software Statement Assertion (SSA)
          The SSA is a JSON Web Token (JWT) containing client metadata about an instance of client software. The JWT is issued and signed by the Directory.
        ## SSA Payload
          The payload of the SSA MUST be a compliant software statement according to [RFC7591]. The SSA MUST also be a compliant JWT according to [RFC7519]. The following metadata profiles the metadata in [RFC7591] and [RFC7519]:
          | Metadata | Description | Source Specification |
          |----------|-------------|----------------------|
          |`softwareid`|Unique Identifier for Client Software|[RFC7591]|
          |`iss`|SSA Issuer|[RFC7519]|
          |`iat`|Time SSA issued|[RFC7519]|
          |`jti`|JWT ID|[RFC7519]|
          The following software metadata is additionally defined for this profile:
          |Metadata |Description |Field Size |Default values |
          |---------|------------|-----------|---------------|
          |`SoftwareClientId`|The Client ID Registered in Directory services used to access directory resources|Base62 GUID (22 chars)| |
          |`SoftwareClientDescription`|Human-readable detailed description of the client|Max256Text| |
          |`SoftwareClientName`|Human-readable Software statement Name|Max40Text| |
          |`SoftwareClientUri`|The website or resource root uri|Max256Text| |
          |`SoftwareVersion`|The version number of the software should an org choose to register and / or maintain it|decimal| |
          |`SoftwareEnvironment`|Requested additional field to avoid certificate check|Max256Text| |
          |`softwareJwksUri`|Contains all active signing and network certs for the software|Max256Text| |
          |`SoftwareJwksRevokedUri`|Contains all revoked signing and network certs for the software|Max256Text| |
          |`SoftwareLogoUri`|Link to the Org logo. |Max256Text| |
          |`SoftwareMode`|Org Requested additional field to indicate that this software is `Test` or `Live` the default is `Live`. Impact and support for `Test` software is up to the Org.|Max40Text| |
          |`SoftwareOnBehalfOf`|A reference to fourth party organisation resource on the Directory if the registering app is acting on behalf of another.|Max40Text| |
          |`SoftwarePolicyUri`|A link to the software's policy page|Max256Text| |
          |`SoftwareRedirectUris`|Registered client callback endpoints as registered with RTS|A string array of Max256Text items|
          |`SoftwareAuthorityClaims`|A multi value list of roles that this software is authorized to perform.|A string array of authority claims items| |
          |`SoftwareTosUri`|A link to the software's terms of service page|Max256Text| |
          The following Organisational metadata is defined for this profile:
          |Metadata |Description |Field Size | Default values |
          |---------|------------|-----------|----------------|
          |`OrganisationAuthorityClaims`|Claims object for the organisation detailing all the authorisation roles| |
          |`OrgStatus`|Included to cater for voluntary withdrawal from directory scenarios|`Active`, `Revoked`, or `Withdrawn`| |
          |`OrgId`|The Unique Organisation Id.|Max35Text| |
          |`OrgName`|Legal Entity Identifier or other known organisation name|Max140Text| |
          |`OrgContacts`|JSON array of objects containing a triplet of name, email, and phone number|Each item Max256Text| |
          |`OrgJwksUri`|Contains all active signing and network certs for the organisation|Max256Text| |
          |`OrgJwksRevokedUri`|Contains all revoked signing and network certs for the organisation|Max256Text| |
        ## SSA header
          The SSA header MUST comply with [RFC7519].
          |Metadata |Description |Comments |
          |---------|------------|---------|
          |`typ`|MUST be set to `JWT`| |
          |`alg`|MUST be set to `ES256` or `PS256` note the majority of ecosystems use RSA keys so support for PS256 is critical| |
          |`kid`|The kid will be kept the same as the `x5t` parameter. (X.509 Certificate SHA-1 Thumbprint) of the signing certificate.| |
          ### Example SSA
          The elements defined in the software statement will consist of the following values.
          *Note that there are inconsistent applications of booleans or "Active" strings in the current data model.*
          *Note that there are inconsistent applications of status flags case sensitivity.*
          *The attributes required to be displayed by Orgs.*
        ```
        {
          "typ": "JWT",
          "alg": "ES256",
          "kid": "ABCD1234"
        }
        {
          "iss": "Example Ltd",
          "iat": 1492756331,
          "jti": "id12345685439487678",
          "SoftwareEnvironment": "production",
          "SoftwareMode": "live",
          "SoftwareId": "65d1f27c-4aea-4549-9c21-60e495a7a86f",
          "SoftwareClientId": "xClient Unique ID",
          "SoftwareClientName": "Amazon Prime Movies",
          "SoftwareClientDescription": "Amazon Prime Movies is a moving streaming service",
          "SoftwareVersion": "2.2",
          "SoftwareClientUri": "https://prime.amazon.com",
          "SoftwareRedirectUris": [
            "https://prime.amazon.com/cb",
            "https://prime.amazon.co.uk/cb"
          ],
          "SoftwareAuthorityClaims": {
            "AuthorisationDomains": [
              {
                "AuthorisationDomain": "PDS2",
                "Roles": [
                  {
                    "Role": "ASPSP",
                    "Status": "Active"
                  }
                ]
              },
              {
                "AuthorisationDomain": "Pensions",
                "Roles": [
                  {
                    "Role": "TPP",
                    "Status": "Active"
                  },
                  {
                    "Role": "ASPSP",
                    "Status": "Active"
                  }
                ]
              }
            ]
          },
          "OrganisationAuthorityClaims": [
            {
              "AuthorityId": "123",
              "RegistrationId": "111111",
              "AuthorisationDomains": [
                {
                  "AuthorisationDomain": "PDS2",
                  "Roles": [
                    {
                      "Role": "ASPSP",
                      "Authorisations": [
                        {
                          "Status": "Active",
                          "MemberState": "GB"
                        },
                        {
                          "Status": "Active",
                          "MemberState": "IL"
                        }
                      ]
                    },
                    {
                      "Role": "AISP",
                      "Authorisations": [
                        {
                          "Status": "Active",
                          "MemberState": "GB"
                        },
                        {
                          "Status": "Active",
                          "MemberState": "IL"
                        }
                      ]
                    }
                  ]
                },
                {
                  "AuthorisationDomain": "Pensions",
                  "Roles": [
                    {
                      "Role": "ASPSP",
                      "Authorisations": [
                        {
                          "Status": "Active",
                          "MemberState": "GB"
                        },
                        {
                          "Status": "Active",
                          "MemberState": "IL"
                        }
                      ]
                    },
                    {
                      "Role": "TPP",
                      "Authorisations": [
                        {
                          "Status": "Active",
                          "MemberState": "GB"
                        },
                        {
                          "Status": "Active",
                          "MemberState": "IL"
                        }
                      ]
                    }
                  ]
                }
              ]
            }
          ],
          "SoftwareLogoUri": "https://mycompanyprofile.com/logo.png",
          "OrgStatus": "Active",
          "OrgId": "My Company's ID",
          "OrgName": "Registered Name",
          "OrgContacts": [
            {
              "name": "contact name",
              "email": "contact@contact.com",
              "phone": "+447890130558",
              "type": "business"
            },
            {
              "name": "contact name",
              "email": "contact@contact.com",
              "phone": "+447890130558",
              "type": "technical"
            }
          ],
          "OrgJwksUri": "https://jwks.raidiam.ts.uk/org_id/org_id.jkws",
          "OrgJwksRevokedUri": "https://jwks.raidiam.ts.uk/org_id/revoked/org_id.jkws",
          "SoftwareJwksUri": "https://jwks.raidiam.ts.uk/org_id/software_id.jkws",
          "SoftwareJwksRevokedUri": "https://jwks.raidiam.ts.uk/org_id/revoked/software_id.jkws",
          "SoftwarePolicyUri": "https://myapp.com/policy.html",
          "SoftwareTosUri": "https://myapp.com/tos.html",
          "SoftwareOnBehalfOf": "A Mediator Ltd"
        }
        {
          Signature
        }
        ```
        # Automated Client Registration
        An organisation MAY use automated client registration to submit an SSA in exchange for client credentials for use as a client against an OAuth 2.0 Authorization Server. It is RECOMMENDED for Orgs to support the automated client registration mechanism. A large number of claims that OpenID Connect OPs could support as part of the RFC7591 request are detailed [https://openid.net/specs/openid-connect-registration-1_0.html#ClientMetadata](https://openid.net/specs/openid-connect-registration-1_0.html#ClientMetadata) and should be followed if not explicitly referenced in the Software Statement Assertion claim set.
        ## Request Validation
        Prior to issuing a client registration response, the Orgs MUST perform the following checks
        * The Org SHOULD check whether the initiated TLS connection is the same Org as listed in the SSA.
        * In the case where a gateway or other piece of infrastructure pre-terminates the MATLS channel in front of the registration endpoint, the certificate used to initiate the connection or some part of that certificate (such as DN & Issuer) SHOULD be made available to the Org for validation against the claims in the SSA.
        * The registration request MUST be signed with a key contained in the JWKS referenced in the SSA included with the request. This ensures that a holder-of-key proof-of-possession is performed proving that the app was the originally intended recipient of the SSA when the directory services issued it.
        * The SSA MUST be validated according to [RFC7519], including validation of the signature and validity window.
        JWT signature must be validated, this involves retrieving the jwks keyset for both the directory and the app. The keystore location will be published as part of the directory specification, The App's will be included in the software statement.
        ### SSA Lifetime
        The SSA's Lifetime / Validity period is not defined by RTS. Orgs in the directory ecosystem are required to implement pragmatic time ranges in which to accept an SSA. For example, an Org that has implemented Dynamic Client Registration may choose to accept SSA's that were issued no earlier than 1 minute prior to their presentation however Orgs that only support manual registration may need to accept SSAs that were issued 30 minutes prior as the elapsed time period between generation and use between these two flows is expected to differ significantly.
      operationId: getOrganisationSoftwareStatementAssertion
      tags:
        - Organisations
        - Software Statements
        - Assertion
        - Public
        - Closed
      responses:
        '200':
          $ref: '#/components/responses/SoftwareStatementAssertion'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '500':
          $ref: '#/components/responses/InternalServerError'
        '502':
          $ref: '#/components/responses/BadGateway'
        '504':
          $ref: '#/components/responses/UpstreamTimeout'
        '429':
          $ref: '#/components/responses/TooManyRequests'

      security:
        - authorizer: [ ]
        - oAuth:
            - directory:website
            - directory:software
      x-amazon-apigateway-integration:
        uri: "${organisation_write_arn}"
        passthroughBehavior: "when_no_match"
        httpMethod: "POST"
        timeoutInMillis: 29000
        type: "aws_proxy"

  '/organisations/{OrganisationId}/softwarestatements/{SoftwareStatementId}/custom-claims':
    parameters:
      - $ref: '#/components/parameters/OrganisationId'
      - $ref: '#/components/parameters/SoftwareStatementId'
      - $ref: "#/components/parameters/x-fapi-auth-date"
      - $ref: "#/components/parameters/x-fapi-customer-ip-address"
      - $ref: "#/components/parameters/x-fapi-interaction-id"
      - $ref: "#/components/parameters/x-customer-user-agent"
    get:
      summary: Get a list of custom claims for the given Software Statement.
      description: Retrieve a list of custom claims associated with a specific software statement.
      operationId: getOrganisationSoftwareStatementCustomClaims
      tags:
        - Public
      parameters:
        - $ref: "#/components/parameters/PageNumber"
        - $ref: "#/components/parameters/PageSize"
        - $ref: "#/components/parameters/PageSort"
      responses:
        '200':
          $ref: '#/components/responses/CustomClaimList'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '406':
          $ref: '#/components/responses/NotAcceptable'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '500':
          $ref: '#/components/responses/InternalServerError'
        '502':
          $ref: '#/components/responses/BadGateway'
        '504':
          $ref: '#/components/responses/UpstreamTimeout'
      security:
        - authorizer: [ ]
        - oAuth:
            - directory:software
            - directory:website
      x-amazon-apigateway-integration:
        uri: "${organisation_read_arn}"
        passthroughBehavior: "when_no_match"
        httpMethod: "POST"
        timeoutInMillis: 29000
        type: "aws_proxy"
    post:
      summary: Create a custom claim for the given Software Statement.
      description: Create a new custom claim for a specific software statement.
      operationId: createOrganisationSoftwareStatementCustomClaim
      tags:
        - Public
      requestBody:
        $ref: '#/components/requestBodies/CustomClaimCreationRequest'
      responses:
        '201':
          $ref: '#/components/responses/CustomClaimObject'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '406':
          $ref: '#/components/responses/NotAcceptable'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '500':
          $ref: '#/components/responses/InternalServerError'
        '502':
          $ref: '#/components/responses/BadGateway'
        '504':
          $ref: '#/components/responses/UpstreamTimeout'
      security:
        - authorizer: [ ]
        - oAuth:
            - directory:software
            - directory:website
      x-amazon-apigateway-integration:
        uri: "${organisation_write_arn}"
        passthroughBehavior: "when_no_match"
        httpMethod: "POST"
        timeoutInMillis: 29000
        type: "aws_proxy"

  '/organisations/{OrganisationId}/softwarestatements/{SoftwareStatementId}/custom-claims/{CustomClaimID}':
    parameters:
      - $ref: '#/components/parameters/OrganisationId'
      - $ref: '#/components/parameters/SoftwareStatementId'
      - $ref: '#/components/parameters/CustomClaimID'
      - $ref: "#/components/parameters/x-fapi-auth-date"
      - $ref: "#/components/parameters/x-fapi-customer-ip-address"
      - $ref: "#/components/parameters/x-fapi-interaction-id"
      - $ref: "#/components/parameters/x-customer-user-agent"
    get:
      summary: Get a custom claim for the given Software Statement.
      description: Retrieve a specific custom claim associated with a specific software statement.
      operationId: getOrganisationSoftwareStatementCustomClaim
      tags:
        - Public
      responses:
        '200':
          $ref: '#/components/responses/CustomClaimObject'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '406':
          $ref: '#/components/responses/NotAcceptable'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '500':
          $ref: '#/components/responses/InternalServerError'
        '502':
          $ref: '#/components/responses/BadGateway'
        '504':
          $ref: '#/components/responses/UpstreamTimeout'
      security:
        - authorizer: [ ]
        - oAuth:
            - directory:software
            - directory:website
      x-amazon-apigateway-integration:
        uri: "${organisation_read_arn}"
        passthroughBehavior: "when_no_match"
        httpMethod: "POST"
        timeoutInMillis: 29000
        type: "aws_proxy"
    put:
      summary: Update a custom claim for the given Software Statement.
      description: Modify an existing custom claim for a specific software statement.
      operationId: updateOrganisationSoftwareStatementCustomClaim
      tags:
        - Public
      requestBody:
        $ref: '#/components/requestBodies/CustomClaimUpdateRequest'
      responses:
        '200':
          $ref: '#/components/responses/CustomClaimObject'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '406':
          $ref: '#/components/responses/NotAcceptable'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '500':
          $ref: '#/components/responses/InternalServerError'
        '502':
          $ref: '#/components/responses/BadGateway'
        '504':
          $ref: '#/components/responses/UpstreamTimeout'
      security:
        - authorizer: [ ]
        - oAuth:
            - directory:software
            - directory:website
      x-amazon-apigateway-integration:
        uri: "${organisation_write_arn}"
        passthroughBehavior: "when_no_match"
        httpMethod: "POST"
        timeoutInMillis: 29000
        type: "aws_proxy"
    delete:
      summary: Delete a custom claim for the given Software Statement.
      description: Remove a custom claim associated with a specific software statement.
      operationId: deleteOrganisationSoftwareStatementCustomClaim
      tags:
        - Public
      responses:
        '204':
          $ref: '#/components/responses/NoContent'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '406':
          $ref: '#/components/responses/NotAcceptable'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '500':
          $ref: '#/components/responses/InternalServerError'
        '502':
          $ref: '#/components/responses/BadGateway'
        '504':
          $ref: '#/components/responses/UpstreamTimeout'
      security:
        - authorizer: [ ]
        - oAuth:
            - directory:software
            - directory:website
      x-amazon-apigateway-integration:
        uri: "${organisation_write_arn}"
        passthroughBehavior: "when_no_match"
        httpMethod: "POST"
        timeoutInMillis: 29000
        type: "aws_proxy"

  '/organisations/{OrganisationId}/softwarestatements/{SoftwareStatementId}/metadata':
    parameters:
      - $ref: '#/components/parameters/OrganisationId'
      - $ref: '#/components/parameters/SoftwareStatementId'
      - $ref: "#/components/parameters/x-fapi-auth-date"
      - $ref: "#/components/parameters/x-fapi-customer-ip-address"
      - $ref: "#/components/parameters/x-fapi-interaction-id"
      - $ref: "#/components/parameters/x-customer-user-agent"
    get:
      summary: Get all metadata associated with a software statement
      description: get all metadata from the roles attached to a software statement
      operationId: getOrganisationSoftwareStatementMetadata
      tags:
        - Organisations
        - Software Statements
        - Authority Claims
        - Authorisation Domain Role Metadata
        - Software Statement Metadata
        - Public
        - Closed
      parameters:
        - in: query
          name: type
          schema:
            type: string
            default: ""
          required: false
          description: Get all metadata of a specific type
        - $ref: "#/components/parameters/PageNumber"
        - $ref: "#/components/parameters/PageSize"
        - $ref: "#/components/parameters/PageSort"
      responses:
        '200':
          $ref: '#/components/responses/MetadataList'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '406':
          $ref: '#/components/responses/NotAcceptable'
        '500':
          $ref: '#/components/responses/InternalServerError'
        '502':
          $ref: '#/components/responses/BadGateway'
        '504':
          $ref: '#/components/responses/UpstreamTimeout'
        '429':
          $ref: '#/components/responses/TooManyRequests'
      security:
        - authorizer: [ ]
        - oAuth:
            - directory:software
            - directory:website
      x-amazon-apigateway-integration:
        uri: "${organisation_read_arn}"
        passthroughBehavior: "when_no_match"
        httpMethod: "POST"
        timeoutInMillis: 29000
        type: "aws_proxy"

  '/organisations/{OrganisationId}/certificates':
    parameters:
      - $ref: '#/components/parameters/OrganisationId'
      - $ref: "#/components/parameters/x-fapi-auth-date"
      - $ref: "#/components/parameters/x-fapi-customer-ip-address"
      - $ref: "#/components/parameters/x-fapi-interaction-id"
      - $ref: "#/components/parameters/x-customer-user-agent"
      - $ref: "#/components/parameters/PageNumber"
      - $ref: "#/components/parameters/PageSize"
      - $ref: "#/components/parameters/PageSort"
    get:
      summary: Get the certificates for the given organisation
      description: get all certificates attached to the specified organisation
      operationId: getOrganisationCertificates
      tags:
        - Organisations
        - Certificates
        - Public
      responses:
        '200':
          $ref: '#/components/responses/CertificatesOrKeys'
        '400':
          $ref: '#/components/responses/BadRequest'
        '404':
          $ref: '#/components/responses/NotFound'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '406':
          $ref: '#/components/responses/NotAcceptable'
        '500':
          $ref: '#/components/responses/InternalServerError'
        '502':
          $ref: '#/components/responses/BadGateway'
        '504':
          $ref: '#/components/responses/UpstreamTimeout'
        '429':
          $ref: '#/components/responses/TooManyRequests'
      security:
        - authorizer: [ ]
        - oAuth:
            - directory:website
            - directory:software
      x-amazon-apigateway-integration:
        uri: "${organisation_read_arn}"
        passthroughBehavior: "when_no_match"
        httpMethod: "POST"
        timeoutInMillis: 29000
        type: "aws_proxy"

  '/organisations/{OrganisationId}/certificates/{OrganisationCertificateType}':
    parameters:
      - $ref: '#/components/parameters/OrganisationId'
      - $ref: '#/components/parameters/OrganisationCertificateType'
      - $ref: "#/components/parameters/x-fapi-auth-date"
      - $ref: "#/components/parameters/x-fapi-customer-ip-address"
      - $ref: "#/components/parameters/x-fapi-interaction-id"
      - $ref: "#/components/parameters/x-customer-user-agent"
    post:
      summary: Store or create a new certificate of the given OrganisationCertificateType for the given organisation
      description: create an organisation certificate
      operationId: createOrganisationCertificate
      tags:
        - Organisations
        - Certificates
        - Public

      requestBody:
        $ref: '#/components/requestBodies/CSROrKey'

      responses:
        '201':
          $ref: '#/components/responses/CertificatesOrKey'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '500':
          $ref: '#/components/responses/InternalServerError'
        '502':
          $ref: '#/components/responses/BadGateway'
        '504':
          $ref: '#/components/responses/UpstreamTimeout'
        '429':
          $ref: '#/components/responses/TooManyRequests'
      security:
        - authorizer: [ ]
        - oAuth:
            - directory:website
      x-amazon-apigateway-integration:
        uri: "${organisation_write_arn}"
        passthroughBehavior: "when_no_match"
        httpMethod: "POST"
        timeoutInMillis: 29000
        type: "aws_proxy"

    get:
      summary: Get the certificates of the given OrganisationCertificateType for the given organisation
      description: get all organisation certificates of a specific type
      parameters:
        - $ref: "#/components/parameters/PageNumber"
        - $ref: "#/components/parameters/PageSize"
        - $ref: "#/components/parameters/PageSort"
      operationId: getOrganisationCertificatesByType
      tags:
        - Organisations
        - Certificates
        - Public

      responses:
        '200':
          $ref: '#/components/responses/CertificatesOrKeys'
        '400':
          $ref: '#/components/responses/BadRequest'
        '404':
          $ref: '#/components/responses/NotFound'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '406':
          $ref: '#/components/responses/NotAcceptable'
        '500':
          $ref: '#/components/responses/InternalServerError'
        '502':
          $ref: '#/components/responses/BadGateway'
        '504':
          $ref: '#/components/responses/UpstreamTimeout'
        '429':
          $ref: '#/components/responses/TooManyRequests'
      security:
        - authorizer: [ ]
        - oAuth:
            - directory:website
            - directory:software
      x-amazon-apigateway-integration:
        uri: "${organisation_read_arn}"
        passthroughBehavior: "when_no_match"
        httpMethod: "POST"
        timeoutInMillis: 29000
        type: "aws_proxy"

  '/organisations/{OrganisationId}/certificates/kid/{CertificateOrKeyId}':
    parameters:
      - $ref: '#/components/parameters/OrganisationId'
      - $ref: '#/components/parameters/CertificateOrKeyId'
      - $ref: "#/components/parameters/x-fapi-auth-date"
      - $ref: "#/components/parameters/x-fapi-customer-ip-address"
      - $ref: "#/components/parameters/x-fapi-interaction-id"
      - $ref: "#/components/parameters/x-customer-user-agent"
    get:
      summary: Retrieve a certificate with the given CertificateOrKeyId
      description: get a specific organisation certificate
      operationId: getOrganisationCertificateById
      tags:
        - Organisations
        - Certificates
        - Public

      responses:
        '200':
          $ref: '#/components/responses/CertificatesOrKey'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '406':
          $ref: '#/components/responses/NotAcceptable'
        '500':
          $ref: '#/components/responses/InternalServerError'
        '502':
          $ref: '#/components/responses/BadGateway'
        '504':
          $ref: '#/components/responses/UpstreamTimeout'
        '429':
          $ref: '#/components/responses/TooManyRequests'
      security:
        - authorizer: [ ]
        - oAuth:
            - directory:website
            - directory:software
      x-amazon-apigateway-integration:
        uri: "${organisation_read_arn}"
        passthroughBehavior: "when_no_match"
        httpMethod: "POST"
        timeoutInMillis: 29000
        type: "aws_proxy"

    put:
      summary: Revoke or remove a certificate with the given CertificateOrKeyId providing a revoke reason
      description: revokes an organisation level certificate and allows a revocation reason to be specified
      parameters:
        - $ref: "#/components/parameters/x-fapi-auth-date"
        - $ref: "#/components/parameters/x-fapi-customer-ip-address"
        - $ref: "#/components/parameters/x-fapi-interaction-id"
        - $ref: "#/components/parameters/x-customer-user-agent"
      operationId: updateOrganisationCertificateById
      tags:
        - Organisations
        - Certificates
        - Public
      requestBody:
        $ref: '#/components/requestBodies/AmendCertificateRequest'
      responses:
        '200':
          $ref: '#/components/responses/CertificatesOrKey'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '406':
          $ref: '#/components/responses/NotAcceptable'
        '500':
          $ref: '#/components/responses/InternalServerError'
        '502':
          $ref: '#/components/responses/BadGateway'
        '504':
          $ref: '#/components/responses/UpstreamTimeout'
        '429':
          $ref: '#/components/responses/TooManyRequests'
      security:
        - authorizer: [ ]
        - oAuth:
            - directory:website
      x-amazon-apigateway-integration:
        uri: "${organisation_write_arn}"
        passthroughBehavior: "when_no_match"
        httpMethod: "POST"
        timeoutInMillis: 29000
        type: "aws_proxy"

  '/dashboard/federation/referencedatapolicies':
    parameters:
      - in: query
        name: Status
        schema:
          type: string
        description: The policy status to return of the result set
      - in: query
        name: Type
        schema:
          type: string
        description: The policy type to return of the result set
    get:
      summary: Get all metadata policies
      description: get all metadata policies
      operationId: getAllFederationMetadataPolicies
      tags:
        - Dashboard
        - Reference Data
        - Federation
      responses:
        '200':
          $ref: '#/components/responses/FederationMetadataPolicyPage'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/InternalServerError'
        '502':
          $ref: '#/components/responses/BadGateway'
        '504':
          $ref: '#/components/responses/UpstreamTimeout'
      security:
        - authorizer: [ ]
        - oAuth:
            - directory:website
      x-amazon-apigateway-integration:
        uri: "${organisation_read_arn}"
        passthroughBehavior: "when_no_match"
        httpMethod: "POST"
        timeoutInMillis: 15000
        type: "aws_proxy"

  '/.well-known/openid-configuration':
    get:
      summary: Get the well known endpoint for discovery
      description: Get the well known endpoint for discovery
      parameters:
        - $ref: "#/components/parameters/x-fapi-auth-date"
        - $ref: "#/components/parameters/x-fapi-customer-ip-address"
        - $ref: "#/components/parameters/x-fapi-interaction-id"
        - $ref: "#/components/parameters/x-customer-user-agent"
      operationId: getWellKnown
      tags:
        - OpenID Provider
      responses:
        '201':
          $ref: '#/components/responses/WellKnown'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/InternalServerError'
        '502':
          $ref: '#/components/responses/BadGateway'
        '504':
          $ref: '#/components/responses/UpstreamTimeout'
        '429':
          $ref: '#/components/responses/TooManyRequests'
      x-amazon-apigateway-integration:
        uri: "${op_lambda_invoke_arn}"
        passthroughBehavior: "when_no_match"
        httpMethod: "POST"
        timeoutInMillis: 29000
        type: "aws_proxy"
      x-amazon-apigateway-request-validator: no-validation

  '/token':
    post:
      summary: Post a request to the token endpoint to retrieve a token
      description: exchange a code for an access token
      parameters:
        - $ref: "#/components/parameters/x-fapi-auth-date"
        - $ref: "#/components/parameters/x-fapi-customer-ip-address"
        - $ref: "#/components/parameters/x-fapi-interaction-id"
        - $ref: "#/components/parameters/x-customer-user-agent"
      requestBody:
        $ref: '#/components/requestBodies/AccessTokenRequest'
      operationId: getToken
      tags:
        - OpenID Provider
      responses:
        '200':
          $ref: '#/components/responses/RetrieveTokenResponse'
        '400':
          $ref: '#/components/responses/OpBadRequest'
        '404':
          $ref: '#/components/responses/NotFound'
        '406':
          $ref: '#/components/responses/NotAcceptable'
        '500':
          $ref: '#/components/responses/InternalServerError'
        '502':
          $ref: '#/components/responses/BadGateway'
        '504':
          $ref: '#/components/responses/UpstreamTimeout'
        '429':
          $ref: '#/components/responses/TooManyRequests'
      x-amazon-apigateway-integration:
        uri: "${op_lambda_invoke_arn}"
        passthroughBehavior: "when_no_match"
        httpMethod: "POST"
        timeoutInMillis: 29000
        type: "aws_proxy"
      x-amazon-apigateway-request-validator: no-validation

  '/token/revocation':
    post:
      summary: Post a request to the token revocation endpoint to revoke a token
      description: revoke an access token
      parameters:
        - $ref: "#/components/parameters/x-fapi-auth-date"
        - $ref: "#/components/parameters/x-fapi-customer-ip-address"
        - $ref: "#/components/parameters/x-fapi-interaction-id"
        - $ref: "#/components/parameters/x-customer-user-agent"
      requestBody:
        $ref: '#/components/requestBodies/AccessTokenRevocationRequest'
      operationId: revokeToken
      tags:
        - OpenID Provider
      responses:
        '204':
          $ref: '#/components/responses/NoContent'
        '404':
          $ref: '#/components/responses/NotFound'
        '406':
          $ref: '#/components/responses/NotAcceptable'
        '500':
          $ref: '#/components/responses/InternalServerError'
        '502':
          $ref: '#/components/responses/BadGateway'
        '504':
          $ref: '#/components/responses/UpstreamTimeout'
        '429':
          $ref: '#/components/responses/TooManyRequests'
      x-amazon-apigateway-integration:
        uri: "${op_lambda_invoke_arn}"
        passthroughBehavior: "when_no_match"
        httpMethod: "POST"
        timeoutInMillis: 29000
        type: "aws_proxy"
      x-amazon-apigateway-request-validator: no-validation

  '/backchannel':
    post:
      summary: Post a Oauth 2.0 ciba request
      description: Post a Oauth 2.0 ciba request
      parameters:
        - $ref: "#/components/parameters/x-fapi-auth-date"
        - $ref: "#/components/parameters/x-fapi-customer-ip-address"
        - $ref: "#/components/parameters/x-fapi-interaction-id"
        - $ref: "#/components/parameters/x-customer-user-agent"
      requestBody:
        $ref: '#/components/requestBodies/IntrospectionRequest'
      operationId: postCiba
      tags:
        - OpenID Provider
      responses:
        '201':
          $ref: '#/components/responses/Introspection'
        '404':
          $ref: '#/components/responses/NotFound'
        '406':
          $ref: '#/components/responses/NotAcceptable'
        '500':
          $ref: '#/components/responses/InternalServerError'
        '502':
          $ref: '#/components/responses/BadGateway'
        '504':
          $ref: '#/components/responses/UpstreamTimeout'
        '429':
          $ref: '#/components/responses/TooManyRequests'
      x-amazon-apigateway-integration:
        uri: "${op_lambda_invoke_arn}"
        passthroughBehavior: "when_no_match"
        httpMethod: "POST"
        timeoutInMillis: 29000
        type: "aws_proxy"
      x-amazon-apigateway-request-validator: no-validation

  '/request':
    post:
      summary: Post a Oauth 2.0 pushed authorization request
      description: Post a Oauth 2.0 pushed authorization request
      parameters:
        - $ref: "#/components/parameters/x-fapi-auth-date"
        - $ref: "#/components/parameters/x-fapi-customer-ip-address"
        - $ref: "#/components/parameters/x-fapi-interaction-id"
        - $ref: "#/components/parameters/x-customer-user-agent"
      requestBody:
        $ref: '#/components/requestBodies/IntrospectionRequest'
      operationId: postPar
      tags:
        - OpenID Provider
      responses:
        '201':
          $ref: '#/components/responses/Introspection'
        '404':
          $ref: '#/components/responses/NotFound'
        '406':
          $ref: '#/components/responses/NotAcceptable'
        '500':
          $ref: '#/components/responses/InternalServerError'
        '502':
          $ref: '#/components/responses/BadGateway'
        '504':
          $ref: '#/components/responses/UpstreamTimeout'
        '429':
          $ref: '#/components/responses/TooManyRequests'
      x-amazon-apigateway-integration:
        uri: "${op_lambda_invoke_arn}"
        passthroughBehavior: "when_no_match"
        httpMethod: "POST"
        timeoutInMillis: 29000
        type: "aws_proxy"
      x-amazon-apigateway-request-validator: no-validation

  '/token/introspection':
    post:
      summary: Post a Oauth 2.0 token and return a JSON payload representing meta information surrounding the token
      description: Post a Oauth 2.0 token and return a JSON payload representing meta information surrounding the token
      parameters:
        - $ref: "#/components/parameters/x-fapi-auth-date"
        - $ref: "#/components/parameters/x-fapi-customer-ip-address"
        - $ref: "#/components/parameters/x-fapi-interaction-id"
        - $ref: "#/components/parameters/x-customer-user-agent"
      requestBody:
        $ref: '#/components/requestBodies/IntrospectionRequest'
      operationId: tokenIntrospection
      tags:
        - OpenID Provider
      responses:
        '200':
          $ref: '#/components/responses/Introspection'
        '404':
          $ref: '#/components/responses/NotFound'
        '406':
          $ref: '#/components/responses/NotAcceptable'
        '500':
          $ref: '#/components/responses/InternalServerError'
        '502':
          $ref: '#/components/responses/BadGateway'
        '504':
          $ref: '#/components/responses/UpstreamTimeout'
        '429':
          $ref: '#/components/responses/TooManyRequests'
      x-amazon-apigateway-integration:
        uri: "${op_lambda_invoke_arn}"
        passthroughBehavior: "when_no_match"
        httpMethod: "POST"
        timeoutInMillis: 29000
        type: "aws_proxy"
      x-amazon-apigateway-request-validator: no-validation

  '/device/auth':
    post:
      summary: Post a request to the device endpoint to retrieve a token
      description: Post a request to the device endpoint to retrieve a token
      parameters:
        - $ref: "#/components/parameters/x-fapi-auth-date"
        - $ref: "#/components/parameters/x-fapi-customer-ip-address"
        - $ref: "#/components/parameters/x-fapi-interaction-id"
        - $ref: "#/components/parameters/x-customer-user-agent"
      requestBody:
        content:
          application/json:
            schema:
              type: object
      operationId: postDeviceAuth
      tags:
        - OpenID Provider
      responses:
        '200':
          content:
            application/json:
              schema:
                type: object
          description: A device code flow response
        '404':
          $ref: '#/components/responses/NotFound'
        '406':
          $ref: '#/components/responses/NotAcceptable'
        '500':
          $ref: '#/components/responses/InternalServerError'
        '502':
          $ref: '#/components/responses/BadGateway'
        '504':
          $ref: '#/components/responses/UpstreamTimeout'
        '429':
          $ref: '#/components/responses/TooManyRequests'
      x-amazon-apigateway-integration:
        uri: "${op_lambda_invoke_arn}"
        passthroughBehavior: "when_no_match"
        httpMethod: "POST"
        timeoutInMillis: 29000
        type: "aws_proxy"
      x-amazon-apigateway-request-validator: no-validation

  '/reg/{ClientId}':
    parameters:
      - $ref: '#/components/parameters/ClientId'
      - $ref: "#/components/parameters/x-fapi-auth-date"
      - $ref: "#/components/parameters/x-fapi-customer-ip-address"
      - $ref: "#/components/parameters/x-fapi-interaction-id"
      - $ref: "#/components/parameters/x-customer-user-agent"
    get:
      summary: Get an oauth client by Id
      description: Get an oauth client by Id
      parameters:
        - in: path
          name: ClientId   # Note the name is the same as in the path
          required: true
          schema:
            type: string
            minimum: 1
          description: The oauth ClientId
      operationId: getClientById
      tags:
        - OpenID Provider
      responses:
        '200':
          $ref: '#/components/responses/ClientCreationResponse'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/InternalServerError'
        '502':
          $ref: '#/components/responses/BadGateway'
        '504':
          $ref: '#/components/responses/UpstreamTimeout'
        '429':
          $ref: '#/components/responses/TooManyRequests'

      x-amazon-apigateway-integration:
        uri: "${op_lambda_invoke_arn}"
        passthroughBehavior: "when_no_match"
        httpMethod: "POST"
        timeoutInMillis: 29000
        type: "aws_proxy"
      x-amazon-apigateway-request-validator: no-validation
    put:
      summary: Update an oauth client by Id
      description: Update an oauth client by Id
      parameters:
        - in: path
          name: ClientId   # Note the name is the same as in the path
          required: true
          schema:
            type: string
            minimum: 1
          description: The oauth ClientId
      requestBody:
        $ref: '#/components/requestBodies/ClientUpdateRequest'
      operationId: updateClientById
      tags:
        - OpenID Provider
      responses:
        '200':
          $ref: '#/components/responses/ClientCreationResponse'
        '201':
          $ref: '#/components/responses/ClientCreationResponse'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/InternalServerError'
        '502':
          $ref: '#/components/responses/BadGateway'
        '504':
          $ref: '#/components/responses/UpstreamTimeout'
        '429':
          $ref: '#/components/responses/TooManyRequests'

      x-amazon-apigateway-integration:
        uri: "${op_lambda_invoke_arn}"
        passthroughBehavior: "when_no_match"
        httpMethod: "POST"
        timeoutInMillis: 29000
        type: "aws_proxy"
      x-amazon-apigateway-request-validator: no-validation
    delete:
      summary: Delete an oauth client. Cascade delete all child details
      description: Delete an oauth client. Cascade delete all child details
      parameters:
        - in: path
          name: ClientId   # Note the name is the same as in the path
          required: true
          schema:
            type: string
            minimum: 1
          description: The ClientId to be deleted
        - $ref: "#/components/parameters/x-fapi-auth-date"
        - $ref: "#/components/parameters/x-fapi-customer-ip-address"
        - $ref: "#/components/parameters/x-fapi-interaction-id"
        - $ref: "#/components/parameters/x-customer-user-agent"
      operationId: deleteClientById
      tags:
        - OpenID Provider
      responses:
        '204':
          $ref: '#/components/responses/NoContent'
        '400':
          $ref: '#/components/responses/BadRequest'
      x-amazon-apigateway-integration:
        uri: "${op_lambda_invoke_arn}"
        passthroughBehavior: "when_no_match"
        httpMethod: "POST"
        timeoutInMillis: 29000
        type: "aws_proxy"
      x-amazon-apigateway-request-validator: no-validation

  '/me':
    get:
      summary: Gets the user information stored in OpenId Provider
      description: Gets the user information stored in OpenId Provider
      operationId: getUserInfo
      tags:
        - OpenID Provider
      parameters:
        - $ref: "#/components/parameters/x-fapi-auth-date"
        - $ref: "#/components/parameters/x-fapi-customer-ip-address"
        - $ref: "#/components/parameters/x-fapi-interaction-id"
        - $ref: "#/components/parameters/x-customer-user-agent"
      responses:
        '200':
          $ref: '#/components/responses/UserOPInfo'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '500':
          $ref: '#/components/responses/InternalServerError'
        '502':
          $ref: '#/components/responses/BadGateway'
        '504':
          $ref: '#/components/responses/UpstreamTimeout'
        '429':
          $ref: '#/components/responses/TooManyRequests'
      x-amazon-apigateway-integration:
        uri: "${op_lambda_invoke_arn}"
        passthroughBehavior: "when_no_match"
        httpMethod: "POST"
        timeoutInMillis: 29000
        type: "aws_proxy"
      x-amazon-apigateway-request-validator: no-validation

  '/clients':
    parameters:
      - $ref: "#/components/parameters/PageNumber"
      - $ref: "#/components/parameters/PageSize"
      - $ref: "#/components/parameters/startDate"
      - $ref: "#/components/parameters/endDate"
      - $ref: "#/components/parameters/clientRole"
      - $ref: "#/components/parameters/clientStatus"
      - $ref: "#/components/parameters/clientName"
      - $ref: "#/components/parameters/x-fapi-auth-date"
      - $ref: "#/components/parameters/x-fapi-customer-ip-address"
      - $ref: "#/components/parameters/x-fapi-interaction-id"
      - $ref: "#/components/parameters/x-customer-user-agent"
    get:
      summary: Get all registered clients
      description: get all ecosystem clients
      operationId: getEcosystemClients
      tags:
        - Software Statements
        - Client Registration
        - Public
      responses:
        '200':
          $ref: '#/components/responses/RegisteredClientsPage'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '406':
          $ref: '#/components/responses/NotAcceptable'
        '500':
          $ref: '#/components/responses/InternalServerError'
        '502':
          $ref: '#/components/responses/BadGateway'
        '504':
          $ref: '#/components/responses/UpstreamTimeout'
        '429':
          $ref: '#/components/responses/TooManyRequests'
      security:
        - authorizer: [ ]
        - oAuth:
            - directory:website
            - directory:software
      x-amazon-apigateway-integration:
        uri: "${organisation_read_arn}"
        passthroughBehavior: "when_no_match"
        httpMethod: "POST"
        timeoutInMillis: 15000
        type: "aws_proxy"

    post:
      parameters:
        - $ref: "#/components/parameters/x-fapi-auth-date"
        - $ref: "#/components/parameters/x-fapi-customer-ip-address"
        - $ref: "#/components/parameters/x-fapi-interaction-id"
        - $ref: "#/components/parameters/x-customer-user-agent"
      summary: Refresh/rebuild the registered clients data
      description: rebuild all ecosystem clients
      operationId: rebuildEcosystemClients
      tags:
        - Software Statements
        - Client Registration
        - Public
      responses:
        '201':
          $ref: '#/components/responses/Ok'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '406':
          $ref: '#/components/responses/NotAcceptable'
        '500':
          $ref: '#/components/responses/InternalServerError'
        '502':
          $ref: '#/components/responses/BadGateway'
        '504':
          $ref: '#/components/responses/UpstreamTimeout'
        '429':
          $ref: '#/components/responses/TooManyRequests'
      security:
        - authorizer: [ ]
        - oAuth:
            - directory:website
            - directory:software
      x-amazon-apigateway-integration:
        uri: "${organisation_write_arn}"
        passthroughBehavior: "when_no_match"
        httpMethod: "POST"
        timeoutInMillis: 15000
        type: "aws_proxy"

  '/clients/{ClientId}':
    get:
      parameters:
        - $ref: "#/components/parameters/ClientId"
        - $ref: "#/components/parameters/x-fapi-auth-date"
        - $ref: "#/components/parameters/x-fapi-customer-ip-address"
        - $ref: "#/components/parameters/x-fapi-interaction-id"
        - $ref: "#/components/parameters/x-customer-user-agent"
      summary: Get details for one client
      description: get specifc ecosystem client by id
      operationId: getEcosystemClientsById
      tags:
        - Software Statements
        - Client Registration
        - Public
      responses:
        '200':
          $ref: '#/components/responses/RegisteredClient'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '406':
          $ref: '#/components/responses/NotAcceptable'
        '500':
          $ref: '#/components/responses/InternalServerError'
        '502':
          $ref: '#/components/responses/BadGateway'
        '504':
          $ref: '#/components/responses/UpstreamTimeout'
        '429':
          $ref: '#/components/responses/TooManyRequests'
      security:
        - authorizer: [ ]
        - oAuth:
            - directory:website
            - directory:software
      x-amazon-apigateway-integration:
        uri: "${organisation_read_arn}"
        passthroughBehavior: "when_no_match"
        httpMethod: "POST"
        timeoutInMillis: 15000
        type: "aws_proxy"

components:
  securitySchemes:
    authorizer:
      type: "apiKey"
      name: "Authorization"
      in: "header"
      x-amazon-apigateway-authtype: "custom"
      x-amazon-apigateway-authorizer:
        authorizerUri: "${authorizer_invoke_arn}"
        authorizerResultTtlInSeconds: 300
        type: "request"
        identitySource: "method.request.header.Authorization"
    godir-authorizer:
      type: "apiKey"
      name: "Authorization"
      in: "header"
      x-amazon-apigateway-authtype: "custom"
      x-amazon-apigateway-authorizer:
        authorizerUri: "${godir_authorizer_invoke_arn}"
        authorizerResultTtlInSeconds: 300
        type: "request"
        identitySource: "method.request.header.Authorization"
    oAuth:
      type: oauth2
      description: This API uses OAUTH 2.0 with client creds for the admin role and auth code for web users
      flows:
        authorizationCode:
          authorizationUrl: https://auth.openbanking.raidiam.io/auth
          tokenUrl: https://auth.openbanking.raidiam.io/token
          refreshUrl: https://auth.openbanking.raidiam.io/token
          scopes:
            directory:website: Web based operations
        clientCredentials:
          tokenUrl: https://auth.openbanking.raidiam.io/token
          scopes:
            directory:admin: All operations for super and domain users
            directory:software: Software statement client operations
            directory:servicedesk: Operations performed by clients respresenting service desk applications

  parameters:
    Identifier:
      name: identifier
      in: query
      description: The string to search for
      required: true
      schema:
        $ref: '#/components/schemas/Identifier'
    GlobalSearchStatus:
      name: status
      in: query
      description: The status of the resource
      required: false
      schema:
        $ref: '#/components/schemas/GlobalSearchStatusEnums'
    ResourceTypes:
      name: resourceTypes
      in: query
      description: Comma-separated list of resource types to filter by
      required: false
      schema:
        $ref: '#/components/schemas/GlobalSearchResourceTypes'
    ContactTypeID:
      name: ContactTypeID
      in: path
      description: The ID of the contact type to target
      required: true
      schema:
        $ref: '#/components/schemas/ContactTypeID'
    ContactTypeStatus:
      name: status
      in: query
      description: The status of the contact type
      required: false
      schema:
        $ref: '#/components/schemas/StatusEnum'
    ContactTypeName:
      name: contactType
      in: query
      description: The name of the contact type
      required: false
      schema:
        $ref: '#/components/schemas/ContactTypeName'
    ContactTypesAccessLevel:
      name: accessLevel
      in: query
      description: the access level of the contact type
      required: false
      schema:
        $ref: '#/components/schemas/ContactTypesAccessLevel'
    ConformanceConfigurationID:
      name: ConformanceConfigurationID
      in: path
      description: The ID of the conformance configuration to target
      required: true
      schema:
        $ref: '#/components/schemas/ConformanceConfigurationID'
    ApiFamilyID:
      name: ApiFamilyID
      in: path
      description: The ID of the api family to target
      required: true
      schema:
        $ref: '#/components/schemas/ApiFamilyID'
    ApiFamilyName:
      name: name
      in: query
      description: The name of the api family
      required: false
      schema:
        $ref: '#/components/schemas/ApiFamilyName'
    ApiFamilyStatus:
      name: status
      in: query
      description: The status of the api family
      required: false
      schema:
        $ref: '#/components/schemas/StatusEnum'
    ApiFamilyVersion:
      name: version
      in: query
      description: A string that represents the version of the api families
      required: false
      schema:
        type: string
    ApiFamilyConformanceTest:
      name: certification
      in: query
      description: A boolean that represents api families that have automatic certification
      required: false
      schema:
        type: boolean
    FlagID:
      name: FlagID
      in: path
      description: The ID of the flag to target
      required: true
      schema:
        $ref: '#/components/schemas/FlagID'
    FlagName:
      name: name
      in: query
      description: The name of the flag
      required: false
      schema:
        $ref: '#/components/schemas/FlagName'
    FlagType:
      name: type
      in: query
      description: The type of the flag
      required: false
      schema:
        $ref: '#/components/schemas/FlagType'
    FlagStatus:
      name: status
      in: query
      description: The status of the flag
      required: false
      schema:
        $ref: '#/components/schemas/StatusEnum'
    VariantID:
      name: VariantID
      in: path
      description: The UUID used to denote the certification type variant in question
      required: true
      schema:
        $ref: '#/components/schemas/VariantID'
    TypeID:
      name: TypeID
      in: path
      description: The UUID used to denote the certification type in question
      required: true
      schema:
        $ref: '#/components/schemas/TypeID'
    ActionType:
      name: actionType
      in: query
      description: The type of action to search for.
      required: false
      schema:
        $ref: '#/components/schemas/ActionType'
    AuthorisationServerId:
      name: AuthorisationServerId
      description: The authorisation server Id
      in: path
      required: true
      schema:
        $ref: '#/components/schemas/AuthorisationServerId'
    AuthorisationServerCertificationId:
      name: AuthorisationServerCertificationId
      description: Auth server certification Id
      in: path
      required: true
      schema:
        $ref: '#/components/schemas/AuthorisationServerCertificationId'
    OrganisationAuthorityClaimId:
      name: OrganisationAuthorityClaimId
      description: The Authority claims ID for an organisation
      in: path
      required: true
      schema:
        $ref: '#/components/schemas/OrganisationAuthorityClaimId'
    OrganisationAuthorisationId:
      name: OrganisationAuthorisationId
      description: The authorisation ID for an organisation's authority claims
      in: path
      required: true
      schema:
        $ref: '#/components/schemas/OrganisationAuthorisationId'
    CertificateOrKeyId:
      name: CertificateOrKeyId
      description: The certificate or key Id
      in: path
      required: true
      schema:
        $ref: '#/components/schemas/CertificateOrKeyId'
    ContactId:
      name: ContactId
      description: The contact id
      in: path
      required: true
      schema:
        $ref: '#/components/schemas/ContactId'
    FederationId:
      name: FederationId
      description: The federation id
      in: path
      required: true
      schema:
        $ref: '#/components/schemas/FederationId'
    MetadataPolicyType:
      name: type
      description: The metadata policy type
      in: query
      required: false
      schema:
        $ref: '#/components/schemas/MetadataPolicyTypeEnum'
    MetadataPolicyVersion:
      name: version
      description: The metadata policy version. Providing a value of '0' returns the latest version
      in: query
      required: false
      schema:
        $ref: '#/components/schemas/MetadataPolicyVersion'
    MetadataPolicyId:
      name: MetadataPolicyId
      description: The metadata policy id
      in: path
      required: true
      schema:
        $ref: '#/components/schemas/MetadataPolicyId'
    OrganisationCertificateType:
      name: OrganisationCertificateType
      description: The certificate type
      in: path
      required: true
      schema:
        $ref: '#/components/schemas/OrganisationCertificateType'
    OrganisationId:
      name: OrganisationId
      description: The organisation ID
      in: path
      required: true
      schema:
        $ref: '#/components/schemas/OrganisationId'
    SoftwareStatementStatus:
      in: query
      name: status
      schema:
        $ref: "#/components/schemas/SoftwareStatementStatus"
      description: Filters software statements by the provided status
      required: false
    OrganisationIdQueryParameter:
      name: organisationId
      description: The organisation ID. Required if using API as an organisation administrator
      in: query
      required: false
      schema:
        $ref: '#/components/schemas/OrganisationId'
    AuthorityId:
      name: AuthorityId
      description: The reference authority Id
      in: path
      required: true
      schema:
        $ref: '#/components/schemas/AuthorityId'
    AuthorityIdQuery:
      name: AuthorityID
      description: The reference authority Id
      in: query
      required: false
      schema:
        $ref: '#/components/schemas/AuthorityId'
    AuthorisationDomainId:
      name: AuthorisationDomainId
      description: The authorisation domain id
      in: path
      required: true
      schema:
        $ref: '#/components/schemas/AuthorisationDomainID'
    AuthorisationDomainIdQuery:
      name: AuthorisationDomainID
      description: The authorisation domain id
      in: query
      required: false
      schema:
        $ref: '#/components/schemas/AuthorisationDomainID'
    SoftwareStatementCertificateOrKeyType:
      name: SoftwareStatementCertificateOrKeyType
      description: The certificate or key type that can be associated with a software statement
      in: path
      required: true
      schema:
        $ref: '#/components/schemas/SoftwareStatementCertificateOrKeyType'
    SoftwareStatementId:
      name: SoftwareStatementId
      description: The software statement ID
      in: path
      required: true
      schema:
        $ref: '#/components/schemas/SoftwareStatementId'
    SoftwareAuthorityClaimId:
      name: SoftwareAuthorityClaimId
      description: The software statement's authority claim ID
      in: path
      required: true
      schema:
        $ref: '#/components/schemas/SoftwareAuthorityClaimId'
    ServerAuthorityClaimID:
      name: ServerAuthorityClaimID
      description: The server's authority claim ID
      in: path
      required: true
      schema:
        $ref: '#/components/schemas/ServerAuthorityClaimId'
    SoftwareStatementCertificationId:
      name: SoftwareStatementCertificationId
      description: Software Statement certification Id
      in: path
      required: true
      schema:
        $ref: '#/components/schemas/SoftwareStatementCertificationId'
    UserEmailOrID:
      name: UserEmailOrID
      description: UUID or email address of the user. Note use of the email address is considered deprecated
      in: path
      required: true
      schema:
        $ref: '#/components/schemas/UserEmailOrID'
    SubDomainID:
      name: SubDomainID
      description: The sub-domains unique registration ID
      in: path
      required: true
      schema:
        $ref: '#/components/schemas/SubDomainID'
    AuthorisationDomainName:
      name: AuthorisationDomainName
      description: Authorisation Domain Name. Eg:PSD2
      in: path
      required: true
      schema:
        $ref: '#/components/schemas/AuthorisationDomainName'
    AuthorisationDomainRoleIdentifier:
      name: AuthorisationDomainRoleIdentifier
      in: path
      description: Authorisation Domain Role Id, a UUID
      required: true
      schema:
        $ref: '#/components/schemas/AuthorisationDomainRoleID'
    AuthorisationDomainRoleName:
      name: AuthorisationDomainRoleName
      description: Authorisation Domain Role Name. Eg:TPP
      in: path
      required: true
      schema:
        $ref: '#/components/schemas/AuthorisationDomainRoleName'
    QueryAuthorisationDomainRoleName:
      name: AuthorisationDomainRoleName
      description: Authorisation Domain Role Name. Eg:TPP
      in: query
      required: false
      schema:
        $ref: '#/components/schemas/AuthorisationDomainRoleName'
    AuthorityAuthorisationDomainId:
      name: AuthorityAuthorisationDomainId
      description: ID of the Authority mapped with Authorisation Domain
      in: path
      required: true
      schema:
        $ref: '#/components/schemas/AuthorityAuthorisationDomainId'
    OrganisationAuthorityDomainClaimId:
      name: OrganisationAuthorityDomainClaimId
      description: Organisation Authority Domain Claim Id
      in: path
      required: true
      schema:
        $ref: '#/components/schemas/OrganisationAuthorityDomainClaimId'
    AuthorisationDomainUserId:
      name: AuthorisationDomainUserId
      description: Unique record Id to identify Domain User
      in: path
      required: true
      schema:
        $ref: '#/components/schemas/AuthorisationDomainUserId'
    TnCId:
      name: TnCId
      description: Terms and Conditions unique identifier
      in: path
      required: true
      schema:
        $ref: '#/components/schemas/TnCId'
    ClientId:
      name: ClientId
      description: Oauth clientId
      in: path
      required: true
      schema:
        $ref: '#/components/schemas/ClientId'
    ApiResourceId:
      name: ApiResourceId
      description: The api version Id
      in: path
      required: true
      schema:
        $ref: '#/components/schemas/ApiResourceId'
    ApiDiscoveryEndpointId:
      name: ApiDiscoveryEndpointId
      description: The api discovery endpoint Id
      in: path
      required: true
      schema:
        $ref: '#/components/schemas/ApiEndpointId'
    ExternalSigningServiceEnvelopeId:
      name: ExternalSigningServiceEnvelopeId
      description: The envelope id
      in: path
      required: true
      schema:
        $ref: '#/components/schemas/ExternalSigningServiceEnvelopeId'
    MetadataId:
      name: MetadataId
      description: The metadata id object
      in: path
      required: true
      schema:
        $ref: '#/components/schemas/MetadataId'
    CustomClaimID:
      name: CustomClaimID
      description: a UUID denoting a specific custom claim
      in: path
      required: true
      schema:
        $ref: '#/components/schemas/CustomClaimID'
    AuthorisationDomainSystemID:
      name: AuthorisationDomainSystemID
      description: a UUID denoting a specific authorisation domain system
      in: path
      required: true
      schema:
        $ref: '#/components/schemas/AuthorisationDomainSystemID'
    AuthorisationDomainUserTypeID:
      name: AuthorisationDomainUserTypeID
      description: A UUID denoting a specific authorisation domain user type
      in: path
      required: true
      schema:
        $ref: '#/components/schemas/AuthorisationDomainUserTypeID'
    FederationConfigId:
      name: FederationConfigId
      description: The federation configuration id
      in: path
      required: true
      schema:
        $ref: '#/components/schemas/FederationConfigId'
    SsoConfigurationIdPathParameter:
      name: ssoConfigurationId
      description: The unique identifier representing a given sso configuration of an authorisation server
      in: path
      required: true
      schema:
        $ref: '#/components/schemas/SsoConfigurationID'
    ApprovalFlowStatusEnumQueryParameter:
      name: status
      description: Filters the response by one or more status values
      in: query
      required: false
      schema:
        $ref: '#/components/schemas/ApprovalFlowStatusEnum'
    SsoConfigurationVersionIdPathParameter:
      name: versionId
      description: The unique identifier representing a given version of sso configuration for an sso-enabled authorisation server
      in: path
      required: true
      schema:
        $ref: '#/components/schemas/SsoConfigurationVersionID'
    PolicyApprovalStatusEnum:
      name: policyStatus
      in: query
      required: false
      schema:
        $ref: '#/components/schemas/PolicyApprovalStatusEnum'
    ContainsOpenIdDiscoveryDocument:
      name: containsOpenIdDiscoveryDocument
      in: query
      required: false
      schema:
        type: boolean
      description: Filter responses by whether they contain an Open ID Discovery Document
    OmitFromEcosystem:
      name: omitFromEcosystem
      in: query
      required: false
      schema:
        type: boolean
      description: Filter responses to those whose 'OmitFromEcosystem' matches the input
    Status:
      name: status
      in: query
      required: false
      schema:
        $ref: '#/components/schemas/StatusEnum'
      description: Filter responses by status
    FilterBy:
      name: filterBy
      in: query
      required: false
      schema:
        type: string
      description: Query by CustomerFriendlyName or AuthorisationServerId that contain the given string, case insensitive
    PageNumber:
      in: query
      name: page
      schema:
        type: integer
      description: The page number to return of the result set
    PageSize:
      in: query
      name: size
      schema:
        type: integer
      description: The size of the pages to return
    PageSort:
      in: query
      name: sort
      style: form
      explode: true
      schema:
        oneOf:
          - type: string
          - type: array
            items:
              type: string
      description: The field name to sort
    x-customer-user-agent:
      in: "header"
      name: "x-customer-user-agent"
      description: "Indicates the user-agent that the PSU is using."
      required: false
      schema:
        type: "string"
    x-fapi-customer-ip-address:
      in: "header"
      name: "x-fapi-customer-ip-address"
      required: false
      description: "The PSU's IP address if the PSU is currently logged in with the TPP."
      schema:
        type: "string"
    x-fapi-auth-date:
      in: "header"
      name: "x-fapi-auth-date"
      required: false
      description: "The time when the PSU last logged in with the TPP. \nAll dates in the HTTP headers are represented as RFC 7231 Full Dates. An example is below: \nSun, 10 Sep 2017 19:43:31 UTC"
      schema:
        type: "string"
        pattern: "^(Mon|Tue|Wed|Thu|Fri|Sat|Sun), \\d{2} (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) \\d{4} \\d{2}:\\d{2}:\\d{2} (GMT|UTC)$"
    x-fapi-interaction-id:
      in: "header"
      name: "x-fapi-interaction-id"
      required: false
      description: "An RFC4122 UID used as a correlation id."
      schema:
        type: "string"
    startDate:
      name: "startDate"
      in: "query"
      description: "Optional start of date range to constrain the set of results returned. This will restrict the clients returned to those whose metadata was most recently modified after the specified startDate. The date must be supplied in RFC3339 format. If not supplied, the startDate used will be the epoch."
      required: false
      example: "2022-05-12T23:20:50Z"
      schema:
        type: "string"
        format: "date-time"
    endDate:
      name: "endDate"
      in: "query"
      description: "Optional end of date range to constrain the set of results returned. This will restrict the clients returned to those whose metadata was most recently modified before the specified sendDate. The date must be supplied in RFC3339 format. If not supplied, the endDate used will be the current date and time."
      required: false
      example: "2022-05-15T23:20:50Z"
      schema:
        type: "string"
        format: "date-time"
    clientRole:
      name: "role"
      in: "query"
      description: "A role name, clients that have this role (whether active or inactive) will be returned. Clients with this role in an Inactive state will be returned but will not show the role in their roles array"
      required: false
      example: "RP-ROLE"
      schema:
        type: "string"
    clientStatus:
      name: "status"
      in: "query"
      description: "Return clients with a matching status. Available values are Active, Inactive and Suspended"
      required: false
      example: "Active"
      schema:
        type: "string"
    clientName:
      name: "name"
      in: "query"
      description: "Search the available clients based on a name match. Match is partial so a search for 'abc' will return clients 'abc','abc1', '1abc' and '1abc2' "
      required: false
      example: "A Client"
      schema:
        type: "string"
    ResourceType:
      name: "resourceType"
      in: "query"
      description: "The type of resource to search for."
      required: true
      schema:
        $ref: '#/components/schemas/ResourceType'
    ResourceId:
      name: "resourceId"
      in: "query"
      description: "The ID of the specific resource we want to parse by."
      required: false
      schema:
        type: "string"
    ParentResourceId:
      name: "parentResourceId"
      in: "query"
      description: "The ID of the parent resource we want to parse by."
      required: false
      schema:
        type: "string"
    PerformedBy:
      name: "performedBy"
      in: "query"
      description: "The user email you want to parse by. This will be performed for createdBy and updatedBy based on the revision type"
      required: false
      schema:
        type: "string"

  requestBodies:
    SubDomainCreationRequest:
      description: A request body to register an existing domain as a sub domain
      required: true
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/SubDomainCreationRequest'

    SubDomainUpdateRequest:
      description: A request body to update an existing sub-domain registration
      required: true
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/SubDomainUpdateRequest'

    ApiResourceMetadataRequest:
      description: A post body to create an API resource metadata
      required: true
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ApiResourceMetadata'

    DocusignPost:
      description: A post from docusign to the directory
      required: true
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/DocusignPost'

    AuthorisationDomainSystemRequest:
      description: Create or update an authorisation domain system
      required: true
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/AuthorisationDomainSystemRequest'

    AuthorisationDomainUserTypeRequest:
      description: Create or update an authorisation domain user type
      required: true
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/AuthorisationDomainUserTypeRequest'

    AmendCertificateRequest:
      description: Amend a certificate, current functionality supports Revoke Reason
      required: true
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/AmendCertificateRequest'

    AuthorisationServerCreationRequest:
      description: Properties to create an authorisation server
      required: true
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/AuthorisationServerCreationRequest'

    AuthorisationServerUpdateRequest:
      description: Properties to update an authorisation server
      required: true
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/AuthorisationServerUpdateRequest'

    AuthorisationServerCertificationRequest:
      description: Properties to create/update a certification for an authorisation server
      required: true
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/AuthorisationServerCertificationRequest'

    SoftwareStatementCertificationRequest:
      description: Properties to create/update a certification for an software statement
      required: true
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/SoftwareStatementCertificationRequest'

    OrganisationAuthorityDomainRoleClaimCreationRequest:
      description: Properties to create organisation authority domain role claims
      required: true
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/OrganisationAuthorityDomainRoleClaimCreationRequest'

    OrganisationAuthorityDomainRoleClaimUpdateRequest:
      description: Properties to update an existing organisation authority domain role claims
      required: true
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/OrganisationAuthorityDomainRoleClaimUpdateRequest'

    UserUpdateRequest:
      description: Properties to toggle a user between activated and deactivated status
      required: true
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/UserUpdateRequest'

    FederationRequest:
      description: Properties to create/update federation
      required: true
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/FederationRequest'

    FederationMetadataPolicyRequest:
      description: Properties to create/update federation metadata policies
      required: true
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/FederationMetadataPolicyRequest'

    MetadataRequest:
      description: Properties to create a metadata object to associate with a domain role
      required: true
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/MetadataRequest'

    OrganisationAuthorityClaimAuthorisationRequest:
      description: Properties to update/retrieve authorisation server
      required: true
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/OrganisationAuthorityClaimAuthorisationRequest'
    ContactRequest:
      description: Properties to update contacts
      required: true
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ContactRequest'
    CSROrKey:
      description: PEM file -- the contents of the PEM file will differ depending upon *SoftwareStatementCertificateOrKeyType*. If *SoftwareStatementCertificateOrKeyType* is set to *brcac*, *rtssigning* or *rtstransport* then the PEM file should contain a Certificate Signing Request (CSR) for an RTS signing or RTS transport certificate respectively; if *SoftwareStatementCertificateOrKeyType* is set to *sigkey*, *enckey* then the PEM file should contain a public signing or encryption key respectively.
      required: true
      content:
        application/x-pem-file:
          schema:
            $ref: '#/components/schemas/CertificateOrKeyOrJWT'
        application/json:
          schema:
            $ref: '#/components/schemas/CertificateOrKeyJsonRequest'

    Organisation:
      description: Create a new organisation
      required: true
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/OrganisationRequest'

    OrganisationUpdate:
      description: Update an organisation
      required: true
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/OrganisationUpdateRequest'

    OrganisationConformanceTest:
      description: Create and run a Conformance Suite test
      required: true
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/OrganisationConformanceTest'

    AuthorityCreationRequest:
      description: Authority configuration creation request
      required: true
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/AuthorityCreationRequest'

    AuthorityUpdateRequest:
      description: Authority configuration update request
      required: true
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/AuthorityUpdateRequest'

    IntrospectionRequest:
      description: Reference introspection request
      required: true
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/IntrospectionRequest'

    SoftwareStatementRequest:
      description: Software Statement payload
      required: true
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/SoftwareStatementRequest'

    UnlockSoftwareStatementRequest:
      description: Software Statement payload
      required: true
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/UnlockSoftwareStatementRequest'

    SoftwareStatementUpdateRequest:
      description: Software Statement payload
      required: true
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/SoftwareStatementUpdateRequest'

    SoftwareAuthorityClaimCreationRequest:
      description: Software Statement authority claim's payload
      required: true
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/SoftwareAuthorityClaimCreationRequest'

    SoftwareAuthorityClaimUpdateRequest:
      description: Software Statement authority claim's update payload
      required: true
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/SoftwareAuthorityClaimUpdateRequest'

    ServerAuthorityClaimCreationRequest:
      description: Server authority claim's payload
      required: true
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ServerAuthorityClaimCreationRequest'

    ServerAuthorityClaimUpdateRequest:
      description: Server authority claim's update payload
      required: true
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ServerAuthorityClaimUpdateRequest'

    ClientCreationRequest:
      description: Client Creation Request
      required: true
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ClientCreationRequest'

    ClientUpdateRequest:
      description: Client Update Request
      required: true
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ClientUpdateRequest'

    AccessTokenRequest:
      description: Client Access Token Request
      required: true
      content:
        application/x-www-form-urlencoded:
          schema:
            $ref: '#/components/schemas/AccessTokenRequest'

    AccessTokenRevocationRequest:
      description: A valid RFC7009 request - https://datatracker.ietf.org/doc/html/rfc7009#section-2.1
      required: true
      content:
        application/x-www-form-urlencoded:
          schema:
            $ref: '#/components/schemas/AccessTokenRevocationRequest'


    SuperUserCreationRequest:
      description: Super user creation request
      required: true
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/UserCreationRequest'

    CertificationManagerCreationRequest:
      description: Super user creation request
      required: true
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/UserCreationRequest'

    AuthorisationDomainUserCreateRequest:
      description: Admin user creation request
      required: true
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/AuthorisationDomainUserCreateRequest'

    DataAdministratorCreationRequest:
      description: Data administrator creation request
      required: true
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/UserCreationRequest'

    AuthorisationDomainRequest:
      description: Authorisation Domain creation request
      required: true
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/AuthorisationDomainRequest'

    AuthorisationDomainUpdateRequest:
      description: Authorisation Domain creation request
      required: true
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/AuthorisationDomainUpdateRequest'

    DomainAuthorisationDomainRoleRequest:
      description: Authorisation Domain Role creation request
      required: true
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/DomainAuthorisationDomainRoleRequest'

    AuthorisationDomainRoleRequest:
      description: Authorisation Domain Role creation request, compatibility structure for deprecated endpoints
      required: true
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/AuthorisationDomainRoleRequest'

    DomainAuthorisationDomainRoleUpdateRequest:
      description: Authorisation Domain Role update request
      required: true
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/DomainAuthorisationDomainRoleUpdateRequest'

    AuthorisationDomainRoleUpdateRequest:
      description: Authorisation Domain Role update request, compatibility structure for deprecated endpoints
      required: true
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/AuthorisationDomainRoleUpdateRequest'

    AuthorityAuthorisationDomainRequest:
      description: Authority Authorisation Domain mapping request
      required: true
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/AuthorityAuthorisationDomainRequest'

    OrganisationAuthorityDomainClaimCreationRequest:
      description: Authority Authorisation Domain mapping request
      required: true
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/OrganisationAuthorityDomainClaimCreationRequest'

    OrganisationAuthorityDomainClaimUpdateRequest:
      description: Authority Authorisation Domain mapping request
      required: true
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/OrganisationAuthorityDomainClaimUpdateRequest'

    TermsAndConditionsCreateRequest:
      description: TnC create request
      required: true
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/TermsAndConditionsCreateRequest'

    TermsAndConditionsUpdateRequest:
      description: TnC update request
      required: true
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/TermsAndConditionsUpdateRequest'

    OrgAdminUserCreateRequest:
      description: Org Admin user create request
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/OrgAdminUserCreateRequest'

    ApiResourceRequest:
      description: Api Resource request
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ApiResourceRequest'

    ApiResourceUpdateRequest:
      description: Api Resource update request
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ApiResourceUpdateRequest'

    ApiDiscoveryEndpointRequest:
      description: Api Resource request
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ApiDiscoveryEndpointRequest'

    EssSignRequest:
      description: Request object to capture ESS sign attributes
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/EssSignRequest'

    CertificationTypeRequest:
      description: Request object to set a certification type
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/CertificationTypeRequest'
    CertificationTypeVariantRequest:
      description: Request object to set a certification type
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/CertificationTypeVariantRequest'
    CertificationTypeVariantUpdateRequest:
      description: Request object to set a certification type for update
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/CertificationTypeVariantUpdateRequest'
    FlagRequest:
      description: Request object to create a flag
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/FlagRequest'
    FlagUpdateRequest:
      description: Request object to update a flag
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/FlagUpdateRequest'
    ContactTypeUpdateRequest:
      description: Request object to update a contact type
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ContactTypeRequest'
    ContactTypeRequest:
      description: Request object to create a contact type
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ContactTypeRequest'
    ApiFamilyRequest:
      description: Request object to create an api family
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ApiFamilyRequest'
    ApiFamilyUpdateRequest:
      description: Request object to update a api family
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ApiFamilyUpdateRequest'

    ConformanceConfigurationRequest:
      description: Request object to create/update a conformance configuration
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ConformanceConfigurationRequest'

    UserGroupOrganisationBindingCreationRequest:
      description: Request object to create a binding between an Organisation and user group
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/UserGroupOrganisationBindingCreationRequest'

    UserGroupIDPBindingCreationRequest:
      description: Request object to create a binding between an IDP and user group
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/UserGroupIDPBindingCreationRequest'

    UserGroupPermissionCreationRequest:
      description: Request object to create a binding between an IDP and user group
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/UserGroupPermissionCreationRequest'

    UserGroupCreationRequest:
      description: Request object to create a directory-managed user group
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/UserGroupCreationRequest'

    UserGroupUpdateRequest:
      description: Request object to update an existing directory-managed user group
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/UserGroupUpdateRequest'

    SsoConfigurationCreationRequest:
      description: Request object to configure a subject authorisation server with sso functionality
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/SsoConfigurationCreationRequest'

    SsoConfigurationVersionCreationRequest:
      description: Request object to configure a subject authorisation server's sso functionality with a new verison of it's configuration
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/SsoConfigurationVersionCreationRequest'

    SsoConfigurationUpdateRequest:
      description: Request object to configure a subject authorisation server with sso functionality
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/SsoConfigurationUpdateRequest'

    SsoConfigurationVersionUpdateRequest:
      description: Request object to update a subject authorisation server's sso functionality with a new version of it's configuration
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/SsoConfigurationVersionUpdateRequest'

    CustomClaimCreationRequest:
      description: Request object used to create a given custom claim object
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/CustomClaimCreationRequest'

    CustomClaimUpdateRequest:
      description: Request object used to update a given custom claim object
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/CustomClaimUpdateRequest'

  responses:
    Ok:
      description: No Content
      headers:
        x-fapi-interaction-id:
          schema:
            $ref: '#/components/schemas/xFapiInteractionId'
    NoContent:
      description: No Content
      headers:
        x-fapi-interaction-id:
          schema:
            $ref: '#/components/schemas/xFapiInteractionId'
    BadRequest:
      description: Bad Request
      headers:
        x-fapi-interaction-id:
          schema:
            $ref: '#/components/schemas/xFapiInteractionId'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/HttpResponseBody'
    OpBadRequest:
      description: Bad Request
      headers:
        x-fapi-interaction-id:
          schema:
            $ref: '#/components/schemas/xFapiInteractionId'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/OpErrorResponseBody'
    Unauthorized:
      description: Unauthorized
      headers:
        x-fapi-interaction-id:
          schema:
            $ref: '#/components/schemas/xFapiInteractionId'
    Forbidden:
      description: Forbidden
      headers:
        x-fapi-interaction-id:
          schema:
            $ref: '#/components/schemas/xFapiInteractionId'
    NotFound:
      description: Not found
      headers:
        x-fapi-interaction-id:
          schema:
            $ref: '#/components/schemas/xFapiInteractionId'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/HttpResponseBody'
    NotAcceptable:
      description: Not Acceptable
      headers:
        x-fapi-interaction-id:
          schema:
            $ref: '#/components/schemas/xFapiInteractionId'
    Conflict:
      description: Conflict
      headers:
        x-fapi-interaction-id:
          schema:
            $ref: '#/components/schemas/xFapiInteractionId'
    BadGateway:
      description: Bad Gateway
      headers:
        x-fapi-interaction-id:
          schema:
            $ref: '#/components/schemas/xFapiInteractionId'
    UpstreamTimeout:
      description: Upstream timeout, insufficient capacity to serve request. More capacity being brought online. Please try again.
      headers:
        x-fapi-interaction-id:
          schema:
            $ref: '#/components/schemas/xFapiInteractionId'
    TooManyRequests:
      description: Too many requests, maximum capacity reached. Requests are now throttled.
      headers:
        x-fapi-interaction-id:
          schema:
            $ref: '#/components/schemas/xFapiInteractionId'
    InternalServerError:
      description: Internal Server Error
      headers:
        x-fapi-interaction-id:
          schema:
            $ref: '#/components/schemas/xFapiInteractionId'
    NotImplemented:
      description: Request is not yet implemented
      headers:
        x-fapi-interaction-id:
          schema:
            $ref: '#/components/schemas/xFapiInteractionId'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/HttpResponseBody'
    SubDomainList:
      description: All sub-domain registrations for a given domain
      headers:
        x-fapi-interaction-id:
          schema:
            $ref: '#/components/schemas/xFapiInteractionId'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/SubDomainList'
    SubDomainObject:
      description: A sub-domain registration
      headers:
        x-fapi-interaction-id:
          schema:
            $ref: '#/components/schemas/xFapiInteractionId'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/SubDomainObject'
    OrganisationAuthorityDomainRoleClaims:
      description: All authority claims for the organisation
      headers:
        x-fapi-interaction-id:
          schema:
            $ref: '#/components/schemas/xFapiInteractionId'
      content:
        application/json:
          schema:
            oneOf:
              - $ref: '#/components/schemas/OrganisationAuthorityDomainRoleClaims'
              - $ref: '#/components/schemas/OrganisationAuthorityDomainRoleClaimsPage'
    OrganisationAuthorityDomainRoleClaimObject:
      description: A given organisation authority domain role claim with additional details
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/OrganisationAuthorityDomainRoleClaimObject'

    OrganisationAuthorityClaimAuthorisations:
      description: Authorisations response
      headers:
        x-fapi-interaction-id:
          schema:
            $ref: '#/components/schemas/xFapiInteractionId'
      content:
        application/json:
          schema:
            oneOf:
              - $ref: '#/components/schemas/OrganisationAuthorityClaimAuthorisations'
              - $ref: '#/components/schemas/OrganisationAuthorityClaimAuthorisationsPage'

    GlobalSearchResponse:
      description: Global Search response
      headers:
        x-fapi-interaction-id:
          schema:
            $ref: '#/components/schemas/xFapiInteractionId'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/GlobalSearchResponse'

    ApiFamiliesPage:
      description: Paginated response with all api families
      headers:
        x-fapi-interaction-id:
          schema:
            $ref: '#/components/schemas/xFapiInteractionId'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ApiFamiliesPage'

    ApiFamily:
      description: Response with for a single api family
      headers:
        x-fapi-interaction-id:
          schema:
            $ref: '#/components/schemas/xFapiInteractionId'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ApiFamily'

    ConformanceConfigurationsPage:
      description: Paginated response with all conformance configurations
      headers:
        x-fapi-interaction-id:
          schema:
            $ref: '#/components/schemas/xFapiInteractionId'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ConformanceConfigurationsPage'
    
    ConformanceConfiguration:
      description: Response with for a single conformance configuration
      headers:
        x-fapi-interaction-id:
          schema:
            $ref: '#/components/schemas/xFapiInteractionId'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ConformanceConfiguration'


    ContactTypesPage:
      description: Paginated response with all contact types
      headers:
        x-fapi-interaction-id:
          schema:
            $ref: '#/components/schemas/xFapiInteractionId'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ContactTypesPage'

    ContactType:
      description: Response for a single contact type
      headers:
        x-fapi-interaction-id:
          schema:
            $ref: '#/components/schemas/xFapiInteractionId'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ContactTypeObject'

    FlagsPage:
      description: Paginated response with all flags
      headers:
        x-fapi-interaction-id:
          schema:
            $ref: '#/components/schemas/xFapiInteractionId'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/FlagsPage'

    Flag:
      description: Response with for a single flag
      headers:
        x-fapi-interaction-id:
          schema:
            $ref: '#/components/schemas/xFapiInteractionId'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Flag'

    OrganisationAuthorityClaimAuthorisation:
      description: Authorisations response
      headers:
        x-fapi-interaction-id:
          schema:
            $ref: '#/components/schemas/xFapiInteractionId'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/OrganisationAuthorityClaimAuthorisation'

    AuthorisationServers:
      description: All authorisation servers for the org
      headers:
        x-fapi-interaction-id:
          schema:
            $ref: '#/components/schemas/xFapiInteractionId'
      content:
        application/json:
          schema:
            oneOf:
                - $ref: '#/components/schemas/AuthorisationServersPage'
                - $ref: '#/components/schemas/AuthorisationServers'

    AuthorisationServer:
      description: Authorisation server response
      headers:
        x-fapi-interaction-id:
          schema:
            $ref: '#/components/schemas/xFapiInteractionId'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/AuthorisationServerResponse'
    AuthorisationServerResponse:
      description: Authorisation server response
      headers:
        x-fapi-interaction-id:
          schema:
            $ref: '#/components/schemas/xFapiInteractionId'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/AuthorisationServerResponseWithWarnings'
    AuthorisationServerCertification:
      description: Authorisation Server certification for the given certification id
      headers:
        x-fapi-interaction-id:
          schema:
            $ref: '#/components/schemas/xFapiInteractionId'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/AuthorisationServerCertification'

    AuthorisationServerCertifications:
      description: Authorisation Server certification for the given certification id
      headers:
        x-fapi-interaction-id:
          schema:
            $ref: '#/components/schemas/xFapiInteractionId'
      content:
        application/json:
          schema:
            oneOf:
              - $ref: '#/components/schemas/AuthorisationServerCertifications'
              - $ref: '#/components/schemas/AuthorisationServerCertificationsPage'

    SoftwareStatementCertification:
      description: Software Statement certification for the given certification id
      headers:
        x-fapi-interaction-id:
          schema:
            $ref: '#/components/schemas/xFapiInteractionId'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/SoftwareStatementCertification'

    SoftwareStatementCertifications:
      description: Software Statement certification for the given certification id
      headers:
        x-fapi-interaction-id:
          schema:
            $ref: '#/components/schemas/xFapiInteractionId'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/SoftwareStatementCertifications'

    CertificatesOrKeys:
      description: All certificates for the org
      content:
        application/jwk-set+json:
          schema:
            oneOf:
              - $ref: '#/components/schemas/CertificatesOrKeys'
              - $ref: '#/components/schemas/CertificatesOrKeysPage'

    CertificatesOrKey:
      description: A certificate object
      headers:
        x-fapi-interaction-id:
          schema:
            $ref: '#/components/schemas/xFapiInteractionId'
      content:
        application/jwk+json:
          schema:
            $ref: '#/components/schemas/CertificateOrKey'
    ContactsPage:
      description: Paged Contacts Snapshot
      headers:
        x-fapi-interaction-id:
          schema:
            $ref: '#/components/schemas/xFapiInteractionId'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ContactsPage'

    Contact:
      description: A contact object
      headers:
        x-fapi-interaction-id:
          schema:
            $ref: '#/components/schemas/xFapiInteractionId'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Contact'
    DataAdministrators:
      description: A paginated set of all users with the data administrator role in the platform
      headers:
        x-fapi-interaction-id:
          schema:
            $ref: '#/components/schemas/xFapiInteractionId'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/DataAdministratorsPage'
    DataAdministrator:
      description: A users with the data administrator role
      headers:
        x-fapi-interaction-id:
          schema:
            $ref: '#/components/schemas/xFapiInteractionId'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/DataAdministrator'
    OrganisationWithTnc:
      description: Full details of the organisation including TnC information
      headers:
        x-fapi-interaction-id:
          schema:
            $ref: '#/components/schemas/xFapiInteractionId'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/OrganisationWithTnc'
    OrganisationsPage:
      description: All organisations
      headers:
        x-fapi-interaction-id:
          schema:
            $ref: '#/components/schemas/xFapiInteractionId'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/OrganisationsPage'
    AuthorisationDomainUserTypesPage:
      description: All authorisation domain user types paginated
      headers:
        x-fapi-interaction-id:
          schema:
            $ref: '#/components/schemas/xFapiInteractionId'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/AuthorisationDomainUserTypesPage'
    AuthorisationDomainUserType:
      description: Authorisation domain user type
      headers:
        x-fapi-interaction-id:
          schema:
            $ref: '#/components/schemas/xFapiInteractionId'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/AuthorisationDomainUserType'
    AuthorisationDomainSystemsPage:
      description: All authorisation domain user systems paginated
      headers:
        x-fapi-interaction-id:
          schema:
            $ref: '#/components/schemas/xFapiInteractionId'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/AuthorisationDomainSystemsPage'
    AuthorisationDomainSystem:
      description: Authorisation domain user system
      headers:
        x-fapi-interaction-id:
          schema:
            $ref: '#/components/schemas/xFapiInteractionId'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/AuthorisationDomainSystem'
    SoftwareStatements:
      description: All software statements for the org
      headers:
        x-fapi-interaction-id:
          schema:
            $ref: '#/components/schemas/xFapiInteractionId'
      content:
        application/json:
          schema:
            oneOf:
              - $ref: '#/components/schemas/SoftwareStatementsPage'
              - $ref: '#/components/schemas/SoftwareStatements'
    OrganisationResponse:
      description: |
        Full details of the organisation including warnings on a create or update operation
      headers:
        x-fapi-interaction-id:
          schema:
            $ref: '#/components/schemas/xFapiInteractionId'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/OrganisationResponse'
    OrganisationsExportOpenData:
      description: Export the open-data for all the organisations
      headers:
        x-fapi-interaction-id:
          schema:
            $ref: '#/components/schemas/xFapiInteractionId'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/OrganisationsExportOpenData'
    OrgTermsAndConditionsDetail:
      description: Details of the TnC and external signing service
      headers:
        x-fapi-interaction-id:
          schema:
            $ref: '#/components/schemas/xFapiInteractionId'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/OrgTermsAndConditionsDetail'
    OrganisationConformanceTestResult:
      description: |
        Result of the conformance suite test run
      headers:
        x-fapi-interaction-id:
          schema:
            $ref: '#/components/schemas/xFapiInteractionId'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/OrganisationConformanceTestResult'

    PemFile:
      description: Content in an application/x-pem-file format
      headers:
        x-fapi-interaction-id:
          schema:
            $ref: '#/components/schemas/xFapiInteractionId'
      content:
        application/x-pem-key:
          schema:
            type: object
        application/x-pem-certificate:
          schema:
            type: object

    AuthoritiesPage:
      description: |
        Retrieves all organisation authority configurations in the platform
      headers:
        x-fapi-interaction-id:
          schema:
            $ref: '#/components/schemas/xFapiInteractionId'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/AuthoritiesPage'

    AuthorityObject:
      description: |
        Get a reference authority by Id
      headers:
        x-fapi-interaction-id:
          schema:
            $ref: '#/components/schemas/xFapiInteractionId'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/AuthorityObject'

    Introspection:
      description: |
        metadata for token
      headers:
        x-fapi-interaction-id:
          schema:
            $ref: '#/components/schemas/xFapiInteractionId'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Introspection'
    SoftwareStatement:
      description: Get the software statements with the given id
      headers:
        x-fapi-interaction-id:
          schema:
            $ref: '#/components/schemas/xFapiInteractionId'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/SoftwareStatement'
    SoftwareStatementResponse:
      description: Get the software statements with the given id
      headers:
        x-fapi-interaction-id:
          schema:
            $ref: '#/components/schemas/xFapiInteractionId'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/SoftwareStatementResponse'
    SoftwareStatementAssertion:
      description: OK
      headers:
        x-fapi-interaction-id:
          schema:
            $ref: '#/components/schemas/xFapiInteractionId'
      content:
        application/jwt:
          schema:
            $ref: '#/components/schemas/SoftwareStatementAssertion'
        application/json:
          schema:
            $ref: '#/components/schemas/SoftwareStatementAssertion'
    SoftwareAuthorityClaims:
      description: Authority claim for the given Id
      headers:
        x-fapi-interaction-id:
          schema:
            $ref: '#/components/schemas/xFapiInteractionId'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/SoftwareAuthorityClaims'
    SoftwareAuthorityClaim:
      description: Authority claim for the given Id
      headers:
        x-fapi-interaction-id:
          schema:
            $ref: '#/components/schemas/xFapiInteractionId'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/SoftwareAuthorityClaim'
    ServerAuthorityClaimPage:
      description: Page of server authority claim for the given server id
      headers:
        x-fapi-interaction-id:
          schema:
            $ref: '#/components/schemas/xFapiInteractionId'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ServerAuthorityClaimPage'
    ServerAuthorityClaim:
      description: Authority claim for the given Id
      headers:
        x-fapi-interaction-id:
          schema:
            $ref: '#/components/schemas/xFapiInteractionId'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ServerAuthorityClaim'
    ClientCreationResponse:
      description: |
        Creates an OAuth Client in the OpenID Server
      headers:
        x-fapi-interaction-id:
          schema:
            $ref: '#/components/schemas/xFapiInteractionId'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ClientCreationResponse'

    RetrieveTokenResponse:
      description: |
        Access token response
      headers:
        x-fapi-interaction-id:
          schema:
            $ref: '#/components/schemas/xFapiInteractionId'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/AccessTokenResponse'

    SuperUsersPage:
      description: All super users
      headers:
        x-fapi-interaction-id:
          schema:
            $ref: '#/components/schemas/xFapiInteractionId'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/SuperUsersPage'

    SuperUser:
      description: Super user data
      headers:
        x-fapi-interaction-id:
          schema:
            $ref: '#/components/schemas/xFapiInteractionId'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/SuperUser'

    CertificationManagers:
      description: All certification managers
      headers:
        x-fapi-interaction-id:
          schema:
            $ref: '#/components/schemas/xFapiInteractionId'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/CertificationManagersPage'

    CertificationManager:
      description: Certification manager data
      headers:
        x-fapi-interaction-id:
          schema:
            $ref: '#/components/schemas/xFapiInteractionId'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/CertificationManager'

    AuthorisationDomainUsersPage:
      description: All users belonging to an authorisation domain
      headers:
        x-fapi-interaction-id:
          schema:
            $ref: '#/components/schemas/xFapiInteractionId'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/AuthorisationDomainUsersPage'

    AuthorisationDomainUser:
      description: User data belonging to an authorisation domain
      headers:
        x-fapi-interaction-id:
          schema:
            $ref: '#/components/schemas/xFapiInteractionId'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/AuthorisationDomainUser'


    AuthorisationDomainsPage:
      description: All data of authorisation domains mapped to an authority
      headers:
        x-fapi-interaction-id:
          schema:
            $ref: '#/components/schemas/xFapiInteractionId'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/AuthorisationDomainsPage'

    AuthorisationDomain:
      description: Data of an authorisation domain mapped to an authority
      headers:
        x-fapi-interaction-id:
          schema:
            $ref: '#/components/schemas/xFapiInteractionId'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/AuthorisationDomain'

    AuthorisationDomainRolesPage:
      description: All data of authorisation domains mapped to an authority
      headers:
        x-fapi-interaction-id:
          schema:
            $ref: '#/components/schemas/xFapiInteractionId'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/AuthorisationDomainRolesPage'

    AuthorisationDomainRole:
      description: Role data
      headers:
        x-fapi-interaction-id:
          schema:
            $ref: '#/components/schemas/xFapiInteractionId'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/AuthorisationDomainRole'

    AuthorityAuthorisationDomainsPage:
      description: All data of authorisation domains mapped to an authority
      headers:
        x-fapi-interaction-id:
          schema:
            $ref: '#/components/schemas/xFapiInteractionId'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/AuthorityAuthorisationDomainsPage'

    AuthorityAuthorisationDomain:
      description: Authority to domain mapping data
      headers:
        x-fapi-interaction-id:
          schema:
            $ref: '#/components/schemas/xFapiInteractionId'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/AuthorityAuthorisationDomain'

    OrganisationAuthorityDomainClaimsPage:
      description: All data of an organisation's authority domain claims
      headers:
        x-fapi-interaction-id:
          schema:
            $ref: '#/components/schemas/xFapiInteractionId'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/OrganisationAuthorityDomainClaimsPage'

    OrganisationAuthorityDomainClaimObject:
      description: All authority to domain mappings data
      headers:
        x-fapi-interaction-id:
          schema:
            $ref: '#/components/schemas/xFapiInteractionId'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/OrganisationAuthorityDomainClaimObject'

    UserDetail:
      description: Details of the user
      headers:
        x-fapi-interaction-id:
          schema:
            $ref: '#/components/schemas/xFapiInteractionId'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/UserDetail'

    UserOPInfo:
      description: User information from the OpenId Provider
      headers:
        x-fapi-interaction-id:
          schema:
            $ref: '#/components/schemas/xFapiInteractionId'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/UserOPInfo'

    WellKnown:
      description: endpoint discovery for well known endpoint
      headers:
        x-fapi-interaction-id:
          schema:
            $ref: '#/components/schemas/xFapiInteractionId'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/WellKnown'

    TermsAndConditionsPage:
      description: Paged data of TnC items
      headers:
        x-fapi-interaction-id:
          schema:
            $ref: '#/components/schemas/xFapiInteractionId'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/TermsAndConditionsPage'

    TermsAndConditionsItem:
      description: Details of the TnC item
      headers:
        x-fapi-interaction-id:
          schema:
            $ref: '#/components/schemas/xFapiInteractionId'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/TermsAndConditionsItem'

    OrganisationAdminUsers:
      description: All admin users for this org
      headers:
        x-fapi-interaction-id:
          schema:
            $ref: '#/components/schemas/xFapiInteractionId'
      content:
        application/json:
          schema:
            oneOf:
              - $ref: '#/components/schemas/OrganisationAdminUsers'
              - $ref: '#/components/schemas/OrganisationAdminUsersPage'

    OrganisationAdminUser:
      description: Admin user details
      headers:
        x-fapi-interaction-id:
          schema:
            $ref: '#/components/schemas/xFapiInteractionId'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/OrganisationAdminUser'

    FederationMetadataPolicyPage:
      description: Paged data of federation metadata policies
      headers:
        x-fapi-interaction-id:
          schema:
            $ref: '#/components/schemas/xFapiInteractionId'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/FederationMetadataPolicyPage'

    FederationMetadataPolicyItem:
      description: Details of the federation metadata policy item
      headers:
        x-fapi-interaction-id:
          schema:
            $ref: '#/components/schemas/xFapiInteractionId'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/FederationMetadataPolicyItem'

    FederationsPage:
      description: Paged data of federations
      headers:
        x-fapi-interaction-id:
          schema:
            $ref: '#/components/schemas/xFapiInteractionId'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/FederationsPage'

    FederationItem:
      description: Details of the federation item
      headers:
        x-fapi-interaction-id:
          schema:
            $ref: '#/components/schemas/xFapiInteractionId'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/FederationItem'

    ApiResources:
      description: Authorisation server Api Resources response
      headers:
        x-fapi-interaction-id:
          schema:
            $ref: '#/components/schemas/xFapiInteractionId'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ApiResources'

    ApiResource:
      description: Authorisation server Api Resource response
      headers:
        x-fapi-interaction-id:
          schema:
            $ref: '#/components/schemas/xFapiInteractionId'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ApiResource'

    ApiDiscoveryEndpoints:
      description: Authorisation server response
      headers:
        x-fapi-interaction-id:
          schema:
            $ref: '#/components/schemas/xFapiInteractionId'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ApiDiscoveryEndpoints'

    ApiDiscoveryEndpoint:
      description: Authorisation server response
      headers:
        x-fapi-interaction-id:
          schema:
            $ref: '#/components/schemas/xFapiInteractionId'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ApiDiscoveryEndpoint'

    ApiDiscoveryEndpointFamilyResponse:
      description: Api endpoint creation response with family complete flag
      headers:
        x-fapi-interaction-id:
          schema:
            $ref: '#/components/schemas/xFapiInteractionId'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ApiDiscoveryEndpointFamilyResponse'

    UserTermsAndConditionsPage:
      description: User TnCs history
      headers:
        x-fapi-interaction-id:
          schema:
            $ref: '#/components/schemas/xFapiInteractionId'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/UserTermsAndConditionsPage'

    OrgTermsAndConditionsPage:
      description: Org TnCs history
      headers:
        x-fapi-interaction-id:
          schema:
            $ref: '#/components/schemas/xFapiInteractionId'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/OrgTermsAndConditionsPage'

    EssPollResponse:
      description: External Signing Service Poll response
      headers:
        x-fapi-interaction-id:
          schema:
            $ref: '#/components/schemas/xFapiInteractionId'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/EssPollResponse'

    EssPollAllResponse:
      description: External Signing Service Poll All response
      headers:
        x-fapi-interaction-id:
          schema:
            $ref: '#/components/schemas/xFapiInteractionId'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/EssPollResponses'

    AllWebhooksResponse:
      description: Update all webhooks response
      headers:
        x-fapi-interaction-id:
          schema:
            $ref: '#/components/schemas/xFapiInteractionId'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/WebhookStatusResponses'

    CustomClaimList:
      description: List of custom claim objects
      headers:
        x-fapi-interaction-id:
          schema:
            $ref: '#/components/schemas/xFapiInteractionId'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/CustomClaimList'

    CustomClaimObject:
      description: A single custom claim object
      headers:
        x-fapi-interaction-id:
          schema:
            $ref: '#/components/schemas/xFapiInteractionId'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/CustomClaimObject'

    MetadataList:
      description: List of all metadata associated with an object
      headers:
        x-fapi-interaction-id:
          schema:
            $ref: '#/components/schemas/xFapiInteractionId'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/MetadataListResponse'

    Metadata:
      description: Single metadata object
      headers:
        x-fapi-interaction-id:
          schema:
            $ref: '#/components/schemas/xFapiInteractionId'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/MetadataResponse'

    RegisteredClientsPage:
      description: All clients
      headers:
        x-fapi-interaction-id:
          schema:
            $ref: '#/components/schemas/xFapiInteractionId'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/RegisteredClientsPage'

    RegisteredClients:
      description: All registered clients
      headers:
        x-fapi-interaction-id:
          schema:
            $ref: '#/components/schemas/xFapiInteractionId'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/RegisteredClients'

    RegisteredClient:
      description: All registered clients
      headers:
        x-fapi-interaction-id:
          schema:
            $ref: '#/components/schemas/xFapiInteractionId'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/RegisteredClient'

    AuditHistoryPage:
      description: Audit history in paginated form
      headers:
        x-fapi-interaction-id:
          schema:
            $ref: '#/components/schemas/xFapiInteractionId'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/AuditHistoryPage'

    CertificationTypes:
      description: Certification Type
      headers:
        x-fapi-interaction-id:
          schema:
            $ref: '#/components/schemas/xFapiInteractionId'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/CertificationTypePage'
    CertificationType:
      description: Certification Type
      headers:
        x-fapi-interaction-id:
          schema:
            $ref: '#/components/schemas/xFapiInteractionId'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/CertificationType'
    CertificationTypeVariantPage:
      description: Certification Type Variant page
      headers:
        x-fapi-interaction-id:
          schema:
            $ref: '#/components/schemas/xFapiInteractionId'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/CertificationTypeVariantPage'

    CertificationTypeVariant:
      description: Certification Type Variant
      headers:
        x-fapi-interaction-id:
          schema:
            $ref: '#/components/schemas/xFapiInteractionId'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/CertificationTypeVariant'

    ApiResourceMetadataItemResponse:
      description: A response of a given API resource metadata including the status
      headers:
        x-fapi-interaction-id:
          schema:
            $ref: '#/components/schemas/xFapiInteractionId'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ApiResourceMetadata'

    UserGroupPermissionPage:
      description: A paginated set of user group permissions
      headers:
        x-fapi-interaction-id:
          schema:
            $ref: '#/components/schemas/xFapiInteractionId'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/UserGroupPermissionPage'

    UserGroupPermissionObject:
      description: A specific user group permission
      headers:
        x-fapi-interaction-id:
          schema:
            $ref: '#/components/schemas/xFapiInteractionId'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/UserGroupPermissionObject'

    UserGroupMembersPage:
      description: A paginated set of user group members
      headers:
        x-fapi-interaction-id:
          schema:
            $ref: '#/components/schemas/xFapiInteractionId'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/UserGroupMembersPage'

    HighLevelSsoConfigurationObjectPage:
      description: A paginated set of IDPs configured as SSO providers
      headers:
        x-fapi-interaction-id:
          schema:
            $ref: '#/components/schemas/xFapiInteractionId'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/HighLevelSsoConfigurationObjectPage'

    HighLevelSsoConfigurationObject:
      description: An IDP configured as an SSO provider
      headers:
        x-fapi-interaction-id:
          schema:
            $ref: '#/components/schemas/xFapiInteractionId'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/HighLevelSsoConfigurationObject'

    UserGroupPage:
      description: A paginated set of user groups
      headers:
        x-fapi-interaction-id:
          schema:
            $ref: '#/components/schemas/xFapiInteractionId'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/UserGroupPage'

    UserGroupObject:
      description: A user group
      headers:
        x-fapi-interaction-id:
          schema:
            $ref: '#/components/schemas/xFapiInteractionId'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/UserGroupObject'

    UserGroupIDPBindingPage:
      description: A page of mappings between an IDP Configuration and a User Group
      headers:
        x-fapi-interaction-id:
          schema:
            $ref: '#/components/schemas/xFapiInteractionId'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/UserGroupIDPBindingPage'

    UserGroupIDPBindingObject:
      description: A mapping between an IDP Configuration and a User Group
      headers:
        x-fapi-interaction-id:
          schema:
            $ref: '#/components/schemas/xFapiInteractionId'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/UserGroupIDPBindingObject'

    UserGroupOrganisationBindingPage:
      description: A page of mappings between an IDP Configuration and a User Group
      headers:
        x-fapi-interaction-id:
          schema:
            $ref: '#/components/schemas/xFapiInteractionId'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/UserGroupOrganisationBindingPage'

    UserGroupOrganisationBindingObject:
      description: A mapping between an IDP Configuration and a User Group
      headers:
        x-fapi-interaction-id:
          schema:
            $ref: '#/components/schemas/xFapiInteractionId'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/UserGroupOrganisationBindingObject'

    SsoConfigurationObjectPage:
      description: A paginated set of sso configuration options for a given authorisation server
      headers:
        x-fapi-interaction-id:
          schema:
            $ref: '#/components/schemas/xFapiInteractionId'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/SsoConfigurationObjectPage'

    SsoConfigurationObject:
      description: A single sso configuration option for a given authorisation server
      headers:
        x-fapi-interaction-id:
          schema:
            $ref: '#/components/schemas/xFapiInteractionId'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/SsoConfigurationObject'

    SsoConfigurationVersionObjectPage:
      description: A paginated set of sso configuration versions for a given authorisation server sso configuration
      headers:
        x-fapi-interaction-id:
          schema:
            $ref: '#/components/schemas/xFapiInteractionId'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/SsoConfigurationVersionObjectPage'

    SsoConfigurationVersionObject:
      description: A single sso configuration version for a given authorisation server's sso configuration
      headers:
        x-fapi-interaction-id:
          schema:
            $ref: '#/components/schemas/xFapiInteractionId'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/SsoConfigurationVersionObject'

  schemas:
    CustomClaimID:
      type: string
      format: uuid
      description: Unique identifier for a given custom claim object

    CustomClaimCreationRequest:
      type: object
      properties:
        Name:
          type: string
          pattern: '^[A-Za-z0-9_~-]+$'
          maxLength: 255
          description: Key value for the custom claim as it will appear in the ID Token
        Path:
          type: string
          default: '$.'
          pattern: '^\$[.\[].*'
          maxLength: 255
          description: Valid JSON Path indicating the values in the trust framework profile to be pulled into the claim
        Source:
          type: string
          description: Source from which the custom claim data is to be pulled. Determines the structure of the path
          enum:
            - TRUST_FRAMEWORK_PROFILE
      required:
        - Name
        - Path
        - Source

    CustomClaimUpdateRequest:
      type: object
      allOf:
        - $ref: '#/components/schemas/CustomClaimCreationRequest'

    CustomClaimObject:
      type: object
      allOf:
        - $ref: '#/components/schemas/CustomClaimUpdateRequest'
        - type: object
          properties:
            ID:
              $ref: '#/components/schemas/CustomClaimID'
            ClaimKey:
              type: string
              description: The claim key as it will appear in identity responses
              readOnly: true
            CreatedAt:
              $ref: '#/components/schemas/CreatedAt'
            UpdatedAt:
              $ref: '#/components/schemas/UpdatedAt'

    CustomClaimList:
      allOf:
        - $ref: '#/components/schemas/PaginationProperties'
        - type: object
          properties:
            content:
              type: array
              items:
                $ref: '#/components/schemas/CustomClaimObject'

    ApiResourceMetadata:
      type: object

    AuditHistoryPage:
      type: object
      allOf:
        - $ref: '#/components/schemas/PaginationProperties'
      properties:
        items:
          type: array
          items:
            anyOf:
              - $ref: '#/components/schemas/OrganisationAuthorityClaimDetailsAudit'
              - $ref: '#/components/schemas/SoftwareStatementAudit'

    ApiResourceDetailAudit:
      type: object
      allOf:
        - $ref: '#/components/schemas/AuditFields'
        - $ref: '#/components/schemas/ApiResourceDetail'

    ApiDiscoveryEndpointAudit:
      type: object
      allOf:
        - $ref: '#/components/schemas/AuditFields'
        - $ref: '#/components/schemas/ApiDiscoveryEndpoint'

    AuthorisationServerDetailsAudit:
      type: object
      allOf:
        - $ref: '#/components/schemas/AuditFields'
        - $ref: '#/components/schemas/AuthorisationServerResponse'
      properties:
        Flags:
          $ref: '#/components/schemas/FlagArray'

    AuthorisationServerCertificationAudit:
      type: object
      allOf:
        - $ref: '#/components/schemas/AuditFields'
        - $ref: '#/components/schemas/AuthorisationServerCertification'

    ContactAudit:
      type: object
      allOf:
        - $ref: '#/components/schemas/AuditFields'
        - $ref: '#/components/schemas/Contact'

    OrganisationAudit:
      type: object
      allOf:
        - $ref: '#/components/schemas/AuditFields'
        - $ref: '#/components/schemas/Organisation'

    CertificateOrKeyAudit:
      type: object
      allOf:
        - $ref: '#/components/schemas/AuditFields'
        - $ref: '#/components/schemas/CertificateOrKey'

    OrganisationAuthorityClaimDetailsAudit:
      type: object
      allOf:
        - $ref: '#/components/schemas/AuditFields'
        - $ref: '#/components/schemas/OrganisationAuthorityDomainRoleClaimObject'

    OrganisationAuthorityClaimAuthorisationAudit:
      type: object
      allOf:
        - $ref: '#/components/schemas/AuditFields'
        - $ref: '#/components/schemas/OrganisationAuthorityClaimAuthorisation'

    OrganisationAuthorityDomainClaimAudit:
      type: object
      allOf:
        - $ref: '#/components/schemas/AuditFields'
        - $ref: '#/components/schemas/OrganisationAuthorityDomainClaimObject'

    AuthorisationDomainUserAudit:
      type: object
      allOf:
        - $ref: '#/components/schemas/AuditFields'
        - $ref: '#/components/schemas/AuthorisationDomainUser'

    UserDetailsAudit:
      type: object
      allOf:
        - $ref: '#/components/schemas/AuditFields'
        - $ref: '#/components/schemas/UserDetails'

    OrganisationAdminUserDetailsAudit:
      type: object
      allOf:
        - $ref: '#/components/schemas/AuditFields'
        - $ref: '#/components/schemas/OrganisationAdminUserDetails'

    SoftwareStatementAudit:
      type: object
      allOf:
        - $ref: '#/components/schemas/AuditFields'
        - $ref: '#/components/schemas/SoftwareStatementAuditRecord'

    AuditFields:
      type: object
      properties:
        ResourceType:
          $ref: '#/components/schemas/ResourceType'
        EntryType:
          $ref: '#/components/schemas/ActionType'
        PerformedBy:
          type: string
          description: The user who performed the action
        Timestamp:
          type: string
          format: date
          description: When the action was performed
        EntryId:
          type: integer
          description: The unique ID of the action

    ActionType:
      type: string
      enum:
        - created
        - updated
        - deleted

    GlobalSearchStatusEnums:
      type: array
      items:
        $ref: '#/components/schemas/GlobalSearchStatusEnum'

    GlobalSearchResourceTypes:
      type: array
      items:
        $ref: '#/components/schemas/GlobalSearchResourceType'

    GlobalSearchResourceType:
      type: "string"
      enum:
        - organisation
        - softwareStatement
        - authorisationServer
        - certificate

    ResourceType:
      type: "string"
      enum:
        - apiDiscoveryEndpoint
        - apiResource
        - authorisationDomainSystem
        - authorisationDomainUserType
        - authorisationServer
        - authorisationServerCertification
        - authorisationServerFederation
        - authorisationServerFederationPolicy
        - authorisationServerFlag
        - certificationType
        - certificationManager
        - certificationTypeVariant
        - contact
        - dataAdministrator
        - domain
        - domainUser
        - federation
        - federationMetadataPolicy
        - flag
        - contactType
        - jwk
        - organisation
        - organisationAdmin
        - organisationAuthorityClaim
        - organisationAuthorityClaimAuthorisations
        - organisationAuthorityDomainClaim
        - organisationCertificate
        - organisationFlag
        - organisationTermsAndConditions
        - authority
        - referenceAuthority
        - referenceAuthorisationDomain
        - referenceAuthorisationDomainRole
        - referenceAuthorisationDomainRoleMetadata
        - referenceAuthorityAuthorisationDomain
        - referenceTermsAndConditions
        - registeredClient
        - serverAuthorityAuthorityRoleClaim
        - softwareStatement
        - softwareStatementAuthorityRoleClaim
        - softwareStatementCertification
        - softwareStatementMetadata
        - softwareStatementFlag
        - softwareStatementJwk
        - ssoConfiguration
        - ssoConfigurationVersion
        - superUser
        - user
        - userGroup
        - userGroupIdpBinding
        - userGroupOrganisationBinding
        - userGroupPermissionBinding
        - userGroupUserMapping
        - webhookSubscriptionForDeletion
        - apiFamilies
        - conformanceConfigurations
        - subDomain
        - customClaim

    FederationId:
      type: string
      format: uuid
      description: The ID of the federation

    FederationsPage:
      type: object
      allOf:
        - $ref: '#/components/schemas/PaginationProperties'
      properties:
        content:
          type: array
          items:
            $ref: '#/components/schemas/FederationItem'

    FederationItem:
      type: object
      properties:
        ReferenceID:
          $ref: '#/components/schemas/FederationId'
        Name:
          $ref: '#/components/schemas/FederationName'
        Description:
          $ref: '#/components/schemas/FederationDescription'
        FederationFetchEndpoint:
          $ref: '#/components/schemas/FederationFetchEndpoint'
        FederationListEndpoint:
          $ref: '#/components/schemas/FederationListEndpoint'
        FederationResolveEndpoint:
          $ref: '#/components/schemas/FederationResolveEndpoint'
        FederationTrustMarkStatusEndpoint:
          $ref: '#/components/schemas/FederationTrustMarkStatusEndpoint'
        FederationTrustMarkListEndpoint:
          $ref: '#/components/schemas/FederationTrustMarkListEndpoint'
        OrganizationName:
          $ref: '#/components/schemas/FederationOrganizationName'
        Contacts:
          $ref: '#/components/schemas/FederationContacts'
        LogoUri:
          $ref: '#/components/schemas/FederationLogoUri'
        PolicyUri:
          $ref: '#/components/schemas/FederationPolicyUri'
        HomepageUri:
          $ref: '#/components/schemas/FederationHomepageUri'
        CreatedAt:
          $ref: '#/components/schemas/CreatedAt'
        Status:
          $ref: '#/components/schemas/StatusEnum'
        RemoteTrustAnchor:
          $ref: '#/components/schemas/FederationRemoteTrustAnchor'

    FederationRequest:
      type: object
      properties:
        Name:
          $ref: '#/components/schemas/FederationName'
        Description:
          $ref: '#/components/schemas/FederationDescription'
        OrganizationName:
          $ref: '#/components/schemas/FederationOrganizationName'
        Contacts:
          $ref: '#/components/schemas/FederationContacts'
        LogoUri:
          $ref: '#/components/schemas/FederationLogoUri'
        PolicyUri:
          $ref: '#/components/schemas/FederationPolicyUri'
        HomepageUri:
          $ref: '#/components/schemas/FederationHomepageUri'
        Status:
          $ref: '#/components/schemas/StatusEnum'
        RemoteTrustAnchor:
          $ref: '#/components/schemas/FederationRemoteTrustAnchor'
      required:
        - Name

    FederationName:
      type: string
      pattern: "^[^<>]*$"
      maxLength: 255
      description: The name of the federation
      x-required-message: Name must be provided

    FederationDescription:
      type: string
      pattern: "^[^<>]*$"
      maxLength: 255
      description: The description of the federation
      x-required-message: Description must be provided

    FederationOrganizationName:
      type: string
      pattern: "^[^<>]*$"
      maxLength: 255
      description: The organization name of the federation
      x-required-message: OrganizationName must be provided

    FederationContacts:
      type: array
      description: The contacts of the federation
      items:
        $ref: '#/components/schemas/FederationContact'

    FederationContact:
      type: string
      pattern: "^[^<>]*$"
      maxLength: 255
      description: The contact of the federation

    FederationLogoUri:
      type: string
      pattern: "^[^<>]*$"
      maxLength: 255
      description: The logo uri of the federation
      x-required-message: LogoUri must be provided

    FederationPolicyUri:
      type: string
      pattern: "^[^<>]*$"
      maxLength: 255
      description: The policy uri of the federation
      x-required-message: PolicyUri must be provided

    FederationHomepageUri:
      type: string
      pattern: "^[^<>]*$"
      maxLength: 255
      description: The homepage uri of the federation
      x-required-message: HomepageUri must be provided

    FederationFetchEndpoint:
      type: string
      format: uri
      maxLength: 255
      description: The fetch endpoint of the federation
      x-required-message: FederationFetchEndpoint must be provided

    FederationListEndpoint:
      type: string
      format: uri
      maxLength: 255
      description: The list endpoint of the federation
      x-required-message: FederationListEndpoint must be provided

    FederationResolveEndpoint:
      type: string
      format: uri
      maxLength: 255
      description: The resolve endpoint of the federation
      x-required-message: FederationResolveEndpoint must be provided

    FederationTrustMarkStatusEndpoint:
      type: string
      format: uri
      maxLength: 255
      description: The trust mark status endpoint of the federation
      x-required-message: FederationTrustMarkStatusEndpoint must be provided

    FederationTrustMarkListEndpoint:
      type: string
      format: uri
      maxLength: 255
      description: The trust mark list endpoint of the federation
      x-required-message: FederationTrustMarkListEndpoint must be provided

    FederationRemoteTrustAnchor:
      type: array
      items:
        type: string
        format: uri
        maxLength: 255
        description: The uri for a remote trust anchor

    FederationMetadataPolicyPage:
      type: object
      allOf:
        - $ref: '#/components/schemas/PaginationProperties'
      properties:
        content:
          type: array
          items:
            $ref: '#/components/schemas/FederationMetadataPolicyItem'

    FederationMetadataPolicyItem:
      type: object
      properties:
        ReferenceID:
          $ref: '#/components/schemas/MetadataPolicyId'
        FederationID:
          $ref: '#/components/schemas/FederationId'
        Type:
          $ref: '#/components/schemas/MetadataPolicyTypeEnum'
        Version:
          $ref: '#/components/schemas/MetadataPolicyVersion'
        Policy:
          $ref: '#/components/schemas/MetadataPolicyJson'
        Status:
          $ref: '#/components/schemas/PolicyApprovalStatusEnum'
        CreatedAt:
          $ref: '#/components/schemas/CreatedAt'

    FederationMetadataPolicyRequest:
      type: object
      properties:
        Type:
          $ref: '#/components/schemas/MetadataPolicyTypeEnum'
        Policy:
          $ref: '#/components/schemas/MetadataPolicyJson'
        Status:
          $ref: '#/components/schemas/PolicyApprovalStatusEnum'
      required:
        - Type
        - Policy
        - Status

    MetadataPolicyId:
      type: string
      pattern: "^[^<>]*$"
      maxLength: 36
      description: The id of the metadata policy

    MetadataPolicyTypeEnum:
      type: string
      pattern: "^[^<>]*$"
      description: The type of the metadata policy
      x-required-message: Type must be provided
      enum:
        - openid_relying_party
        - openid_provider
        - oauth_authorization_server
        - oauth_client
        - oauth_resource
        - federation_entity

    MetadataPolicyVersion:
      type: integer
      description: The version of the metadata policy
      x-required-message: MetadataPolicyVersion must be provided

    ApprovalFlowStatusEnum:
      type: string
      pattern: "^[^<>]*$"
      description: The status of a resource that has an approval flow
      x-required-message: Status must be provided
      enum:
        - Active
        - Assignable
        - Pending
        - Rejected
        - Inactive

    PolicyApprovalStatusEnum:
      type: string
      pattern: "^[^<>]*$"
      description: The status of the policy
      x-required-message: Status must be provided
      enum:
        - active
        - assignable
        - pending
        - rejected

    MetadataPolicyJson:
      type: string
      pattern: "^[^<>]*$"
      description: The json of the metadata policy
      x-required-message: Policy must be provided

    DocusignPost:
      type: object
      properties:
        event:
          type: string
          pattern: "^[^<>]*$"
          description: The docusign event type
          x-required-message: event must be provided
        data:
          $ref: '#/components/schemas/DocusignPostData'

    DocusignPostData:
      type: object
      description: Data associated with the docusign event
      x-required-message: data must be provided
      properties:
        envelopeId:
          type: string
          pattern: "^[^<>]*$"
          description: The envelope ID
          x-required-message: data.envelopeId must be provided
        envelopeSummary:
          $ref: '#/components/schemas/EnvelopeSummary'

    EnvelopeSummary:
      type: object
      description: Summary of the envelope
      x-required-message: data.envelopeSummary must be provided
      properties:
        status:
          type: string
          pattern: "^[^<>]*$"
          description: The status of the envelope
          x-required-message: data.envelopeSummary.status must be provided

    xFapiInteractionId:
      description: "An RFC4122 UID used as a correlation id."
      type: string
      pattern: '^[a-zA-Z0-9][a-zA-Z0-9\-]{0,99}$'
      minLength: 1
      maxLength: 100
      example: 73cac523-d3ae-2289-b106-330a6218710d
    HttpResponseBody:
      type: object
      properties:
        errors:
          type: array
          description: Validation Error messages
          items:
            type: string
    OpErrorResponseBody:
      type: object
      properties:
        error:
          type: string
          description: Validation Error
        error_description:
          type: string
          description: Validation Error description
    UserUpdateRequest:
      type: object
      properties:
        Status:
          $ref: '#/components/schemas/StatusEnum'
      required:
        - Status
    GlobalSearchStatusEnum:
      type: string
      default: Active
      description: Status of the resource
      enum:
        - Active
        - Inactive
        - Suspended
        - Withdrawn
        - Pending
    StatusEnum:
      type: string
      default: Active
      description: Current status of this resource
      enum:
        - Active
        - Inactive
      x-required-message: Status must be provided
    CertificationStatusEnum:
      type: string
      description: The different types of certification status
      enum:
        - Awaiting Certification
        - Certified
        - Deprecated
        - Rejected
        - Warning
        - Self-Certified
      default:
        Awaiting Certification
    OrganisationAuthorityDomainRoleClaims:
      type: array
      items:
        $ref: '#/components/schemas/OrganisationAuthorityDomainRoleClaimObject'

    OrganisationAuthorityDomainRoleClaimsPage:
      allOf:
        - $ref: '#/components/schemas/PaginationProperties'
      properties:
        content:
          type: array
          items:
            $ref: '#/components/schemas/OrganisationAuthorityDomainRoleClaimObject'

    UniqueTechnicalIdentifiers:
      type: array
      maxItems: 16
      uniqueItems: true
      items:
        $ref: '#/components/schemas/UniqueTechnicalIdentifier'

    UniqueTechnicalIdentifier:
      type: string
      pattern: "^[^<>]*$"
      maxLength: 255

    OrganisationAuthorityDomainRoleClaimCreationRequest:
      type: object
      properties:
        AuthorityId:
          $ref: '#/components/schemas/AuthorityId'
        AuthorisationDomainID:
          $ref: '#/components/schemas/AuthorisationDomainID'
        AuthorisationDomain:
          type: string
          deprecated: true
          pattern: "^[^<>]*$"
          description: 'Authorisation domain name. 
            Deprecated in favour of providing the ID. 
            Note, when fully deprecated, will still be returned in the response object'
        AuthorisationDomainRoleIdentifier:
          $ref: '#/components/schemas/AuthorisationDomainRoleID'
        Role:
          type: string
          deprecated: true
          description: 'Authorisation domain role name. 
            Deprecated in favour of providing the ID. 
            Note, when fully deprecated, will still be returned in the response object'
          example: "PAGTO"
          pattern: "^[^<>]*$"
        RegistrationId:
          type: string
          pattern: "^[^<>]*$"
          minLength: 1
          description: Registration ID for the organisation
          maxLength: 40
          x-required-message: RegistrationId must be provided
        UniqueTechnicalIdentifiers:
          $ref: '#/components/schemas/UniqueTechnicalIdentifiers'
      required:
        - AuthorityId

    OrganisationAuthorityDomainRoleClaimUpdateRequest:
      type: object
      allOf:
        - $ref: '#/components/schemas/OrganisationAuthorityDomainRoleClaimCreationRequest'
        - type: object
          properties:
            Status:
              $ref: '#/components/schemas/StatusEnum'
      required:
        - Status
        - AuthorityId

    OrganisationAuthorityDomainRoleClaimObject:
      type: object
      allOf:
        - $ref: '#/components/schemas/OrganisationAuthorityDomainRoleClaimUpdateRequest'
        - type: object
          properties:
            OrganisationAuthorityClaimId:
              $ref: '#/components/schemas/OrganisationAuthorityClaimId'
            OrganisationId:
              $ref: '#/components/schemas/OrganisationId'
            Authorisations:
              type: array
              items:
                type: object
                properties:
                  Status:
                    $ref: '#/components/schemas/StatusEnum'
                  MemberState:
                    type: string
                    pattern: "^[^<>]*$"
                    description: Abbreviated states information i.e. GB, IE, NL etc
                    maxLength: 2
            RoleType:
              type: string
              pattern: "^[^<>]*$"
              description: Type of authorisation domain role
              maxLength: 255
            Exclusive:
              $ref: '#/components/schemas/ExclusiveAuthorisationDomainRole'
            Metadata:
              type: object
              description: Authorisation domain role metadata
              maxLength: 255

    GlobalSearchResponse:
      type: object
      properties:
        results:
          type: array
          items:
            type: object
            properties:
              resourceType:
                $ref: '#/components/schemas/GlobalSearchResourceType'
              name:
                type: string
              legalEntityName:
                type: string
                nullable: true
              organisationId:
                type: string
                nullable: true
              softwareStatementId:
                $ref: '#/components/schemas/SoftwareStatementId'
              identifier:
                type: string
              status:
                $ref: '#/components/schemas/GlobalSearchStatusEnum'
            required:
              - resourceType
              - name
              - identifier
              - status
    
    OrganisationAuthorityClaimAuthorisations:
      type: array
      items:
        $ref: '#/components/schemas/OrganisationAuthorityClaimAuthorisation'

    OrganisationAuthorityClaimAuthorisationsPage:
      allOf:
        - $ref: '#/components/schemas/PaginationProperties'
      properties:
        content:
          type: array
          items:
            $ref: '#/components/schemas/OrganisationAuthorityClaimAuthorisation'

    OrganisationAuthorityClaimAuthorisation:
      type: object
      properties:
        OrganisationAuthorisationId:
          $ref: '#/components/schemas/OrganisationAuthorisationId'
        OrganisationAuthorityClaimId:
          $ref: '#/components/schemas/OrganisationAuthorityClaimId'
        Status:
          $ref: '#/components/schemas/StatusEnum'
        MemberState:
          type: string
          pattern: "^[^<>]*$"
          description: Abbreviated states information i.e. GB, IE, NL etc
          maxLength: 10

    OrganisationAuthorityClaimAuthorisationRequest:
      type: object
      properties:
        Status:
          $ref: '#/components/schemas/StatusEnum'
        MemberState:
          type: string
          pattern: "^[^<>]*$"
          description: Abbreviated states information i.e. GB, IE, NL etc
          minLength: 2
          maxLength: 10
          x-required-message: MemberState must be provided
      required:
        - Status
        - MemberState


    CertificationExpirationDate:
      type: string
      pattern: "^[^<>]*$"
      description: JSONDatetime of certification expiration date

    CertificationStartDate:
      type: string
      description: JSONDatetime of certification start date
      pattern: "^[0-3][0-9]/[0-1][0-9]/2([0-9]{3})$"

    AuthorisationServers:
      type: array
      items:
        $ref: '#/components/schemas/AuthorisationServerResponse'

    AuthorisationServersPage:
        allOf:
            - $ref: '#/components/schemas/PaginationProperties'
        properties:
            content:
                type: array
                items:
                    $ref: '#/components/schemas/AuthorisationServerResponse'

    AuthorisationServersExportOpenData:
      type: array
      items:
        $ref: '#/components/schemas/AuthorisationServerExportOpenData'

    AuthorisationServerCertificationId:
      type: string
      pattern: "^[^<>]*$"
      description: Unique ID associated with the auth server certification
      minLength: 1
      maxLength: 40

    SoftwareStatementCertificationId:
      type: string
      pattern: "^[^<>]*$"
      description: Unique ID associated with the software statement certification
      minLength: 1
      maxLength: 40

    AuthorisationServerCertification:
      type: object
      properties:
        CertificationStartDate:
          $ref: '#/components/schemas/CertificationStartDate'
        CertificationExpirationDate:
          $ref: '#/components/schemas/CertificationExpirationDate'
        CertificationId:
          $ref: '#/components/schemas/AuthorisationServerCertificationId'
        AuthorisationServerId:
          $ref: '#/components/schemas/AuthorisationServerId'
        CertificationStatus:
          $ref: '#/components/schemas/CertificationStatusEnum'
        ProfileVariant:
          $ref: '#/components/schemas/ProfileVariant'
        ProfileType:
          $ref: '#/components/schemas/ProfileType'
        ProfileVersion:
          type: number
          description: The version number of the certification
          x-required-message: Version must be provided
        CertificationURI:
          $ref: '#/components/schemas/ApiCertificationUri'
        Status:
          $ref: '#/components/schemas/StatusEnum'

    AuthorisationServerCertificationExportData:
      type: object
      properties:
        CertificationStartDate:
          $ref: '#/components/schemas/CertificationStartDate'
        CertificationExpirationDate:
          $ref: '#/components/schemas/CertificationExpirationDate'
        CertificationId:
          $ref: '#/components/schemas/AuthorisationServerCertificationId'
        AuthorisationServerId:
          $ref: '#/components/schemas/AuthorisationServerId'
        CertificationStatus:
          $ref: '#/components/schemas/CertificationStatusEnum'
        ProfileVariant:
          $ref: '#/components/schemas/ProfileVariant'
        ProfileType:
          $ref: '#/components/schemas/ProfileType'
        ProfileVersion:
          type: number
          description: The version number of the certification
          x-required-message: Version must be provided
        CertificationURI:
          $ref: '#/components/schemas/ApiCertificationUri'
        Status:
          $ref: '#/components/schemas/CertificationStatusEnum'

    AuthorisationServerCertifications:
      type: array
      items:
        $ref: '#/components/schemas/AuthorisationServerCertification'
      description: The list of certifications for a given authorisation server

    AuthorisationServerCertificationsPage:
      allOf:
        - $ref: '#/components/schemas/PaginationProperties'
      properties:
        content:
          type: array
          items:
            $ref: '#/components/schemas/AuthorisationServerCertification'

    AuthorisationServerCertificationRequest:
      type: object
      properties:
        CertificationStartDate:
          type: string
          maxLength: 10
          pattern: "^[0-3][0-9]/[0-1][0-9]/2([0-9]{3})$"
          x-pattern-message: "Date must match the format of dd/mm/yyyy, for example 31/12/2021"
        CertificationStatus:
          $ref: '#/components/schemas/CertificationStatusEnum'
        ProfileVariant:
          $ref: '#/components/schemas/ProfileVariant'
        ProfileType:
          $ref: '#/components/schemas/ProfileType'
        ProfileVersion:
          type: number
          description: The version number of the certification
          x-required-message: Version must be provided
        CertificationURI:
          $ref: '#/components/schemas/ApiCertificationUri'
        Status:
          $ref: '#/components/schemas/StatusEnum'
      required:
        - CertificationStartDate
        - CertificationStatus
        - ProfileVariant
        - ProfileType
        - ProfileVersion
        - CertificationURI

    AuthorisationServerExportOpenData:
      type: object
      allOf:
        - $ref: '#/components/schemas/BaseAuthorisationServer'
        - $ref: '#/components/schemas/AdditionalAuthorisationServerFields'
        - type: object
          properties:
            Status:
              $ref: '#/components/schemas/StatusEnum'
            ApiResources:
              type: array
              items:
                $ref: '#/components/schemas/ApiResource'
            AuthorisationServerCertifications:
              type: array
              items:
                $ref: '#/components/schemas/AuthorisationServerCertificationExportData'
            Flags:
              $ref: '#/components/schemas/ExportFlagObject'

    ExportFlagObject:
      type: object
      description: JSON key-value pairs containing the flags the resource owns grouped by flag type
      example:
        Personal Accounts:
          - "multiple approvals"
          - "Temporization"
        Business Accounts:
          - "multiple approvals"
          - "Temporization"

    AuthorisationServerCreationRequest:
      type: object
      allOf:
        - $ref: '#/components/schemas/BaseAuthorisationServer'
        - type: object
          properties:
            Flags:
              $ref: '#/components/schemas/FlagIDArray'

    AuthorisationServerUpdateRequest:
      type: object
      allOf:
        - $ref: '#/components/schemas/AuthorisationServerCreationRequest'
        - type: object
          properties:
            Status:
              $ref: '#/components/schemas/StatusEnum'
      required:
        - Status

    AuthorisationServerResponseWithWarnings:
      type: object
      allOf:
        - $ref: '#/components/schemas/AuthorisationServerResponse'
        - type: object
          properties:
            OperationWarnings:
              type: array
              items:
                $ref: '#/components/schemas/OperationWarning'

    AuthorisationServerResponse:
      type: object
      allOf:
        - $ref: '#/components/schemas/BaseAuthorisationServer'
        - $ref: '#/components/schemas/AdditionalAuthorisationServerFields'
        - type: object
          properties:
            Status:
              $ref: '#/components/schemas/StatusEnum'
            Flags:
              $ref: '#/components/schemas/FlagArray'
            ApiResources:
              type: array
              items:
                $ref: '#/components/schemas/ApiResource'
            AuthorisationServerCertifications:
              type: array
              items:
                $ref: '#/components/schemas/AuthorisationServerCertification'

    BaseAuthorisationServer:
      type: object
      properties:
        AutoRegistrationSupported:
          $ref: '#/components/schemas/AutoRegistrationSupported'
        AutoRegistrationNotificationWebhook:
          $ref: '#/components/schemas/AutoRegistrationNotificationWebhook'
        CustomerFriendlyDescription:
          $ref: '#/components/schemas/CustomerFriendlyDescription'
        CustomerFriendlyLogoUri:
          $ref: '#/components/schemas/LogoUri'
        CustomerFriendlyName:
          $ref: '#/components/schemas/CustomerFriendlyName'
        DeveloperPortalUri:
          $ref: '#/components/schemas/DeveloperPortalUri'
        TermsOfServiceUri:
          $ref: '#/components/schemas/TermsOfServiceUri'
        NotificationWebhook:
          $ref: '#/components/schemas/SnsNotificationWebhookUri'
        Issuer:
          $ref: '#/components/schemas/Issuer'
        PayloadSigningCertLocationUri:
          $ref: '#/components/schemas/PayloadSigningCertLocationUri'
        ParentAuthorisationServerId:
          $ref: '#/components/schemas/AuthorisationServerId'
        DeprecatedDate:
          $ref: '#/components/schemas/AuthDeprecatedDate'
        RetirementDate:
          $ref: '#/components/schemas/AuthRetirementDate'
        SupersededByAuthorisationServerId:
          $ref: '#/components/schemas/AuthSupersededById'
        OmitFromEcosystem:
          $ref: '#/components/schemas/OmitFromEcosystem'
      required:
        - AutoRegistrationSupported
        - CustomerFriendlyName
        - CustomerFriendlyDescription
        - CustomerFriendlyLogoUri

    AdditionalAuthorisationServerFields:
      type: object
      properties:
        AuthorisationServerId:
          $ref: '#/components/schemas/AuthorisationServerId'
        OrganisationId:
          $ref: '#/components/schemas/DeprecatedOrganisationId'
        OpenIDDiscoveryDocument:
          $ref: '#/components/schemas/OpenIDDiscoveryDocument'
        NotificationWebhookAddedDate:
          $ref: '#/components/schemas/NotificationWebhookAddedDate'
        NotificationWebhookStatus:
          $ref: '#/components/schemas/NotificationWebhookStatusEnum'
        SupportsCiba:
          $ref: '#/components/schemas/SupportsCiba'
        SupportsDCR:
          $ref: '#/components/schemas/SupportsDCR'
        SupportsRedirect:
          $ref: '#/components/schemas/SupportsRedirect'
        CreatedAt:
          $ref: '#/components/schemas/CreatedAt'

    OmitFromEcosystem:
      type: boolean
      default: false
      nullable: false
      description: '''Denotes if the entity should be omitted from the subject ecosystem. For example, an 
      authorisation server with this flag set to true would not appear in the participants endpoint or 
      OpenID Federation offerings'''

    FlagIDArray:
      type: array
      writeOnly: true
      items:
        $ref: '#/components/schemas/FlagID'

    FlagArray:
      type: array
      readOnly: true
      items:
        $ref: '#/components/schemas/Flag'

    HomepageUri:
      type: string
      format: uri
      description: The URI for the website with details about the application and its services
      pattern: "^(http://|https://).*"
      x-pattern-message: "HomepageUri must be in a URI format https://... or http://..."
      maxLength: 255

    AutoRegistrationSupported:
      type: boolean
      default: false
      description: Flag to denote if this authorisation server supports the automatic onboarding of software statement clients
      x-required-message: AutoRegistrationSupported must be provided

    AutoRegistrationNotificationWebhook:
      description: A compliant URI to subscribe to the software statement onboarding webhook
      pattern: "^(http://|https://).*"
      x-pattern-message: "WebhookUri must be in a URI format https://... or http://..."
      type: string
      format: uri
      maxLength: 255

    CustomerFriendlyDescription:
      description: A customer friendly description
      type: string
      pattern: "^[^<>]*$"
      minLength: 1
      maxLength: 255
      x-required-message: CustomerFriendlyDescription must be provided

    CustomerFriendlyName:
      type: string
      pattern: "^[^<>]*$"
      minLength: 1
      maxLength: 255
      x-required-message: CustomerFriendlyName must be provided

    DeveloperPortalUri:
      description: A compliant URI
      nullable: true
      pattern: "^(http://|https://).*"
      x-pattern-message: "DeveloperPortalUri must be in a URI format https://... or http://..."
      type: string
      format: uri
      maxLength: 255

    TermsOfServiceUri:
      description: A compliant URI
      nullable: true
      pattern: "^(http://|https://).*"
      x-pattern-message: "TermsOfServiceUri must be in a URI format https://... or http://..."
      type: string
      format: uri
      maxLength: 255

    OpenIDDiscoveryDocument:
      description: A compliant URI
      pattern: "^(http://|https://).*"
      x-pattern-message: "OpenIDDiscoveryDocument must be in a URI format https://... or http://..."
      type: string
      maxLength: 255

    PayloadSigningCertLocationUri:
      description: A compliant URI
      pattern: "^(http://|https://).*"
      x-pattern-message: "PayloadSigningCertLocationUri must be in a URI format https://... or http://..."
      type: string
      maxLength: 255
      x-required-message: PayloadSigningCertLocationUri must be provided

    Issuer:
      description: An issuer value pulled from the well-known endpoint
      pattern: "^(https://).*"
      x-pattern-message: "Issuer must be in a URI format https://... or http://..."
      type: string
      format: uri

    NotificationWebhookAddedDate:
      type: string
      format: date
      description: Creation date
      example: "2021-01-30"

    SupportsRedirect:
      type: boolean
      default: false
      description: Flag to denote if this authorisation server supports redirect

    SupportsCiba:
      type: boolean
      default: false
      description: Flag to denote if this authorisation server supports Client Initiated Backchannel Authentication

    SupportsDCR:
      type: boolean
      default: false
      description: Flag to denote if this authorisation server supports Dynamic Client Registration

    AuthorisationDomainSystemID:
      type: string
      format: uuid
      description: Unique authorisation domain system UUID
    AuthorisationDomainSystemName:
      type: string
      pattern: "^[^<>]*$"
      description: The name of the authorisation domain user type
      maxLength: 255
    AuthorisationDomainSystemDescription:
      type: string
      pattern: "^[^<>]*$"
      description: The description of the authorisation domain user type
      maxLength: 255
    AuthorisationDomainUserTypeID:
      type: string
      format: uuid
      description: Unique authorisation domain user type UUID
    AuthorisationDomainUserTypeName:
      type: string
      pattern: "^[^<>]*$"
      description: The name of the authorisation domain user type
      maxLength: 255
    AuthorisationDomainUserTypeDescription:
      type: string
      pattern: "^[^<>]*$"
      description: The description of the authorisation domain user type
      maxLength: 255
    AuthorisationDomainUserTypeDirectoryAccess:
      type: boolean
      description: If the user type grants read access to the directory
    ReceiveEmailNotifications:
      type: boolean
      description: If the user type should receive organisation update email notifications
    MetadataId:
      type: string
      pattern: "^[^<>]*$"
      description: Unique Metadata Id
      maxLength: 40
    MetadataRequest:
      type: object
      properties:
        EntityType:
          type: string
          description: The entity type the metadata should be applied to
          enum:
            - openid_provider
            - openid_relying_party
            - oauth_authorization_server
            - oauth_client
        ClaimName:
          type: string
          pattern: "^[^<>]*$"
          description: The metadata claim itself i.e. scope, grant_type...
          minLength: 1
          maxLength: 255
          x-required-message: Metadata ClaimName must be provided
        PolicyOperator:
          type: string
          description: The policy operator for the metadata
          enum:
            - value
            - add
            - default
            - one_of
            - subset_of
            - superset_of
            - essential
          x-required-message: Metadata PolicyOperator must be provided
        DataType:
          type: string
          description: What datatype the subject metadatas value is
          enum:
            - string
            - boolean
            - number
        Value:
          $ref: '#/components/schemas/MetadataValue'
        Values:
          type: array
          items:
            $ref: '#/components/schemas/MetadataValue'
          description: The values of the claim. Conflicts with Value
      required:
        - ClaimName
        - PolicyOperator
        - EntityType
        - DataType

    MetadataValue:
      type: string
      pattern: "^[^<>]*$"
      description: The value of a metadata claim
      minLength: 1
      maxLength: 255


    MetadataResponse:
      type: object
      allOf:
        - $ref: '#/components/schemas/MetadataRequest'
        - type: object
          properties:
            MetadataId:
              $ref: '#/components/schemas/MetadataId'
            DomainRoleName:
              $ref: '#/components/schemas/AuthorisationDomainRoleName'

    MetadataListResponse:
      type: object
      allOf:
        - $ref: '#/components/schemas/PaginationProperties'
      properties:
        content:
          type: array
          items:
            $ref: '#/components/schemas/MetadataResponse'

    CertificationTypePage:
      type: object
      allOf:
        - $ref: '#/components/schemas/PaginationProperties'
      properties:
        content:
          type: array
          items:
            $ref: '#/components/schemas/CertificationType'

    CertificationType:
      type: object
      properties:
        TypeID:
          $ref: '#/components/schemas/TypeID'
        TypeName:
          $ref: '#/components/schemas/TypeName'
        Description:
          $ref: '#/components/schemas/Description'
        ResourceType:
          $ref: '#/components/schemas/ResourceType'
        CreatedAt:
          $ref: '#/components/schemas/CreatedAt'
        CreatedBy:
          $ref: '#/components/schemas/CreatedBy'
        Status:
          $ref: '#/components/schemas/StatusEnum'

    CertificationTypeVariantPage:
      type: object
      allOf:
        - $ref: '#/components/schemas/PaginationProperties'
      properties:
        content:
          type: array
          items:
            $ref: '#/components/schemas/CertificationTypeVariant'

    CertificationTypeVariant:
      type: object
      properties:
        VariantID:
          $ref: '#/components/schemas/VariantID'
        VariantName:
          $ref: '#/components/schemas/VariantName'
        TypeID:
          $ref: '#/components/schemas/TypeID'
        Description:
          $ref: '#/components/schemas/Description'
        CertificationDurationDays:
          $ref: '#/components/schemas/CertificationDurationDays'
        CreatedAt:
          $ref: '#/components/schemas/CreatedAt'
        CreatedBy:
          $ref: '#/components/schemas/CreatedBy'
        Status:
          $ref: '#/components/schemas/StatusEnum'

    CertificationTypeRequest:
      type: object
      properties:
        TypeName:
          $ref: '#/components/schemas/TypeName'
        Description:
          $ref: '#/components/schemas/Description'
        ResourceType:
          $ref: '#/components/schemas/ResourceType'
        Status:
          $ref: '#/components/schemas/StatusEnum'
      required:
        - TypeName
        - ResourceType

    CertificationTypeVariantRequest:
      type: object
      properties:
        VariantName:
          $ref: '#/components/schemas/VariantName'
        Description:
          $ref: '#/components/schemas/Description'
        CertificationDurationDays:
          $ref: '#/components/schemas/CertificationDurationDays'
        Status:
          $ref: '#/components/schemas/StatusEnum'
      required:
        - VariantName
        - CertificationDurationDays

    CertificationTypeVariantUpdateRequest:
      type: object
      allOf:
        - $ref: '#/components/schemas/CertificationTypeVariantRequest'
      properties:
        Cascade:
          $ref: '#/components/schemas/Cascade'
      required:
        - VariantName
        - CertificationDurationDays

    FederationConfigId:
      type: string
      pattern: "^[^<>]*$"
      description: Unique Federation Configuration Id
      maxLength: 36
    ConfigJson:
      type: string
      pattern: "^[^<>]*$"
      description: JSON containing all Federation Configurations
      x-required-message: ConfigJSON must be provided
    FederationVersion:
      type: integer
      description: Version number of the Federation configuration
      x-required-message: Version must be provided

    AuthorisationServerId:
      type: string
      format: uuid
    CertificateOrKeyOrJWT:
      type: string
      pattern: "^[^<>]*$"
    CertificateOrKeyId:
      type: string
      pattern: "^[^<>]*$"
      maxLength: 255
    CertificatesOrKeys:
      type: array
      items:
        $ref: '#/components/schemas/CertificateOrKey'
    CertificatesOrKeysPage:
      type: object
      allOf:
        - $ref: '#/components/schemas/PaginationProperties'
      properties:
        content:
          type: array
          items:
            $ref: '#/components/schemas/CertificateOrKey'
    CertificateOrKeyJsonRequest:
      type: object
      properties:
        KeyMaterial:
          type: string
          description: The key material in PEM format, URL Encoded
        Description:
          $ref: '#/components/schemas/CertificateOrKeyDescription'
      required:
        - KeyMaterial
    CertificateOrKey:
      type: object
      properties:
        OrganisationId:
          $ref: '#/components/schemas/OrganisationId'
        SoftwareStatementIds:
          type: array
          items:
            $ref: '#/components/schemas/SoftwareStatementId'
        ClientName:
          type: string
          maxLength: 40
        Status:
          type: string
          maxLength: 40
        ValidFromDateTime:
          type: string
          maxLength: 30
        RevokedDateTime:
          type: string
          maxLength: 30
        ExpiryDateTime:
          type: string
          maxLength: 30
        e:
          type: string
          maxLength: 255
        keyType:
          type: string
          maxLength: 255
        kid:
          type: string
          maxLength: 255
        kty:
          type: string
          maxLength: 255
        n:
          type: string
          maxLength: 255
        x:
          type: string
        y:
          type: string
        crv:
          type: string
        use:
          type: string
          maxLength: 255
        x5c:
          type: array
          items:
            description: A PKIX certificate [RFC5280]
            type: string
            maxLength: 255
        x5t:
          type: string
          maxLength: 255
        x5thashS256:
          type: string
          maxLength: 255
        x5u:
          type: string
          maxLength: 255
        SignedCertPath:
          type: string
          maxLength: 255
          description: Used to display location of the signed certificate in PEM format
        JwkPath:
          type: string
          maxLength: 255
          description: Used to display path to JWKS containing this certificate
        OrgJwkPath:
          type: string
          maxLength: 255
          description: Used to display path to Org JWKS containing org certificates
        Description:
          $ref: '#/components/schemas/CertificateOrKeyDescription'

    AmendCertificateRequest:
      type: object
      properties:
        Description:
          $ref: '#/components/schemas/CertificateOrKeyDescription'
        RevokeReason:
          enum:
            - unspecified
            - keycompromise
            - superseded
            - cessationofoperation
            - privilegewithdrawn
          type: string
          description: Specify a reason for revokation of the certificate.
        OrganisationId:
          $ref: '#/components/schemas/OrganisationId'
        SoftwareStatementIds:
          type: array
          items:
            $ref: '#/components/schemas/SoftwareStatementId'
        ClientName:
          type: string
          maxLength: 40
        Status:
          type: string
          maxLength: 40
        ValidFromDateTime:
          type: string
          maxLength: 30
        RevokedDateTime:
          type: string
          maxLength: 30
        ExpiryDateTime:
          type: string
          maxLength: 30
        e:
          type: string
          maxLength: 255
        keyType:
          type: string
          maxLength: 255
        kid:
          type: string
          maxLength: 255
        kty:
          type: string
          maxLength: 255
        n:
          type: string
          maxLength: 255
        x:
          type: string
          maxLength: 255
        y:
          type: string
          maxLength: 255
        crv:
          type: string
          maxLength: 255
        use:
          type: string
          maxLength: 255
        x5c:
          type: array
          items:
            description: A PKIX certificate [RFC5280]
            type: string
            maxLength: 255
        x5t:
          type: string
          maxLength: 255
        x5thashS256:
          type: string
          maxLength: 255
        x5u:
          type: string
          maxLength: 255
        SignedCertPath:
          type: string
          maxLength: 255
          description: Used to display location of the signed certificate in PEM format
        JwkPath:
          type: string
          maxLength: 255
          description: Used to display path to JWKS containing this certificate
        OrgJwkPath:
          type: string
          maxLength: 255
          description: Used to display path to Org JWKS containing org certificates

    AuthorisationDomainUserTypeRequest:
      type: object
      properties:
        Name:
          $ref: '#/components/schemas/AuthorisationDomainUserTypeName'
        Description:
          $ref: '#/components/schemas/AuthorisationDomainUserTypeDescription'
        ParentRole:
          $ref: '#/components/schemas/AuthorisationDomainUserTypeID'
        SystemID:
          $ref: '#/components/schemas/AuthorisationDomainSystemID'
        DirectoryAccess:
          $ref: '#/components/schemas/AuthorisationDomainUserTypeDirectoryAccess'
        ReceiveEmailNotifications:
          $ref: '#/components/schemas/ReceiveEmailNotifications'
        OrganisationCertificatesAccess:
          $ref: '#/components/schemas/AccessEnum'
        OrganisationContactsAccess:
          $ref: '#/components/schemas/AccessEnum'
        DomainUserAccess:
          $ref: '#/components/schemas/AccessEnum'
        SoftwareStatementAccess:
          $ref: '#/components/schemas/AccessEnum'
        AuthorisationServerAccess:
          $ref: '#/components/schemas/AccessEnum'
        TermsAndConditionsAccess:
          $ref: '#/components/schemas/AccessEnum'
        Status:
          $ref: '#/components/schemas/StatusEnum'
      required:
        - Name
        - SystemID
        - DirectoryAccess
        - ReceiveEmailNotifications
        - OrganisationCertificatesAccess
        - OrganisationContactsAccess
        - DomainUserAccess
        - SoftwareStatementAccess
        - AuthorisationServerAccess
        - TermsAndConditionsAccess
        - Status
    AuthorisationDomainSystemRequest:
      type: object
      properties:
        Name:
          $ref: '#/components/schemas/AuthorisationDomainSystemName'
        Description:
          $ref: '#/components/schemas/AuthorisationDomainSystemDescription'
        Status:
          $ref: '#/components/schemas/StatusEnum'
      required:
        - Name
        - Status
    ContactRequest:
      type: object
      properties:
        ContactType:
          $ref: '#/components/schemas/ContactType'
        FirstName:
          type: string
          pattern: "^[^<>]*$"
          maxLength: 255
        LastName:
          type: string
          pattern: "^[^<>]*$"
          maxLength: 255
        Department:
          type: string
          pattern: "^[^<>]*$"
          maxLength: 255
        EmailAddress:
          type: string
          pattern: '^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$'
          x-pattern-message: "EmailAddress must be a valid email"
          maxLength: 255
        PhoneNumber:
          type: string
          pattern: "^[^<>]*$"
          minLength: 1
          maxLength: 18
        AddressLine1:
          type: string
          pattern: "^[^<>]*$"
          description: Address line 1
          maxLength: 255
        AddressLine2:
          type: string
          pattern: "^[^<>]*$"
          description: Address line 2
          maxLength: 255
        City:
          type: string
          pattern: "^[^<>]*$"
          description: City
          maxLength: 255
        Postcode:
          type: string
          pattern: "^[^<>]*$"
          description: Postcode
          maxLength: 40
        Country:
          type: string
          pattern: "^[^<>]*$"
          description: Country
          maxLength: 255
        AdditionalInformation:
          type: string
          pattern: "^[^<>]*$"
          description: Any additional user information
          maxLength: 65535
        PgpPublicKey:
          type: string
          pattern: "^[^<>]*$"
          description: A PGP Public Key in text form
          maxLength: 65535
      required:
        - ContactType
        - EmailAddress
        - PhoneNumber

    ContactsPage:
      type: object
      allOf:
        - $ref: '#/components/schemas/PaginationProperties'
      properties:
        content:
          type: array
          items:
            $ref: '#/components/schemas/Contact'

    Contacts:
      type: array
      items:
        $ref: '#/components/schemas/Contact'
      description: The list of contacts

    Contact:
      type: object
      properties:
        ContactId:
          type: string
          pattern: "^[^<>]*$"
          description: Unique contact ID for the row.
        OrganisationId:
          $ref: '#/components/schemas/OrganisationId'
        ContactType:
          $ref: '#/components/schemas/ContactType'
        FirstName:
          type: string
          pattern: "^[^<>]*$"
          maxLength: 255
        LastName:
          type: string
          pattern: "^[^<>]*$"
          maxLength: 255
        Department:
          type: string
          pattern: "^[^<>]*$"
          maxLength: 255
        EmailAddress:
          type: string
          pattern: '^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$'
          x-pattern-message: "EmailAddress must be a valid email"
          maxLength: 255
        PhoneNumber:
          type: string
          pattern: "^[^<>]*$"
          maxLength: 18
        AddressLine1:
          type: string
          pattern: "^[^<>]*$"
          description: Address line 1
          maxLength: 255
        AddressLine2:
          type: string
          pattern: "^[^<>]*$"
          description: Address line 2
          maxLength: 255
        City:
          type: string
          pattern: "^[^<>]*$"
          description: City
          maxLength: 255
        Postcode:
          type: string
          pattern: "^[^<>]*$"
          description: Postcode
          maxLength: 40
        Country:
          type: string
          pattern: "^[^<>]*$"
          description: Country
          maxLength: 255
        AdditionalInformation:
          type: string
          pattern: "^[^<>]*$"
          description: Any additional user information
          maxLength: 65535
        PgpPublicKey:
          type: string
          pattern: "^[^<>]*$"
          description: A PGP Public Key in text form
          maxLength: 65535

    ContactId:
      type: string
      pattern: "^[^<>]*$"
      maxLength: 255

    OrganisationRequest:
      type: object
      properties:
        OrganisationId:
          $ref: '#/components/schemas/OrganisationId'
        Status:
          type: string
          description: Status of the directory registration of an organisation
          enum:
            - Active
            - Pending
            - Withdrawn
          default: Active
        OrganisationName:
          $ref: '#/components/schemas/OrganisationName'
        LegalEntityName:
          type: string
          pattern: "^[^<>]*$"
          description: Legal Entity name for the org. Usually the same as org name
          minLength: 1
          maxLength: 255
          x-required-message: LegalEntityName must be provided
        CountryOfRegistration:
          type: string
          pattern: "^[^<>]*$"
          description: Country of registration for the org
          minLength: 2
          maxLength: 255
          x-required-message: CountryOfRegistration must be provided
        CompanyRegister:
          type: string
          pattern: "^[^<>]*$"
          description: Legal company register for the country, i.e. Companies House
          minLength: 1
          maxLength: 255
          x-required-message: CompanyRegister must be provided
        Size:
          description: Size of the organisation
          pattern: "^[^<>]*$"
          maxLength: 255
          type: string
        RegistrationNumber:
          type: string
          pattern: "^[^<>]*$"
          description: Company registration number from company register i.e. Companies House registration number
          minLength: 1
          maxLength: 255
          x-required-message: RegistrationNumber must be provided
        TaxRegistrationNumber:
          $ref: '#/components/schemas/TaxRegistrationNumber'
        RegistrationId:
          type: string
          pattern: "^[^<>]*$"
          description: Registered ID for the organisation i.e. Legal Entity identifier number
          maxLength: 40
        RegisteredName:
          type: string
          pattern: "^[^<>]*$"
          description: Registered legal name
          maxLength: 255
        AddressLine1:
          type: string
          pattern: "^[^<>]*$"
          description: Address line 1
          minLength: 5
          maxLength: 255
          x-required-message: AddressLine1 must be provided
        AddressLine2:
          type: string
          pattern: "^[^<>]*$"
          description: Address line 2
          maxLength: 255
        City:
          type: string
          pattern: "^[^<>]*$"
          description: City
          minLength: 2
          maxLength: 255
          x-required-message: City must be provided
        Postcode:
          type: string
          pattern: "^[^<>]*$"
          description: Postcode
          minLength: 3
          maxLength: 40
          x-required-message: Postcode must be provided
        Country:
          type: string
          pattern: "^[^<>]*$"
          description: Country
          minLength: 2
          maxLength: 255
          x-required-message: Country must be provided
        ParentOrganisationReference:
          type: string
          pattern: "^[^<>]*$"
          description: Parent Organisation Reference
          maxLength: 65535
        RequiresParticipantTermsAndConditionsSigning:
          type: boolean
          description: Participant Terms and Conditions Signing Required
          default: true
        LogoUri:
          $ref: '#/components/schemas/OrgLogoUri'
        Flags:
          $ref: '#/components/schemas/FlagIDArray'
        EnforceIdpUserManagement:
          $ref: '#/components/schemas/EnforceIdpUserManagement'
      required:
        - OrganisationId
        - OrganisationName
        - CountryOfRegistration
        - CompanyRegister
        - RegistrationNumber
        - LegalEntityName
        - AddressLine1
        - City
        - Postcode
        - Country

    OrganisationUpdateRequest:
      type: object
      properties:
        Status:
          type: string
          description: Status of the directory registration of an organisation
          enum:
            - Active
            - Pending
            - Withdrawn
          default: Pending
        OrganisationName:
          $ref: '#/components/schemas/OrganisationName'
        LegalEntityName:
          type: string
          pattern: "^[^<>]*$"
          description: Legal Entity name for the org. Usually the same as org name
          minLength: 1
          maxLength: 255
          x-required-message: LegalEntityName must be provided
        CountryOfRegistration:
          type: string
          pattern: "^[^<>]*$"
          description: Country of registration for the org
          minLength: 2
          maxLength: 255
          x-required-message: CountryOfRegistration must be provided
        CompanyRegister:
          type: string
          pattern: "^[^<>]*$"
          description: Legal company register for the country, i.e. Companies House
          minLength: 1
          maxLength: 255
          x-required-message: CompanyRegister must be provided
        Flags:
          $ref: '#/components/schemas/FlagIDArray'
        Size:
          description: Size of the organisation
          maxLength: 255
          type: string
          pattern: "^[^<>]*$"
        TaxRegistrationNumber:
          $ref: '#/components/schemas/TaxRegistrationNumber'
        RegistrationNumber:
          type: string
          pattern: "^[^<>]*$"
          description: Company registration number from company register i.e. Companies House registration number
          minLength: 1
          maxLength: 255
          x-required-message: RegistrationNumber must be provided
        RegistrationId:
          type: string
          pattern: "^[^<>]*$"
          description: Registered ID for the organisation i.e. Legal Entity identifier number
          maxLength: 40
        RegisteredName:
          type: string
          pattern: "^[^<>]*$"
          description: Registered legal name
          maxLength: 255
        AddressLine1:
          type: string
          pattern: "^[^<>]*$"
          description: Address line 1
          minLength: 5
          maxLength: 255
          x-required-message: AddressLine1 must be provided
        AddressLine2:
          type: string
          pattern: "^[^<>]*$"
          description: Address line 2
          maxLength: 255
        City:
          type: string
          pattern: "^[^<>]*$"
          description: City
          minLength: 2
          maxLength: 255
          x-required-message: City must be provided
        Postcode:
          type: string
          pattern: "^[^<>]*$"
          description: Postcode
          minLength: 3
          maxLength: 40
          x-required-message: Postcode must be provided
        Country:
          type: string
          description: Country
          minLength: 2
          maxLength: 255
          x-required-message: Country must be provided
        ParentOrganisationReference:
          type: string
          description: Parent Organisation Reference
          maxLength: 65535
        RequiresParticipantTermsAndConditionsSigning:
          type: boolean
          description: Participant Terms and Conditions Signing Required
          default: true
        LogoUri:
          $ref: '#/components/schemas/OrgLogoUri'
        EnforceIdpUserManagement:
          $ref: '#/components/schemas/EnforceIdpUserManagement'
      required:
        - OrganisationName
        - CountryOfRegistration
        - CompanyRegister
        - RegistrationNumber
        - LegalEntityName
        - AddressLine1
        - City
        - Postcode
        - Country

    EnforceIdpUserManagement:
      type: boolean
      default: false
      description: 'When true, prevents the creation of users directly on the organisation and mandates all users 
      are managed by SSO Configured IDPs'

    OrganisationConformanceTest:
      type: object
      properties:
        ResourceUrl:
          description: The url of the API to be tested (for example, https://matls-api.mockbank.poc.raidiam.io/open-banking/products-services/v1/personal-accounts)
          type: string
          x-required-message: The ResourceUrl must be provided
          pattern: "^[^<>]*$"
        ApiFamilyType:
          description: The family type of the resource url to be tested (for example channels_branches)
          type: string
          pattern: "^[^<>]*$"
          x-required-message: The ApiFamilyType must be provided
        Version:
          description: The version of the api family to be tested (for example 1.0.0)
          type: string
          pattern: "^[^<>]*$"
          x-required-message: The version must be provided
      required:
        - ResourceUrl
        - ApiFamilyType
        - Version

    OrganisationConformanceTestResult:
      description: a JSON response with the result of the test
      type: object
      properties:
        result:
          description: Boolean with the result of the execution of the Conformance Suite Test
          type: boolean
        testPlanUrl:
          description: URL of the published test plan result
          pattern: "^[^<>]*$"
          type: string
        errorCount:
          description: Number of errors found during the execution of the Conformance Suite Test
          type: integer
        errors:
          description: List of distinct errors found during the execution of the Conformance Suite Test
          type: array
          items:
            type: string
            pattern: "^[^<>]*$"
            uniqueItems: true

    OrganisationCertificateType:
      type: string
      pattern: "^[^<>]*$"

    OrganisationId:
      type: string
      description: Unique ID associated with the organisation
      minLength: 1
      maxLength: 40
      pattern: "^[^<>]*$"

    DeprecatedOrganisationId:
      type: string
      description: Unique ID associated with the organisation
      minLength: 1
      maxLength: 40
      deprecated: true
      pattern: "^[^<>]*$"

    ContactType:
      type: string
      default: Business
      description: The type of Contact, default contact type is Business.
      maxLength: 255
      x-required-message: ContactType must be provided
      pattern: "^[^<>]*$"

    OrganisationAuthorityClaimId:
      type: string
      format: uuid
      description: Unique ID associated with an organisation authority domain role claim
      minLength: 1
      maxLength: 40
      pattern: "^[^<>]*$"

    OrganisationAuthorisationId:
      type: string
      description: Unique ID associated with authorisations for organisation's authority claims
      minLength: 1
      maxLength: 40
      pattern: "^[^<>]*$"

    SoftwareAuthorityClaimId:
      type: string
      description: Unique ID associated with the authority claims for a software statement
      minLength: 1
      maxLength: 40
      pattern: "^[^<>]*$"

    ServerAuthorityClaimId:
      type: string
      description: Unique ID associated with the authority claims for a server
      format: uuid
      minLength: 1
      maxLength: 40
      pattern: "^[^<>]*$"

    AuthorityId:
      type: string
      format: uuid
      description: Unique ID associated with the Authorisation reference schema
      minLength: 1
      maxLength: 40
      pattern: "^[^<>]*$"

    AuthorisationDomainUserTypesPage:
      type: object
      allOf:
        - $ref: '#/components/schemas/PaginationProperties'
      properties:
        content:
          type: array
          items:
            $ref: '#/components/schemas/AuthorisationDomainUserType'

    AuthorisationDomainSystemsPage:
      type: object
      allOf:
        - $ref: '#/components/schemas/PaginationProperties'
      properties:
        content:
          type: array
          items:
            $ref: '#/components/schemas/AuthorisationDomainSystem'

    AuthorisationDomainSystem:
      type: object
      properties:
        SystemID:
          $ref: '#/components/schemas/AuthorisationDomainSystemID'
        Name:
          $ref: '#/components/schemas/AuthorisationDomainSystemName'
        Description:
          $ref: '#/components/schemas/AuthorisationDomainSystemDescription'
        Status:
          $ref: '#/components/schemas/StatusEnum'

    AuthorisationDomainUserType:
      type: object
      properties:
        AuthorisationDomainUserTypeID:
          $ref: '#/components/schemas/AuthorisationDomainUserTypeID'
        Name:
          $ref: '#/components/schemas/AuthorisationDomainUserTypeName'
        Description:
          $ref: '#/components/schemas/AuthorisationDomainUserTypeDescription'
        SystemID:
          $ref: '#/components/schemas/AuthorisationDomainSystemID'
        ParentRole:
          $ref: '#/components/schemas/AuthorisationDomainUserTypeID'
        DirectoryAccess:
          $ref: '#/components/schemas/AuthorisationDomainUserTypeDirectoryAccess'
        ReceiveEmailNotifications:
          $ref: '#/components/schemas/ReceiveEmailNotifications'
        OrganisationCertificatesAccess:
          $ref: '#/components/schemas/AccessEnum'
        OrganisationContactsAccess:
          $ref: '#/components/schemas/AccessEnum'
        DomainUserAccess:
          $ref: '#/components/schemas/AccessEnum'
        SoftwareStatementAccess:
          $ref: '#/components/schemas/AccessEnum'
        AuthorisationServerAccess:
          $ref: '#/components/schemas/AccessEnum'
        TermsAndConditionsAccess:
          $ref: '#/components/schemas/AccessEnum'
        Status:
          $ref: '#/components/schemas/StatusEnum'

    OrganisationsPage:
      type: object
      allOf:
        - $ref: '#/components/schemas/PaginationProperties'
      properties:
        content:
          type: array
          items:
            $ref: '#/components/schemas/Organisation'

    OrganisationName:
      type: string
      description: Name of the organisation.
      minLength: 1
      maxLength: 255
      pattern: "^[^<>]*$"

    Organisation:
      type: object
      properties:
        OrganisationId:
          $ref: '#/components/schemas/OrganisationId'
        Status:
          type: string
          description: Status of the directory registration of an organisation
          enum:
            - Active
            - Pending
            - Withdrawn
          default: Active
        OrganisationName:
          $ref: '#/components/schemas/OrganisationName'
        CreatedOn:
          type: string
          description: JSONDatetime of organisation creation.
          maxLength: 30
        LegalEntityName:
          type: string
          description: Legal Entity name for the org. Usually the same as org name
          maxLength: 255
          pattern: "^[^<>]*$"
        CountryOfRegistration:
          type: string
          description: Country of registration for the org
          maxLength: 255
          pattern: "^[^<>]*$"
        CompanyRegister:
          $ref: '#/components/schemas/CompanyRegister'
        Size:
          description: Size of the organisation
          maxLength: 255
          type: string
          pattern: "^[^<>]*$"
        RegistrationNumber:
          $ref: '#/components/schemas/RegistrationNumber'
        TaxRegistrationNumber:
          $ref: '#/components/schemas/TaxRegistrationNumber'
        RegistrationId:
          type: string
          description: Registered ID for the organisation i.e. Legal Entity identifier number
          maxLength: 40
          pattern: "^[^<>]*$"
        RegisteredName:
          type: string
          maxLength: 255
          pattern: "^[^<>]*$"
        AddressLine1:
          type: string
          description: Address line 1
          maxLength: 255
          pattern: "^[^<>]*$"
        AddressLine2:
          type: string
          description: Address line 2
          maxLength: 255
          pattern: "^[^<>]*$"
        City:
          type: string
          description: City
          maxLength: 255
          pattern: "^[^<>]*$"
        Postcode:
          type: string
          description: Postcode
          maxLength: 40
          pattern: "^[^<>]*$"
        Country:
          $ref: '#/components/schemas/Country'
        ParentOrganisationReference:
          type: string
          description: Parent Organisation Reference
          maxLength: 65535
          pattern: "^[^<>]*$"
        RequiresParticipantTermsAndConditionsSigning:
          type: boolean
          description: true - this organisation requires terms and conditions to be signed. false - this organisation does not require terms and conditions to be signed
        LogoUri:
          $ref: '#/components/schemas/OrgLogoUri'
        Flags:
          $ref: '#/components/schemas/FlagArray'
        EnforceIdpUserManagement:
          $ref: '#/components/schemas/EnforceIdpUserManagement'
        Authority:
          type: boolean
          description: Indicates if the subject organisation has been configured as an Authority
          default: false

    CompanyRegister:
      type: string
      description: Legal company register for the country, i.e. Companies House
      maxLength: 255
      pattern: "^[^<>]*$"

    Country:
      type: string
      description: Country
      maxLength: 255
      pattern: "^[^<>]*$"

    TaxRegistrationNumber:
      type: string
      pattern: "^[^<>]*$"
      description: Company tax registration number
      minLength: 1
      maxLength: 255

    RegistrationNumber:
      type: string
      description: Company registration number from company register i.e. Companies House registration number
      maxLength: 255
      pattern: "^[^<>]*$"

    OrganisationResponse:
      type: object
      allOf:
        - $ref: '#/components/schemas/Organisation'
      properties:
        OperationWarnings:
          type: array
          items:
            $ref: '#/components/schemas/OperationWarning'

    OrgLogoUri:
      description: A compliant URI
      pattern: ^(http://|https://).*.(svg|png|jpg|jpeg)$|(data:image/[a-zA-Z0-9;+=-]+,[A-Za-z0-9+/]*={0,2})$
      x-pattern-message: "LogoUri must be in a URI format (https://... or http://...) or a base64 encoded string (data:image/png;base64,base64encoded)"
      type: string
      format: uri

    OrganisationWithTnc:
      type: object
      properties:
        OrgDetails:
          $ref: '#/components/schemas/Organisation'
        TncDetails:
          type: object
          properties:
            TnCSigned:
              type: boolean
              description: true - the terms and conditions have been signed. false - the terms and conditions have not been signed
            TnCUpdated:
              type: boolean
              description: true - attached signer template has been updated. false - no tnc present/not updated
            TnCsToBeSigned:
              $ref: '#/components/schemas/TnCsToBeSigned'

    OrgTermsAndConditionsDetail:
      type: object
      description: Participant TnC details
      properties:
        InitiatedBy:
          type: string
          description: Email of the user who initiated the External signing for this participant
        Role:
          type: string
          description: Role of the user who initiated the External signing for this participant
        TermsAndConditionsDetail:
          $ref: '#/components/schemas/TermsAndConditionsDetail'


    TermsAndConditionsDetail:
      type: object
      description: TnC details Parent
      properties:
        TermsAndConditionsItem:
          $ref: '#/components/schemas/TermsAndConditionsItem'
        InititatedDate:
          type: string
          description: Terms and Conditions initiated date
          maxLength: 255
        ExternalSigningServiceEnvelopeId:
          $ref: '#/components/schemas/ExternalSigningServiceEnvelopeId'
        ExternalSigningServiceEnvelopeStatus:
          $ref: '#/components/schemas/ExternalSigningServiceEnvelopeStatus'
        ExternalSigningServiceEnvelopePasscode:
          type: string
          description: Access code for the specifier to fill in the signer details. This will be populated only once, when signing is initiated

    SnsNotificationWebhookUri:
      description: A compliant URI
      pattern: "^(http://|https://).*"
      x-pattern-message: "WebhookUri must be in a URI format https://... or http://..."
      type: string
      format: uri
      maxLength: 255

    ExclusiveAuthorisationDomainRole:
      type: boolean
      description: An organization that claims an exclusive role cannot claim any other roles

    NotificationWebhookStatusEnum:
      type: string
      enum:
        - Pending
        - Confirmed
        - Deactivated
      default: Pending

    AccessEnum:
      type: string
      enum:
        - Read
        - Write
        - Administrator
        - None
      default: Read

    ExternalSigningServiceEnvelopeStatus:
      enum:
        - completed
        - created
        - declined
        - deleted
        - delivered
        - processing
        - sent
        - signed
        - template
        - voided
        - expired
        - reissued

    Pageable:
      type: object
      properties:
        number:
          type: integer
          description: Page number
        sort:
          $ref: '#/components/schemas/PageableSort'
        size:
          type: integer
          description: Size of the page
        offset:
          type: integer
          description: Offset
        sorted:
          type: boolean
          description: Is the page sorted
        unpaged:
          type: boolean
          description: Is this an unpaged response
        mode:
          type: string
          description: Pageable mode. Possible values are OFFSET, CURSOR_NEXT, CURSOR_PREVIOUS
    PageableSort:
      type: object
      properties:
        sorted:
          type: boolean
        orderBy:
          type: array
          items:
            type: object
            properties:
              property:
                type: string
                description: Name of the property used for sorting
                example: createdAt
              direction:
                type: string
                description: Direction of sort, i.e. ascending or descending
                enum:
                  - ASC
                  - DESC
              ignoreCase:
                type: boolean
                description: Was the case ignored
              ascending:
                type: boolean
                description: Whether ascending

    OrganisationSnapshot:
      type: object
      properties:
        OrganisationDetails:
          $ref: '#/components/schemas/Organisation'
        Contacts:
          $ref: '#/components/schemas/Contacts'
        AuthorisationServers:
          $ref: '#/components/schemas/AuthorisationServers'
        OrgDomainClaims:
          $ref: '#/components/schemas/OrganisationAuthorityDomainClaims'
        OrgDomainRoleClaims:
          $ref: '#/components/schemas/OrganisationAuthorityDomainRoleClaims'
        SoftwareStatements:
          type: object
          additionalProperties:
            type: object
            properties:
              SoftwareDetails:
                $ref: '#/components/schemas/SoftwareStatement'
              SoftwareAuthorityClaims:
                $ref: '#/components/schemas/SoftwareAuthorityClaims'
              SoftwareCertificates:
                $ref: '#/components/schemas/CertificatesOrKeys'
        OrganisationCertificates:
          $ref: '#/components/schemas/CertificatesOrKeys'

    OrganisationsExportOpenData:
      type: array
      items:
        $ref: '#/components/schemas/OrganisationExportOpenData'

    OrganisationExportOpenData:
      type: object
      properties:
        OrganisationId:
          $ref: '#/components/schemas/OrganisationId'
        Status:
          type: string
          description: Status of the directory registration of an organisation
          enum:
            - Active
            - Pending
            - Withdrawn
          default: Active
        OrganisationName:
          $ref: '#/components/schemas/OrganisationName'
        CreatedOn:
          type: string
          description: JSONDatetime of organisation creation.
          maxLength: 30
          pattern: "^[^<>]*$"
        LegalEntityName:
          type: string
          description: Legal Entity name for the org. Usually the same as org name
          maxLength: 255
          pattern: "^[^<>]*$"
        CountryOfRegistration:
          type: string
          description: Country of registration for the org
          maxLength: 255
          pattern: "^[^<>]*$"
        CompanyRegister:
          $ref: '#/components/schemas/CompanyRegister'
        Tags:
          description: Tags to describe or classify an organisation
          items:
            type: string
            maxLength: 255
            pattern: "^[^<>]*$"
          type: array
        Flags:
          $ref: '#/components/schemas/ExportFlagObject'
        Size:
          type: string
          description: Size of an organisation
          maxLength: 255
          pattern: "^[^<>]*$"
        TaxRegistrationNumber:
          $ref: '#/components/schemas/TaxRegistrationNumber'
        RegistrationNumber:
          $ref: '#/components/schemas/RegistrationNumber'
        RegistrationId:
          type: string
          description: Registered ID for the organisation i.e. Legal Entity identifier number
          maxLength: 40
          pattern: "^[^<>]*$"
        RegisteredName:
          type: string
          maxLength: 255
          pattern: "^[^<>]*$"
        AddressLine1:
          type: string
          description: Address line 1
          maxLength: 255
          pattern: "^[^<>]*$"
        AddressLine2:
          type: string
          description: Address line 2
          maxLength: 255
          pattern: "^[^<>]*$"
        City:
          type: string
          description: City
          maxLength: 255
          pattern: "^[^<>]*$"
        Postcode:
          type: string
          description: Postcode
          maxLength: 40
          pattern: "^[^<>]*$"
        Country:
          $ref: '#/components/schemas/Country'
        ParentOrganisationReference:
          type: string
          description: Parent Organisation Reference
          maxLength: 65535
          pattern: "^[^<>]*$"
        AuthorisationServers:
          $ref: '#/components/schemas/AuthorisationServersExportOpenData'
        OrgDomainClaims:
          $ref: '#/components/schemas/OrganisationAuthorityDomainClaims'
        OrgDomainRoleClaims:
          $ref: '#/components/schemas/OrganisationAuthorityDomainRoleClaims'

    AuthoritiesPage:
      type: object
      allOf:
        - $ref: '#/components/schemas/PaginationProperties'
      properties:
        content:
          type: array
          items:
            $ref: '#/components/schemas/AuthorityObject'

    AuthorityName:
      description: Name of the Authority i.e. FCA, etc
      type: string
      minLength: 1
      maxLength: 40
      x-required-message: AuthorityName must be provided
      pattern: "^[^<>]*$"

    SubDomainID:
      type: string
      format: uuid
      nullable: false
      description: Unique identifier for a sub-domain registration

    SubDomainCreationRequest:
      type: object
      properties:
        AuthorisationDomainID:
          $ref: '#/components/schemas/AuthorisationDomainID'
      required:
        - AuthorisationDomainID

    SubDomainUpdateRequest:
      type: object
      allOf:
        - $ref: '#/components/schemas/SubDomainCreationRequest'
        - type: object
          properties:
            Status:
              $ref: '#/components/schemas/StatusEnum'
      required:
        - AuthorisationDomainID
        - Status

    SubDomainObject:
      type: object
      allOf:
        - $ref: '#/components/schemas/SubDomainUpdateRequest'
        - type: object
          properties:
            ID:
              $ref: '#/components/schemas/SubDomainID'

    SubDomainList:
      allOf:
        - $ref: '#/components/schemas/PaginationProperties'
        - type: object
          properties:
            content:
              type: array
              items:
                $ref: '#/components/schemas/SubDomainObject'

    AuthorityCreationRequest:
      type: object
      properties:
        AuthorityCode:
          description: Code of the Authority i.e. GBFCA, etc
          type: string
          x-required-message: AuthorityCode must be provided
          minLength: 1
          maxLength: 255
          pattern: "^[^<>]*$"
        AuthorityUri:
          description: URI of the authority
          pattern: "^(https://).*"
          x-pattern-message: "AuthorityUri must be an HTTPS URI format"
          type: string
          maxLength: 255
          x-required-message: AuthorityUri must be provided
      required:
        - AuthorityCode
        - AuthorityUri

    AuthorityUpdateRequest:
      type: object
      allOf:
        - $ref: '#/components/schemas/AuthorityCreationRequest'
        - type: object
          properties:
            Status:
              $ref: '#/components/schemas/StatusEnum'
      required:
        - AuthorityCode
        - AuthorityUri
        - Status

    AuthorityObject:
      type: object
      allOf:
        - $ref: '#/components/schemas/AuthorityUpdateRequest'
        - type: object
          properties:
            AuthorityId:
              $ref: '#/components/schemas/AuthorityId'
            OrganisationId:
              $ref: '#/components/schemas/OrganisationId'
            OrganisationName:
              $ref: '#/components/schemas/OrganisationName'
            AuthorityName:
              $ref: '#/components/schemas/AuthorityName'
            AuthorityCountry:
              description: Country the authority is based in
              type: string
              maxLength: 255

    Introspection:
      type: object
      properties:
        active:
          description: if the token has expired
          type: boolean
        client_id:
          description: id of client who owns the token
          type: string
          maxLength: 255
        exp:
          description: expiration time in ms
          type: string
        iat:
          description: when the token was issued
          type: string
        iss:
          description: the issuer
          type: string
        jti:
          description: unique string
          type: string
        scope:
          description: scope
          type: string
        token_type:
          description: type of token
          type: string
        sub:
          description: subject of token (not always present, depending on the token)
          type: string

    IntrospectionRequest:
      type: object
      properties:
        token:
          description: Oauth 2.0 token to be introspected
          type: string
          minLength: 1
          x-required-message: a token must be provided
      required:
        - token

    SoftwareStatementCertificateOrKeyType:
      type: string
      pattern: "^[^<>]*$"

    SoftwareStatements:
      type: array
      items:
        $ref: '#/components/schemas/SoftwareStatement'
      description: The list of Software Statements

    SoftwareStatementsPage:
      description: The list of Software Statements
      allOf:
        - $ref: '#/components/schemas/PaginationProperties'
      properties:
        content:
          type: array
          items:
            $ref: '#/components/schemas/SoftwareStatement'

    SoftwareStatementStatus:
      type: string
      description: Is this software statement Active/Suspended/Inactive
      enum:
        - Active
        - Suspended
        - Inactive
      default: Active

    SoftwareStatementDetail:
      type: object
      properties:
        Status:
          $ref: '#/components/schemas/SoftwareStatementStatus'
        ClientId:
          $ref: '#/components/schemas/ClientId'
        ClientName:
          $ref: '#/components/schemas/ClientName'
        Description:
          type: string
          description: Software Statement description
          maxLength: 255
          pattern: "^[^<>]*$"
        Environment:
          type: string
          description: The additional check for software statement, this field can avoid
          maxLength: 40
          pattern: "^[^<>]*$"
        OrganisationId:
          $ref: '#/components/schemas/OrganisationId'
        SoftwareStatementId:
          $ref: '#/components/schemas/SoftwareStatementId'
        Mode:
          $ref: '#/components/schemas/SoftwareStatementMode'
        RtsClientCreated:
          type: boolean
          description: Client created flag
        OnBehalfOf:
          type: string
          description: A reference to fourth party organisation resource on the RTS Directory if the registering Org is acting on behalf of another
          maxLength: 255
          pattern: "^[^<>]*$"
        PolicyUri:
          $ref: '#/components/schemas/PolicyUri'
        ClientUri:
          $ref: '#/components/schemas/ClientUri'
        LogoUri:
          $ref: '#/components/schemas/LogoUri'
        RedirectUri:
          type: array
          items:
            $ref: '#/components/schemas/RedirectUri'
          maxLength: 255
        PostLogoutRedirectUris:
          type: array
          items:
            $ref: '#/components/schemas/RedirectUri'
          maxLength: 255
        ApiWebhookUri:
          type: array
          items:
            $ref: '#/components/schemas/ApiWebhookUri'
        TermsOfServiceUri:
          type: string
          pattern: "^(http://|https://).*"
          x-pattern-message: "TermsOfServiceUri must be in a URI format https://... or http://..."
          format: uri
          description: The Software Statement terms of service compliant URI
          maxLength: 255
        NotificationWebhook:
          $ref: '#/components/schemas/SnsNotificationWebhookUri'
        NotificationWebhookStatus:
          $ref: '#/components/schemas/NotificationWebhookStatusEnum'
        SoftwareVersion:
          $ref: '#/components/schemas/RFCCompliantSoftwareVersion'
        Version:
          $ref: '#/components/schemas/SoftwareVersion'
        Locked:
          type: boolean
          description: Flag shows if assertion has been generated on the software statement - will be set to true when assertion is generated
        UpdateFailed:
          type: boolean
          description: Flag shows if software statement is in failed update state
        UpdateFailedReason:
          type: string
          description: Error message describing why the update failed
          pattern: "^[^<>]*$"
        AdditionalSoftwareMetadata:
          $ref: '#/components/schemas/AdditionalSoftwareMetadata'
        OpenidFederationEnabled:
          $ref: '#/components/schemas/OpenidFederationEnabled'
        OpenidFederationEntityManagementType:
          $ref: '#/components/schemas/OpenidFederationEntityManagementType'
        RequireSignedRequestObject:
          $ref: '#/components/schemas/RequireSignedRequestObject'
        IdTokenSignedResponseAlgorithm:
          $ref: '#/components/schemas/IdTokenSignedResponseAlgorithm'
        TokenEndpointAuthMethod:
          $ref: '#/components/schemas/TokenEndpointAuthMethod'
        ClientSecret:
          type: string
          description: The client secret, only returned when a client is created/updated to have client_secret_basic auth type
          maxLength: 255
        CreatedAt:
          $ref: '#/components/schemas/CreatedAt'
        OriginUri:
          type: array
          items:
            $ref: '#/components/schemas/OriginUri'
        TlsClientCertificateBoundAccessTokens:
          $ref: '#/components/schemas/TlsClientCertificateBoundAccessTokens'
        RelatedAuthorisationServer:
          $ref: '#/components/schemas/RelatedAuthorisationServer'
        Flags:
          $ref: '#/components/schemas/FlagArray'
        HomepageUri:
          $ref: '#/components/schemas/HomepageUri'

    SoftwareStatementAuditRecord:
      type: object
      properties:
        Status:
          $ref: '#/components/schemas/SoftwareStatementStatus'
        ClientId:
          $ref: '#/components/schemas/ClientId'
        ClientName:
          $ref: '#/components/schemas/ClientName'
        Description:
          type: string
          description: Software Statement description
          maxLength: 255
          pattern: "^[^<>]*$"
        Environment:
          type: string
          description: The additional check for software statement, this field can avoid
          maxLength: 40
          pattern: "^[^<>]*$"
        OrganisationId:
          $ref: '#/components/schemas/OrganisationId'
        SoftwareStatementId:
          $ref: '#/components/schemas/SoftwareStatementId'
        Mode:
          type: string
          enum:
            - Live
            - Test
          default: Live
          description: Software Statement mode
          maxLength: 8
        RtsClientCreated:
          type: boolean
          description: Client created flag
        OnBehalfOf:
          type: string
          description: A reference to fourth party organisation resource on the RTS Directory if the registering Org is acting on behalf of another
          maxLength: 255
          pattern: "^[^<>]*$"
        PolicyUri:
          $ref: '#/components/schemas/PolicyUri'
        ClientUri:
          $ref: '#/components/schemas/ClientUri'
        LogoUri:
          $ref: '#/components/schemas/LogoUri'
        RedirectUri:
          type: array
          items:
            $ref: '#/components/schemas/RedirectUri'
          maxLength: 255
        PostLogoutRedirectUris:
          type: array
          items:
            $ref: '#/components/schemas/RedirectUri'
          maxLength: 255
        ApiWebhookUri:
          type: array
          items:
            $ref: '#/components/schemas/ApiWebhookUri'
        TermsOfServiceUri:
          type: string
          pattern: "^(http://|https://).*"
          x-pattern-message: "TermsOfServiceUri must be in a URI format https://... or http://..."
          format: uri
          description: The Software Statement terms of service compliant URI
          maxLength: 255
        NotificationWebhook:
          $ref: '#/components/schemas/SnsNotificationWebhookUri'
        NotificationWebhookStatus:
          $ref: '#/components/schemas/NotificationWebhookStatusEnum'
        Version:
          $ref: '#/components/schemas/SoftwareVersion'
        Locked:
          type: boolean
          description: Flag shows if assertion has been generated on the software statement - will be set to true when assertion is generated
        UpdateFailed:
          type: boolean
          description: Flag shows if software statement is in failed update state
        UpdateFailedReason:
          type: string
          description: Error message describing why the update failed
          pattern: "^[^<>]*$"
        AdditionalSoftwareMetadata:
          $ref: '#/components/schemas/AdditionalSoftwareMetadata'
        OpenidFederationEnabled:
          $ref: '#/components/schemas/OpenidFederationEnabled'
        OpenidFederationEntityManagementType:
          $ref: '#/components/schemas/OpenidFederationEntityManagementType'
        RequireSignedRequestObject:
          $ref: '#/components/schemas/RequireSignedRequestObject'
        IdTokenSignedResponseAlgorithm:
          $ref: '#/components/schemas/IdTokenSignedResponseAlgorithm'
        TokenEndpointAuthMethod:
          $ref: '#/components/schemas/TokenEndpointAuthMethod'
        OriginUri:
          type: array
          items:
            $ref: '#/components/schemas/OriginUri'
        TlsClientCertificateBoundAccessTokens:
          $ref: '#/components/schemas/TlsClientCertificateBoundAccessTokens'
        RelatedAuthorisationServer:
          $ref: '#/components/schemas/RelatedAuthorisationServer'
        HomepageUri:
          $ref: '#/components/schemas/HomepageUri'

    CreatedAt:
      type: string
      format: date-time
      readOnly: true

    UpdatedAt:
      type: string
      format: date-time
      readOnly: true

    SoftwareStatement:
      type: object
      allOf:
        - $ref: '#/components/schemas/SoftwareStatementDetail'
      properties:
        SoftwareStatementCertifications:
          type: array
          items:
            $ref: '#/components/schemas/SoftwareStatementCertification'

    SoftwareStatementResponse:
      type: object
      allOf:
        - $ref: '#/components/schemas/SoftwareStatement'
      properties:
        OperationWarnings:
          type: array
          items:
            $ref: '#/components/schemas/OperationWarning'

    UnlockSoftwareStatementRequest:
      type: object
      properties:
        Unlock:
          type: boolean
          description: Unlock Software Statement
          x-required-message: Unlock equal to true must be provided

    SoftwareStatementRequest:
      type: object
      properties:
        ClientName:
          $ref: '#/components/schemas/ClientName'
        ClientId:
          $ref: '#/components/schemas/ClientId'
        Description:
          type: string
          description: Software Statement description
          maxLength: 255
          pattern: "^[^<>]*$"
        OnBehalfOf:
          type: string
          description: A reference to fourth party organisation resource on the RTS Directory if the registering Org is acting on behalf of another
          maxLength: 255
          pattern: "^[^<>]*$"
        PolicyUri:
          $ref: '#/components/schemas/PolicyUri'
        ClientUri:
          $ref: '#/components/schemas/ClientUri'
        LogoUri:
          $ref: '#/components/schemas/LogoUri'
        Environment:
          type: string
          description: The additional check for software statement, this field can avoid environment checks.
          maxLength: 40
          pattern: "^[^<>]*$"
        Mode:
          $ref: '#/components/schemas/SoftwareStatementMode'
        RedirectUri:
          type: array
          items:
            $ref: '#/components/schemas/RedirectUri'
          description: The Software Statement redirect URIs
          x-required-message: RedirectUri must be provided
        PostLogoutRedirectUris:
          type: array
          items:
            $ref: '#/components/schemas/RedirectUri'
        ApiWebhookUri:
          type: array
          items:
            $ref: '#/components/schemas/ApiWebhookUri'
        OriginUri:
          type: array
          items:
            $ref: '#/components/schemas/OriginUri'
        TermsOfServiceUri:
          $ref: '#/components/schemas/TermsOfServiceUri'
        NotificationWebhook:
          $ref: '#/components/schemas/SnsNotificationWebhookUri'
        SoftwareVersion:
          $ref: '#/components/schemas/RFCCompliantSoftwareVersion'
        Version:
          $ref: '#/components/schemas/SoftwareVersion'
        AdditionalSoftwareMetadata:
          $ref: '#/components/schemas/AdditionalSoftwareMetadata'
        OpenidFederationEnabled:
          $ref: '#/components/schemas/OpenidFederationEnabled'
        OpenidFederationEntityManagementType:
          $ref: '#/components/schemas/OpenidFederationEntityManagementType'
        RequireSignedRequestObject:
          $ref: '#/components/schemas/RequireSignedRequestObject'
        IdTokenSignedResponseAlgorithm:
          $ref: '#/components/schemas/IdTokenSignedResponseAlgorithm'
        TokenEndpointAuthMethod:
          $ref: '#/components/schemas/TokenEndpointAuthMethod'
        Roles:
          type: array
          items:
            $ref: '#/components/schemas/SoftwareAuthorityClaimCreationRequest'
        TlsClientCertificateBoundAccessTokens:
          $ref: '#/components/schemas/TlsClientCertificateBoundAccessTokens'
        RelatedAuthorisationServer:
          $ref: '#/components/schemas/RelatedAuthorisationServer'
        Flags:
          $ref: '#/components/schemas/FlagIDArray'
        HomepageUri:
          $ref: '#/components/schemas/HomepageUri'
      required:
        - ClientName
        - LogoUri
        - RedirectUri

    AdditionalSoftwareMetadata:
      type: string
      description: Extra metadata defined by the org admins to be loaded into the software statement and made avaiable during introspection
      maxLength: 255
      pattern: "^[^<>]*$"

    SoftwareStatementUpdateRequest:
      type: object
      allOf:
        - $ref: '#/components/schemas/SoftwareStatementRequest'
        - type: object
          properties:
            Status:
              type: string
              description: Should this software statement be active or suspended?
              enum:
                - Active
                - Suspended
              default: Active

    SoftwareStatementCertification:
      type: object
      properties:
        CertificationStartDate:
          $ref: '#/components/schemas/CertificationStartDate'
        CertificationExpirationDate:
          $ref: '#/components/schemas/CertificationExpirationDate'
        CertificationId:
          $ref: '#/components/schemas/SoftwareStatementCertificationId'
        SoftwareStatementId:
          $ref: '#/components/schemas/SoftwareStatementId'
        Status:
          $ref: '#/components/schemas/StatusEnum'
        ProfileVariant:
          $ref: '#/components/schemas/ProfileVariant'
        ProfileType:
          $ref: '#/components/schemas/ProfileType'
        ProfileVersion:
          type: number
          description: The version number of the certification
          x-required-message: Version must be provided
        CertificationURI:
          $ref: '#/components/schemas/ApiCertificationUri'
        CertificationStatus:
          $ref: '#/components/schemas/CertificationStatusEnum'

    SoftwareStatementCertificationRequest:
      type: object
      properties:
        CertificationStartDate:
          type: string
          maxLength: 10
          pattern: "^[0-3][0-9]/[0-1][0-9]/2([0-9]{3})$"
          x-pattern-message: "Date must match the format of dd/mm/yyyy, for example 31/12/2021"
        Status:
          $ref: '#/components/schemas/StatusEnum'
        ProfileVariant:
          $ref: '#/components/schemas/ProfileVariant'
        ProfileType:
          $ref: '#/components/schemas/ProfileType'
        ProfileVersion:
          type: number
          description: The version number of the certification
          x-required-message: Version must be provided
        CertificationURI:
          $ref: '#/components/schemas/ApiCertificationUri'
        CertificationStatus:
          $ref: '#/components/schemas/CertificationStatusEnum'
      required:
        - CertificationStartDate
        - CertificationStatus
        - ProfileVariant
        - ProfileType
        - ProfileVersion
        - CertificationURI


    SoftwareStatementCertifications:
      type: array
      items:
        $ref: '#/components/schemas/SoftwareStatementCertification'

    SoftwareStatementId:
      type: string
      description: Unique Software Statement Id
      maxLength: 40
      pattern: "^[^<>]*$"
    SoftwareStatementAssertion:
      type: string
      description: A signed JWT (JWS)
      maxLength: 4000
      pattern: "^[^<>]*$"
    SoftwareAuthorityClaims:
      type: array
      items:
        $ref: '#/components/schemas/SoftwareAuthorityClaim'
    ServerAuthorityClaimCreationRequest:
      type: object
      properties:
        OrganisationAuthorisationDomainRoleClaimID:
          $ref: '#/components/schemas/OrganisationAuthorityClaimId'
      required:
        - OrganisationAuthorisationDomainRoleClaimID
    ServerAuthorityClaimUpdateRequest:
      type: object
      allOf:
        - $ref: '#/components/schemas/ServerAuthorityClaimCreationRequest'
        - type: object
          properties:
            Status:
              $ref: '#/components/schemas/StatusEnum'
      required:
        - Status
    ServerAuthorityClaim:
      type: object
      allOf:
        - $ref: '#/components/schemas/ServerAuthorityClaimUpdateRequest'
        - type: object
          properties:
            ServerAuthorityClaimId:
              $ref: '#/components/schemas/ServerAuthorityClaimId'
            AuthorityName:
              $ref: '#/components/schemas/AuthorityName'
            AuthorisationDomainName:
              $ref: '#/components/schemas/AuthorisationDomainName'
            AuthorisationDomainRoleName:
              $ref: '#/components/schemas/AuthorisationDomainRoleName'
    ServerAuthorityClaimPage:
      allOf:
        - $ref: '#/components/schemas/PaginationProperties'
      properties:
        content:
          type: array
          items:
            $ref: '#/components/schemas/ServerAuthorityClaim'
    SoftwareAuthorityClaimCreationRequest:
      type: object
      properties:
        OrganisationAuthorisationDomainRoleClaimID:
          $ref: '#/components/schemas/OrganisationAuthorityClaimId'
        AuthorisationDomain:
          deprecated: true
          type: string
          description: Authorisation domain for the authority
          minLength: 1
          maxLength: 30
          pattern: "^[^<>]*$"
        Role:
          deprecated: true
          type: string
          description: The authorisation domain role name
          minLength: 1
          maxLength: 60
          example: "PAGTO"
          pattern: "^[^<>]*$"
    SoftwareAuthorityClaimUpdateRequest:
      type: object
      allOf:
        - $ref: '#/components/schemas/SoftwareAuthorityClaimCreationRequest'
        - type: object
          properties:
            Status:
              $ref: '#/components/schemas/StatusEnum'
      required:
        - Status
    SoftwareAuthorityClaim:
      type: object
      allOf:
        - $ref: '#/components/schemas/SoftwareAuthorityClaimUpdateRequest'
        - type: object
          properties:
            SoftwareAuthorityClaimId:
              $ref: '#/components/schemas/SoftwareAuthorityClaimId'
            AuthorityName:
              $ref: '#/components/schemas/AuthorityName'
            AuthorisationDomainName:
              $ref: '#/components/schemas/AuthorisationDomainName'
            AuthorisationDomainRoleName:
              $ref: '#/components/schemas/AuthorisationDomainRoleName'
    SoftwareAuthorityClaimPage:
      allOf:
        - $ref: '#/components/schemas/PaginationProperties'
      properties:
        content:
          type: array
          items:
            $ref: '#/components/schemas/SoftwareAuthorityClaim'
    SoftwareStatementMode:
      type: string
      enum:
        - Live
        - Test
      default: Live
      description: Software Statement mode

    ClientCreationRequest:
      type: object
      properties:
        id_token_signed_response_alg:
          $ref: '#/components/schemas/IdTokenSignedResponseAlgorithm'
        token_endpoint_auth_method:
          $ref: '#/components/schemas/TokenEndpointAuthMethod'
        jwks_uri:
          type: string
          description: Link to the application active jwks
          pattern: "^(http://|https://).*"
          x-required-message: Link to the application active jwks
        tls_client_auth_subject_dn:
          type: string
          description: The DN of the certificate that will be used to authenticate to this client
          maxLength: 250
        redirect_uris:
          type: array
          items:
            type: string
            uniqueItems: true
            pattern: "^[^<>]*$"
          description: redirect_uris uri must be provided. For client_credentials this should be an empty array.
          x-required-message: redirect_uris uri must be provided. For client_credentials this should be an empty array.
        post_logout_redirect_uris:
          type: array
          items:
            $ref: '#/components/schemas/RedirectUri'
        response_types:
          type: array
          items:
            type: string
            uniqueItems: true
          description: response_types uri must be provided. For client_credentials this should be an empty array
          x-required-message: response_types uri must be provided. For client_credentials this should be an empty array
        grant_types:
          type: array
          items:
            type: string
            uniqueItems: true
          description: grant_types uri must be provided. For client_credentials this should be array containing ["client_credentials"]
          x-required-message: grant_types uri must be provided. For client_credentials this should be array containing ["client_credentials"]
        authorization_details_types:
          $ref: '#/components/schemas/AuthorizationDetailsTypes'
        scope:
          type: string
          description: scopes to be tagged
          x-required-message: scope must be provided.
        software_id:
          $ref: '#/components/schemas/SoftwareStatementId'
        software_name:
          type: string
          description: Software Statement client name
          minLength: 1
          maxLength: 255
          x-required-message: software_name must be provided
        organisation_id:
          $ref: '#/components/schemas/OrganisationId'
        organisation_name:
          type: string
          minLength: 1
          maxLength: 255
          x-required-message: organisation_name must be provided
        organisation_number:
          type: string
          description: the cnpj number of the organisation
          minLength: 1
          maxLength: 255
          x-required-message: organisation_number must be provided
        software_roles:
          type: array
          items:
            type: string
          description: array of software roles
        software_description:
          type: string
          maxLength: 255
          x-required-message: software_description must be provided
        additional_software_metadata:
          type: object
          additionalProperties: { }
        software_statement:
          $ref: '#/components/schemas/SoftwareStatementAssertion'
        require_signed_request_object:
          $ref: '#/components/schemas/RequireSignedRequestObject'
        client_id:
          $ref: '#/components/schemas/ClientId'
        tls_client_certificate_bound_access_tokens:
          $ref: '#/components/schemas/TlsClientCertificateBoundAccessTokens'
        custom_claims:
          type: object

      required:
        - id_token_signed_response_alg
        - token_endpoint_auth_method
        - jwks_uri
        - redirect_uris
        - response_types
        - grant_types
        - scope
        - organisation_id
        - organisation_name
        - organisation_number
        - software_roles

    ClientUpdateRequest:
      allOf:
        - $ref: '#/components/schemas/ClientCreationRequest'
        - type: object
          properties:
            client_secret:
              type: string
      required:
        - id_token_signed_response_alg
        - token_endpoint_auth_method
        - jwks_uri
        - redirect_uris
        - response_types
        - grant_types
        - scope
        - organisation_id
        - organisation_name
        - organisation_number
        - software_roles
        - client_id
        - client_secret

    ClientCreationResponse:
      type: object
      properties:
        application_type:
          type: string
          description: OIDC application type response
          enum:
            - web
          default: web
        grant_types:
          type: array
          items:
            type: string
          description: grant_types
        authorization_details_types:
          $ref: '#/components/schemas/AuthorizationDetailsTypes'
        id_token_signed_response_alg:
          $ref: '#/components/schemas/IdTokenSignedResponseAlgorithm'
        require_auth_time:
          type: boolean
        subject_type:
          type: string
        response_types:
          type: array
          items:
            type: string
          description: response_types
        post_logout_redirect_uris:
          type: array
          items:
            type: string
          description: post_logout_redirect_uris
        tls_client_certificate_bound_access_token:
          type: boolean
        token_endpoint_auth_method:
          $ref: '#/components/schemas/TokenEndpointAuthMethod'
        introspection_endpoint_auth_method:
          type: string
        revocation_endpoint_auth_method:
          type: string
        client_id_issued_at:
          type: number
        client_id:
          type: string
        jwks_uri:
          type: string
        registration_client_uri:
          type: string
          description: management uri location to manage client post creation
        registration_access_token:
          type: string
          description: token used to manage client post creation
        redirect_uris:
          type: array
          items:
            type: string
          description: redirect_uris
        organisation_id:
          $ref: '#/components/schemas/OrganisationId'
        organisation_name:
          type: string
          minLength: 1
          maxLength: 255
          x-required-message: organisation_name must be provided
        organisation_number:
          type: string
          description: the cnpj number of the organisation
          minLength: 1
          maxLength: 255
          x-required-message: organisation_number must be provided
        software_roles:
          type: array
          items:
            type: string
          description: array of software roles
        software_id:
          type: string
          minLength: 1
          maxLength: 255
        software_name:
          type: string
          description: Software Statement client name
          minLength: 1
          maxLength: 255
          x-required-message: software_name must be provided
        software_description:
          type: string
          maxLength: 255
          x-required-message: software_description must be provided
        request_object_signing_alg:
          type: string
        require_signed_request_object:
          type: boolean
        require_pushed_authorization_requests:
          type: boolean
        authorization_signed_response_alg:
          type: string
        backchannel_user_code_parameter:
          type: boolean
        client_secret_expires_at:
          type: number
        client_secret:
          type: string
        scope:
          type: string
        tls_client_certificate_bound_access_tokens:
          $ref: '#/components/schemas/TlsClientCertificateBoundAccessTokens'


    AccessTokenRequest:
      type: object
      properties:
        grant_type:
          type: string
          description: The Grant Type
          enum:
            - client_credentials
            - private_key_jwt
            - tls_client_auth
            - urn:ietf:params:oauth:grant-type:device_code
          default: client_credentials
          minLength: 1
          x-required-message: Only client credentials supported
        client_id:
          type: string
          description: Required with grant_type private_key_jwt
          minLength: 1
          maxLength: 255
        client_assertion_type:
          type: string
          enum:
            - urn:ietf:params:oauth:client-assertion-type:jwt-bearer
          description: Required with grant_type private_key_jwt
          minLength: 1
          maxLength: 160
          x-required-message: Client assertion type must be set to urn:ietf:params:oauth:client-assertion-type:jwt-bearer
        assertion:
          type: string
          description: The assertion that is used to get a token, required with grant_type private_key_jwt
          minLength: 1
          x-required-message: Assertion is a required field
      required:
        - grant_type


    AccessTokenResponse:
      type: object
      properties:
        access_token:
          type: string
          description: Access token
        expires_in:
          type: integer
          description: lifetime in seconds
        token_type:
          type: string
        scope:
          type: string

    AccessTokenRevocationRequest:
      type: object
      description: A valid RFC7009 request - https://datatracker.ietf.org/doc/html/rfc7009#section-2.1
      properties:
        token:
          type: string
          description: The token that the client wants to get revoked.
          x-required-message: A token is required to be revoked.
        token_type_hint:
          type: string
          enum:
            - access_token
            - refresh_token
          description: |
            A hint about the type of the token
            submitted for revocation.  Clients MAY pass this parameter in
            order to help the authorization server to optimize the token
            lookup.  If the server is unable to locate the token using
            the given hint, it MUST extend its search across all of its
            supported token types.  An authorization server MAY ignore
            this parameter, particularly if it is able to detect the
            token type automatically.  This specification defines two
            such values:

            * access_token: An access token as defined in [RFC6749],
              Section 1.4

            * refresh_token: A refresh token as defined in [RFC6749],
              Section 1.5
      required:
        - token

    UserEmailOrID:
      type: string
      description: User email address or UUID. Use of the email address is considered deprecated
      maxLength: 50
      pattern: "^[^<>]*$"

    UserCreationRequest:
      type: object
      properties:
        Email:
          type: string
          description: The user email address
          minLength: 1
          x-required-message: The user email address is mandatory
          pattern: "^[^<>]*$"
      required:
        - Email

    SuperUsersPage:
      type: object
      allOf:
        - $ref: '#/components/schemas/PaginationProperties'
      properties:
        content:
          type: array
          items:
            $ref: '#/components/schemas/SuperUser'

    SuperUser:
      type: object
      allOf:
        - $ref: '#/components/schemas/UserDetails'

    CertificationManagersPage:
      allOf:
        - $ref: '#/components/schemas/PaginationProperties'
        - type: object
          properties:
            Content:
              $ref: '#/components/schemas/CertificationManagers'

    CertificationManagers:
      type: array
      items:
        $ref: '#/components/schemas/CertificationManager'

    CertificationManager:
      type: object
      allOf:
        - $ref: '#/components/schemas/UserDetails'

    DataAdministratorsPage:
      type: object
      allOf:
        - $ref: '#/components/schemas/PaginationProperties'
      properties:
        content:
          type: array
          items:
            $ref: '#/components/schemas/DataAdministrator'

    DataAdministrator:
      type: object
      allOf:
        - $ref: '#/components/schemas/UserDetails'

    AuthorisationDomainName:
      type: string
      description: Authorisation Domain Name
      minLength: 1
      maxLength: 30
      pattern: "^[^<>]*$"
      x-required-message: The authorisation domain name is mandatory

    AuthorisationDomainRegion:
      type: string
      description: The authorisation domain region
      minLength: 2
      pattern: "^[^<>]*$"
      x-required-message: The authorisation domain region is mandatory

    AuthorisationDomainDescription:
      type: string
      description: The authorisation domain description
      pattern: "^[^<>]*$"

    AuthorisationDomainRoleDescription:
      type: string
      description: The authorisation domain role description
      default: ""
      maxLength: 255
      pattern: "^[^<>]*$"

    AuthorityAuthorisationDomainId:
      type: string
      description: Mapping ID between Authority and Authorisation Domain
      maxLength: 50
      pattern: "^[^<>]*$"

    AuthorisationDomainUserCreateRequest:
      type: object
      allOf:
        - $ref: '#/components/schemas/UserCreationRequest'
      properties:
        AuthorisationDomainRole:
          $ref: '#/components/schemas/AuthorisationDomainRoleName'
        UserTypeID:
          $ref: '#/components/schemas/AuthorisationDomainUserTypeID'
        SystemID:
          $ref: '#/components/schemas/AuthorisationDomainSystemID'
      required:
        - Email
        - AuthorisationDomainRole
        - UserTypeID
        - SystemID

    AuthorisationDomainUsersPage:
      type: object
      allOf:
        - $ref: '#/components/schemas/PaginationProperties'
      properties:
        content:
          type: array
          items:
            $ref: '#/components/schemas/AuthorisationDomainUser'

    AuthorisationDomainUser:
      type: object
      allOf:
        - $ref: '#/components/schemas/UserDetails'
      properties:
        AuthorisationDomainUserId:
          $ref: '#/components/schemas/AuthorisationDomainUserId'
        AuthorisationDomain:
          $ref: '#/components/schemas/AuthorisationDomainName'
        AuthorisationDomainRole:
          $ref: '#/components/schemas/AuthorisationDomainRoleName'
        UserTypeID:
          $ref: '#/components/schemas/AuthorisationDomainUserTypeID'
        ContactRole:
          $ref: '#/components/schemas/AuthorisationDomainUserTypeName'
        SystemID:
          $ref: '#/components/schemas/AuthorisationDomainSystemID'
        System:
          $ref: '#/components/schemas/AuthorisationDomainSystemName'

    AuthorisationDomainRequest:
      type: object
      properties:
        AuthorisationDomainName:
          $ref: '#/components/schemas/AuthorisationDomainName'
        AuthorisationDomainRegion:
          $ref: '#/components/schemas/AuthorisationDomainRegion'
        AuthorisationDomainDescription:
          $ref: '#/components/schemas/AuthorisationDomainDescription'
        FederationID:
          $ref: '#/components/schemas/FederationId'
        Status:
          $ref: '#/components/schemas/StatusEnum'
      required:
        - AuthorisationDomainName
        - AuthorisationDomainRegion

    AuthorisationDomainUpdateRequest:
      type: object
      properties:
        AuthorisationDomainName:
          $ref: '#/components/schemas/AuthorisationDomainName'
        AuthorisationDomainRegion:
          $ref: '#/components/schemas/AuthorisationDomainRegion'
        AuthorisationDomainDescription:
          $ref: '#/components/schemas/AuthorisationDomainDescription'
        FederationID:
          $ref: '#/components/schemas/FederationId'
        Status:
          $ref: '#/components/schemas/StatusEnum'
      required:
        - AuthorisationDomainName
        - AuthorisationDomainRegion
        - Status

    AuthorisationDomainsPage:
      type: object
      allOf:
        - $ref: '#/components/schemas/PaginationProperties'
      properties:
        content:
          type: array
          items:
            $ref: '#/components/schemas/AuthorisationDomain'

    AuthorisationDomain:
      type: object
      properties:
        AuthorisationDomainID:
          $ref: '#/components/schemas/AuthorisationDomainID'
        AuthorisationDomainName:
          $ref: '#/components/schemas/AuthorisationDomainName'
        AuthorisationDomainRegion:
          $ref: '#/components/schemas/AuthorisationDomainRegion'
        AuthorisationDomainDescription:
          $ref: '#/components/schemas/AuthorisationDomainDescription'
        FederationID:
          $ref: '#/components/schemas/FederationId'
        Status:
          $ref: '#/components/schemas/StatusEnum'

    AuthorisationDomainID:
      type: string
      format: uuid
      nullable: false
      description: Unique identifier for an authorisation domain

    AuthorisationDomainRoleID:
      type: string
      format: uuid
      nullable: false
      description: Unique identifier for an authorisation domain role

    DomainAuthorisationDomainRoleRequest:
      type: object
      properties:
        AuthorisationDomainRoleName:
          $ref: '#/components/schemas/AuthorisationDomainRoleName'
        AuthorisationDomainRoleDescription:
          $ref: '#/components/schemas/AuthorisationDomainRoleDescription'
        RoleType:
          $ref: '#/components/schemas/RoleTypeEnum'
        Exclusive:
          $ref: '#/components/schemas/ExclusiveAuthorisationDomainRole'
      required:
        - AuthorisationDomainRoleName

    AuthorisationDomainRoleRequest:
      type: object
      allOf:
        - $ref: '#/components/schemas/DomainAuthorisationDomainRoleRequest'
        - type: object
          properties:
            AuthorisationDomainName:
              $ref: '#/components/schemas/AuthorisationDomainName'
      required:
        - AuthorisationDomainName


    DomainAuthorisationDomainRoleUpdateRequest:
      type: object
      allOf:
        - $ref: '#/components/schemas/DomainAuthorisationDomainRoleRequest'
        - type: object
          properties:
            Status:
              $ref: '#/components/schemas/StatusEnum'

    AuthorisationDomainRoleUpdateRequest:
      type: object
      allOf:
        - $ref: '#/components/schemas/DomainAuthorisationDomainRoleUpdateRequest'
        - type: object
          properties:
            AuthorisationDomainName:
              $ref: '#/components/schemas/AuthorisationDomainName'

    AuthorisationDomainRolesPage:
      type: object
      allOf:
        - $ref: '#/components/schemas/PaginationProperties'
      properties:
        content:
          type: array
          items:
            $ref: '#/components/schemas/AuthorisationDomainRole'

    AuthorisationDomainRole:
      type: object
      properties:
        AuthorisationDomainName:
          $ref: '#/components/schemas/AuthorisationDomainName'
        AuthorisationDomainRoleName:
          $ref: '#/components/schemas/AuthorisationDomainRoleName'
        AuthorisationDomainRoleIdentifier:
          $ref: '#/components/schemas/AuthorisationDomainRoleID'
        AuthorisationDomainRoleDescription:
          $ref: '#/components/schemas/AuthorisationDomainRoleDescription'
        RoleType:
          $ref: '#/components/schemas/RoleTypeEnum'
        Exclusive:
          $ref: '#/components/schemas/ExclusiveAuthorisationDomainRole'
        Status:
          $ref: '#/components/schemas/StatusEnum'

    AuthorisationDomainRoleName:
      type: string
      description: The authorisation domain role name
      minLength: 1
      maxLength: 60
      example: "PAGTO"
      x-required-message: Authorisation domain role name must be provided
      pattern: "^[^<>]*$"

    AuthorityAuthorisationDomainRequest:
      type: object
      properties:
        AuthorityID:
          type: string
          format: uuid
          description: The GUID of the Authority
          pattern: "^[^<>]*$"
        AuthorisationDomainID:
          $ref: '#/components/schemas/AuthorisationDomainID'
        Status:
          $ref: '#/components/schemas/StatusEnum'
      required:
        - AuthorityID
        - AuthorisationDomainID

    AuthorityAuthorisationDomainsPage:
      type: object
      allOf:
        - $ref: '#/components/schemas/PaginationProperties'
      properties:
        content:
          type: array
          items:
            $ref: '#/components/schemas/AuthorityAuthorisationDomain'

    AuthorityAuthorisationDomain:
      allOf:
        - $ref: '#/components/schemas/AuthorityAuthorisationDomainRequest'
        - type: object
          properties:
            AuthorityAuthorisationDomainId:
              type: string
              format: uuid
              description: The UUID of the Authority-Domain mapping
              pattern: "^[^<>]*$"
            AuthorityName:
              $ref: '#/components/schemas/AuthorityName'
            AuthorisationDomainName:
              $ref: '#/components/schemas/AuthorisationDomainName'

    OrganisationAuthorityDomainClaimId:
      type: string
      description: Organisation Authority Domain Claim ID
      maxLength: 50
      pattern: "^[^<>]*$"

    OrganisationAuthorityDomainClaimCreationRequest:
      type: object
      properties:
        AuthorisationDomainID:
          $ref: '#/components/schemas/AuthorisationDomainID'
        AuthorisationDomainName:
          deprecated: true
          type: string
          description: 'The name of the authorisation domain to map to the organisation. 
            NOTE: deprecated in favour of `AuthorisationDomainID`.'
          minLength: 1
          maxLength: 30
          pattern: "^[^<>]*$"
        AuthorityId:
          $ref: '#/components/schemas/AuthorityId'
        RegistrationId:
          type: string
          description: The registration ID
          pattern: "^[^<>]*$"
      required:
        - AuthorityId

    OrganisationAuthorityDomainClaimUpdateRequest:
      type: object
      allOf:
        - $ref: '#/components/schemas/OrganisationAuthorityDomainClaimCreationRequest'
        - type: object
          properties:
            Status:
              $ref: '#/components/schemas/StatusEnum'
      required:
        - AuthorityId
        - Status

    OrganisationAuthorityDomainClaimObject:
      type: object
      allOf:
        - $ref: '#/components/schemas/OrganisationAuthorityDomainClaimUpdateRequest'
        - type: object
          properties:
            OrganisationAuthorityDomainClaimId:
              type: string
              description: The unique org authority domain claim ID
            AuthorityName:
              type: string
              description: The name of the Authority
              pattern: "^[^<>]*$"

    OrganisationAuthorityDomainClaims:
      type: array
      items:
        $ref: '#/components/schemas/OrganisationAuthorityDomainClaimObject'

    OrganisationAuthorityDomainClaimsPage:
      type: object
      allOf:
        - $ref: '#/components/schemas/PaginationProperties'
      properties:
        content:
          type: array
          items:
            $ref: '#/components/schemas/OrganisationAuthorityDomainClaimObject'

    AuthorisationDomainUserId:
      type: string
      description: Unique record ID to identify Domain user
      maxLength: 50
      pattern: "^[^<>]*$"

    UserDetail:
      type: object
      properties:
        SuperUser:
          type: boolean
          description: Is the user a super user
        DataAdministrator:
          type: boolean
          description: Is the user a data administrator
        CertificationManager:
          type: boolean
          description: Is the user a certification manager
        SystemUser:
          type: boolean
          description: Is the user a system user
        BasicInformation:
          type: object
          properties:
            UserID:
              $ref: '#/components/schemas/UserID'
            UserEmail:
              type: string
              pattern: "^[^<>]*$"
            Status:
              $ref: '#/components/schemas/StatusEnum'
        OrgAccessDetails:
          type: object
          description: Map Key - OrgId, Map Value - Org Access Detail(containing info about org admin and domain role)
          additionalProperties:
            $ref: '#/components/schemas/OrgAccessDetail'
        DirectoryTermsAndConditionsDetails:
          $ref: '#/components/schemas/TermsAndConditionsDetails'
        CreatedAt:
          $ref: '#/components/schemas/CreatedAt'
        UpdatedAt:
          $ref: '#/components/schemas/UpdatedAt'

    TermsAndConditionsDetails:
      type: object
      description: Details of TnC
      properties:
        RequiresSigning:
          type: boolean
          description: Does the Directory TnC require signing
        Updated:
          type: boolean
          description: Has the document updated since the user signed
        TermsAndConditionsItem:
          $ref: '#/components/schemas/TermsAndConditionsItem'

    UserOPInfo:
      type: object
      description: The information contained within is subject to the scopes passed during token generation
      properties:
        sub:
          type: string
          description: Contains the email address
        family_name:
          type: string
          description: Family name
        given_name:
          type: string
          description: Given name
        name:
          type: string
          description: Full name
        email:
          type: string
          description: Email address
        email_verified:
          type: boolean
          description: Is the email verified
        address:
          type: string
          description: Address
        phone_number:
          type: string
          description: Phone number
        phone_number_verified:
          type: boolean
          description: Is the phone number verified

    WellKnown:
      type: object
      properties:
        acr_values_supported:
          type: array
          items: { }
        authorization_endpoint:
          type: string
          description: REQUIRED. URL of the OP's OAuth 2.0 Authorization Endpoint
        claims_parameter_supported:
          type: boolean
          description: OPTIONAL. Boolean value specifying whether the OP supports use of
            the claims parameter, with true indicating support. If omitted, the
            default value is false
        claims_supported:
          type: array
          items: { }
          description: RECOMMENDED. JSON array containing a list of the Claim Names of the
            Claims that the OpenID Provider MAY be able to supply values for
        code_challenge_methods_supported:
          type: array
          items: { }
        end_session_endpoint:
          type: string
        check_session_endpoint:
          type: string
        grant_types_supported:
          type: array
          items: { }
          description: OPTIONAL. JSON array containing a list of the OAuth 2.0 Grant Type
            values that this OP supports
        id_token_signing_alg_values_supported:
          type: array
          items: { }
          description: REQUIRED. JSON array containing a list of the JWS signing algorithms
            (alg values) supported by the OP for the ID Token to encode the
            Claims in a JWT
        issuer:
          type: string
          description: REQUIRED. URL using the https scheme with no query or fragment
            component that the OP asserts as its Issuer Identifier
        jwks_uri:
          type: string
          description: REQUIRED. URL of the OP's JSON Web Key Set [JWK] document.
        registration_endpoint:
          type: string
          description: RECOMMENDED. URL of the OP's Dynamic Client Registration Endpoint
        request_object_signing_alg_values_supported:
          type: string
          description: OPTIONAL. JSON array containing a list of the JWS signing algorithms
            (alg values) supported by the OP for Request Objects
        request_parameter_supported:
          type: boolean
          description: OPTIONAL. Boolean value specifying whether the OP supports use of
            the request parameter, with true indicating support. If omitted, the
            default value is false
        request_uri_parameter_supported:
          type: boolean
          description: OPTIONAL. Boolean value specifying whether the OP supports use of
            the request_uri parameter, with true indicating support. If omitted,
            the default value is true
        require_request_uri_registration:
          type: boolean
          description: OPTIONAL. Boolean value specifying whether the OP requires any
            request_uri values used to be pre-registered using the request_uris
            registration parameter
        pushed_authorization_request_endpoint:
          type: array
          items: { }
        response_modes_supported:
          type: array
          items: { }
          description: OPTIONAL. JSON array containing a list of the OAuth 2.0
            response_mode values that this OP supports
        response_types_supported:
          type: array
          items: { }
          description: REQUIRED. JSON array containing a list of the OAuth 2.0
            response_type values that this OP supports
        scopes_supported:
          type: array
          items: { }
          description: RECOMMENDED. JSON array containing a list of the OAuth 2.0 [RFC6749]
            scope values that this server supports
        subject_types_supported:
          type: array
          items: { }
          description: REQUIRED. JSON array containing a list of the Subject Identifier
            types that this OP supports
        token_endpoint_auth_methods_supported:
          type: array
          items: { }
          description: OPTIONAL. JSON array containing a list of Client Authentication
            methods supported by this Token Endpoint
        token_endpoint_auth_signing_alg_values_supported:
          type: array
          items: { }
          description: OPTIONAL. JSON array containing a list of the JWS signing algorithms
            (alg values) supported by the Token Endpoint for the signature on
            the JWT
        token_endpoint:
          type: string
          description: URL of the OP's OAuth 2.0 Token Endpoint
        userinfo_endpoint:
          type: string
          description: RECOMMENDED. URL of the OP's UserInfo Endpoint
        userinfo_signing_alg_values_supported:
          type: array
          items: { }
          description: OPTIONAL. JSON array containing a list of the JWS signing algorithms
            (alg values) [JWA] supported by the UserInfo Endpoint to encode the
            Claims in a JWT
        authorization_signing_alg_values_supported:
          type: array
          items: { }
        introspection_endpoint:
          type: string
        introspection_endpoint_auth_methods_supported:
          type: array
          items: { }
        introspection_endpoint_auth_signing_alg_values_supported:
          type: array
          items: { }
        revocation_endpoint:
          type: string
        revocation_endpoint_auth_methods_supported:
          type: array
          items: { }
        revocation_endpoint_auth_signing_alg_values_supported:
          type: array
          items: { }
        frontchannel_logout_supported:
          type: boolean
        frontchannel_logout_session_supported:
          type: boolean
        tls_client_certificate_bound_access_tokens:
          type: boolean
        claim_types_supported:
          type: array
          items: { }
          description: OPTIONAL. JSON array containing a list of the Claim Types that the
            OpenID Provider supports

    OrgAccessDetail:
      type: object
      properties:
        OrgRegistrationNumber:
          type: string
          description: CNPJ/Registration number of the org
          pattern: "^[^<>]*$"
        OrganisationName:
          $ref: '#/components/schemas/OrganisationName'
        OrgAdmin:
          type: boolean
          description: Is the user the org admin of the current org
        DomainRoleDetails:
          type: array
          description: Array of domain, role and status of domain role mapping
          items:
            $ref: '#/components/schemas/DomainRoleDetail'

    DomainRoleDetail:
      type: object
      properties:
        AuthorisationDomainName:
          $ref: '#/components/schemas/AuthorisationDomainName'
        AuthorisationDomainRoleName:
          $ref: '#/components/schemas/AuthorisationDomainRoleName'
        Status:
          $ref: '#/components/schemas/StatusEnum'
        ContactRole:
          $ref: '#/components/schemas/AuthorisationDomainUserTypeName'
        UserTypeID:
          $ref: '#/components/schemas/AuthorisationDomainUserTypeID'
        System:
          $ref: '#/components/schemas/AuthorisationDomainSystemName'

    TnCId:
      type: integer
      description: TnC unique identifier

    TermsAndConditionsPage:
      type: object
      allOf:
        - $ref: '#/components/schemas/PaginationProperties'
      properties:
        content:
          type: array
          items:
            $ref: '#/components/schemas/TermsAndConditionsItem'


    TermsAndConditionsItemDetails:
      type: object
      properties:
        TnCId:
          type: integer
          description: Unique identifier for the Terms and Conditions Item
          readOnly: true
        Name:
          type: string
          minLength: 1
          description: The Name of the TnC
          x-required-message: Name must be provided
          pattern: "^[^<>]*$"
        Type:
          type: string
          description: Role for which this TnC applies
          enum:
            - Participant
            - Directory
          x-required-message: Type must be provided
        Content:
          type: string
          minLength: 1
          description: The MarkDown of the TnC
          x-required-message: MarkDown must be provided
          pattern: "^[^<>]*$"
        Status:
          $ref: '#/components/schemas/StatusEnum'
        RoleIds:
          type: array
          description: Array of Unique identifiers for the Authorisation Domain Roles the Terms and Conditions Item is linked to
          items:
            $ref: '#/components/schemas/AuthorisationDomainRoleID'
      required:
        - Type
        - Content
        - Name

    TermsAndConditionsItem:
      type: object
      allOf:
        - $ref: '#/components/schemas/TermsAndConditionsItemDetails'
      properties:
        ExternalSigningService:
          $ref: '#/components/schemas/ExternalSigningService'
        Version:
          type: integer
          description: Version of the TnC

    TermsAndConditionsCreateRequest:
      type: object
      allOf:
        - $ref: '#/components/schemas/TermsAndConditionsItemDetails'
      properties:
        ExternalSigningService:
          $ref: '#/components/schemas/ExternalSigningService'

    ExternalSigningService:
      type: object
      properties:
        ExternalSigningServiceName:
          $ref: '#/components/schemas/ExternalSigningServiceName'
        ExternalSigningServiceSignerTemplateConfig:
          $ref: '#/components/schemas/ExternalSigningServiceSignerTemplateConfig'
        ExternalSigningServiceSubject:
          type: string
          minLength: 1
          description: The Subject of the External Signing Service
          x-required-message: Subject must be provided
          pattern: "^[^<>]*$"
        ExternalSigningServiceEmailSubject:
          type: string
          minLength: 1
          maxLength: 100
          description: The Subject of the Email for External Signing Service
          x-required-message: Email Subject must be provided
          pattern: "^[^<>]*$"

    ExternalSigningServiceName:
      type: string
      enum:
        - DocuSign
      description: The Name of the External Signing Service
      x-required-message: External signing service name must be provided

    ExternalSigningServiceSignerTemplateConfig:
      type: object
      properties:
        Signer1TemplateId:
          type: string
          minLength: 1
          description: Template ID for 1 signer
          pattern: "^[^<>]*$"
        Signer1Version:
          type: integer
          description: Version of the TnC document
          readOnly: true
        Signer2TemplateId:
          type: string
          minLength: 1
          description: Template ID for 2 signers
          pattern: "^[^<>]*$"
        Signer2Version:
          type: integer
          description: Version of the TnC document
          readOnly: true
        Signer3TemplateId:
          type: string
          minLength: 1
          description: Template ID for 3 signers
          pattern: "^[^<>]*$"
        Signer3Version:
          type: integer
          description: Version of the TnC document
          readOnly: true
        Signer4TemplateId:
          type: string
          minLength: 1
          description: Template ID for 4 signers
          pattern: "^[^<>]*$"
        Signer4Version:
          type: integer
          description: Version of the TnC document
          readOnly: true
        Signer5TemplateId:
          type: string
          minLength: 1
          description: Template ID for 5 signers
          pattern: "^[^<>]*$"
        Signer5Version:
          type: integer
          description: Version of the TnC document
          readOnly: true
        Signer6TemplateId:
          type: string
          minLength: 1
          description: Template ID for 6 signers
          pattern: "^[^<>]*$"
        Signer6Version:
          type: integer
          description: Version of the TnC document
          readOnly: true

    TermsAndConditionsUpdateRequest:
      type: object
      properties:
        Status:
          $ref: '#/components/schemas/StatusEnum'
        Content:
          type: string
          minLength: 1
          description: The MarkDown of the TnC
          pattern: "^[^<>]*$"
        ExternalSigningService:
          $ref: '#/components/schemas/ExternalSigningService'
        RoleIds:
          type: array
          items:
            $ref: '#/components/schemas/AuthorisationDomainRoleID'
      required:
        - Content

    OrgAdminUserCreateRequest:
      type: object
      properties:
        UserEmail:
          type: string
          description: Admin user email address
          pattern: '^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$'
          x-pattern-message: "EmailAddress must be a valid email"
      required:
        - UserEmail

    OrganisationAdminUsers:
      type: array
      items:
        $ref: '#/components/schemas/OrganisationAdminUser'

    OrganisationAdminUsersPage:
      allOf:
        - $ref: '#/components/schemas/PaginationProperties'
      properties:
        content:
          type: array
          items:
            $ref: '#/components/schemas/OrganisationAdminUser'

    UserDetails:
      type: object
      properties:
        UserID:
          $ref: '#/components/schemas/UserID'
        Status:
          $ref: '#/components/schemas/StatusEnum'
        Email:
          type: string
          description: Users email address
          pattern: "^[^<>]*$"

    UserID:
      type: string
      format: uuid
      description: The unique ID of a user

    OrganisationAdminUserDetails:
      type: object
      allOf:
        - $ref: '#/components/schemas/UserDetails'
      properties:
        UserEmail:
          deprecated: true
          type: string
          description: Users email address
          pattern: "^[^<>]*$"

    OrganisationAdminUser:
      type: object
      allOf:
        - $ref: '#/components/schemas/OrganisationAdminUserDetails'
      properties:
        DomainRoleDetails:
          type: array
          items:
            $ref: '#/components/schemas/DomainRoleDetail'

    ApiResources:
      type: array
      items:
        $ref: '#/components/schemas/ApiResource'

    ApiResourceDetail:
      type: object
      properties:
        ApiResourceId:
          $ref: '#/components/schemas/ApiResourceId'
        ApiVersion:
          type: string
          pattern: "^([0-9]+\\.[0-9]+\\.[0-9]+)$|^([0-9]+)$|^([0-9]+\\.[0-9]+)$"
          x-pattern-message: Version must be a valid format (x), (x.x) or (x.x.x)
          description: The version number of the API
        ApiFamilyID:
          $ref: '#/components/schemas/ApiFamilyID'
        FamilyComplete:
          type: boolean
          description: Denotes whether or not the api resource has had all related api endpoints published
        ApiCertificationUri:
          $ref: '#/components/schemas/ApiCertificationUri'
        CertificationStatus:
          $ref: '#/components/schemas/CertificationStatusEnum'
        CertificationStartDate:
          $ref: '#/components/schemas/CertificationStartDate'
        CertificationExpirationDate:
          $ref: '#/components/schemas/CertificationExpirationDate'
        ApiFamilyType:
          $ref: '#/components/schemas/ApiFamilyType'
        Status:
          $ref: '#/components/schemas/StatusEnum'
    ApiResource:
      type: object
      allOf:
        - $ref: '#/components/schemas/ApiResourceDetail'
      properties:
        ApiDiscoveryEndpoints:
          type: array
          items:
            $ref: '#/components/schemas/ApiDiscoveryEndpoint'
        ApiMetadata:
          $ref: '#/components/schemas/ApiResourceMetadata'

    ApiResourceRequest:
      type: object
      properties:
        ApiFamilyType:
          type: string
          minLength: 1
          maxLength: 128
          description: The type of API this record describes
          pattern: "^[^<>]*$"
          deprecated: true
        ApiVersion:
          type: string
          deprecated: true
          pattern: "^([0-9]+\\.[0-9]+\\.[0-9]+)$|^([0-9]+)$|^([0-9]+\\.[0-9]+)$"
          description: The version number of the API
        ApiFamilyID:
          $ref: '#/components/schemas/ApiFamilyID'
        ApiCertificationUri:
          $ref: '#/components/schemas/ApiCertificationUri'
        ApiEndpoint:
          $ref: '#/components/schemas/ApiEndpoint'
        CertificationStatus:
          $ref: '#/components/schemas/CertificationStatusEnum'
        CertificationStartDate:
          nullable: true
          type: string
          maxLength: 10
          pattern: "^[0-3][0-9]/[0-1][0-9]/2([0-9]{3})$"
          x-pattern-message: "Date must match the format of dd/mm/yyyy, for example 31/12/2021"
        Status:
          $ref: '#/components/schemas/StatusEnum'
      required:
        - Status

    ApiResourceUpdateRequest:
      type: object
      properties:
        ApiFamilyType:
          type: string
          minLength: 1
          maxLength: 128
          description: The type of API this record describes
          pattern: "^[^<>]*$"
          deprecated: true
        ApiVersion:
          type: string
          deprecated: true
          pattern: "^([0-9]+\\.[0-9]+\\.[0-9]+)$|^([0-9]+)$|^([0-9]+\\.[0-9]+)$"
          description: The version number of the API
        ApiFamilyID:
          $ref: '#/components/schemas/ApiFamilyID'
        ApiCertificationUri:
          $ref: '#/components/schemas/ApiCertificationUri'
        ApiEndpoint:
          $ref: '#/components/schemas/ApiEndpoint'
        CertificationStatus:
          $ref: '#/components/schemas/CertificationStatusEnum'
        CertificationStartDate:
          nullable: true
          type: string
          maxLength: 10
          pattern: "^[0-3][0-9]/[0-1][0-9]/2([0-9]{3})$"
          x-pattern-message: "Date must match the format of dd/mm/yyyy, for example 31/12/2021"
        Status:
          $ref: '#/components/schemas/StatusEnum'
      required:
        - Status
        - CertificationStatus

    ApiCertificationUri:
      type: string
      description: Link to the certifation package. Example https://github.com/Open[Domain]/conformance/blob/main/submissions/functional/business/1.0.3/api-business-customer.zip
      pattern: '^(https://).*'
      format: uri
      x-pattern-message: "ApiCertificationUri must be in a URI format https://..."
      maxLength: 500

    ApiFamilyType:
      type: string
      minLength: 1
      maxLength: 128
      description: The type of API this record describes
      pattern: "^[^<>]*$"

    ApiResourceId:
      type: string
      maxLength: 40
      description: The unique ID of an Api version resource
      pattern: "^[^<>]*$"

    ApiDiscoveryEndpoints:
      type: array
      items:
        $ref: '#/components/schemas/ApiDiscoveryEndpoint'

    ApiDiscoveryEndpointFamilyResponse:
      type: object
      properties:
        ApiDiscoveryEndpoints:
          items:
            $ref: '#/components/schemas/ApiDiscoveryEndpoint'
        FamilyComplete:
          type: boolean
          description: Denotes a completed api family set

    ApiDiscoveryEndpoint:
      type: object
      properties:
        ApiDiscoveryId:
          $ref: '#/components/schemas/ApiEndpointId'
        ApiEndpoint:
          $ref: '#/components/schemas/ApiEndpoint'

    ApiDiscoveryEndpointRequest:
      type: object
      properties:
        ApiEndpoints:
          type: array
          items:
            $ref: '#/components/schemas/ApiDiscoveryEndpointRequestObject'
      required:
        - ApiEndpoints

    ApiDiscoveryEndpointRequestObject:
      type: object
      properties:
        ApiEndpoint:
          $ref: '#/components/schemas/ApiEndpoint'
      required:
        - ApiEndpoint

    ApiEndpoint:
      type: string
      description: A compliant URI
      pattern: "^(http://|https://).*"
      x-pattern-message: "ApiEndpoint must be in a URI format https://... or http://..."
      maxLength: 255
      example: "https://raidiam.io/cb"

    ApiEndpointId:
      type: string
      maxLength: 40
      description: The unique ID of an Api discovery endpoint resource
      pattern: "^[^<>]*$"

    OrgTermsAndConditionsPage:
      type: object
      allOf:
        - $ref: '#/components/schemas/PaginationProperties'
      properties:
        content:
          type: array
          items:
            $ref: '#/components/schemas/OrgTermsAndConditionsDetail'

    UserTermsAndConditionsPage:
      type: object
      allOf:
        - $ref: '#/components/schemas/PaginationProperties'
      properties:
        content:
          type: array
          items:
            $ref: '#/components/schemas/TermsAndConditionsDetail'

    PaginationProperties:
      type: object
      properties:
        totalPages:
          type: integer
        totalSize:
          type: integer
        pageable:
          $ref: '#/components/schemas/Pageable'
        numberOfElements:
          type: integer
        size:
          type: integer
        offset:
          type: integer
        empty:
          type: boolean
        pageNumber:
          type: integer

    FlagUpdateRequest:
      type: object
      allOf:
        - $ref: '#/components/schemas/FlagRequest'
      properties:
        Cascade:
          $ref: '#/components/schemas/Cascade'
      required:
        - Cascade
        - Status
        - Name
        - Type
        - Value

    FlagRequest:
      type: object
      properties:
        Name:
          $ref: '#/components/schemas/FlagName'
        Description:
          $ref: '#/components/schemas/FlagDescription'
        Type:
          $ref: '#/components/schemas/FlagType'
        Value:
          $ref: '#/components/schemas/FlagValue'
        Status:
          $ref: '#/components/schemas/StatusEnum'
        AccessLevel:
          $ref: '#/components/schemas/FlagAccessLevel'
      required:
        - Status
        - Name
        - Type
        - Value
        - AccessLevel

    FlagsPage:
      type: object
      allOf:
        - $ref: '#/components/schemas/PaginationProperties'
      properties:
        content:
          type: array
          items:
            $ref: '#/components/schemas/Flag'

    Flag:
      type: object
      allOf:
        - $ref: '#/components/schemas/FlagRequest'
      properties:
        Id:
          $ref: '#/components/schemas/FlagID'
        CreatedAt:
          $ref: '#/components/schemas/CreatedAt'
        UpdatedAt:
          $ref: '#/components/schemas/UpdatedAt'

    FlagType:
      type: string
      description: The type of this tag
      enum:
        - Organisation
        - Software_Statement
        - Authorisation_Server

    FlagAccessLevel:
      type: integer
      description: The access level of a flag as a number. The higher the number, the more sensitive it is

    FlagValue:
      type: string
      description: The value of this flag
      maxLength: 255
      pattern: "^[^<>]*$"

    FlagDescription:
      type: string
      description: The description of this flag
      maxLength: 255
      pattern: "^[^<>]*$"

    FlagName:
      type: string
      description: The name of this flag
      maxLength: 255
      pattern: "^[^<>]*$"

    FlagID:
      type: string
      maxLength: 40
      description: Unique ID of the flag
      example: "f81d4fae-7dec-11d0-a765-00a0c91e6bf6"
      pattern: "^[^<>]*$"

    ContactTypeRequest:
      type: object
      properties:
        ContactType:
          $ref: '#/components/schemas/ContactTypeName'
        Description:
          $ref: '#/components/schemas/ContactTypeDescription'
        AccessLevel:
          $ref: '#/components/schemas/ContactTypesAccessLevel'
      required:
        - ContactType
        - AccessLevel

    ContactTypeUpdateRequest:
      type: object
      allOf:
        - $ref: '#/components/schemas/ContactTypeRequest'
        - type: object
          properties:
            Status:
              $ref: '#/components/schemas/StatusEnum'
          required:
            - ContactType
            - AccessLevel
            - Status

    ContactTypesPage:
      type: object
      allOf:
        - $ref: '#/components/schemas/PaginationProperties'
        - type: object
          properties:
            content:
              type: array
              items:
                $ref: '#/components/schemas/ContactTypeObject'

    ContactTypeObject:
      type: object
      allOf:
        - $ref: '#/components/schemas/ContactTypeRequest'
        - type: object
          properties:
            Id:
              $ref: '#/components/schemas/ContactTypeID'
            CreatedAt:
              $ref: '#/components/schemas/CreatedAt'
            UpdatedAt:
              $ref: '#/components/schemas/UpdatedAt'
            Status:
              $ref: '#/components/schemas/StatusEnum'

    ContactTypeID:
      type: string
      maxLength: 40
      description: Unique ID of the contact type
      example: "f81d4fae-7dec-11d0-a765-00a0c91e6bf6"
      pattern: "^[^<>]*$"
      format: uuid

    ContactTypeName:
      type: string
      description: The name of this contact type
      maxLength: 255
      pattern: "^[^<>]*$"

    ContactTypeDescription:
      type: string
      description: The description of this contact type
      maxLength: 255
      pattern: "^[^<>]*$"

    ContactTypesAccessLevel:
      type: integer
      description: The access level of a contact type as a number. The higher the number, the more sensitive it is
    
    ConformanceConfigurationRequest:
      type: object
      properties:
        ApiFamilyID:
          $ref: '#/components/schemas/ApiFamilyID'
        TestPlanName:
          $ref: '#/components/schemas/ConformanceConfigurationTestPlanName'
      required:
        - ApiFamilyID
        - TestPlanName

    ConformanceConfiguration:
      type: object
      allOf:
        - $ref: '#/components/schemas/ConformanceConfigurationRequest'
      properties:
        ID:
          $ref: '#/components/schemas/ConformanceConfigurationID'
        CreatedAt:
          $ref: '#/components/schemas/CreatedAt'
        UpdatedAt:
          $ref: '#/components/schemas/UpdatedAt'

    ConformanceConfigurationsPage:
      type: object
      allOf:
        - $ref: '#/components/schemas/PaginationProperties'
      properties:
        content:
          type: array
          items:
            $ref: '#/components/schemas/ConformanceConfiguration'

    ApiFamiliesPage:
      type: object
      allOf:
        - $ref: '#/components/schemas/PaginationProperties'
      properties:
        content:
          type: array
          items:
            $ref: '#/components/schemas/ApiFamily'

    ApiFamilyRequest:
      type: object
      properties:
        Name:
          $ref: '#/components/schemas/ApiFamilyName'
        Version:
          $ref: '#/components/schemas/ApiFamilyVersion'
        ConformanceTest:
          $ref: '#/components/schemas/ApiFamilyConformanceTest'
        CertificationURIRegex:
          $ref: '#/components/schemas/ApiFamilyCertificationURIRegex'
        Mandatory:
          $ref: '#/components/schemas/ApiFamilyMandatory'
        RequiresWellKnown:
          $ref: '#/components/schemas/ApiFamilyRequiresWellKnown'
        Endpoints:
          $ref: '#/components/schemas/ApiFamilyEndpoints'
        MetadataSchema:
          $ref: '#/components/schemas/ApiFamilyMetadataSchema'
        StartDate:
          $ref: '#/components/schemas/ApiFamilyStartDate'
        DeprecationDate:
          $ref: '#/components/schemas/ApiFamilyDeprecationDate'
      required:
        - Name
        - Version
        - ConformanceTest
        - Mandatory
        - RequiresWellKnown
        - Endpoints
    
    ApiFamilyUpdateRequest:
      type: object
      allOf:
        - $ref: '#/components/schemas/ApiFamilyRequest'
      properties:
        Status:
          $ref: '#/components/schemas/StatusEnum'
        Cascade:
          $ref: '#/components/schemas/Cascade'
      required:
        - Cascade
        - Status

    ApiFamily:
      type: object
      allOf:
        - $ref: '#/components/schemas/ApiFamilyRequest'
      properties:
        ID:
          $ref: '#/components/schemas/ApiFamilyID'
        Status:
          $ref: '#/components/schemas/StatusEnum'
        CreatedAt:
          $ref: '#/components/schemas/CreatedAt'
        UpdatedAt:
          $ref: '#/components/schemas/UpdatedAt'

    ApiFamilyID:
      type: string
      format: uuid
      nullable: false
      description: Unique ID of the api family
      example: "f81d4fae-7dec-11d0-a765-00a0c91e6bf6"

    ConformanceConfigurationID:
      type: string
      format: uuid
      nullable: false
      description: Unique ID of the conformance configuration
      example: "f81d4fae-7dec-11d0-a765-00a0c91e6bf6"

    ApiFamilyName:
      type: string
      description: The name of the api family
      maxLength: 255
      pattern: "^[^<>]*$"

    ConformanceConfigurationTestPlanName:
      type: string
      description: The name of the test plan
      maxLength: 255
      pattern: "^[^<>]*$"

    ApiFamilyCertificationURIRegex:
      type: string
      maxLength: 255
      description: regex to validate the cerfification URI
      pattern: "^[^<>]*$"
    
    ApiFamilyConformanceTest:
      type: boolean
      default: false
      description: Whether the conformance testing is required/enabled
    
    ApiFamilyEndpoints:
      type: array
      description: List of regexes (as strings) that valid endpoint URLs must match
      items:
        type: string
        example: '^(https:\/\/)(.*?)(\/open-banking\/admin\/v\d+\/metrics)$'
    
    ApiFamilyMandatory:
      type: boolean
      default: false
      description: Whether implementing this API family is mandatory

    ApiFamilyVersion:
      type: string
      pattern: "^[0-9]+([.][0-9]+){0,2}$"
      description: version of this configuration.
      example: '2.0.0'

    ApiFamilyMetadataSchema:
      type: object
      description: Raw JSON object containing an OpenAPI Schema definition for the metadata.
      additionalProperties: true

    ApiFamilyRequiresWellKnown:
      default: false
      type: boolean

    ApiFamilyStartDate:
      type: string
      format: date
      description: Api family start date
      example: "2021-01-30"
      x-pattern-message: "Date must match the format of yyyy-MM-dd, for example 2021-01-30"
    
    ApiFamilyDeprecationDate:
      type: string
      format: date
      description: Api family support/deprecation end date
      example: "2021-01-30"
      x-pattern-message: "Date must match the format of yyyy-MM-dd, for example 2021-01-30"

    Identifier:
      type: string
      description: The string to search for
      maxLength: 255
      pattern: "^[^<>]*$"
    
    EssSignRequest:
      type: object
      properties:
        TnCId:
          $ref: '#/components/schemas/TnCId'
        NoOfSigners:
          type: integer

    EssPollResponse:
      type: object
      properties:
        OrganisationId:
          $ref: '#/components/schemas/OrganisationId'
        EssEnvelopeId:
          $ref: '#/components/schemas/ExternalSigningServiceEnvelopeId'
        ExternalSigningServiceEnvelopeStatus:
          $ref: '#/components/schemas/ExternalSigningServiceEnvelopeStatus'

    EssPollResponses:
      type: array
      items:
        $ref: '#/components/schemas/EssPollResponse'

    Cascade:
      type: boolean
      description: If set to true on an operation that would deactivate the resource, all references to this given resource in other resources will be removed
      default: false

    ProfileVariant:
      type: string
      example: "FAPI Adv. OP w/ MTLS"
      description: Certification variant
      x-required-message: Certification needs to have a variant
      pattern: "^[^<>]*$"

    ProfileType:
      type: string
      example: "Redirect"
      description: Certification type
      pattern: "^[^<>]*$"

    WebhookStatusResponses:
      type: array
      items:
        $ref: '#/components/schemas/WebhookStatusResponse'

    WebhookStatusResponse:
      type: object
      properties:
        AuthorisationServerId:
          $ref: '#/components/schemas/AuthorisationServerId'
        WebhookStatus:
          $ref: '#/components/schemas/NotificationWebhookStatusEnum'

    TnCsToBeSigned:
      type: array
      items:
        $ref: '#/components/schemas/TermsAndConditionsItem'

    ExternalSigningServiceEnvelopeId:
      type: string
      description: The envelope id of the ess signing request
      pattern: "^[^<>]*$"

    RoleTypeEnum:
      type: string
      description: The different types of authorisation domain roles
      enum:
        - Directory
        - Federation
      default:
        Federation

    AuthDeprecatedDate:
      type: string
      format: date
      description: Authorisation Server support/deprecation end date
      example: "2021-01-30"
      x-pattern-message: "Date must match the format of yyyy-MM-dd, for example 2021-01-30"

    AuthRetirementDate:
      type: string
      format: date
      description: Authorisation Server Retirement date
      example: "2023-12-30"
      x-pattern-message: "Date must match the format of yyyy-MM-dd, for example 2023-12-30"

    AuthSupersededById:
      type: string
      format: uuid
      description: Authorisation Server ID which replaces the current auth server
      example: "f81d4fae-7dec-11d0-a765-00a0c91e6bf6"

    RegisteredClientsPage:
      type: object
      allOf:
        - $ref: '#/components/schemas/PaginationProperties'
      properties:
        content:
          $ref: '#/components/schemas/RegisteredClients'

    RegisteredClients:
      type: array
      items:
        $ref: '#/components/schemas/RegisteredClient'
      description: The list of Registered Clients

    ClientName:
      type: string
      description: Software Statement client name
      maxLength: 255
      pattern: "^[^<>]*$"

    SoftwareVersion:
      type: number
      description: Software Statement version as provided by the organisation's software team
      maxLength: 40
      deprecated: true

    RFCCompliantSoftwareVersion:
      type: string
      description: Software Statement version as provided by the organisation's software team
      maxLength: 40

    ClientId:
      type: string
      description: Software Statement client Id
      maxLength: 255
      pattern: "^[^<>]*$"

    RegisteredClient:
      type: object
      properties:
        redirect_uris:
          type: array
          items:
            $ref: '#/components/schemas/RedirectUri'
          description: The Software Statement redirect compliant URI
        post_logout_redirect_uris:
          type: array
          items:
            $ref: '#/components/schemas/RedirectUri'
          description: The Software Statement redirect compliant URI
        token_endpoint_auth_method:
          $ref: '#/components/schemas/TokenEndpointAuthMethod'
        use_mtls_endpoint_aliases:
          $ref: '#/components/schemas/MtlsEndpointAliases'
        grant_types:
          type: array
          items:
            type: string
            minLength: 1
            maxLength: 40
        authorization_details_types:
          $ref: '#/components/schemas/AuthorizationDetailsTypes'
        response_types:
          type: array
          items:
            type: string
            minLength: 1
            maxLength: 40
          description: List of response types
        client_name:
          $ref: '#/components/schemas/ClientName'
        client_uri:
          $ref: '#/components/schemas/ClientUri'
        homepage_uri:
          $ref: '#/components/schemas/HomepageUri'
        logo_uri:
          $ref: '#/components/schemas/LogoUri'
        scope:
          description: String containing a space-separated list of scope values
          type: string
          maxLength: 255
        tos_uri:
          $ref: '#/components/schemas/TosUri'
        policy_uri:
          $ref: '#/components/schemas/PolicyUri'
        jwks_uri:
          $ref: '#/components/schemas/JwksUri'
        software_id:
          $ref: '#/components/schemas/SoftwareStatementId'
        software_version:
          $ref: '#/components/schemas/SoftwareVersion'
        client_id:
          $ref: '#/components/schemas/ClientId'
        claims:
          type: array
          items:
            type: string
            description: The claim names aggregated from domain role metadata for this client
            maxLength: 255
        claims_in_verified_claims:
          type: array
          items:
            type: string
            description: The verified claim names aggregated from domain role metadata for this client
            maxLength: 255
        roles:
          type: array
          items:
            type: string
            description: The software authority roles that apply to this client
            maxLength: 255
        subject_type:
          type: string
        sector_identifier_uri:
          $ref: '#/components/schemas/SectorIdentifierUri'
        application_type:
          type: string
          description: OIDC application type response
          enum:
            - web
          default: web
        client_description:
          type: string
          description: Client description
          maxLength: 255
        status:
          $ref: '#/components/schemas/SoftwareStatementStatus'
        organisation_id:
          $ref: '#/components/schemas/OrganisationId'
        org_id:
          $ref: '#/components/schemas/OrganisationId'
        last_updated:
          type: string
          format: date-time
          description: JSONDatetime of last updated timestamp
        openid_federation_enabled:
          $ref: '#/components/schemas/OpenidFederationEnabled'
        openid_federation_entity_management_type:
          $ref: '#/components/schemas/OpenidFederationEntityManagementType'
        software_api_webhook_uri:
          type: array
          items:
            $ref: '#/components/schemas/ApiWebhookUri'
        organisation_registration_number:
          $ref: '#/components/schemas/RegistrationNumber'
        software_flags:
          type: array
          items:
            $ref: '#/components/schemas/ClientFlag'
        organisation_company_register:
          $ref: '#/components/schemas/CompanyRegister'
        organisation_country:
          $ref: '#/components/schemas/Country'

    ClientFlag:
      type: object
      properties:
        name:
          $ref: '#/components/schemas/FlagName'
        id:
          $ref: '#/components/schemas/FlagID'
        value:
          $ref: '#/components/schemas/FlagValue'

    RedirectUri:
      type: string
      pattern: "^(http://|https://).*"
      x-pattern-message: "RedirectUri must be in a URI format https://... or http://..."
      format: uri
      maxLength: 255
      description: An RFC-compliant redirect URI. Must use the `http` scheme and must be a valid absolute uri

    AuthorizationDetailsTypes:
      type: array
      items:
        type: string
        pattern: "^[^<>]*$"
      description: Defines whether or not a client is allowed to send RAR requests with authorization_details of specific types

    ApiWebhookUri:
      type: string
      format: uri
      maxLength: 255
      pattern: "^(https:\\/\\/[^\\s/?#]+(?:\\/[^\\s\\/?#]+)*)$"
      description: A compliant URI
      x-pattern-message: "ApiWebhookUri must be in a URI format <https://...> or <http://...>"

    OriginUri:
      type: string
      format: uri
      maxLength: 255
      pattern: "^https:\\/\\/(?:[a-zA-Z0-9-]+\\.)+[a-zA-Z]+(?::\\d+)?(?:\\/[a-zA-Z0-9-._~!$&'()*+,;=:@\\/?%]*)?(?:\\?[a-zA-Z0-9-._~!$&'()*+,;=:@\\/?%]*)?(?:#[a-zA-Z0-9-._~!$&'()*+,;=:@\\/?%]*)?$|(^android:apk-key-hash:[a-zA-Z0-9-]+)|(^ios:bundle-id:[a-zA-Z][-a-zA-Z0-9]*\\.([a-zA-Z][-a-zA-Z0-9]*\\.?)+)$"
      description: A compliant URI
      x-pattern-message: "OriginUri must be in a valid URI format"

    ClientUri:
      type: string
      pattern: "^(http://|https://).*"
      x-pattern-message: "ClientUri must be in a URI ./gradlew format https://... or http://..."
      description: The Software Statement client compliant URI
      maxLength: 255
      format: uri

    PolicyUri:
      description: A compliant URI string that points to a human-readable privacy policy document
      type: string
      pattern: "^(http://|https://).*"
      x-pattern-message: "PolicyUri must be in a URI format https://... or http://..."
      format: uri
      maxLength: 255

    JwksUri:
      description: A compliant URI string referencing the client's JSON Web Key (JWK) Set
      pattern: "^(http://|https://).*"
      x-pattern-message: "JwksUri must be in a URI format https://... or http://..."
      type: string
      format: uri
      maxLength: 255

    TosUri:
      type: string
      pattern: "^(http://|https://).*"
      x-pattern-message: "TermsOfServiceUri must be in a URI format https://... or http://..."
      format: uri
      description: The Software Statement terms of service compliant URI
      maxLength: 255

    LogoUri:
      type: string
      format: uri
      description: A compliant URI
      pattern: ^(http://|https://).*.(svg|png|jpg|jpeg)$|(data:image/[a-zA-Z0-9;+=-]+,[A-Za-z0-9+/]*={0,2})$
      x-pattern-message: "LogoUri must be in a URI format (https://... or http://...) or a base64 encoded string (data:image/png;base64,base64encoded)"
      x-required-message: LogoUri must be provided

    SectorIdentifierUri:
      description: A compliant URI string referencing the client's sector identifier
      pattern: "^(http://|https://).*"
      x-pattern-message: "SectorIdentifierUri must be in a URI format https://... or http://..."
      type: string
      format: uri
      maxLength: 255

    OpenidFederationEnabled:
      type: boolean
      default: false
      description: Is this software statement enabled for federation

    OpenidFederationEntityManagementType:
      type: string
      enum:
        - openid_entity_federation_managed
        - openid_entity_self_managed
      description: The type of federation management that applies to this software statement

    RequireSignedRequestObject:
      type: boolean
      default: true
      description: Require a signed request object. If this is set to false, the client will not be FAPI compliant

    TlsClientCertificateBoundAccessTokens:
      type: boolean
      default: true
      description: Are the tokens issued for this client bound to a client tls certificate

    IdTokenSignedResponseAlgorithm:
      type: string
      description: Signing algorithm that a client expects the server to return an id_token with. Must be PS256
      enum:
        - PS256
        - RS256
      default: PS256
      x-required-message: id_token_signed_response_alg must be provided. If this is set to anything other than PS256, the client will not be FAPI compliant

    TokenEndpointAuthMethod:
      enum:
        - private_key_jwt
        - tls_client_auth
        - client_secret_basic
      default: private_key_jwt
      type: string
      description: Token endpoint authentication method
      minLength: 1
      maxLength: 60
      x-required-message: Token endpoint auth method must be provided

    MtlsEndpointAliases:
      type: boolean
      default: true
      description: Is the client required to use endpoints defined in the Authorisation Server Discovery Document, or if non MTLS endpoints can be used

    RelatedAuthorisationServer:
      type: string
      format: uuid
      nullable: true
      description: ID of the Authorisation Server that is connected to this Software Statement

    TypeID:
      type: string
      description: Type ID of the certification
      maxLength: 40
      pattern: "^[^<>]*$"

    TypeName:
      type: string
      description: Type name of the certification
      pattern: "^[^<>]*$"

    CertificateOrKeyDescription:
      maxLength: 255
      type: string
      description: Information about the certificate

    Description:
      type: string
      description: Description of the certification type
      pattern: "^[^<>]*$"

    CreatedBy:
      type: string
      description: User who created the certification type
      pattern: "^[^<>]*$"

    VariantID:
      type: string
      description: Variant ID of the certification type
      maxLength: 40
      pattern: "^[^<>]*$"

    VariantName:
      type: string
      description: Variant Name of the certification type
      pattern: "^[^<>]*$"

    CertificationDurationDays:
      type: integer
      description: The number of days a certification is valid for up to a maximum of 100 years
      maximum: 36500

    OperationWarning:
      type: string
      description: A warning code that describes a warning condition that occurred during the last operation
      enum:
        - IMAGE_UPLOAD_FAILURE_PLACEHOLDER_USED
        - IMAGE_VALIDATION_FAILURE_BAD_DATA_ENCODING_PLACEHOLDER_USED
        - IMAGE_VALIDATION_FAILURE_UNSUPPORTED_IMAGE_FORMAT_PLACEHOLDER_USED
        - IMAGE_VALIDATION_CONTENT_FAILURE_PLACEHOLDER_USED
        - IMAGE_VALIDATION_DIMENSIONS_FAILURE_PLACEHOLDER_USED
        - IMAGE_VALIDATION_MAX_SIZE_FAILURE_PLACEHOLDER_USED
        - IMAGE_VALIDATION_FAILURE_SVG_VALIDATION_PLACEHOLDER_USED
        - IMAGE_VALIDATION_CONTENT_WARNING_SUPERUSER_OVERRIDE
        - IMAGE_VALIDATION_DIMENSIONS_WARNING_SUPERUSER_OVERRIDE

    UserGroupIDPBindingCreationRequest:
      type: object
      description: Request object used to create a mapping between an IDP and a user group
      properties:
        SsoConfigurationID:
          $ref: '#/components/schemas/SsoConfigurationID'
        ExternalID:
          $ref: '#/components/schemas/ExternalID'
      required:
        - SsoConfigurationID
        - ExternalID

    UserGroupIDPBindingObject:
      type: object
      description: A User Group IDP binding
      allOf:
        - $ref: '#/components/schemas/UserGroupIDPBindingCreationRequest'
        - type: object
          properties:
            ID:
              $ref: '#/components/schemas/UserGroupIDPBindingID'
            OrganisationID:
              $ref: '#/components/schemas/OrganisationId'
            ServerID:
              $ref: '#/components/schemas/AuthorisationServerId'
            DisplayName:
              $ref: '#/components/schemas/SsoConfigurationDisplayName'
            CreatedAt:
              $ref: '#/components/schemas/CreatedAt'
            UpdatedAt:
              $ref: '#/components/schemas/UpdatedAt'

    UserGroupIDPBindingPage:
      type: object
      allOf:
        - $ref: '#/components/schemas/PaginationProperties'
      properties:
        content:
          type: array
          items:
            $ref: '#/components/schemas/UserGroupIDPBindingObject'

    UserGroupIDPBindingID:
      type: string
      format: uuid
      nullable: false
      description: Unique identifier of the given mapping between an IDP Configuration and User Group

    UserGroupOrganisationBindingCreationRequest:
      type: object
      description: Request object used to create a mapping between an Organisation and a user group
      properties:
        OrganisationID:
          $ref: '#/components/schemas/OrganisationId'
      required:
        - OrganisationID

    UserGroupOrganisationBindingObject:
      type: object
      description: A User Group Organisation binding
      allOf:
        - $ref: '#/components/schemas/UserGroupOrganisationBindingCreationRequest'
        - type: object
          properties:
            ID:
              $ref: '#/components/schemas/UserGroupIDPBindingID'
            OrganisationName:
              type: string
            CreatedAt:
              $ref: '#/components/schemas/CreatedAt'
            UpdatedAt:
              $ref: '#/components/schemas/UpdatedAt'

    UserGroupOrganisationBindingPage:
      type: object
      allOf:
        - $ref: '#/components/schemas/PaginationProperties'
      properties:
        content:
          type: array
          items:
            $ref: '#/components/schemas/UserGroupOrganisationBindingObject'

    UserGroupOrganisationBindingID:
      type: string
      format: uuid
      nullable: false
      description: Unique identifier of the given mapping between an Organisation and User Group

    UserGroupCreationRequest:
      type: object
      description: Request object used to create a directory-managed user group
      properties:
        Name:
          type: string
          maxLength: 64
          nullable: false
          description: Display name for the user group
      required:
        - Name

    ExternalID:
      type: string
      maxLength: 64
      nullable: false
      description: Identifier for a user group used to identify it for permission management purposes

    UserGroupUpdateRequest:
      type: object
      description: Request object used to update an existing SSO Configuration for a given OpenID Connect Authorization Server
      allOf:
        - $ref: '#/components/schemas/UserGroupCreationRequest'
        - type: object
          properties:
            Status:
              $ref: '#/components/schemas/StatusEnum'
          required:
            - Status

    UserGroupObject:
      type: object
      description: A User Group object
      allOf:
        - $ref: '#/components/schemas/UserGroupUpdateRequest'
        - type: object
          properties:
            ID:
              $ref: '#/components/schemas/UserGroupID'
            ManagementType:
              $ref: '#/components/schemas/UserGroupManagementType'
            CreatedAt:
              $ref: '#/components/schemas/CreatedAt'
            UpdatedAt:
              $ref: '#/components/schemas/UpdatedAt'

    UserGroupPage:
      type: object
      allOf:
        - $ref: '#/components/schemas/PaginationProperties'
      properties:
        content:
          type: array
          items:
            $ref: '#/components/schemas/UserGroupObject'

    UserGroupID:
      type: string
      format: uuid
      nullable: false
      description: Unique identifier of the given User Group

    HighLevelSsoConfigurationObjectPage:
      type: object
      allOf:
        - $ref: '#/components/schemas/PaginationProperties'
      properties:
        content:
          type: array
          items:
            $ref: '#/components/schemas/HighLevelSsoConfigurationObject'

    HighLevelSsoConfigurationObject:
      type: object
      properties:
        ID:
          $ref: '#/components/schemas/SsoConfigurationID'
        DisplayName:
          $ref: '#/components/schemas/SsoConfigurationDisplayName'
        ServerID:
          $ref: '#/components/schemas/AuthorisationServerId'
        ServerName:
          $ref: '#/components/schemas/CustomerFriendlyName'
        ServerLogoURI:
          $ref: '#/components/schemas/LogoUri'
        OrganisationID:
          $ref: '#/components/schemas/OrganisationId'
        OrganisationName:
          type: string

    UserGroupManagementType:
      type: string
      description: Indicator as to which platform can manage the user group
      enum:
        - directory
        - raidiam

    UserGroupMembersPage:
      type: object
      allOf:
        - $ref: '#/components/schemas/PaginationProperties'
      properties:
        content:
          type: array
          items:
            type: object
            properties:
              ID:
                $ref: '#/components/schemas/UserGroupMembershipID'
              UserIdentifier:
                type: string
                description: Identifier for the given user
              LastAuthenticatedAt:
                type: string
                format: date-time

    UserGroupMembershipID:
      type: string
      format: uuid
      nullable: false
      description: Unique identifier for a given user's membership of a group

    UserGroupPermissionCreationRequest:
      type: object
      description: Request object used to assign a permission to a user group
      anyOf:
        - $ref: '#/components/schemas/UserGroupOrganisationAdministratorPermissionCreationRequest'
        - $ref: '#/components/schemas/UserGroupDomainUserPermissionCreationRequest'
      discriminator:
        propertyName: PermissionType
        mapping:
          OrganisationAdministrator: '#/components/schemas/UserGroupOrganisationAdministratorPermissionCreationRequest'
          DomainUser: '#/components/schemas/UserGroupDomainUserPermissionCreationRequest'

    UserGroupOrganisationAdministratorPermissionCreationRequest:
      type: object
      description: A request object used to assign an organisation administrator permission to a user group
      properties:
        PermissionType:
          $ref: '#/components/schemas/UserGroupPermissionTypeEnum'
      required:
        - PermissionType

    UserGroupPermissionTypeEnum:
      type: string
      enum:
        - OrganisationAdministrator
        - DomainUser

    UserGroupDomainUserPermissionCreationRequest:
      type: object
      description: A request object used to assign a domain user permission to a user group
      properties:
        PermissionType:
          $ref: '#/components/schemas/UserGroupPermissionTypeEnum'
        AuthorisationDomainID:
          $ref: '#/components/schemas/AuthorisationDomainID'
        AuthorisationDomainRoleID:
          $ref: '#/components/schemas/AuthorisationDomainRoleID'
        AuthorisationDomainUserTypeID:
          $ref: '#/components/schemas/AuthorisationDomainUserTypeID'
        AuthorisationDomainSystemID:
          $ref: '#/components/schemas/AuthorisationDomainSystemID'
      required:
        - PermissionType
        - AuthorisationDomainID
        - AuthorisationDomainRoleID
        - AuthorisationDomainUserTypeID
        - AuthorisationDomainSystemID

    UserGroupPermissionObject:
      type: object
      description: A User Group object
      allOf:
        - $ref: '#/components/schemas/UserGroupPermissionCreationRequest'
        - type: object
          properties:
            ID:
              $ref: '#/components/schemas/UserGroupID'
            ManagementType:
              $ref: '#/components/schemas/UserGroupManagementType'
            AuthorisationDomainName:
              $ref: '#/components/schemas/AuthorisationDomainName'
            AuthorisationDomainRoleName:
              $ref: '#/components/schemas/AuthorisationDomainRoleName'
            AuthorisationDomainUserTypeName:
              $ref: '#/components/schemas/AuthorisationDomainUserTypeName'
            AuthorisationDomainSystemName:
              $ref: '#/components/schemas/AuthorisationDomainSystemName'
            CreatedAt:
              $ref: '#/components/schemas/CreatedAt'
            UpdatedAt:
              $ref: '#/components/schemas/UpdatedAt'

    UserGroupPermissionPage:
      type: object
      allOf:
        - $ref: '#/components/schemas/PaginationProperties'
      properties:
        content:
          type: array
          items:
            $ref: '#/components/schemas/UserGroupPermissionObject'

    UserGroupPermissionID:
      type: string
      format: uuid
      nullable: false
      description: Unique identifier for a specific user group permission mapping

    BaseSsoConfigurationRequest:
      type: object
      description: Base request object used to manage an SSO Configuration for a given OpenID Connect Authorization Server
      properties:
        DisplayName:
          $ref: '#/components/schemas/SsoConfigurationDisplayName'
        Contacts:
          type: array
          items:
            type: string
            format: email
          nullable: false
          minItems: 1
          maxItems: 10
          description: List of email addresses to act as points of contact for ecosystem administrators
      required:
        - DisplayName
        - Contacts

    SsoConfigurationCreationRequest:
      type: object
      description: Request object used to create an SSO Configuration for a given OpenID Connect Authorization Server
      allOf:
        - $ref: '#/components/schemas/BaseSsoConfigurationRequest'
        - type: object
          properties:
            RedirectUriSuffix:
              $ref: '#/components/schemas/SsoConfigurationRedirectUriSuffix'

    SsoConfigurationUpdateRequest:
      type: object
      description: Request object used to update an existing SSO Configuration for a given OpenID Connect Authorization Server
      allOf:
        - $ref: '#/components/schemas/BaseSsoConfigurationRequest'
        - type: object
          properties:
            Status:
              $ref: '#/components/schemas/StatusEnum'
            RedirectUriSuffix:
              $ref: '#/components/schemas/SsoConfigurationRedirectUriSuffix'
          required:
            - Status

    SsoConfigurationObject:
      type: object
      description: SSO Configuration for a given OpenID Connect Authorization Server
      allOf:
        - $ref: '#/components/schemas/BaseSsoConfigurationRequest'
        - type: object
          properties:
            ID:
              $ref: '#/components/schemas/SsoConfigurationID'
            ServerID:
              $ref: '#/components/schemas/AuthorisationServerId'
            RedirectUri:
              $ref: '#/components/schemas/RedirectUri'
            TextRecord:
              type: string
              maxLength: 255
              nullable: false
              description: DNS text record value for the SSO configuration
            Status:
              $ref: '#/components/schemas/StatusEnum'
            CreatedAt:
              $ref: '#/components/schemas/CreatedAt'
            UpdatedAt:
              $ref: '#/components/schemas/UpdatedAt'

    SsoConfigurationObjectPage:
      type: object
      allOf:
        - $ref: '#/components/schemas/PaginationProperties'
      properties:
        content:
          type: array
          items:
            $ref: '#/components/schemas/SsoConfigurationObject'

    SsoConfigurationID:
      type: string
      format: uuid
      nullable: false
      description: Unique identifier of the given OpenID Connect Provider's SSO Configuration

    SsoConfigurationDisplayName:
      maxLength: 64
      type: string
      description: Display name for the SSO configuration
      nullable: false

    SsoConfigurationRedirectUriSuffix:
      type: string
      minLength: 1
      maxLength: 40
      description: DNS text record value for the SSO configuration

    SsoConfigurationVersionID:
      type: string
      format: uuid
      nullable: false
      description: Unique identifier of the given OpenID Connect Provider's SSO Configuration

    SsoConfigurationVersionCreationRequest:
      type: object
      description: Request object used to create an SSO Configuration Version for a given Authorization Server's SSO Configuration
      properties:
        ClientID:
          type: string
          maxLength: 255
          nullable: false
          description: The Client ID to be used by the Raidiam IDP to retrieve identity claims from the external IDP used for SSO
        RestrictedDomains:
          type: array
          items:
            type: string
            maxLength: 255
            pattern: ^\S*$
          maxItems: 10
          description: List of email domains that will be forced to use this IDP for SSO
        SupportedDomains:
          type: array
          items:
            type: string
            maxLength: 255
            pattern: ^\S*$
          maxItems: 10
          description: List email domains that will have the option to use this IDP for SSO
        GroupClaim:
          type: string
          maxLength: 60
          description: The name of the claim in the ID Token returned by the external IDP containing the list of user group identifiers
        GroupClaimPath:
          type: string
          default: '$.'
          pattern: '^\$[.\[].*'
          maxLength: 255
          description: Valid JSON Path indicating the location in the ID Token of the group claim
        AdditionalScopeValues:
          type: string
          default: ""
          maxLength: 255
          description: Additional space-separated scope values that will be requested alongside the default of openid, email and profile
        AuthenticationPolicies:
          type: array
          items:
            $ref: '#/components/schemas/AuthenticationPolicyEnum'
          description: List of sign-in policies that are applied during authentication
      required:
        - ClientID
        - RestrictedDomains
        - SupportedDomains
        - GroupClaim
        - AuthenticationPolicies

    SsoConfigurationVersionUpdateRequest:
      type: object
      description: Request object used to update an existing SSO Configuration for a given OpenID Connect Authorization Server
      allOf:
        - $ref: '#/components/schemas/SsoConfigurationVersionCreationRequest'
        - type: object
          properties:
            Status:
              $ref: '#/components/schemas/ApprovalFlowStatusEnum'
          required:
            - Status

    SsoConfigurationVersionObject:
      type: object
      description: SSO Configuration Version for a given IDP SSO configuration
      allOf:
        - $ref: '#/components/schemas/SsoConfigurationVersionUpdateRequest'
        - type: object
          properties:
            ID:
              $ref: '#/components/schemas/SsoConfigurationVersionID'
            SsoConfigurationID:
              $ref: '#/components/schemas/SsoConfigurationID'
            Version:
              type: integer
              format: int16
              nullable: false
              description: Version number of the SSO configuration
            CreatedAt:
              $ref: '#/components/schemas/CreatedAt'
            UpdatedAt:
              $ref: '#/components/schemas/UpdatedAt'

    SsoConfigurationVersionObjectPage:
      type: object
      allOf:
        - $ref: '#/components/schemas/PaginationProperties'
      properties:
        content:
          type: array
          items:
            $ref: '#/components/schemas/SsoConfigurationVersionObject'

    SsoConfigurationVersionApproved:
      type: boolean
      description: Whether the SSO configuration version is approved. Once approved, further modifications beyond status changes are no longer possible

    AuthenticationPolicyEnum:
      type: string
      enum:
        - 'CLICK_TO_ACCEPT_TERMS'
        - 'ESIGNATURE_TERMS'
        - 'RECOVERY_CODES'
        - 'TWO_FACTOR'
        - 'VERIFY_EMAIL_AND_MOBILE'

x-amazon-apigateway-request-validators:
  no-validation:
    validateRequestBody: false
    validateRequestParameters: false
  body-only:
    validateRequestBody: true
    validateRequestParameters: false
  params-only:
    validateRequestBody: false
    validateRequestParameters: true
  all:
    validateRequestBody: true
    validateRequestParameters: true

x-amazon-apigateway-request-validator: all

x-amazon-apigateway-binary-media-types: [ "application/x-pem-file" ]

x-amazon-apigateway-gateway-responses:
  BAD_REQUEST_BODY:
    responseTemplates:
      application/json: "{
        \"errors\": [
          \"$context.error.message: $context.error.validationErrorString\"
        ],
        \"requestId\": \"$context.requestId\"
      }"
  BAD_REQUEST_PARAMETERS:
    responseTemplates:
      application/json: "{
        \"errors\": [
          \"$context.error.message: $context.error.validationErrorString\"
        ],
        \"requestId\": \"$context.requestId\"
      }"
  DEFAULT_4XX:
    responseTemplates:
      application/json: "{
        \"errors\": [
          \"There is an issue with your request.\"
        ],
        \"requestId\": \"$context.requestId\"
      }"
  UNAUTHORIZED:
    responseTemplates:
      application/json: "{
        \"errors\": [
          \"Authorizer failed to authorize request.\"
        ],
        \"requestId\": \"$context.requestId\"
      }"
  DEFAULT_5XX:
    responseTemplates:
      application/json: "{
        \"errors\": [
          \"A server error occurred.\"
        ],
        \"requestId\": \"$context.requestId\"
      }"
  THROTTLED:
    responseTemplates:
      application/json: "{
        \"errors\": [
          \"There are no available services to process your request and maximum number of configured processing instances has been reached. Your request is now throttled. Please try again.\"
        ],
        \"requestId\": \"$context.requestId\"
      }"
  INTEGRATION_TIMEOUT:
    responseTemplates:
      application/json: "{
        \"errors\": [
          \"There are no available services to process your request. This increase in demand is resulting more resources being initialised to increase capacity. Please try again in 30 seconds.\"
        ],
        \"requestId\": \"$context.requestId\"
      }"
