openapi: 3.1.0
info:
  title: WireMock Cloud
  description: The public API for WireMock Cloud
  contact:
    email: help@wiremock.io
  version: 1.0.0
  license:
    name: Apache 2.0
    url: https://www.apache.org/licenses/LICENSE-2.0.html
servers:
  - url: https://wmc.wiremockapi.cloud
    description: Mock
  - url: https://api.wiremock.cloud
    description: Production
security:
  - tokenAuth: []
tags:
  - name: Users
    description: User accounts
  - name: Teams
    description: Teams
  - name: Organisations
    description: Organisations
  - name: Usage
    description: Product usage
  - name: Mock APIs
    description: Mock APIs
  - name: Mock API versioning
    description: Mock API versioning
  - name: Data sources
    description: Data sources
  - name: Database connections
    description: Database connections
  - name: Security
    description: Security
  - name: Access control
    description: Access control / authorisation
  - name: API templates
    description: API template library
  - name: Jobs
    description: Background jobs e.g. OpenAPI import
  - name: OpenAPI
    description: OpenAPI description
  - name: Settings
    description: Mock API configuration settings
  - name: Stub Mappings
    description: Operations on stub mappings
    externalDocs:
      description: User documentation
      url: https://wiremock.org/docs/stubbing/
  - name: Requests
    description: Logged requests and responses received by the mock service
    externalDocs:
      description: User documentation
      url: https://wiremock.org/docs/verifying/
  - name: Recordings
    description: Stub mapping record and snapshot functions
    externalDocs:
      description: User documentation
      url: https://wiremock.org/docs/record-playback/
  - name: State
    description: Scenarios support modelling of stateful behaviour
    externalDocs:
      description: User documentation
      url: https://wiremock.org/docs/stateful-behaviour/
  - name: Imports
    description: Importing into your mock API
  - name: Mock Hosts
    description: Mock API hosts
paths:
  /v1/users/self:
    get:
      operationId: getSelf
      summary: Get self
      description: Redirect to the user account owned by the authenticated user
      tags:
        - Users
      responses:
        '307':
          description: 307 Temporary redirect response to /v1/users/{userId}
          headers:
            Location:
              schema:
                type: string
                format: uri
        '401':
          $ref: '#/components/responses/401'
  /v1/users/{userId}:
    summary: User account
    parameters:
      - in: path
        name: userId
        required: true
        schema:
          type: string
    get:
      operationId: getUserById
      description: Retrieve a single user's account information by their ID.
      summary: Get user by ID
      tags:
        - Users
      responses:
        '200':
          description: 200 response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UserAccount'
              examples:
                main:
                  value:
                    user:
                      id: 9gd5l
                      aclObject: 4kg32
                      username: docs@example.com
                      avatarUrl: https://s.gravatar.com/avatar/0dc7361faa5dcde8ee7789f06074bb30?s=480&r=pg&d=https%3A%2F%2Fcdn.auth0.com%2Favatars%2Fdo.png
                      emailAddress: docs@example.com
                      marketingOptIn: true
                      signupDate: '2024-08-23T20:15:32.289889Z'
                      idpUserId: auth0|66c8ede29a4b3267bd1c4c42
                      userHash: 47f058ba304b4e3988f285e8b8f6b37b288fbe93c343578ce2deb37c47a24289
                      links:
                        self: /v1/users/9gd5l
                        teams: /v1/users/9gd5l/teams
                        mockApis: /v1/users/9gd5l/apis
                        apiTemplateCatalogues: /v1/users/9gd5l/api-template-catalogues
                        apiTemplates: /v1/users/9gd5l/api-templates
                        dataSources: /v1/users/9gd5l/data-sources
                        keys: /v1/users/9gd5l/jwks
                        organisation: /v1/organisations/mgk7g
                        aclSubject: /v1/acl/subjects/9gd5l
                        aclObject: /v1/acl/objects/4kg32
                      hasNativeIdp: true
                      aclSubject: 9gd5l
        '401':
          $ref: '#/components/responses/401'
        '403':
          $ref: '#/components/responses/403'
        '404':
          $ref: '#/components/responses/404'
    put:
      operationId: updateUser
      description: Update a user's account information.
      summary: Update user
      tags:
        - Users
      responses:
        '200':
          description: 200 response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UserAccount'
              examples:
                main:
                  value:
                    user:
                      id: 9gd5l
                      aclObject: 4kg32
                      username: docs@example.com
                      apiKey: 3b35fdee8ff9cf5055d062c28675ee22
                      avatarUrl: https://s.gravatar.com/avatar/0dc7361faa5dcde8ee7789f06074bb30?s=480&r=pg&d=https%3A%2F%2Fcdn.auth0.com%2Favatars%2Fdo.png
                      emailAddress: docs@example.com
                      marketingOptIn: true
                      signupDate: '2024-08-23T20:15:32.289889Z'
                      idpUserId: auth0|66c8ede29a4b3267bd1c4c42
                      userHash: 47f058ba304b4e3988f285e8b8f6b37b288fbe93c343578ce2deb37c47a24289
                      links:
                        self: /v1/users/9gd5l
                        features: /v1/users/9gd5l/features
                        progress: /v1/users/9gd5l/progress
                        teams: /v1/users/9gd5l/teams
                        mockApis: /v1/users/9gd5l/apis
                        apiTemplateCatalogues: /v1/users/9gd5l/api-template-catalogues
                        apiTemplates: /v1/users/9gd5l/api-templates
                        dataSources: /v1/users/9gd5l/data-sources
                        keys: /v1/users/9gd5l/jwks
                        organisation: /v1/organisations/mgk7g
                        aclSubject: /v1/acl/subjects/9gd5l
                        aclObject: /v1/acl/objects/4kg32
                      hasNativeIdp: true
                      aclSubject: 9gd5l
        '401':
          $ref: '#/components/responses/401'
        '403':
          $ref: '#/components/responses/403'
        '422':
          $ref: '#/components/responses/422'
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                user:
                  type: object
                  properties:
                    emailAddress:
                      type: string
                    marketingOptIn:
                      type: boolean
                    name:
                      type: string
                  required:
                    - emailAddress
                    - marketingOptIn
              required:
                - user
            examples:
              main:
                value:
                  user:
                    emailAddress: docs@example.com
                    marketingOptIn: false
    delete:
      operationId: deleteUser
      description: Permanently delete a user account.
      summary: Delete user by ID
      tags:
        - Users
      responses:
        '204':
          description: 204 response
        '401':
          $ref: '#/components/responses/401'
        '409':
          $ref: '#/components/responses/409'
  /v1/users/{userId}/apis:
    parameters:
      - in: path
        name: userId
        required: true
        schema:
          type: string
      - in: query
        name: q
        description: A filter for the retrieved items. Only items whose name contains the filter value will be retrieved. The filter is case insensitive.
        required: false
        schema:
          type: string
      - in: query
        name: sort
        description: 'Comma-separated list of sort fields. Prefix with `-` for descending order. Supported fields: `name`, `createdDate`.'
        required: false
        schema:
          type: string
          default: '-createdDate'
        example: '-createdDate'
      - in: query
        name: subjectType
        description: Filter mock APIs by ACL subject type. Must be used together with `subjectId`.
        required: false
        schema:
          type: string
          enum:
            - team
            - user
      - in: query
        name: subjectId
        description: Filter mock APIs by ACL subject ID. Must be used together with `subjectType`.
        required: false
        schema:
          type: string
      - $ref: '#/components/parameters/Limit'
      - $ref: '#/components/parameters/Page'
    get:
      operationId: getMockApisForUser
      summary: Get mock APIs accessible to a user
      description: List the mock APIs a user can access, with support for filtering by name and by ACL subject.
      tags:
        - Mock APIs
      responses:
        '200':
          description: 200 response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MockApis'
              examples:
                main:
                  value:
                    links:
                      self: /v1/users/9gd5l/apis?limit=20&page=1
                    meta:
                      start: 1
                      end: 1
                      total: 1
                      page: 1
                      totalPages: 1
                    mockApis:
                      - id: 63om1
                        aclObject: 1z6rd
                        name: Example Mock API
                        description: An API consisting of assorted stubs.
                        state: RUNNING
                        adminSecurityEnabled: true
                        exportState: EXPORT_ALLOWED
                        createdDate: '2024-08-23T20:15:32.432385Z'
                        openApiGitIntegration: 63om1-openapi-integration-git
                        links:
                          self: /v1/mock-apis/63om1
                          requests: /v1/mock-apis/63om1/requests
                          mappings: /v1/mock-apis/63om1/mappings
                          scenarios: /v1/mock-apis/63om1/scenarios
                          recordings:
                            start: /v1/mock-apis/63om1/recordings/start
                            stop: /v1/mock-apis/63om1/recordings/stop
                            status: /v1/mock-apis/63om1/recordings/status
                            snapshot: /v1/mock-apis/63om1/recordings/snapshot
                          imports: /v1/mock-apis/63om1/imports
                          organisation: /v1/organisations/mgk7g
                          aclObject: /v1/acl/objects/1z6rd
                          aclRoles: /v1/acl/objects/1z6rd/roles
                          invitations: /v1/mock-apis/63om1/invitations
                          acl: /v1/mock-apis/63om1/acl{?subjectId}
                          versionHistoryCommits: /v1/mock-apis/63om1/version-history/commits
                        baseUrl: https://63om1.wiremockapi.cloud
                        domainNames:
                          - domainName: 63om1.wiremockapi.cloud
                            urls:
                              - url: https://63om1.wiremockapi.cloud
                              - url: http://63om1.wiremockapi.cloud
                        domains:
                          - 63om1.wiremockapi.cloud
                    aclObjects:
                      - id: 1z6rd
                        objectType: mock-api
                        name: Example Mock API
                        aclGrants:
                          - 9gd5l-1z6rd-mock_api_admin
                        links:
                          self: /v1/acl/objects/1z6rd
                          grants: /v1/acl/grants?aclObjectId=1z6rd
                    openApiGitIntegrations: []
        '401':
          $ref: '#/components/responses/401'
        '403':
          $ref: '#/components/responses/403'
  /v1/users/{userId}/teams:
    parameters:
      - in: path
        name: userId
        required: true
        schema:
          type: string
      - in: query
        name: q
        required: false
        description: A filter for the retrieved items. Only items whose name contains the filter value will be retrieved. The filter is case insensitive.
        schema:
          type: string
    get:
      operationId: getTeamsForUser
      description: List the teams a user belongs to.
      summary: Get all teams readable by a user
      tags:
        - Teams
      responses:
        '200':
          description: 200 response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Teams'
              examples:
                main:
                  value:
                    teams:
                      - id: p9e4r
                        aclSubject: dyv8j
                        aclObject: 626vg
                        name: Elite Team
                        links:
                          organisation: /v1/organisations/mgk7g
                          aclSubject: /v1/acl/subjects/dyv8j
                          aclObject: /v1/acl/objects/626vg
                          acl: /v1/teams/p9e4r/acl{?subjectId}
        '401':
          $ref: '#/components/responses/401'
        '403':
          $ref: '#/components/responses/403'
  /v1/organisations/{organisationId}:
    parameters:
      - in: path
        name: organisationId
        required: true
        schema:
          type: string
    get:
      operationId: getOrganisationById
      description: Retrieve a single organisation's details by ID.
      summary: Get organisation by ID
      tags:
        - Organisations
      responses:
        '200':
          description: 200 response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Organisation'
              examples:
                main:
                  value:
                    organisation:
                      id: mgk7g
                      name: docs@example.com personal organisation
                      aclSubject: 0vzog
                      aclObject: gkqmy
                      emailAddress: docs@example.com
                      links:
                        self: /v1/organisations/mgk7g
                        users: /v1/organisations/mgk7g/users
                        teams: /v1/organisations/mgk7g/teams
                        subscription: /v1/subscriptions/qmr8z
                        invitations: /v1/organisations/mgk7g/invitations
                        aclSubject: /v1/acl/subjects/0vzog
                        aclObject: /v1/acl/objects/gkqmy
                        acl: /v1/organisations/mgk7g/acl{?subjectId}
        '401':
          $ref: '#/components/responses/401'
        '403':
          $ref: '#/components/responses/403'
        '404':
          $ref: '#/components/responses/404'
    put:
      operationId: updateOrganisation
      description: Update an organisation's details.
      summary: Update organisation
      tags:
        - Organisations
      responses:
        '200':
          description: 200 response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Organisation'
              examples:
                main:
                  value:
                    organisation:
                      id: mgk7g
                      name: docs@example.com personal organisation
                      aclSubject: 0vzog
                      aclObject: gkqmy
                      emailAddress: docs@example.com
                      links:
                        self: /v1/organisations/mgk7g
                        users: /v1/organisations/mgk7g/users
                        teams: /v1/organisations/mgk7g/teams
                        subscription: /v1/subscriptions/qmr8z
                        invitations: /v1/organisations/mgk7g/invitations
                        aclSubject: /v1/acl/subjects/0vzog
                        aclObject: /v1/acl/objects/gkqmy
                        acl: /v1/organisations/mgk7g/acl{?subjectId}
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
        '403':
          $ref: '#/components/responses/403'
        '404':
          $ref: '#/components/responses/404'
        '422':
          $ref: '#/components/responses/422'
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                organisation:
                  type: object
                  properties:
                    name:
                      type: string
                  required:
                    - name
              required:
                - organisation
            examples:
              main:
                value:
                  organisation:
                    name: Acmefy Inc.
    delete:
      operationId: deleteOrganisation
      description: Permanently delete an organisation.
      summary: Delete organisation
      tags:
        - Organisations
      responses:
        '204':
          description: 204 response
        '401':
          $ref: '#/components/responses/401'
        '403':
          $ref: '#/components/responses/403'
        '500':
          $ref: '#/components/responses/500'
  /v1/organisations/{organisationId}/users:
    parameters:
      - $ref: '#/components/parameters/OrganisationId'
    get:
      operationId: getUserAccountsInOrganisation
      summary: Get users in an organisation
      description: Gets the users under a specific organisation, optionally filtered by username/email address.
      tags:
        - Organisations
      parameters:
        - in: query
          name: q
          description: The search query to filter by. Partially matched against username and email address.
          required: false
          schema:
            type: string
            example: docs@example.com
        - $ref: '#/components/parameters/Limit'
        - $ref: '#/components/parameters/Page'
      responses:
        '200':
          description: 200 response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UserAccounts'
              examples:
                main:
                  value:
                    meta:
                      start: 1
                      end: 1
                      total: 1
                      page: 1
                      totalPages: 1
                    links:
                      self: /v1/organisations/mgk7g/users?limit=20&page=1
                    users:
                      - id: 9gd5l
                        username: docs@example.com
                        avatarUrl: https://s.gravatar.com/avatar/0dc7361faa5dcde8ee7789f06074bb30?s=480&r=pg&d=https%3A%2F%2Fcdn.auth0.com%2Favatars%2Fdo.png
                        emailAddress: docs@example.com
                        links:
                          self: /v1/users/9gd5l
                          features: /v1/users/9gd5l/features
                          progress: /v1/users/9gd5l/progress
                          teams: /v1/users/9gd5l/teams
                          mockApis: /v1/users/9gd5l/apis
                          apiTemplateCatalogues: /v1/users/9gd5l/api-template-catalogues
                          apiTemplates: /v1/users/9gd5l/api-templates
                          dataSources: /v1/users/9gd5l/data-sources
                          keys: /v1/users/9gd5l/jwks
                          organisation: /v1/organisations/mgk7g
                          aclSubject: /v1/acl/subjects/9gd5l
                          aclObject: /v1/acl/objects/4kg32
        '401':
          $ref: '#/components/responses/401'
        '403':
          $ref: '#/components/responses/403'
        '404':
          $ref: '#/components/responses/404'
  /v1/organisations/{organisationId}/invitations:
    parameters:
      - $ref: '#/components/parameters/OrganisationId'
      - in: query
        name: q
        description: The search query to filter by. Partially matched against recipient email address.
        required: false
        schema:
          type: string
          example: docs@example.com
    get:
      summary: Get pending invitations for organisation
      operationId: getOrganisationInvitations
      description: List pending user invitations for an organisation.
      tags:
        - Organisations
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                required:
                  - invitations
                type: object
                properties:
                  invitations:
                    type: array
                    items:
                      $ref: '#/components/schemas/InvitationData'
              examples:
                main:
                  value:
                    invitations:
                      - id: neqek
                        senderId: 9gd5l
                        recipientEmailAddress: tom+docsmember2@wiremock.io
                        newUser: true
                        role: organisation_admin
                        created: '2024-10-30T19:28:23.802551Z'
                        links:
                          self: /v1/organisations/mgk7g/invitations/neqek
    post:
      summary: Invite a user to an organisation
      operationId: inviteUserToOrganisation
      description: Invite a user to join an organisation.
      tags:
        - Organisations
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/InvitationRequest'
            examples:
              main:
                value:
                  invitation:
                    role: organisation_admin
                    recipientEmailAddress: docsmember2@example.com
              with-acl-object:
                value:
                  invitation:
                    role: team_member
                    aclObjectId: 8ndxc
                    recipientEmailAddress: docsmember2@example.com
        required: true
      responses:
        '201':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Invitation'
              examples:
                main:
                  value:
                    invitation:
                      id: neqek
                      senderId: 9gd5l
                      recipientEmailAddress: tom+docsmember2@wiremock.io
                      newUser: true
                      role: organisation_admin
                      created: '2024-10-30T19:28:23.802551Z'
                      links:
                        self: /v1/organisations/mgk7g/invitations/neqek
                with-acl-object:
                  value:
                    invitation:
                      id: neqek
                      senderId: 9gd5l
                      recipientEmailAddress: docsmember2@example.com
                      newUser: true
                      role: team_member
                      aclObjectId: 8ndxc
                      created: '2024-10-30T19:28:23.802551Z'
                      links:
                        self: /v1/organisations/mgk7g/invitations/neqek
  /v1/users/{userId}/regenerate-api-token:
    parameters:
      - in: path
        name: userId
        required: true
        schema:
          type: string
    post:
      operationId: regenerateUserApiToken
      description: Invalidate a user's current API token and issue a new one.
      summary: Regenerate a user's API token
      tags:
        - Security
      responses:
        '200':
          description: 200 response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Empty'
        '401':
          $ref: '#/components/responses/401'
        '403':
          $ref: '#/components/responses/403'
      requestBody:
        content:
          application/json:
            schema:
              type: object
  /v1/users/{userId}/data-sources:
    parameters:
      - in: path
        name: userId
        required: true
        schema:
          type: string
    get:
      operationId: getDataSourcesForUser
      summary: Get data sources accessible by a user
      description: List the CSV and database data sources a user can access, with pagination and name filtering.
      tags:
        - Data sources
      parameters:
        - schema:
            type: integer
          in: query
          name: limit
          description: The amount of page items to retrieve.
          required: false
        - schema:
            type: integer
          in: query
          name: page
          description: The index of the page to retrieve.
          required: false
        - schema:
            type: string
          in: query
          name: q
          description: A filter for the retrieved items. Only items whose name contains the filter value will be retrieved. The filter is case insensitive.
          required: false
      responses:
        '200':
          description: 200 response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DataSources'
              examples:
                dataSources:
                  value:
                    dataSources:
                      - id: abc123
                        aclObject: jkl789
                        name: My data source
                        lastUpdatedTime: '2024-01-17T11:46:13.481826Z'
                        version: 3
                        type: CSV
                        columnsMetadata:
                          - name: fullname
                            type:
                              name: STRING
                          - name: dob
                            type:
                              name: DATE
                              format: iso8601
                          - name: admin
                            type:
                              name: BOOLEAN
                          - name: retryLimit
                            type:
                              name: INTEGER
                        state: ENABLED
                        links:
                          self: /v1/data-sources/abc123
                          acl: /v1/data-sources/abc123/acl{?subjectId}
                      - id: def543
                        aclObject: lkj987
                        name: My database data source
                        lastUpdatedTime: '2024-01-17T11:46:13.481826Z'
                        version: 3
                        type: DATABASE
                        databaseConnection: zyx321
                        tableName: products
                        state: ENABLED
                        links:
                          self: /v1/data-sources/def543
                          acl: /v1/data-sources/def543/acl{?subjectId}
                    links:
                      self: /v1/users/my-user/data-sources?page=2&limit=20
                      next: /v1/users/my-user/data-sources?page=3&limit=20
                      previous: /v1/users/my-user/data-sources?page=1&limit=20
                    meta:
                      start: 21
                      end: 40
                      total: 123
                      page: 2
                      totalPages: 7
        '401':
          $ref: '#/components/responses/401'
        '403':
          $ref: '#/components/responses/403'
        '404':
          $ref: '#/components/responses/404'
        '500':
          $ref: '#/components/responses/500'
    post:
      operationId: createDataSource
      summary: Create a data source
      description: Create a new CSV or database data source that mock API responses can be templated from.
      tags:
        - Data sources
      responses:
        '201':
          $ref: '#/components/responses/CreateDataSourceResponse'
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
        '403':
          $ref: '#/components/responses/403'
        '422':
          $ref: '#/components/responses/422'
      requestBody:
        $ref: '#/components/requestBodies/CreateDataSourceRequestBody'
  /v1/data-sources/{dataSourceId}:
    parameters:
      - in: path
        name: dataSourceId
        required: true
        schema:
          type: string
    get:
      operationId: getDataSourceById
      summary: Get data source by ID
      description: Retrieve a single data source's metadata, optionally including a preview of its row data.
      tags:
        - Data sources
      parameters:
        - in: query
          name: data-view
          description: |
            Optionally request a view of the data source's row data. If omitted, no rows will be returned in the response.
             * `preview` - Returns the first few rows of data contained in the data source.
             * `none` - Returns no rows.
          schema:
            type: string
            enum:
              - none
              - preview
            default: none
          required: false
      responses:
        '200':
          $ref: '#/components/responses/GetDataSourceResponse'
        '403':
          description: 403 response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Errors'
        '404':
          description: 404 response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Errors'
    put:
      operationId: updateDataSource
      summary: Update data source
      description: Replace a data source's configuration, such as its name or connection details.
      tags:
        - Data sources
      responses:
        '200':
          $ref: '#/components/responses/CreateDataSourceResponse'
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
        '403':
          $ref: '#/components/responses/403'
        '404':
          $ref: '#/components/responses/404'
        '422':
          $ref: '#/components/responses/422'
      requestBody:
        $ref: '#/components/requestBodies/CreateDataSourceRequestBody'
    delete:
      operationId: deleteDataSource
      summary: Delete data source by ID
      description: Permanently remove a data source. Mock APIs that reference it will no longer be able to template responses from it.
      tags:
        - Data sources
      responses:
        '204':
          description: 204 response
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
        '403':
          $ref: '#/components/responses/403'
        '404':
          $ref: '#/components/responses/404'
        '422':
          $ref: '#/components/responses/422'
  /v1/data-sources/{dataSourceId}/data:
    parameters:
      - in: path
        name: dataSourceId
        required: true
        schema:
          type: string
    put:
      operationId: updateDataSourceCsvData
      summary: Update data source CSV data
      description: Updates the rows of a CSV data source
      tags:
        - Data sources
      requestBody:
        description: A header row must be present in the supplied CSV with names that match the existing headers of the data source. Additionally, all cells of all supplied rows after the header row must conform to the type of their respective column. For example, if a column has type `BOOLEAN`, then all cells within that column must have a value of either `true` or `false`.
        required: true
        content:
          text/csv:
            schema:
              type: string
      responses:
        '200':
          description: Success
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
        '403':
          $ref: '#/components/responses/403'
        '404':
          $ref: '#/components/responses/404'
        '422':
          $ref: '#/components/responses/422'
  /v1/users/{userId}/database-connections:
    parameters:
      - in: path
        name: userId
        required: true
        schema:
          type: string
    get:
      operationId: getDatabaseConnectionsForUser
      summary: Get database connections accessible by a user
      description: List the database connections a user can access, used to back database-backed data sources.
      tags:
        - Database connections
      responses:
        '200':
          description: 200 response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DatabaseConnections'
              examples:
                databaseConnections:
                  value:
                    databaseConnections:
                      - id: abc123
                        connectionName: My database connection
                        databaseType: POSTGRESQL
                        host: my-db.example.com
                        port: 5432
                        databaseName: my-test-data
                        username: alice
                        links:
                          self: /v1/data-connections/abc123
                      - id: def456
                        connectionName: My other database connection
                        databaseType: MYSQL
                        host: my.sql.com
                        port: 3306
                        databaseName: my-sql-data
                        username: bob
                        links:
                          self: /v1/data-connections/def456
                    links:
                      self: /v1/users/my-user/database-connections?page=2&limit=20
                      next: /v1/users/my-user/database-connections?page=3&limit=20
                      previous: /v1/users/my-user/database-connections?page=1&limit=20
                    meta:
                      start: 21
                      end: 40
                      total: 123
                      page: 2
                      totalPages: 7
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
        '403':
          $ref: '#/components/responses/403'
      parameters:
        - schema:
            type: integer
          in: query
          name: limit
          description: The amount of page items to retrieve.
          required: false
        - schema:
            type: integer
          in: query
          name: page
          description: The index of the page to retrieve.
          required: false
        - schema:
            type: string
          in: query
          name: q
          description: A filter for the retrieved items. Only items whose name contains the filter value will be retrieved. The filter is case insensitive.
          required: false
    post:
      operationId: createDatabaseConnection
      summary: Create a database connection
      description: Register a new database connection so its tables can be used as data sources for mock API responses.
      tags:
        - Database connections
      responses:
        '201':
          $ref: '#/components/responses/CreateDatabaseConnectionResponse'
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
        '403':
          $ref: '#/components/responses/403'
        '422':
          $ref: '#/components/responses/422'
      requestBody:
        $ref: '#/components/requestBodies/CreateDatabaseConnectionRequestBody'
  /v1/database-connections/{databaseConnectionId}:
    parameters:
      - in: path
        name: databaseConnectionId
        required: true
        schema:
          type: string
    get:
      operationId: getDatabaseConnectionById
      summary: Get database connection by ID
      description: Retrieve the configuration of a single database connection.
      tags:
        - Database connections
      responses:
        '200':
          $ref: '#/components/responses/CreateDatabaseConnectionResponse'
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
        '403':
          $ref: '#/components/responses/403'
        '404':
          $ref: '#/components/responses/404'
    patch:
      operationId: updateDatabaseConnection
      summary: Update database connection
      description: Partially update a database connection's configuration, such as its host, port or credentials.
      tags:
        - Database connections
      responses:
        '200':
          $ref: '#/components/responses/CreateDatabaseConnectionResponse'
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
        '403':
          $ref: '#/components/responses/403'
        '404':
          $ref: '#/components/responses/404'
        '422':
          $ref: '#/components/responses/422'
      requestBody:
        $ref: '#/components/requestBodies/UpdateDatabaseConnectionRequestBody'
    delete:
      operationId: deleteDatabaseConnection
      summary: Delete database connection by ID
      description: Permanently remove a database connection. Data sources backed by it will stop working.
      tags:
        - Database connections
      responses:
        '204':
          description: 204 response
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
        '403':
          $ref: '#/components/responses/403'
        '404':
          $ref: '#/components/responses/404'
  /v1/users/{userId}/database-connections/test:
    parameters:
      - in: path
        name: userId
        required: true
        schema:
          type: string
    post:
      operationId: testDatabaseConnection
      summary: Test a database connection
      description: Verify that the given database connection details are reachable and valid before saving them.
      tags:
        - Database connections
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DatabaseConnectionCoords'
            examples:
              databaseConnection:
                value:
                  databaseType: POSTGRESQL
                  host: my-db.example.com
                  port: 5432
                  databaseName: my-test-data
                  username: alice
                  password: mysecretpassword
      responses:
        '200':
          $ref: '#/components/responses/TestDatabaseConnectionResponse'
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
        '403':
          $ref: '#/components/responses/403'
  /v1/mock-apis:
    post:
      operationId: createMockApi
      summary: Create a new mock API
      description: Create a new mock API to start simulating an endpoint or service.
      tags:
        - Mock APIs
      responses:
        '201':
          description: 201 Created response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MockApi'
              examples:
                main:
                  value:
                    mockApi:
                      id: jjl8y
                      aclObject: gkqjy
                      name: My new mock API
                      description: This is a sample mock API for testing purposes.
                      state: RUNNING
                      adminSecurityEnabled: true
                      exportState: EXPORT_ALLOWED
                      createdDate: '2024-08-23T21:34:36.595372Z'
                      openApiGitIntegration: jjl8y-openapi-integration-git
                      links:
                        self: /v1/mock-apis/jjl8y
                        requests: /v1/mock-apis/jjl8y/requests
                        mappings: /v1/mock-apis/jjl8y/mappings
                        scenarios: /v1/mock-apis/jjl8y/scenarios
                        recordings:
                          start: /v1/mock-apis/jjl8y/recordings/start
                          stop: /v1/mock-apis/jjl8y/recordings/stop
                          status: /v1/mock-apis/jjl8y/recordings/status
                          snapshot: /v1/mock-apis/jjl8y/recordings/snapshot
                        imports: /v1/mock-apis/jjl8y/imports
                        organisation: /v1/organisations/mgk7g
                        apiTemplate: /v1/api-templates/8nd5x
                        aclObject: /v1/acl/objects/gkqjy
                        aclRoles: /v1/acl/objects/gkqjy/roles
                        invitations: /v1/mock-apis/jjl8y/invitations
                        acl: /v1/mock-apis/jjl8y/acl{?subjectId}
                        versionHistoryCommits: /v1/mock-apis/jjl8y/version-history/commits
                      baseUrl: https://jjl8y.wiremockapi.cloud
                      domainNames:
                        - domainName: my-new-mock-api.wiremockapi.cloud
                          editableSubdomainPart: my-new-mock-api
                          urls:
                            - url: https://my-new-mock-api.wiremockapi.cloud
                            - url: http://my-new-mock-api.wiremockapi.cloud
                        - domainName: jjl8y.wiremockapi.cloud
                          urls:
                            - url: https://jjl8y.wiremockapi.cloud
                            - url: http://jjl8y.wiremockapi.cloud
                      domains:
                        - jjl8y.wiremockapi.cloud
                        - my-new-mock-api.wiremockapi.cloud
        '401':
          $ref: '#/components/responses/401'
        '403':
          $ref: '#/components/responses/403'
        '422':
          $ref: '#/components/responses/422'
        '500':
          $ref: '#/components/responses/500'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateMockApiRequest'
            examples:
              main:
                value:
                  mockApi:
                    name: My new mock API
                    hostname: my-new-mock-api
                    apiTemplateId: 8nd5x
  /v1/mock-apis/{mockApiId}:
    parameters:
      - $ref: '#/components/parameters/mockApiId'
    get:
      operationId: getMockApiById
      summary: Get mock API by ID
      description: Retrieve a single mock API's metadata, such as its name, mock host and configuration.
      tags:
        - Mock APIs
      responses:
        '200':
          description: 200 response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MockApi'
              examples:
                main:
                  value:
                    mockApi:
                      id: jjl8y
                      aclObject: gkqjy
                      name: My new mock API
                      description: This is a sample mock API for testing purposes.
                      state: RUNNING
                      adminSecurityEnabled: true
                      exportState: EXPORT_ALLOWED
                      createdDate: '2024-08-23T21:34:36.595372Z'
                      openApiGitIntegration: jjl8y-openapi-integration-git
                      links:
                        self: /v1/mock-apis/jjl8y
                        requests: /v1/mock-apis/jjl8y/requests
                        mappings: /v1/mock-apis/jjl8y/mappings
                        scenarios: /v1/mock-apis/jjl8y/scenarios
                        recordings:
                          start: /v1/mock-apis/jjl8y/recordings/start
                          stop: /v1/mock-apis/jjl8y/recordings/stop
                          status: /v1/mock-apis/jjl8y/recordings/status
                          snapshot: /v1/mock-apis/jjl8y/recordings/snapshot
                        imports: /v1/mock-apis/jjl8y/imports
                        organisation: /v1/organisations/mgk7g
                        apiTemplate: /v1/api-templates/8nd5x
                        aclObject: /v1/acl/objects/gkqjy
                        aclRoles: /v1/acl/objects/gkqjy/roles
                        invitations: /v1/mock-apis/jjl8y/invitations
                        acl: /v1/mock-apis/jjl8y/acl{?subjectId}
                        versionHistoryCommits: /v1/mock-apis/jjl8y/version-history/commits
                      baseUrl: https://jjl8y.wiremockapi.cloud
                      domainNames:
                        - domainName: my-new-mock-api.wiremockapi.cloud
                          editableSubdomainPart: my-new-mock-api
                          urls:
                            - url: https://my-new-mock-api.wiremockapi.cloud
                            - url: http://my-new-mock-api.wiremockapi.cloud
                        - domainName: jjl8y.wiremockapi.cloud
                          urls:
                            - url: https://jjl8y.wiremockapi.cloud
                            - url: http://jjl8y.wiremockapi.cloud
                      domains:
                        - jjl8y.wiremockapi.cloud
                        - my-new-mock-api.wiremockapi.cloud
                    openApiGitIntegrations:
                      - test: /v1/mock-apis/jjl8y/open-api-integrations/git/test
                        mockApi: jjl8y
                        enabled: false
                        id: jjl8y-openapi-integration-git
                        links:
                          self: /v1/mock-apis/jjl8y/open-api-integrations/git
        '403':
          $ref: '#/components/responses/403'
    put:
      operationId: updateMockApi
      summary: Update mock API
      description: Update a mock API's metadata, such as its name.
      tags:
        - Mock APIs
      responses:
        '200':
          description: 200 response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MockApi'
              examples:
                main:
                  value:
                    mockApi:
                      id: jjl8y
                      aclObject: gkqjy
                      name: My modified mock API
                      description: This is a modified mock API for testing purposes.
                      state: RUNNING
                      adminSecurityEnabled: true
                      exportState: EXPORT_ALLOWED
                      createdDate: '2024-08-23T21:34:36.595372Z'
                      openApiGitIntegration: jjl8y-openapi-integration-git
                      links:
                        self: /v1/mock-apis/jjl8y
                        requests: /v1/mock-apis/jjl8y/requests
                        mappings: /v1/mock-apis/jjl8y/mappings
                        scenarios: /v1/mock-apis/jjl8y/scenarios
                        recordings:
                          start: /v1/mock-apis/jjl8y/recordings/start
                          stop: /v1/mock-apis/jjl8y/recordings/stop
                          status: /v1/mock-apis/jjl8y/recordings/status
                          snapshot: /v1/mock-apis/jjl8y/recordings/snapshot
                        imports: /v1/mock-apis/jjl8y/imports
                        organisation: /v1/organisations/mgk7g
                        apiTemplate: /v1/api-templates/8nd5x
                        aclObject: /v1/acl/objects/gkqjy
                        aclRoles: /v1/acl/objects/gkqjy/roles
                        invitations: /v1/mock-apis/jjl8y/invitations
                        acl: /v1/mock-apis/jjl8y/acl{?subjectId}
                        versionHistoryCommits: /v1/mock-apis/jjl8y/version-history/commits
                      baseUrl: https://jjl8y.wiremockapi.cloud
                      domainNames:
                        - domainName: my-new-mock-api.wiremockapi.cloud
                          editableSubdomainPart: my-new-mock-api
                          urls:
                            - url: https://my-new-mock-api.wiremockapi.cloud
                            - url: http://my-new-mock-api.wiremockapi.cloud
                        - domainName: jjl8y.wiremockapi.cloud
                          urls:
                            - url: https://jjl8y.wiremockapi.cloud
                            - url: http://jjl8y.wiremockapi.cloud
                      domains:
                        - jjl8y.wiremockapi.cloud
                        - my-new-mock-api.wiremockapi.cloud
        '403':
          $ref: '#/components/responses/403'
        '422':
          $ref: '#/components/responses/422'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateMockApiRequest'
            examples:
              main:
                value:
                  mockApi:
                    name: My modified mock API
                    hostname: my-new-mock-api
                    adminSecurityEnabled: false
    delete:
      operationId: deleteMockApi
      summary: Delete mock API
      description: Permanently delete a mock API, including its stub mappings, request journal and settings.
      tags:
        - Mock APIs
      responses:
        '200':
          description: 200 response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Empty'
        '403':
          $ref: '#/components/responses/403'
  /v1/mock-apis/{mockApiId}/host:
    parameters:
      - $ref: '#/components/parameters/mockApiId'
    put:
      operationId: moveMockApiToHost
      summary: Move a mock API to a different mock host
      description: Change which mock host serves a mock API's simulated traffic.
      tags:
        - Mock APIs
      responses:
        '200':
          description: 200 response
          content:
            application/json:
              schema:
                type: object
        '403':
          $ref: '#/components/responses/403'
        '422':
          $ref: '#/components/responses/422'
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                mockHost:
                  description: The ID of the mock host to place this mock API on.
                  type: string
              required:
                - mockHost
  /v1/organisations/{organisationId}/members/{userId}:
    parameters:
      - in: path
        name: organisationId
        required: true
        schema:
          type: string
      - in: path
        name: userId
        required: true
        schema:
          type: string
    delete:
      operationId: deleteOrganisationMemberUser
      description: Remove a user from an organisation.
      summary: Delete organisation member user
      tags:
        - Organisations
      responses:
        '204':
          description: 204 response
        '401':
          $ref: '#/components/responses/401'
        '403':
          $ref: '#/components/responses/403'
        '409':
          $ref: '#/components/responses/409'
  /v1/organisations/{organisationId}/teams:
    parameters:
      - in: path
        name: organisationId
        required: true
        schema:
          type: string
      - in: query
        name: q
        required: false
        description: A filter for the retrieved items. Only items whose name contains the filter value will be retrieved. The filter is case insensitive.
        schema:
          type: string
      - $ref: '#/components/parameters/Limit'
      - $ref: '#/components/parameters/Page'
    get:
      operationId: getOrganisationTeams
      description: List every team in an organisation.
      summary: Get all teams in an organisation
      tags:
        - Teams
      responses:
        '200':
          description: 200 response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Teams'
              examples:
                main:
                  value:
                    meta:
                      start: 1
                      end: 1
                      total: 1
                      page: 1
                      totalPages: 1
                    links:
                      self: /v1/organisations/mgk7g/teams?limit=20&page=1
                    teams:
                      - id: p9e4r
                        aclSubject: dyv8j
                        aclObject: 626vg
                        name: Elite Team
                        links:
                          organisation: /v1/organisations/mgk7g
                          aclSubject: /v1/acl/subjects/dyv8j
                          aclObject: /v1/acl/objects/626vg
                          acl: /v1/teams/p9e4r/acl{?subjectId}
        '401':
          $ref: '#/components/responses/401'
        '403':
          $ref: '#/components/responses/403'
        '404':
          $ref: '#/components/responses/404'
  /v1/subscriptions/{subscriptionId}/usage:
    parameters:
      - in: path
        name: subscriptionId
        required: true
        schema:
          type: string
    get:
      operationId: getUsage
      summary: Get usage
      description: Get product usage for the current billing period for a subscription
      tags:
        - Usage
      responses:
        '200':
          description: 200 response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Usage'
              examples:
                main:
                  value:
                    usage:
                      id: kl1g9
                      currentPeriodStart: '2024-08-01T13:50:48.988681Z'
                      currentPeriodEnd: '2025-08-01T13:50:48.988681Z'
                      stubCalledCount: 22309
                      exportCalledCount: 30
                      organisationMemberCount: 15
                      invitationCount: 0
                      seatLimit: null
                      totalMockApiCount: 158
                      totalDataSourceCount: 9
                      totalDatabaseConnectionCount: 2
                      ownMockApiCount: 0
                      teamMockApiCount: 0
                      collaboratorCount: 0
                      totalSeatCount: 15
                      teamMemberCount: 15
                      totalTeamCount: 15
        '401':
          $ref: '#/components/responses/401'
        '403':
          $ref: '#/components/responses/403'
        '404':
          $ref: '#/components/responses/404'
  /v1/teams:
    post:
      operationId: createTeam
      description: Create a new team within an organisation.
      summary: Create a team
      tags:
        - Teams
      responses:
        '201':
          description: 201 response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Team'
              examples:
                main:
                  value:
                    team:
                      id: p9e4r
                      aclSubject: dyv8j
                      aclObject: 626vg
                      name: Elite Team
                      links:
                        organisation: /v1/organisations/mgk7g
                        aclSubject: /v1/acl/subjects/dyv8j
                        aclObject: /v1/acl/objects/626vg
                        acl: /v1/teams/p9e4r/acl{?subjectId}
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
        '403':
          $ref: '#/components/responses/403'
        '404':
          $ref: '#/components/responses/404'
        '422':
          $ref: '#/components/responses/422'
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                team:
                  type: object
                  properties:
                    name:
                      type: string
                    ownerId:
                      type: string
                  required:
                    - name
              required:
                - team
            examples:
              main:
                value:
                  team:
                    name: Elite Team
  /v1/teams/{teamId}:
    parameters:
      - in: path
        name: teamId
        required: true
        schema:
          type: string
    get:
      operationId: getTeamById
      description: Retrieve a single team's details by ID.
      summary: Get a team by ID
      tags:
        - Teams
      responses:
        '200':
          description: 200 response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Team'
              examples:
                main:
                  value:
                    team:
                      id: p9e4r
                      aclSubject: dyv8j
                      aclObject: 626vg
                      name: Elite Team
                      links:
                        organisation: /v1/organisations/mgk7g
                        aclSubject: /v1/acl/subjects/dyv8j
                        aclObject: /v1/acl/objects/626vg
                        acl: /v1/teams/p9e4r/acl{?subjectId}
        '404':
          description: 404 response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Errors'
    delete:
      operationId: deleteTeam
      description: Permanently delete a team.
      summary: Delete a team by ID
      tags:
        - Teams
      responses:
        '200':
          description: 200 response
          content:
            application/json:
              schema:
                type: object
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
        '403':
          $ref: '#/components/responses/403'
        '404':
          $ref: '#/components/responses/404'
        '409':
          $ref: '#/components/responses/409'
        '422':
          $ref: '#/components/responses/422'
  /v1/teams/{teamId}/members:
    parameters:
      - in: path
        name: teamId
        required: true
        schema:
          type: string
      - in: query
        name: q
        description: The search query to filter by. Partially matched against username and email address.
        required: false
        schema:
          type: string
          example: docs@example.com
    get:
      operationId: getTeamMembers
      description: List the members of a team.
      summary: Get team members
      tags:
        - Teams
      responses:
        '200':
          description: Successfully fetched team members
          content:
            application/json:
              schema:
                required:
                  - members
                type: object
                properties:
                  members:
                    type: array
                    items:
                      $ref: '#/components/schemas/UserSummary'
              examples:
                main:
                  value:
                    members:
                      - id: 6j84g
                        username: docs-teamboss@example.com
                        avatarUrl: https://s.gravatar.com/avatar/57cd30a5c7ebfb10eee28b5fbf85e84d?s=480&r=pg&d=https%3A%2F%2Fcdn.auth0.com%2Favatars%2Fto.png
                        emailAddress: docs-teamboss@example.com
                        links:
                          self: /v1/users/6j84g
                          features: /v1/users/6j84g/features
                          progress: /v1/users/6j84g/progress
                          teams: /v1/users/6j84g/teams
                          mockApis: /v1/users/6j84g/apis
                          apiTemplateCatalogues: /v1/users/6j84g/api-template-catalogues
                          apiTemplates: /v1/users/6j84g/api-templates
                          dataSources: /v1/users/6j84g/data-sources
                          keys: /v1/users/6j84g/jwks
                          organisation: /v1/organisations/p0wqg
                          aclSubject: /v1/acl/subjects/6j84g
                          aclObject: /v1/acl/objects/ne523
                      - id: 5j7yy
                        username: docs-member1@example.com
                        avatarUrl: https://s.gravatar.com/avatar/470b2b63990f8fe4067e306dd5c59e90?s=480&r=pg&d=https%3A%2F%2Fcdn.auth0.com%2Favatars%2Fto.png
                        emailAddress: docs-member1@example.com
                        links:
                          self: /v1/users/5j7yy
                          features: /v1/users/5j7yy/features
                          progress: /v1/users/5j7yy/progress
                          teams: /v1/users/5j7yy/teams
                          mockApis: /v1/users/5j7yy/apis
                          apiTemplateCatalogues: /v1/users/5j7yy/api-template-catalogues
                          apiTemplates: /v1/users/5j7yy/api-templates
                          dataSources: /v1/users/5j7yy/data-sources
                          keys: /v1/users/5j7yy/jwks
                          organisation: /v1/organisations/p0wqg
                          aclSubject: /v1/acl/subjects/5j7yy
                          aclObject: /v1/acl/objects/xqg2l
                      - id: ke6lg
                        username: docs-member2@example.com
                        avatarUrl: https://s.gravatar.com/avatar/d3082c4a60301ca176854d00626bbca9?s=480&r=pg&d=https%3A%2F%2Fcdn.auth0.com%2Favatars%2Fto.png
                        emailAddress: docs-member2@example.com
                        links:
                          self: /v1/users/ke6lg
                          features: /v1/users/ke6lg/features
                          progress: /v1/users/ke6lg/progress
                          teams: /v1/users/ke6lg/teams
                          mockApis: /v1/users/ke6lg/apis
                          apiTemplateCatalogues: /v1/users/ke6lg/api-template-catalogues
                          apiTemplates: /v1/users/ke6lg/api-templates
                          dataSources: /v1/users/ke6lg/data-sources
                          keys: /v1/users/ke6lg/jwks
                          organisation: /v1/organisations/p0wqg
                          aclSubject: /v1/acl/subjects/ke6lg
                          aclObject: /v1/acl/objects/x62ov
                      - id: vrder
                        username: docs-member3@example.com
                        avatarUrl: https://s.gravatar.com/avatar/d0ba6024454dc96288e06b29c7fe1507?s=480&r=pg&d=https%3A%2F%2Fcdn.auth0.com%2Favatars%2Fto.png
                        emailAddress: docs-member3@example.com
                        links:
                          self: /v1/users/vrder
                          features: /v1/users/vrder/features
                          progress: /v1/users/vrder/progress
                          teams: /v1/users/vrder/teams
                          mockApis: /v1/users/vrder/apis
                          apiTemplateCatalogues: /v1/users/vrder/api-template-catalogues
                          apiTemplates: /v1/users/vrder/api-templates
                          dataSources: /v1/users/vrder/data-sources
                          keys: /v1/users/vrder/jwks
                          organisation: /v1/organisations/p0wqg
                          aclSubject: /v1/acl/subjects/vrder
                          aclObject: /v1/acl/objects/ndzvw
                      - id: eglq6
                        username: docs-member5@example.com
                        avatarUrl: https://s.gravatar.com/avatar/32755f65c467c3627e5eef2a08b1b0bc?s=480&r=pg&d=https%3A%2F%2Fcdn.auth0.com%2Favatars%2Fto.png
                        emailAddress: docs-member5@example.com
                        links:
                          self: /v1/users/eglq6
                          features: /v1/users/eglq6/features
                          progress: /v1/users/eglq6/progress
                          teams: /v1/users/eglq6/teams
                          mockApis: /v1/users/eglq6/apis
                          apiTemplateCatalogues: /v1/users/eglq6/api-template-catalogues
                          apiTemplates: /v1/users/eglq6/api-templates
                          dataSources: /v1/users/eglq6/data-sources
                          keys: /v1/users/eglq6/jwks
                          organisation: /v1/organisations/p0wqg
                          aclSubject: /v1/acl/subjects/eglq6
                          aclObject: /v1/acl/objects/pyvog
    post:
      summary: Add team member
      operationId: addTeamMember
      description: Add a user to a team.
      tags:
        - Teams
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AddMemberRequest'
            examples:
              main:
                value:
                  member:
                    memberId: eglq6
                    permissionFriendlyId: team_member
        required: true
      responses:
        '201':
          description: Member added
  /v1/teams/{teamId}/members/{userId}:
    parameters:
      - in: path
        name: teamId
        required: true
        schema:
          type: string
      - in: path
        name: userId
        required: true
        schema:
          type: string
    delete:
      operationId: deleteTeamMember
      description: Remove a user from a team.
      summary: Delete a team member
      tags:
        - Teams
      responses:
        '204':
          description: 204 response
        '401':
          $ref: '#/components/responses/401'
        '403':
          $ref: '#/components/responses/403'
        '404':
          $ref: '#/components/responses/404'
        '409':
          $ref: '#/components/responses/409'
  /v1/{entityCollection}/{entityId}/acl/candidates:
    get:
      summary: Get ACL candidates
      description: Get candidate users and teams that can be added to this entity's ACL
      operationId: getAclCandidatesForEntity
      tags:
        - Access control
      parameters:
        - $ref: '#/components/parameters/EntityCollection'
        - $ref: '#/components/parameters/EntityId'
        - $ref: '#/components/parameters/Limit'
        - schema:
            type: string
          in: query
          name: q
          description: A filter for the retrieved items. Only items whose name contains the filter value will be retrieved. The filter is case insensitive.
          required: false
      responses:
        '200':
          description: ACL candidates
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EntityAclCandidates'
              examples:
                main:
                  value:
                    candidates:
                      - name: All in organisation
                        links:
                          self:
                            href: /v1/mock-apis/l36le/acl/organisation/mgk7g
                      - name: Elite Team
                        links:
                          self:
                            href: /v1/mock-apis/l36le/acl/team/p9e4r
  /v1/{entityCollection}/{entityId}/acl/{subjectType}/{subjectEntityId}:
    put:
      summary: Update an entity's ACL
      description: Add or update a team or user to an entity's ACL.
      operationId: putEntityAcl
      tags:
        - Access control
      parameters:
        - $ref: '#/components/parameters/EntityCollection'
        - $ref: '#/components/parameters/EntityId'
        - $ref: '#/components/parameters/SubjectType'
        - $ref: '#/components/parameters/SubjectEntityId'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Grant'
            examples:
              main:
                value:
                  grant:
                    role: mock_api_editor
        required: true
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Grant'
              examples:
                main:
                  value:
                    grant:
                      role: mock_api_editor
    delete:
      summary: Delete an entry from an entity's ACL.
      description: Remove a team or user to an entity's ACL.
      operationId: deleteEntityAcl
      tags:
        - Access control
      parameters:
        - $ref: '#/components/parameters/EntityCollection'
        - $ref: '#/components/parameters/EntityId'
        - $ref: '#/components/parameters/SubjectType'
        - $ref: '#/components/parameters/SubjectEntityId'
      responses:
        '204':
          description: Success
  /v1/mock-apis/{mockApiId}/mappings:
    parameters:
      - $ref: '#/components/parameters/mockApiId'
    get:
      operationId: getAllStubMappings
      description: List every stub mapping configured on a mock API.
      summary: Get all stub mappings
      tags:
        - Stub Mappings
      parameters:
        - description: The maximum number of results to return
          in: query
          name: limit
          required: false
          example: 10
          schema:
            type: integer
        - description: The start index of the results to return
          in: query
          name: offset
          required: false
          example: 0
          schema:
            type: integer
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/stub-mappings'
              example:
                meta:
                  total: 2
                mappings:
                  - id: 76ada7b0-49ae-4229-91c4-396a36f18e09
                    uuid: 76ada7b0-49ae-4229-91c4-396a36f18e09
                    request:
                      method: GET
                      url: /search?q=things
                      headers:
                        Accept:
                          equalTo: application/json
                    response:
                      status: 200
                      jsonBody:
                        - thing1
                        - thing2
                      headers:
                        Content-Type: application/json
                  - request:
                      method: POST
                      urlPath: /some/things
                      bodyPatterns:
                        - equalToXml: <stuff />
                    response:
                      status: 201
          description: All stub mappings
    post:
      operationId: createNewStubMapping
      description: Create a new stub mapping on a mock API.
      summary: Create a new stub mapping
      tags:
        - Stub Mappings
      requestBody:
        $ref: '#/components/requestBodies/stubMapping'
      responses:
        '201':
          $ref: '#/components/responses/stubMapping'
        '422':
          $ref: '#/components/responses/badRequestEntity'
    delete:
      operationId: deleteAllStubMappings
      description: Permanently delete every stub mapping on a mock API.
      summary: Delete all stub mappings
      tags:
        - Stub Mappings
      responses:
        '200':
          description: Successfully deleted
  /v1/mock-apis/{mockApiId}/mappings/reset:
    parameters:
      - $ref: '#/components/parameters/mockApiId'
    post:
      operationId: resetStubMappings
      summary: Reset stub mappings
      description: Restores stub mappings to the defaults defined back in the backing store
      tags:
        - Stub Mappings
      responses:
        '200':
          description: Successfully reset
  /v1/mock-apis/{mockApiId}/mappings/save:
    parameters:
      - $ref: '#/components/parameters/mockApiId'
    post:
      operationId: persistStubMappings
      summary: Persist stub mappings
      description: Save all persistent stub mappings to the backing store
      tags:
        - Stub Mappings
      responses:
        '200':
          description: Successfully saved
  /v1/mock-apis/{mockApiId}/mappings/import:
    parameters:
      - $ref: '#/components/parameters/mockApiId'
    post:
      operationId: importStubMappings
      summary: Import stub mappings
      description: |
        Import a collection of stub mappings.
        Note: a more flexible import operation is available at the [Import endpoint](../imports/import).
      tags:
        - Stub Mappings
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/stub-mappings'
            examples:
              main:
                value:
                  mappings:
                    - id: 7e6d6733-881e-416d-9f6c-bad8d5015d0f
                      name: Get v2 invoicing invoices by invoiceId
                      request:
                        urlPathTemplate: /v2/invoicing/invoices/{invoiceId}
                        method: GET
                        pathParameters:
                          invoiceId:
                            equalTo: INV2-NS4E-L7P4-RZ6B-KNZY
                      response:
                        status: 200
                        body: '{"id":"INV2-NS4E-L7P4-RZ6B-KNZY","status":"DRAFT","detail":{"reference":"<The reference data. Includes a post office (PO) number.>","currency_code":"USD","note":"<A note to the invoice recipient. Also appears on the invoice notification email.>","terms_and_conditions":"<The general terms of the invoice. Can include return or cancellation policy and other terms and conditions.>","memo":"<A private bookkeeping note for merchant.>","additional_data":"<Any additional information. Includes business hours.>","category_code":"SHIPPABLE","invoice_number":"17494664982","invoice_date":"2022-02-04","payment_term":{"term_type":"NET_10","due_date":"2022-02-14"},"viewed_by_recipient":false,"group_draft":false,"metadata":{"create_time":"2025-06-09T10:54:58Z","last_update_time":"2025-06-09T10:54:58Z","created_by_flow":"REGULAR_SINGLE","recipient_view_url":"https://www.sandbox.paypal.com/invoice/p/#NS4EL7P4RZ6BKNZY","invoicer_view_url":"https://www.sandbox.paypal.com/invoice/details/INV2-NS4E-L7P4-RZ6B-KNZY","caller_type":"API_V2_INVOICE","spam_info":{}},"archived":false},"invoicer":{"name":{"given_name":"David","surname":"Larusso","full_name":"David Larusso"},"address":{"address_line_1":"123 Townsend St","address_line_2":"Floor 6","admin_area_2":"San Francisco","admin_area_1":"CA","postal_code":"94107","country_code":"US"},"phones":[{"country_code":"001","national_number":"4085551234","phone_type":"MOBILE"}],"website":"www.example.com","tax_id":"XX-XXXXXXX","additional_notes":"<Any additional information. Includes business hours.>","logo_url":"https://example.com/logo.png"},"primary_recipients":[{"billing_info":{"name":{"given_name":"Stephanie","surname":"Meyers","full_name":"Stephanie Meyers"},"address":{"address_line_1":"1234 Main Street","admin_area_2":"Anytown","admin_area_1":"CA","postal_code":"98765","country_code":"US"},"email_address":"foobuyer@example.com"},"shipping_info":{"name":{"given_name":"Stephanie","surname":"Meyers","full_name":"Stephanie Meyers"},"address":{"address_line_1":"1234 Main Street","admin_area_2":"Anytown","admin_area_1":"CA","postal_code":"98765","country_code":"US"}}}],"items":[{"id":"ITEM-4M535543K7257150H","name":"Yoga Mat","description":"Elastic mat to practice yoga.","quantity":"1","unit_amount":{"currency_code":"USD","value":"50.00"},"tax":{"id":"TAX-1R2044969B8060438","name":"Sales Tax","percent":"7.25","amount":{"currency_code":"USD","value":"3.27"}},"discount":{"percent":"5","amount":{"currency_code":"USD","value":"-2.50"}},"unit_of_measure":"QUANTITY"},{"id":"ITEM-0SE42747HP857643T","name":"Yoga t-shirt","quantity":"1","unit_amount":{"currency_code":"USD","value":"10.00"},"tax":{"id":"TAX-1R2044969B8060438","name":"Sales Tax","percent":"7.25","amount":{"currency_code":"USD","value":"0.34"}},"discount":{"amount":{"currency_code":"USD","value":"-5.00"}},"unit_of_measure":"QUANTITY"}],"configuration":{"tax_calculated_after_discount":true,"tax_inclusive":false,"allow_tip":true,"partial_payment":{"allow_partial_payment":true,"minimum_amount_due":{"currency_code":"USD","value":"20.00"}},"allow_only_pay_by_bank":false,"template_id":"TEMP-0P400848HY4308238"},"amount":{"breakdown":{"item_total":{"currency_code":"USD","value":"60.00"},"discount":{"invoice_discount":{"percent":"5","amount":{"currency_code":"USD","value":"-2.63"}},"item_discount":{"currency_code":"USD","value":"-7.50"}},"tax_total":{"currency_code":"USD","value":"4.34"},"shipping":{"amount":{"currency_code":"USD","value":"10.00"},"tax":{"id":"TAX-1R2044969B8060438","name":"Sales Tax","percent":"7.25","amount":{"currency_code":"USD","value":"0.73"}}},"custom":{"label":"Packing Charges","amount":{"currency_code":"USD","value":"10.00"}}},"currency_code":"USD","value":"74.21"},"due_amount":{"currency_code":"USD","value":"74.21"},"links":[{"href":"https://api.sandbox.paypal.com/v2/invoicing/invoices/INV2-NS4E-L7P4-RZ6B-KNZY","rel":"self","method":"GET"},{"href":"https://api.sandbox.paypal.com/v2/invoicing/invoices/INV2-NS4E-L7P4-RZ6B-KNZY/send","rel":"send","method":"POST"},{"href":"https://api.sandbox.paypal.com/v2/invoicing/invoices/INV2-NS4E-L7P4-RZ6B-KNZY","rel":"replace","method":"PUT"},{"href":"https://api.sandbox.paypal.com/v2/invoicing/invoices/INV2-NS4E-L7P4-RZ6B-KNZY","rel":"delete","method":"DELETE"},{"href":"https://api.sandbox.paypal.com/v2/invoicing/invoices/INV2-NS4E-L7P4-RZ6B-KNZY/payments","rel":"record-payment","method":"POST"}],"unilateral":false}'
                        headers:
                          Strict-Transport-Security: max-age=31536000; includeSubDomains
                          Cache-Control: max-age=0, no-cache, no-store, must-revalidate
                          Vary: Accept-Encoding
                          Content-Type: application/json
                      persistent: true
                    - id: 2791b6fe-bbbe-4102-a3fd-721fb9ba1557
                      name: Create v2 invoicing invoices
                      request:
                        urlPathTemplate: /v2/invoicing/invoices
                        method: POST
                        bodyPatterns:
                          - equalToJson: |-
                              {
                                  "detail": {
                                      "invoice_number": "17494664982",
                                      "invoice_date": "2022-02-04",
                                      "payment_term": {
                                          "term_type": "NET_10",
                                          "due_date": "2022-02-14"
                                      },
                                      "currency_code": "USD",
                                      "reference": "<The reference data. Includes a post office (PO) number.>",
                                      "note": "<A note to the invoice recipient. Also appears on the invoice notification email.>",
                                      "terms_and_conditions": "<The general terms of the invoice. Can include return or cancellation policy and other terms and conditions.>",
                                      "memo": "<A private bookkeeping note for merchant.>"
                                  },
                                  "invoicer": {
                                      "name": {
                                          "given_name": "David",
                                          "surname": "Larusso"
                                      },
                                      "address": {
                                          "address_line_1": "123 Townsend St",
                                          "address_line_2": "Floor 6",
                                          "admin_area_2": "San Francisco",
                                          "admin_area_1": "CA",
                                          "postal_code": "94107",
                                          "country_code": "US"
                                      },
                                      "phones": [
                                          {
                                              "country_code": "001",
                                              "national_number": "4085551234",
                                              "phone_type": "MOBILE"
                                          }
                                      ],
                                      "website": "www.example.com",
                                      "tax_id": "XX-XXXXXXX",
                                      "logo_url": "https://example.com/logo.png",
                                      "additional_notes": "<Any additional information. Includes business hours.>"
                                  },
                                  "primary_recipients": [
                                      {
                                          "billing_info": {
                                              "name": {
                                                  "given_name": "Stephanie",
                                                  "surname": "Meyers"
                                              },
                                              "address": {
                                                  "address_line_1": "1234 Main Street",
                                                  "admin_area_2": "Anytown",
                                                  "admin_area_1": "CA",
                                                  "postal_code": "98765",
                                                  "country_code": "US"
                                              },
                                              "email_address": "foobuyer@example.com",
                                              "phones": [
                                                  {
                                                      "country_code": "001",
                                                      "national_number": "4884551234",
                                                      "phone_type": "HOME"
                                                  }
                                              ],
                                              "additional_info_value": "add-info"
                                          },
                                          "shipping_info": {
                                              "name": {
                                                  "given_name": "Stephanie",
                                                  "surname": "Meyers"
                                              },
                                              "address": {
                                                  "address_line_1": "1234 Main Street",
                                                  "admin_area_2": "Anytown",
                                                  "admin_area_1": "CA",
                                                  "postal_code": "98765",
                                                  "country_code": "US"
                                              }
                                          }
                                      }
                                  ],
                                  "items": [
                                      {
                                          "name": "Yoga Mat",
                                          "description": "Elastic mat to practice yoga.",
                                          "quantity": "1",
                                          "unit_amount": {
                                              "currency_code": "USD",
                                              "value": "50.00"
                                          },
                                          "tax": {
                                              "name": "Sales Tax",
                                              "percent": "7.25"
                                          },
                                          "discount": {
                                              "percent": "5"
                                          },
                                          "unit_of_measure": "QUANTITY"
                                      },
                                      {
                                          "name": "Yoga t-shirt",
                                          "quantity": "1",
                                          "unit_amount": {
                                              "currency_code": "USD",
                                              "value": "10.00"
                                          },
                                          "tax": {
                                              "name": "Sales Tax",
                                              "percent": "7.25"
                                          },
                                          "discount": {
                                              "amount": {
                                                  "currency_code": "USD",
                                                  "value": "5.00"
                                              }
                                          },
                                          "unit_of_measure": "QUANTITY"
                                      }
                                  ],
                                  "configuration": {
                                      "partial_payment": {
                                          "allow_partial_payment": true,
                                          "minimum_amount_due": {
                                              "currency_code": "USD",
                                              "value": "20.00"
                                          }
                                      },
                                      "allow_tip": true,
                                      "tax_calculated_after_discount": true,
                                      "tax_inclusive": false
                                  },
                                  "amount": {
                                      "breakdown": {
                                          "custom": {
                                              "label": "Packing Charges",
                                              "amount": {
                                                  "currency_code": "USD",
                                                  "value": "10.00"
                                              }
                                          },
                                          "shipping": {
                                              "amount": {
                                                  "currency_code": "USD",
                                                  "value": "10.00"
                                              },
                                              "tax": {
                                                  "name": "Sales Tax",
                                                  "percent": "7.25"
                                              }
                                          },
                                          "discount": {
                                              "invoice_discount": {
                                                  "percent": "5"
                                              }
                                          }
                                      }
                                  }
                              }
                            ignoreArrayOrder: true
                            ignoreExtraElements: true
                      response:
                        status: 201
                        body: '{"id":"INV2-NS4E-L7P4-RZ6B-KNZY","status":"DRAFT","detail":{"reference":"<The reference data. Includes a post office (PO) number.>","currency_code":"USD","note":"<A note to the invoice recipient. Also appears on the invoice notification email.>","terms_and_conditions":"<The general terms of the invoice. Can include return or cancellation policy and other terms and conditions.>","memo":"<A private bookkeeping note for merchant.>","additional_data":"<Any additional information. Includes business hours.>","category_code":"SHIPPABLE","invoice_number":"17494664982","invoice_date":"2022-02-04","payment_term":{"term_type":"NET_10","due_date":"2022-02-14"},"viewed_by_recipient":false,"group_draft":false,"metadata":{"create_time":"2025-06-09T10:54:58Z","last_update_time":"2025-06-09T10:54:58Z","created_by_flow":"REGULAR_SINGLE","recipient_view_url":"https://www.sandbox.paypal.com/invoice/p/#NS4EL7P4RZ6BKNZY","invoicer_view_url":"https://www.sandbox.paypal.com/invoice/details/INV2-NS4E-L7P4-RZ6B-KNZY","caller_type":"API_V2_INVOICE","spam_info":{}},"archived":false},"invoicer":{"name":{"given_name":"David","surname":"Larusso","full_name":"David Larusso"},"address":{"address_line_1":"123 Townsend St","address_line_2":"Floor 6","admin_area_2":"San Francisco","admin_area_1":"CA","postal_code":"94107","country_code":"US"},"phones":[{"country_code":"001","national_number":"4085551234","phone_type":"MOBILE"}],"website":"www.example.com","tax_id":"XX-XXXXXXX","additional_notes":"<Any additional information. Includes business hours.>","logo_url":"https://example.com/logo.png"},"primary_recipients":[{"billing_info":{"name":{"given_name":"Stephanie","surname":"Meyers","full_name":"Stephanie Meyers"},"address":{"address_line_1":"1234 Main Street","admin_area_2":"Anytown","admin_area_1":"CA","postal_code":"98765","country_code":"US"},"email_address":"foobuyer@example.com"},"shipping_info":{"name":{"given_name":"Stephanie","surname":"Meyers","full_name":"Stephanie Meyers"},"address":{"address_line_1":"1234 Main Street","admin_area_2":"Anytown","admin_area_1":"CA","postal_code":"98765","country_code":"US"}}}],"items":[{"id":"ITEM-4M535543K7257150H","name":"Yoga Mat","description":"Elastic mat to practice yoga.","quantity":"1","unit_amount":{"currency_code":"USD","value":"50.00"},"tax":{"id":"TAX-1R2044969B8060438","name":"Sales Tax","percent":"7.25","amount":{"currency_code":"USD","value":"3.27"}},"discount":{"percent":"5","amount":{"currency_code":"USD","value":"-2.50"}},"unit_of_measure":"QUANTITY"},{"id":"ITEM-0SE42747HP857643T","name":"Yoga t-shirt","quantity":"1","unit_amount":{"currency_code":"USD","value":"10.00"},"tax":{"id":"TAX-1R2044969B8060438","name":"Sales Tax","percent":"7.25","amount":{"currency_code":"USD","value":"0.34"}},"discount":{"amount":{"currency_code":"USD","value":"-5.00"}},"unit_of_measure":"QUANTITY"}],"configuration":{"tax_calculated_after_discount":true,"tax_inclusive":false,"allow_tip":true,"partial_payment":{"allow_partial_payment":true,"minimum_amount_due":{"currency_code":"USD","value":"20.00"}},"allow_only_pay_by_bank":false,"template_id":"TEMP-0P400848HY4308238"},"amount":{"breakdown":{"item_total":{"currency_code":"USD","value":"60.00"},"discount":{"invoice_discount":{"percent":"5","amount":{"currency_code":"USD","value":"-2.63"}},"item_discount":{"currency_code":"USD","value":"-7.50"}},"tax_total":{"currency_code":"USD","value":"4.34"},"shipping":{"amount":{"currency_code":"USD","value":"10.00"},"tax":{"id":"TAX-1R2044969B8060438","name":"Sales Tax","percent":"7.25","amount":{"currency_code":"USD","value":"0.73"}}},"custom":{"label":"Packing Charges","amount":{"currency_code":"USD","value":"10.00"}}},"currency_code":"USD","value":"74.21"},"due_amount":{"currency_code":"USD","value":"74.21"},"links":[{"href":"https://api.sandbox.paypal.com/v2/invoicing/invoices/INV2-NS4E-L7P4-RZ6B-KNZY","rel":"self","method":"GET"},{"href":"https://api.sandbox.paypal.com/v2/invoicing/invoices/INV2-NS4E-L7P4-RZ6B-KNZY/send","rel":"send","method":"POST"},{"href":"https://api.sandbox.paypal.com/v2/invoicing/invoices/INV2-NS4E-L7P4-RZ6B-KNZY","rel":"replace","method":"PUT"},{"href":"https://api.sandbox.paypal.com/v2/invoicing/invoices/INV2-NS4E-L7P4-RZ6B-KNZY","rel":"delete","method":"DELETE"},{"href":"https://api.sandbox.paypal.com/v2/invoicing/invoices/INV2-NS4E-L7P4-RZ6B-KNZY/payments","rel":"record-payment","method":"POST"}],"unilateral":false}'
                        headers:
                          Strict-Transport-Security: max-age=31536000; includeSubDomains
                          Cache-Control: max-age=0, no-cache, no-store, must-revalidate
                          Vary: Accept-Encoding
                          Location: https://api-m.sandbox.paypal.com:8443/v2/invoicing/invoices/INV2-NS4E-L7P4-RZ6B-KNZY
                          Content-Type: application/json
                      persistent: true
      responses:
        '200':
          description: Successfully imported
  /v1/mock-apis/{mockApiId}/mappings/{stubMappingId}:
    parameters:
      - $ref: '#/components/parameters/mockApiId'
      - description: The UUID of stub mapping
        in: path
        name: stubMappingId
        required: true
        example: 730d3e32-d098-4169-a20c-554c3bedce58
        schema:
          type: string
    get:
      operationId: getStubMappingById
      description: Retrieve a single stub mapping by ID.
      summary: Get stub mapping by ID
      tags:
        - Stub Mappings
      responses:
        '200':
          $ref: '#/components/responses/stubMapping'
        '404':
          description: Stub mapping not found
    put:
      operationId: updateStubMapping
      description: Update an existing stub mapping.
      summary: Update a stub mapping
      tags:
        - Stub Mappings
      requestBody:
        $ref: '#/components/requestBodies/stubMapping'
      responses:
        '200':
          $ref: '#/components/responses/stubMapping'
        '404':
          description: Stub mapping not found
    delete:
      operationId: deleteStubMapping
      description: Permanently delete a single stub mapping.
      summary: Delete a stub mapping
      tags:
        - Stub Mappings
      responses:
        '200':
          description: OK
        '404':
          description: Stub mapping not found
  /v1/mock-apis/{mockApiId}/mappings/find-by-metadata:
    parameters:
      - $ref: '#/components/parameters/mockApiId'
    post:
      operationId: findStubMappingsByMetadata
      summary: Find stub mappings matching metadata
      description: Find stubs by matching on their metadata
      tags:
        - Stub Mappings
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/content-pattern'
            example:
              matchesJsonPath:
                expression: $.outer
                equalToJson: '{ "inner": 42 }'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/stub-mappings'
              example:
                meta:
                  total: 2
                mappings:
                  - id: 76ada7b0-49ae-4229-91c4-396a36f18e09
                    uuid: 76ada7b0-49ae-4229-91c4-396a36f18e09
                    request:
                      method: GET
                      url: /search?q=things
                      headers:
                        Accept:
                          equalTo: application/json
                    response:
                      status: 200
                      jsonBody:
                        - thing1
                        - thing2
                      headers:
                        Content-Type: application/json
                  - request:
                      method: POST
                      urlPath: /some/things
                      bodyPatterns:
                        - equalToXml: <stuff />
                    response:
                      status: 201
          description: Matched stub mappings
  /v1/mock-apis/{mockApiId}/mappings/remove-by-metadata:
    parameters:
      - $ref: '#/components/parameters/mockApiId'
    post:
      operationId: removeStubMappingsByMetadata
      description: Delete stub mappings whose metadata matches the given criteria.
      summary: Delete stub mappings matching metadata
      tags:
        - Stub Mappings
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/content-pattern'
            example:
              matchesJsonPath:
                expression: $.outer
                equalToJson: '{ "inner": 42 }'
      responses:
        '200':
          description: The stub mappings were successfully removed
  /v1/mock-apis/{mockApiId}/requests:
    parameters:
      - $ref: '#/components/parameters/mockApiId'
    get:
      operationId: getAllRequestsInJournal
      description: List every request logged in a mock API's request journal.
      summary: Get all requests in journal
      tags:
        - Requests
      parameters:
        - description: The maximum number of results to return
          in: query
          name: limit
          example: '10'
          schema:
            type: string
        - description: Only return logged requests after this date
          in: query
          name: since
          example: '2016-10-05T12:33:01Z'
          schema:
            type: string
      responses:
        '200':
          content:
            application/json:
              example:
                requests:
                  - id: 45760a03-eebb-4387-ad0d-bb89b5d3d662
                    request:
                      url: /received-request/9
                      absoluteUrl: http://localhost:56715/received-request/9
                      method: GET
                      clientIp: 127.0.0.1
                      headers:
                        Connection: keep-alive
                        Host: localhost:56715
                        User-Agent: Apache-HttpClient/4.5.1 (Java/1.7.0_51)
                      cookies: {}
                      browserProxyRequest: false
                      loggedDate: 1471442494809
                      bodyAsBase64: ''
                      body: ''
                      loggedDateString: '2016-08-17T14:01:34Z'
                    responseDefinition:
                      status: 404
                      transformers: []
                      fromConfiguredStub: false
                      transformerParameters: {}
                  - id: 6ae78311-0178-46c9-987a-fbfc528d54d8
                    request:
                      url: /received-request/8
                      absoluteUrl: http://localhost:56715/received-request/8
                      method: GET
                      clientIp: 127.0.0.1
                      headers:
                        Connection: keep-alive
                        Host: localhost:56715
                        User-Agent: Apache-HttpClient/4.5.1 (Java/1.7.0_51)
                      cookies: {}
                      browserProxyRequest: false
                      loggedDate: 1471442494802
                      bodyAsBase64: ''
                      body: ''
                      loggedDateString: '2016-08-17T14:01:34Z'
                    responseDefinition:
                      status: 404
                      transformers: []
                      fromConfiguredStub: false
                      transformerParameters: {}
                  - id: aba8e4ad-1b5b-4518-8f05-b2170a24de35
                    request:
                      url: /received-request/7
                      absoluteUrl: http://localhost:56715/received-request/7
                      method: GET
                      clientIp: 127.0.0.1
                      headers:
                        Connection: keep-alive
                        Host: localhost:56715
                        User-Agent: Apache-HttpClient/4.5.1 (Java/1.7.0_51)
                      cookies: {}
                      browserProxyRequest: false
                      loggedDate: 1471442494795
                      bodyAsBase64: ''
                      body: ''
                      loggedDateString: '2016-08-17T14:01:34Z'
                    responseDefinition:
                      status: 404
                      transformers: []
                      fromConfiguredStub: false
                      transformerParameters: {}
                meta:
                  total: 9
                requestJournalDisabled: false
          description: List of received requests
    delete:
      operationId: deleteAllRequestsInJournal
      description: Permanently delete every request in a mock API's request journal.
      summary: Delete all requests in journal
      tags:
        - Requests
      responses:
        '200':
          description: Successfully deleted
  /v1/mock-apis/{mockApiId}/requests/{requestId}:
    parameters:
      - $ref: '#/components/parameters/mockApiId'
    get:
      operationId: getRequestById
      description: Retrieve a single logged request by ID.
      summary: Get request by ID
      tags:
        - Requests
      parameters:
        - description: The UUID of the logged request
          in: path
          name: requestId
          required: true
          example: 12fb14bb-600e-4bfa-bd8d-be7f12562c99
          schema:
            type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              example:
                id: 12fb14bb-600e-4bfa-bd8d-be7f12562c99
                request:
                  url: /received-request/2
                  absoluteUrl: http://localhost:56738/received-request/2
                  method: GET
                  clientIp: 127.0.0.1
                  headers:
                    Connection: keep-alive
                    Host: localhost:56738
                    User-Agent: Apache-HttpClient/4.5.1 (Java/1.7.0_51)
                  cookies: {}
                  browserProxyRequest: false
                  loggedDate: 1471442557047
                  bodyAsBase64: ''
                  body: ''
                  loggedDateString: '2016-08-17T14:02:37Z'
                responseDefinition:
                  status: 404
                  transformers: []
                  fromConfiguredStub: false
                  transformerParameters: {}
        '404':
          description: Request not found
    delete:
      operationId: deleteRequestById
      description: Permanently delete a single logged request.
      summary: Delete request by ID
      tags:
        - Requests
      parameters:
        - description: The UUID of the logged request
          in: path
          name: requestId
          required: true
          example: 12fb14bb-600e-4bfa-bd8d-be7f12562c99
          schema:
            type: string
      responses:
        '200':
          description: Successfully deleted
  /v1/mock-apis/{mockApiId}/requests/reset:
    parameters:
      - $ref: '#/components/parameters/mockApiId'
    post:
      operationId: emptyRequestJournal
      description: Clear all requests from a mock API's request journal.
      deprecated: true
      summary: Empty the request journal
      tags:
        - Requests
      responses:
        '200':
          description: Successfully reset
  /v1/mock-apis/{mockApiId}/requests/count:
    parameters:
      - $ref: '#/components/parameters/mockApiId'
    post:
      operationId: countRequestsByCriteria
      summary: Count requests by criteria
      description: Count requests logged in the journal matching the specified criteria
      tags:
        - Requests
      requestBody:
        $ref: '#/components/requestBodies/requestPattern'
      responses:
        '200':
          description: Number of matching requests
          content:
            application/json:
              schema:
                type: object
                properties:
                  count:
                    type: integer
                    example: 4
  /v1/mock-apis/{mockApiId}/requests/remove:
    parameters:
      - $ref: '#/components/parameters/mockApiId'
    post:
      operationId: removeRequestsByCriteria
      summary: Remove requests by criteria
      description: Removed requests logged in the journal matching the specified criteria
      tags:
        - Requests
      requestBody:
        $ref: '#/components/requestBodies/requestPattern'
      responses:
        '200':
          description: Removed request details
          content:
            application/json:
              example:
                requests:
                  - url: /my/url
                    absoluteUrl: http://mydomain.com/my/url
                    method: GET
                    headers:
                      Accept-Language: en-us,en;q=0.5
                      User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:9.0) Gecko/20100101 Firefox/9.0
                      Accept: image/png,image/*;q=0.8,*/*;q=0.5
                    body: ''
                    browserProxyRequest: true
                    loggedDate: 1339083581823
                    loggedDateString: '2012-06-07 16:39:41'
                  - url: /my/other/url
                    absoluteUrl: http://my.other.domain.com/my/other/url
                    method: POST
                    headers:
                      Accept: text/plain
                      Content-Type: text/plain
                    body: My text
                    browserProxyRequest: false
                    loggedDate: 1339083581823
                    loggedDateString: '2012-06-07 16:39:41'
  /v1/mock-apis/{mockApiId}/requests/remove-by-metadata:
    parameters:
      - $ref: '#/components/parameters/mockApiId'
    post:
      operationId: removeRequestsByMetadata
      description: Delete logged requests whose metadata matches the given criteria.
      summary: Delete requests mappings matching metadata
      tags:
        - Requests
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/content-pattern'
            example:
              matchesJsonPath:
                expression: $.outer
                equalToJson: '{ "inner": 42 }'
      responses:
        '200':
          description: Removed request details
          content:
            application/json:
              example:
                requests:
                  - url: /my/url
                    absoluteUrl: http://mydomain.com/my/url
                    method: GET
                    headers:
                      Accept-Language: en-us,en;q=0.5
                      User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:9.0) Gecko/20100101 Firefox/9.0
                      Accept: image/png,image/*;q=0.8,*/*;q=0.5
                    body: ''
                    browserProxyRequest: true
                    loggedDate: 1339083581823
                    loggedDateString: '2012-06-07 16:39:41'
                  - url: /my/other/url
                    absoluteUrl: http://my.other.domain.com/my/other/url
                    method: POST
                    headers:
                      Accept: text/plain
                      Content-Type: text/plain
                    body: My text
                    browserProxyRequest: false
                    loggedDate: 1339083581823
                    loggedDateString: '2012-06-07 16:39:41'
  /v1/mock-apis/{mockApiId}/requests/find:
    parameters:
      - $ref: '#/components/parameters/mockApiId'
    post:
      operationId: findRequestsByCriteria
      summary: Find requests by criteria
      description: Retrieve details of requests logged in the journal matching the specified criteria
      tags:
        - Requests
      requestBody:
        $ref: '#/components/requestBodies/requestPattern'
      responses:
        '200':
          description: Matching request details
          content:
            application/json:
              example:
                requests:
                  - url: /my/url
                    absoluteUrl: http://mydomain.com/my/url
                    method: GET
                    headers:
                      Accept-Language: en-us,en;q=0.5
                      User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:9.0) Gecko/20100101 Firefox/9.0
                      Accept: image/png,image/*;q=0.8,*/*;q=0.5
                    body: ''
                    browserProxyRequest: true
                    loggedDate: 1339083581823
                    loggedDateString: '2012-06-07 16:39:41'
                  - url: /my/other/url
                    absoluteUrl: http://my.other.domain.com/my/other/url
                    method: POST
                    headers:
                      Accept: text/plain
                      Content-Type: text/plain
                    body: My text
                    browserProxyRequest: false
                    loggedDate: 1339083581823
                    loggedDateString: '2012-06-07 16:39:41'
  /v1/mock-apis/{mockApiId}/requests/unmatched:
    parameters:
      - $ref: '#/components/parameters/mockApiId'
    get:
      operationId: findUnmatchedRequests
      summary: Find unmatched requests
      description: Get details of logged requests that weren't matched by any stub mapping
      tags:
        - Requests
      responses:
        '200':
          description: Unmatched request details
          content:
            application/json:
              example:
                requests:
                  - url: /my/url
                    absoluteUrl: http://mydomain.com/my/url
                    method: GET
                    headers:
                      Accept-Language: en-us,en;q=0.5
                      User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:9.0) Gecko/20100101 Firefox/9.0
                      Accept: image/png,image/*;q=0.8,*/*;q=0.5
                    body: ''
                    browserProxyRequest: true
                    loggedDate: 1339083581823
                    loggedDateString: '2012-06-07 16:39:41'
                  - url: /my/other/url
                    absoluteUrl: http://my.other.domain.com/my/other/url
                    method: POST
                    headers:
                      Accept: text/plain
                      Content-Type: text/plain
                    body: My text
                    browserProxyRequest: false
                    loggedDate: 1339083581823
                    loggedDateString: '2012-06-07 16:39:41'
  /v1/mock-apis/{mockApiId}/recordings/start:
    parameters:
      - $ref: '#/components/parameters/mockApiId'
    post:
      operationId: startRecording
      summary: Start recording
      description: Begin recording stub mappings
      tags:
        - Recordings
      requestBody:
        $ref: '#/components/requestBodies/startRecording'
      responses:
        '200':
          description: Successfully started recording
  /v1/mock-apis/{mockApiId}/recordings/stop:
    parameters:
      - $ref: '#/components/parameters/mockApiId'
    post:
      operationId: stopRecording
      summary: Stop recording
      description: End recording of stub mappings
      tags:
        - Recordings
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/stub-mappings'
              example:
                mappings:
                  - id: 093f1027-e5e0-4921-9e6d-e619dfd5d2c7
                    name: recordables_123
                    request:
                      url: /recordables/123
                      method: GET
                    response:
                      status: 200
                      body: |-
                        {
                          "message": "Congratulations on your first recording!"
                        }
                      headers:
                        Content-Type: application/json
                    uuid: 093f1027-e5e0-4921-9e6d-e619dfd5d2c7
                    persistent: true
          description: Successfully stopped recording
  /v1/mock-apis/{mockApiId}/recordings/status:
    parameters:
      - $ref: '#/components/parameters/mockApiId'
    get:
      operationId: getRecordingStatus
      description: Check whether a mock API is currently recording, and its current recording session state.
      summary: Get recording status
      tags:
        - Recordings
      responses:
        '200':
          description: Successfully got the record status
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: string
                    example: Stopped
                    enum:
                      - NeverStarted
                      - Recording
                      - Stopped
  /v1/mock-apis/{mockApiId}/recordings/snapshot:
    parameters:
      - $ref: '#/components/parameters/mockApiId'
    post:
      operationId: takeRecordingSnapshot
      description: Convert currently logged requests into stub mappings without stopping an active recording session.
      summary: Take a snapshot recording
      tags:
        - Recordings
      requestBody:
        $ref: '#/components/requestBodies/snapshotRecording'
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/stub-mappings'
              example:
                mappings:
                  - id: 093f1027-e5e0-4921-9e6d-e619dfd5d2c7
                    name: recordables_123
                    request:
                      url: /recordables/123
                      method: GET
                    response:
                      status: 200
                      body: |-
                        {
                          "message": "Congratulations on your first recording!"
                        }
                      headers:
                        Content-Type: application/json
                    uuid: 093f1027-e5e0-4921-9e6d-e619dfd5d2c7
                    persistent: true
          description: Successfully took a snapshot recording
  /v1/mock-apis/{mockApiId}/scenarios:
    parameters:
      - $ref: '#/components/parameters/mockApiId'
    get:
      operationId: getAllScenarios
      description: List every scenario and its current state for a mock API.
      summary: Get all scenarios
      tags:
        - State
      parameters:
        - description: When set to `summary`, returns a lightweight view of each scenario containing only its name and current state, omitting stub mappings, possible states, and IDs. Any other value (or omitting the parameter) returns the full scenario representation.
          in: query
          name: detail
          schema:
            type: string
            enum:
              - summary
      responses:
        '200':
          content:
            application/json:
              schema:
                type: object
                properties:
                  scenarios:
                    type: array
                    items:
                      oneOf:
                        - $ref: '#/components/schemas/scenario'
                        - $ref: '#/components/schemas/scenarioSummary'
          description: All scenarios
  /v1/mock-apis/{mockApiId}/scenarios/reset:
    parameters:
      - $ref: '#/components/parameters/mockApiId'
    post:
      operationId: resetAllScenarios
      summary: Reset all state
      description: Resets all scenario and dynamic state
      tags:
        - State
      responses:
        '200':
          description: Successfully reset
  /v1/mock-apis/{mockApiId}/settings/chaos:
    parameters:
      - $ref: '#/components/parameters/mockApiId'
    get:
      operationId: getChaosSettings
      description: Retrieve a mock API's chaos settings (random latency and failure injection).
      summary: Get chaos settings
      tags:
        - Settings
      responses:
        '200':
          description: The chaos settings
          content:
            application/json:
              schema:
                type: object
                properties:
                  chaos:
                    $ref: '#/components/schemas/ChaosSettings'
              example:
                chaos:
                  enabled: true
                  percentageFailures: 13
                  socketClose:
                    enabled: true
                  socketReset:
                    enabled: true
                  invalidHttp:
                    enabled: false
                  longDelay:
                    enabled: true
                    durationMillis: 555
                  httpErrors:
                    - status: 503
        '401':
          $ref: '#/components/responses/401'
        '403':
          $ref: '#/components/responses/403'
    put:
      operationId: updateChaosSettings
      description: Update a mock API's chaos settings.
      summary: Update chaos settings
      tags:
        - Settings
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - chaos
              properties:
                chaos:
                  $ref: '#/components/schemas/ChaosSettings'
            example:
              chaos:
                enabled: true
                percentageFailures: 13
                socketClose:
                  enabled: true
                socketReset:
                  enabled: true
                invalidHttp:
                  enabled: false
                longDelay:
                  enabled: true
                  durationMillis: 555
                httpErrors:
                  - status: 503
      responses:
        '200':
          description: Settings successfully updated
          content:
            application/json:
              schema:
                type: object
                properties:
                  chaos:
                    $ref: '#/components/schemas/ChaosSettings'
        '401':
          $ref: '#/components/responses/401'
        '403':
          $ref: '#/components/responses/403'
  /v1/mock-apis/{mockApiId}/settings/openapi:
    parameters:
      - $ref: '#/components/parameters/mockApiId'
    get:
      operationId: getOpenApiSettings
      description: Retrieve a mock API's OpenAPI validation and generation settings.
      summary: Get OpenAPI settings
      tags:
        - Settings
      responses:
        '200':
          description: The OpenAPI settings
          content:
            application/json:
              schema:
                type: object
                properties:
                  openapi:
                    $ref: '#/components/schemas/OpenApiSettings'
              example:
                openapi:
                  portalEnabled: true
                  portalSecurity:
                    type: OIDC
                  validationMode: soft
                  generateOpenApiFromStubs: true
                  generateStubsFromOpenApi: true
                  generateDefaultStubs: false
        '401':
          $ref: '#/components/responses/401'
        '403':
          $ref: '#/components/responses/403'
    put:
      operationId: updateOpenApiSettings
      description: Update a mock API's OpenAPI validation and generation settings.
      summary: Update OpenAPI settings
      tags:
        - Settings
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - openapi
              properties:
                openapi:
                  $ref: '#/components/schemas/OpenApiSettings'
            example:
              openapi:
                portalEnabled: true
                portalSecurity:
                  type: OIDC
                validationMode: soft
                generateOpenApiFromStubs: true
                generateStubsFromOpenApi: true
                generateDefaultStubs: false
      responses:
        '200':
          description: Settings successfully updated
          content:
            application/json:
              schema:
                type: object
                properties:
                  openapi:
                    $ref: '#/components/schemas/OpenApiSettings'
        '401':
          $ref: '#/components/responses/401'
        '403':
          $ref: '#/components/responses/403'
  /v1/mock-apis/{mockApiId}/settings/state:
    parameters:
      - $ref: '#/components/parameters/mockApiId'
    get:
      operationId: getStateSettings
      description: Retrieve a mock API's dynamic state settings.
      summary: Get state settings
      tags:
        - Settings
      responses:
        '200':
          description: The state settings
          content:
            application/json:
              schema:
                type: object
                properties:
                  state:
                    $ref: '#/components/schemas/StateSettings'
              example:
                state:
                  defaultContextExpression: '{{request.headers.X-Session-Id}}'
        '401':
          $ref: '#/components/responses/401'
        '403':
          $ref: '#/components/responses/403'
    put:
      operationId: updateStateSettings
      description: Update a mock API's dynamic state settings.
      summary: Update state settings
      tags:
        - Settings
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - state
              properties:
                state:
                  $ref: '#/components/schemas/StateSettings'
            example:
              state:
                defaultContextExpression: '{{request.headers.X-Session-Id}}'
      responses:
        '200':
          description: Settings successfully updated
          content:
            application/json:
              schema:
                type: object
                properties:
                  state:
                    $ref: '#/components/schemas/StateSettings'
        '401':
          $ref: '#/components/responses/401'
        '403':
          $ref: '#/components/responses/403'
  /v1/mock-apis/{mockApiId}/settings/delayDistribution:
    parameters:
      - $ref: '#/components/parameters/mockApiId'
    get:
      operationId: getDelayDistribution
      description: Retrieve the response delay distribution configured for a mock API.
      summary: Get delay distribution
      tags:
        - Settings
      responses:
        '200':
          description: The delay distribution settings
          content:
            application/json:
              schema:
                type: object
                properties:
                  delayDistribution:
                    $ref: '#/components/schemas/delay-distribution'
              examples:
                uniform:
                  summary: Uniform distribution
                  value:
                    delayDistribution:
                      type: uniform
                      lower: 5
                      upper: 9
                lognormal:
                  summary: Log normal distribution
                  value:
                    delayDistribution:
                      type: lognormal
                      median: 100
                      sigma: 0.5
                fixed:
                  summary: Fixed delay
                  value:
                    delayDistribution:
                      type: fixed
                      milliseconds: 500
                none:
                  summary: No delay distribution
                  value:
                    delayDistribution:
                      type: none
        '401':
          $ref: '#/components/responses/401'
        '403':
          $ref: '#/components/responses/403'
    put:
      operationId: updateDelayDistribution
      description: Update the response delay distribution for a mock API.
      summary: Update delay distribution
      tags:
        - Settings
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - delayDistribution
              properties:
                delayDistribution:
                  $ref: '#/components/schemas/delay-distribution'
            examples:
              uniform:
                summary: Uniform distribution
                value:
                  delayDistribution:
                    type: uniform
                    lower: 50
                    upper: 100
              lognormal:
                summary: Log normal distribution
                value:
                  delayDistribution:
                    type: lognormal
                    median: 100
                    sigma: 0.5
                    maxValue: 2000
              fixed:
                summary: Fixed delay
                value:
                  delayDistribution:
                    type: fixed
                    milliseconds: 500
              none:
                summary: Clear delay distribution
                value:
                  delayDistribution:
                    type: none
      responses:
        '200':
          description: Settings successfully updated
          content:
            application/json:
              schema:
                type: object
                properties:
                  delayDistribution:
                    $ref: '#/components/schemas/delay-distribution'
        '401':
          $ref: '#/components/responses/401'
        '403':
          $ref: '#/components/responses/403'
  /v1/mock-apis/{mockApiId}/settings/rateLimits:
    parameters:
      - $ref: '#/components/parameters/mockApiId'
    get:
      operationId: getRateLimits
      description: List the rate limits configured on a mock API.
      summary: Get all rate limits
      tags:
        - Settings
      responses:
        '200':
          description: All configured rate limits
          content:
            application/json:
              schema:
                type: object
                properties:
                  rateLimits:
                    type: object
                    description: Map of rate limit IDs to their configurations.
                    additionalProperties:
                      $ref: '#/components/schemas/RateLimit'
              example:
                rateLimits:
                  main:
                    rate: 10
                    unit: seconds
                    burst: 50
        '401':
          $ref: '#/components/responses/401'
        '403':
          $ref: '#/components/responses/403'
    put:
      operationId: updateRateLimits
      description: Replace every rate limit configured on a mock API.
      summary: Replace all rate limits
      tags:
        - Settings
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - rateLimits
              properties:
                rateLimits:
                  type: object
                  description: Map of rate limit IDs to their configurations. Replaces all existing rate limits.
                  additionalProperties:
                    $ref: '#/components/schemas/RateLimit'
            example:
              rateLimits:
                main:
                  rate: 10
                  unit: seconds
                  burst: 50
      responses:
        '200':
          description: Settings successfully updated
          content:
            application/json:
              schema:
                type: object
                properties:
                  rateLimits:
                    type: object
                    additionalProperties:
                      $ref: '#/components/schemas/RateLimit'
        '401':
          $ref: '#/components/responses/401'
        '403':
          $ref: '#/components/responses/403'
    post:
      operationId: createRateLimit
      description: Create a new rate limit on a mock API.
      summary: Create a rate limit
      tags:
        - Settings
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - rateLimit
              properties:
                rateLimit:
                  $ref: '#/components/schemas/RateLimitWithId'
            example:
              rateLimit:
                id: main
                rate: 10
                unit: seconds
                burst: 50
      responses:
        '201':
          description: Rate limit created
          content:
            application/json:
              schema:
                type: object
                properties:
                  rateLimit:
                    $ref: '#/components/schemas/RateLimitWithId'
                  links:
                    type: object
                    properties:
                      self:
                        type: string
              example:
                rateLimit:
                  id: main
                  rate: 10
                  unit: seconds
                  burst: 50
                links:
                  self: /v1/mock-apis/abc123/settings/rateLimits/main
        '401':
          $ref: '#/components/responses/401'
        '403':
          $ref: '#/components/responses/403'
        '422':
          $ref: '#/components/responses/422'
  /v1/mock-apis/{mockApiId}/settings/rateLimits/{rateLimitId}:
    parameters:
      - $ref: '#/components/parameters/mockApiId'
      - description: The ID of the rate limit
        in: path
        name: rateLimitId
        required: true
        example: main
        schema:
          type: string
    get:
      operationId: getRateLimitById
      description: Retrieve a single rate limit by ID.
      summary: Get a rate limit by ID
      tags:
        - Settings
      responses:
        '200':
          description: The rate limit
          content:
            application/json:
              schema:
                type: object
                properties:
                  rateLimit:
                    $ref: '#/components/schemas/RateLimitWithId'
                  links:
                    type: object
                    properties:
                      self:
                        type: string
              example:
                rateLimit:
                  id: main
                  rate: 10
                  unit: seconds
                  burst: 50
                links:
                  self: /v1/mock-apis/abc123/settings/rateLimits/main
        '401':
          $ref: '#/components/responses/401'
        '403':
          $ref: '#/components/responses/403'
        '404':
          $ref: '#/components/responses/404'
    put:
      operationId: updateRateLimit
      description: Update a single rate limit.
      summary: Update a rate limit
      tags:
        - Settings
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - rateLimit
              properties:
                rateLimit:
                  $ref: '#/components/schemas/RateLimitWithId'
            example:
              rateLimit:
                id: main
                rate: 20
                unit: seconds
                burst: 100
      responses:
        '200':
          description: Rate limit updated
          content:
            application/json:
              schema:
                type: object
                properties:
                  rateLimit:
                    $ref: '#/components/schemas/RateLimitWithId'
                  links:
                    type: object
                    properties:
                      self:
                        type: string
        '401':
          $ref: '#/components/responses/401'
        '403':
          $ref: '#/components/responses/403'
        '422':
          $ref: '#/components/responses/422'
    delete:
      operationId: deleteRateLimit
      description: Permanently delete a single rate limit.
      summary: Delete a rate limit
      tags:
        - Settings
      responses:
        '204':
          description: Rate limit deleted
        '401':
          $ref: '#/components/responses/401'
        '403':
          $ref: '#/components/responses/403'
  /v1/mock-apis/{mockApiId}/settings/certificate:
    parameters:
      - $ref: '#/components/parameters/mockApiId'
    get:
      operationId: getMockApiCertificateSettings
      summary: Get mock API certificate settings
      description: |
        Retrieve the certificate settings for a mock API. These settings are used to configure the cryptographic handlebars helpers,
        [`sign`](/response-templating/cryptographic-helpers#signing) and [`x509Certificate`](/response-templating/cryptographic-helpers#x-509-certificate).
      tags:
        - Settings
      responses:
        '200':
          description: The certificate settings
          content:
            application/json:
              schema:
                type: object
                properties:
                  certificate:
                    type: object
                    required:
                      - rsa256PublicKey
                      - rsa256PrivateKey
                      - x509Certificate
                      - hmacSecret
                    properties:
                      rsa256PublicKey:
                        type: string
                        description: |
                          RSA public key in PEM format. Pairs with rsa256PrivateKey. A valid pair is generated by the system upon mock API creation.
                      rsa256PrivateKey:
                        type: string
                        description: |
                          RSA private key in PEM format. Pairs with rsa256PublicKey. A valid pair is generated by the system upon mock API creation.
                          Used by the [`sign`](/response-templating/cryptographic-helpers#signing) helper when generating RSA signatures.
                      x509Certificate:
                        type: string
                        description: |
                          X.509 certificate in PEM format. A valid pair is generated by the system upon mock API creation,
                          using the generated RSA key pair to generate the signature.
                      hmacSecret:
                        type: string
                        description: |
                          A non-empty secret key. A random secret is generated by the system upon mock API creation.
                          Used by the [`sign`](/response-templating/cryptographic-helpers#signing) helper when generating HMAC signatures.
              example:
                certificate:
                  rsa256PublicKey: |-
                    -----BEGIN RSA PUBLIC KEY-----
                    MIIBIjANBg...kCAwEAAQ==
                    -----END RSA PUBLIC KEY-----
                  rsa256PrivateKey: |-
                    -----BEGIN RSA PRIVATE KEY-----
                    MIIEvQIBAD...eXuQIDAQAB
                    -----END RSA PRIVATE KEY-----
                  x509Certificate: |-
                    -----BEGIN CERTIFICATE-----
                    MIICpDCCAY...AwggEKAgEA
                    -----END CERTIFICATE-----
                  hmacSecret: sup3r-s3cr3t-hmac-k3y
        '401':
          $ref: '#/components/responses/401'
        '403':
          $ref: '#/components/responses/403'
        '404':
          $ref: '#/components/responses/404'
    put:
      operationId: updateMockApiCertificateSettings
      summary: Set mock API certificate settings
      description: |
        Set the certificate settings for a mock API. These settings are used to configure the cryptographic handlebars helpers,
        [`sign`](/response-templating/cryptographic-helpers#signing) and [`x509Certificate`](/response-templating/cryptographic-helpers#x-509-certificate).
      tags:
        - Settings
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                certificate:
                  type: object
                  required:
                    - rsa256PublicKey
                    - rsa256PrivateKey
                    - x509Certificate
                    - hmacSecret
                  properties:
                    rsa256PublicKey:
                      type: string
                      description: RSA public key in PEM format.
                    rsa256PrivateKey:
                      type: string
                      description: RSA private key in PEM format.
                    x509Certificate:
                      type: string
                      description: X.509 certificate in PEM format.
                    hmacSecret:
                      type: string
                      description: A non-empty secret key.
            example:
              certificate:
                rsa256PublicKey: |-
                  -----BEGIN RSA PUBLIC KEY-----
                  MIIBIjANBg...kCAwEAAQ==
                  -----END RSA PUBLIC KEY-----
                rsa256PrivateKey: |-
                  -----BEGIN RSA PRIVATE KEY-----
                  MIIEvQIBAD...eXuQIDAQAB
                  -----END RSA PRIVATE KEY-----
                x509Certificate: |-
                  -----BEGIN CERTIFICATE-----
                  MIICpDCCAY...AwggEKAgEA
                  -----END CERTIFICATE-----
                hmacSecret: sup3r-s3cr3t-hmac-k3y
      responses:
        '200':
          description: Settings successfully updated
          content:
            application/json:
              schema:
                type: object
                properties:
                  certificate:
                    type: object
                    required:
                      - rsa256PublicKey
                      - rsa256PrivateKey
                      - x509Certificate
                      - hmacSecret
                    properties:
                      rsa256PublicKey:
                        type: string
                        description: The updated RSA public key.
                      rsa256PrivateKey:
                        type: string
                        description: The updated RSA private key.
                      x509Certificate:
                        type: string
                        description: The updated X.509 certificate.
                      hmacSecret:
                        type: string
                        description: The updated HMAC secret key.
              example:
                certificate:
                  rsa256PublicKey: |-
                    -----BEGIN RSA PUBLIC KEY-----
                    MIIBIjANBg...kCAwEAAQ==
                    -----END RSA PUBLIC KEY-----
                  rsa256PrivateKey: |-
                    -----BEGIN RSA PRIVATE KEY-----
                    MIIEvQIBAD...eXuQIDAQAB
                    -----END RSA PRIVATE KEY-----
                  x509Certificate: |-
                    -----BEGIN CERTIFICATE-----
                    MIICpDCCAY...AwggEKAgEA
                    -----END CERTIFICATE-----
                  hmacSecret: sup3r-s3cr3t-hmac-k3y
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
        '403':
          $ref: '#/components/responses/403'
        '404':
          $ref: '#/components/responses/404'
        '422':
          $ref: '#/components/responses/422'
  /v1/mock-apis/{mockApiId}/open-api:
    parameters:
      - $ref: '#/components/parameters/mockApiId'
    get:
      summary: Get OpenAPI document for mock API
      operationId: getOpenAPIDocumentForMockApi
      description: Retrieve the OpenAPI document currently associated with a mock API.
      tags:
        - OpenAPI
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OpenApi'
              example:
                openApi:
                  doc: |-
                    openapi: 3.1.0
                    info:
                      title: Customer Contacts Management API
                      description: API for managing customer contacts including personal and professional details
                      version: 1.0.0
                    servers:
                    - url: https://dev-openapi-testing.wiremockapi.cloud
    put:
      summary: Update OpenAPI document for mock API
      operationId: putOpenAPIDocumentForMockApi
      description: Replace the OpenAPI document associated with a mock API, regenerating its stubs.
      tags:
        - OpenAPI
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/OpenApi'
            examples:
              main:
                value:
                  openApi:
                    doc: |-
                      openapi: 3.1.0
                      info:
                        title: Customer Contacts Management API
                        description: API for managing customer contacts including personal and professional details
                        version: 1.0.0
                      servers:
                      - url: https://dev-openapi-testing.wiremockapi.cloud
        required: true
      responses:
        '204':
          description: Successfully updated
  /v1/mock-apis/{mockApiId}/open-api/pull:
    parameters:
      - $ref: '#/components/parameters/mockApiId'
    post:
      summary: Pull OpenAPI document from Git
      operationId: pullOpenAPIFromGit
      description: Pull the latest OpenAPI document for a mock API from its connected Git repository.
      tags:
        - OpenAPI
      requestBody:
        content:
          application/json:
            schema:
              required:
                - pull
              type: object
              properties:
                pull:
                  required:
                    - outOfSyncPolicy
                  type: object
                  properties:
                    outOfSyncPolicy:
                      type: string
                      enum:
                        - abort
                        - overwrite_local_with_remote
                      example: abort
            examples:
              main:
                value:
                  pull:
                    outOfSyncPolicy: abort
        required: true
      responses:
        '202':
          description: Pull job successfully initiated
          content:
            application/json:
              schema:
                required:
                  - job
                type: object
                properties:
                  job:
                    required:
                      - id
                      - jobType
                      - links
                      - started
                      - status
                    type: object
                    properties:
                      id:
                        type: string
                        example: 5947aff3-947b-4dfb-90f5-d324684e97db
                      jobType:
                        type: string
                        example: open-api-git-pull
                      status:
                        type: string
                        example: RUNNING
                      started:
                        type: string
                        example: '2024-09-05T10:20:46.143759190Z'
                      links:
                        required:
                          - self
                        type: object
                        properties:
                          self:
                            type: string
                            example: /v1/mock-apis/0ozge/__admin/etc/jobs/5947aff3-947b-4dfb-90f5-d324684e97db
                x-wiremock-hash: 1673969202
              examples:
                main:
                  value:
                    job:
                      id: 5947aff3-947b-4dfb-90f5-d324684e97db
                      jobType: open-api-git-pull
                      status: ERROR
                      started: '2024-09-05T10:20:46.143759190Z'
                      links:
                        self: /v1/mock-apis/0ozge/__admin/etc/jobs/5947aff3-947b-4dfb-90f5-d324684e97db
                      finished: '2024-09-05T10:20:46.200386224Z'
                      elapsed: PT0.056627034S
                      outcome:
                        errorCode: NO_LOCAL_HEAD
                        errors:
                          - code: 112
                            title: No previous pull
                            detail: This is the first time pulling from Git.
                  x-parameter-values:
                    mockApiId: 0ozge
  /v1/mock-apis/{mockApiId}/open-api/push:
    parameters:
      - $ref: '#/components/parameters/mockApiId'
    put:
      summary: Push OpenAPI document to Git
      operationId: pushOpenApiDocumentToGit
      description: Push a mock API's OpenAPI document to its connected Git repository.
      tags:
        - OpenAPI
      requestBody:
        content:
          application/json:
            schema:
              required:
                - push
              type: object
              properties:
                push:
                  required:
                    - outOfSyncPolicy
                  type: object
                  properties:
                    outOfSyncPolicy:
                      type: string
                      enum:
                        - abort
                        - overwrite_remote_with_local
                      example: abort
            examples:
              main:
                value:
                  push:
                    outOfSyncPolicy: abort
        required: true
      responses:
        '202':
          description: Successfully initiated push job
          content:
            application/json:
              schema:
                required:
                  - job
                type: object
                properties:
                  job:
                    required:
                      - id
                      - jobType
                      - links
                      - started
                      - status
                    type: object
                    properties:
                      id:
                        type: string
                        example: fed0d523-df14-4614-9cf4-79454e7eccbd
                      jobType:
                        type: string
                        example: open-api-git-push
                      status:
                        type: string
                        example: RUNNING
                      started:
                        type: string
                        example: '2024-09-05T10:21:43.143601276Z'
                      links:
                        required:
                          - self
                        type: object
                        properties:
                          self:
                            type: string
                            example: /v1/mock-apis/0ozge/__admin/etc/jobs/fed0d523-df14-4614-9cf4-79454e7eccbd
                x-wiremock-hash: 345075986
              examples:
                main:
                  value:
                    job:
                      id: 5947aff3-947b-4dfb-90f5-d324684e97db
                      jobType: open-api-git-pull
                      status: ERROR
                      started: '2024-09-05T10:20:46.143759190Z'
                      links:
                        self: /v1/mock-apis/0ozge/__admin/etc/jobs/5947aff3-947b-4dfb-90f5-d324684e97db
                      finished: '2024-09-05T10:20:46.200386224Z'
                      elapsed: PT0.056627034S
                      outcome:
                        errorCode: NO_LOCAL_HEAD
                        errors:
                          - code: 112
                            title: No previous pull
                            detail: This is the first time pulling from Git.
                  x-parameter-values:
                    mockApiId: 0ozge
  /v1/mock-apis/{mockApiId}/imports:
    parameters:
      - $ref: '#/components/parameters/mockApiId'
    post:
      operationId: importIntoMockApi
      summary: Import into a mock API
      description: Import any supported format into your Mock API. The supplied data will be converted into stubs that your Mock API will be populated with. Supported formats include WireMock mappings JSON files, OpenAPI specifications, Postman collections, HAR (HTTP Archive) logs, WireMock request log JSON files and WireMock directories.
      tags:
        - Imports
      requestBody:
        content:
          '*/*':
            schema:
              $ref: '#/components/schemas/multi-import-file'
            examples:
              WireMock mappings JSON:
                value:
                  mappings:
                    - id: 7e6d6733-881e-416d-9f6c-bad8d5015d0f
                      name: Get v2 invoicing invoices by invoiceId
                      request:
                        urlPathTemplate: /v2/invoicing/invoices/{invoiceId}
                        method: GET
                        pathParameters:
                          invoiceId:
                            equalTo: INV2-NS4E-L7P4-RZ6B-KNZY
                      response:
                        status: 200
                        body: '{"id":"INV2-NS4E-L7P4-RZ6B-KNZY","status":"DRAFT","detail":{"reference":"<The reference data. Includes a post office (PO) number.>","currency_code":"USD","note":"<A note to the invoice recipient. Also appears on the invoice notification email.>","terms_and_conditions":"<The general terms of the invoice. Can include return or cancellation policy and other terms and conditions.>","memo":"<A private bookkeeping note for merchant.>","additional_data":"<Any additional information. Includes business hours.>","category_code":"SHIPPABLE","invoice_number":"17494664982","invoice_date":"2022-02-04","payment_term":{"term_type":"NET_10","due_date":"2022-02-14"},"viewed_by_recipient":false,"group_draft":false,"metadata":{"create_time":"2025-06-09T10:54:58Z","last_update_time":"2025-06-09T10:54:58Z","created_by_flow":"REGULAR_SINGLE","recipient_view_url":"https://www.sandbox.paypal.com/invoice/p/#NS4EL7P4RZ6BKNZY","invoicer_view_url":"https://www.sandbox.paypal.com/invoice/details/INV2-NS4E-L7P4-RZ6B-KNZY","caller_type":"API_V2_INVOICE","spam_info":{}},"archived":false},"invoicer":{"name":{"given_name":"David","surname":"Larusso","full_name":"David Larusso"},"address":{"address_line_1":"123 Townsend St","address_line_2":"Floor 6","admin_area_2":"San Francisco","admin_area_1":"CA","postal_code":"94107","country_code":"US"},"phones":[{"country_code":"001","national_number":"4085551234","phone_type":"MOBILE"}],"website":"www.example.com","tax_id":"XX-XXXXXXX","additional_notes":"<Any additional information. Includes business hours.>","logo_url":"https://example.com/logo.png"},"primary_recipients":[{"billing_info":{"name":{"given_name":"Stephanie","surname":"Meyers","full_name":"Stephanie Meyers"},"address":{"address_line_1":"1234 Main Street","admin_area_2":"Anytown","admin_area_1":"CA","postal_code":"98765","country_code":"US"},"email_address":"foobuyer@example.com"},"shipping_info":{"name":{"given_name":"Stephanie","surname":"Meyers","full_name":"Stephanie Meyers"},"address":{"address_line_1":"1234 Main Street","admin_area_2":"Anytown","admin_area_1":"CA","postal_code":"98765","country_code":"US"}}}],"items":[{"id":"ITEM-4M535543K7257150H","name":"Yoga Mat","description":"Elastic mat to practice yoga.","quantity":"1","unit_amount":{"currency_code":"USD","value":"50.00"},"tax":{"id":"TAX-1R2044969B8060438","name":"Sales Tax","percent":"7.25","amount":{"currency_code":"USD","value":"3.27"}},"discount":{"percent":"5","amount":{"currency_code":"USD","value":"-2.50"}},"unit_of_measure":"QUANTITY"},{"id":"ITEM-0SE42747HP857643T","name":"Yoga t-shirt","quantity":"1","unit_amount":{"currency_code":"USD","value":"10.00"},"tax":{"id":"TAX-1R2044969B8060438","name":"Sales Tax","percent":"7.25","amount":{"currency_code":"USD","value":"0.34"}},"discount":{"amount":{"currency_code":"USD","value":"-5.00"}},"unit_of_measure":"QUANTITY"}],"configuration":{"tax_calculated_after_discount":true,"tax_inclusive":false,"allow_tip":true,"partial_payment":{"allow_partial_payment":true,"minimum_amount_due":{"currency_code":"USD","value":"20.00"}},"allow_only_pay_by_bank":false,"template_id":"TEMP-0P400848HY4308238"},"amount":{"breakdown":{"item_total":{"currency_code":"USD","value":"60.00"},"discount":{"invoice_discount":{"percent":"5","amount":{"currency_code":"USD","value":"-2.63"}},"item_discount":{"currency_code":"USD","value":"-7.50"}},"tax_total":{"currency_code":"USD","value":"4.34"},"shipping":{"amount":{"currency_code":"USD","value":"10.00"},"tax":{"id":"TAX-1R2044969B8060438","name":"Sales Tax","percent":"7.25","amount":{"currency_code":"USD","value":"0.73"}}},"custom":{"label":"Packing Charges","amount":{"currency_code":"USD","value":"10.00"}}},"currency_code":"USD","value":"74.21"},"due_amount":{"currency_code":"USD","value":"74.21"},"links":[{"href":"https://api.sandbox.paypal.com/v2/invoicing/invoices/INV2-NS4E-L7P4-RZ6B-KNZY","rel":"self","method":"GET"},{"href":"https://api.sandbox.paypal.com/v2/invoicing/invoices/INV2-NS4E-L7P4-RZ6B-KNZY/send","rel":"send","method":"POST"},{"href":"https://api.sandbox.paypal.com/v2/invoicing/invoices/INV2-NS4E-L7P4-RZ6B-KNZY","rel":"replace","method":"PUT"},{"href":"https://api.sandbox.paypal.com/v2/invoicing/invoices/INV2-NS4E-L7P4-RZ6B-KNZY","rel":"delete","method":"DELETE"},{"href":"https://api.sandbox.paypal.com/v2/invoicing/invoices/INV2-NS4E-L7P4-RZ6B-KNZY/payments","rel":"record-payment","method":"POST"}],"unilateral":false}'
                        headers:
                          Strict-Transport-Security: max-age=31536000; includeSubDomains
                          Cache-Control: max-age=0, no-cache, no-store, must-revalidate
                          Vary: Accept-Encoding
                          Content-Type: application/json
                      persistent: true
                    - id: 2791b6fe-bbbe-4102-a3fd-721fb9ba1557
                      name: Create v2 invoicing invoices
                      request:
                        urlPathTemplate: /v2/invoicing/invoices
                        method: POST
                        bodyPatterns:
                          - equalToJson: |-
                              {
                                  "detail": {
                                      "invoice_number": "17494664982",
                                      "invoice_date": "2022-02-04",
                                      "payment_term": {
                                          "term_type": "NET_10",
                                          "due_date": "2022-02-14"
                                      },
                                      "currency_code": "USD",
                                      "reference": "<The reference data. Includes a post office (PO) number.>",
                                      "note": "<A note to the invoice recipient. Also appears on the invoice notification email.>",
                                      "terms_and_conditions": "<The general terms of the invoice. Can include return or cancellation policy and other terms and conditions.>",
                                      "memo": "<A private bookkeeping note for merchant.>"
                                  },
                                  "invoicer": {
                                      "name": {
                                          "given_name": "David",
                                          "surname": "Larusso"
                                      },
                                      "address": {
                                          "address_line_1": "123 Townsend St",
                                          "address_line_2": "Floor 6",
                                          "admin_area_2": "San Francisco",
                                          "admin_area_1": "CA",
                                          "postal_code": "94107",
                                          "country_code": "US"
                                      },
                                      "phones": [
                                          {
                                              "country_code": "001",
                                              "national_number": "4085551234",
                                              "phone_type": "MOBILE"
                                          }
                                      ],
                                      "website": "www.example.com",
                                      "tax_id": "XX-XXXXXXX",
                                      "logo_url": "https://example.com/logo.png",
                                      "additional_notes": "<Any additional information. Includes business hours.>"
                                  },
                                  "primary_recipients": [
                                      {
                                          "billing_info": {
                                              "name": {
                                                  "given_name": "Stephanie",
                                                  "surname": "Meyers"
                                              },
                                              "address": {
                                                  "address_line_1": "1234 Main Street",
                                                  "admin_area_2": "Anytown",
                                                  "admin_area_1": "CA",
                                                  "postal_code": "98765",
                                                  "country_code": "US"
                                              },
                                              "email_address": "foobuyer@example.com",
                                              "phones": [
                                                  {
                                                      "country_code": "001",
                                                      "national_number": "4884551234",
                                                      "phone_type": "HOME"
                                                  }
                                              ],
                                              "additional_info_value": "add-info"
                                          },
                                          "shipping_info": {
                                              "name": {
                                                  "given_name": "Stephanie",
                                                  "surname": "Meyers"
                                              },
                                              "address": {
                                                  "address_line_1": "1234 Main Street",
                                                  "admin_area_2": "Anytown",
                                                  "admin_area_1": "CA",
                                                  "postal_code": "98765",
                                                  "country_code": "US"
                                              }
                                          }
                                      }
                                  ],
                                  "items": [
                                      {
                                          "name": "Yoga Mat",
                                          "description": "Elastic mat to practice yoga.",
                                          "quantity": "1",
                                          "unit_amount": {
                                              "currency_code": "USD",
                                              "value": "50.00"
                                          },
                                          "tax": {
                                              "name": "Sales Tax",
                                              "percent": "7.25"
                                          },
                                          "discount": {
                                              "percent": "5"
                                          },
                                          "unit_of_measure": "QUANTITY"
                                      },
                                      {
                                          "name": "Yoga t-shirt",
                                          "quantity": "1",
                                          "unit_amount": {
                                              "currency_code": "USD",
                                              "value": "10.00"
                                          },
                                          "tax": {
                                              "name": "Sales Tax",
                                              "percent": "7.25"
                                          },
                                          "discount": {
                                              "amount": {
                                                  "currency_code": "USD",
                                                  "value": "5.00"
                                              }
                                          },
                                          "unit_of_measure": "QUANTITY"
                                      }
                                  ],
                                  "configuration": {
                                      "partial_payment": {
                                          "allow_partial_payment": true,
                                          "minimum_amount_due": {
                                              "currency_code": "USD",
                                              "value": "20.00"
                                          }
                                      },
                                      "allow_tip": true,
                                      "tax_calculated_after_discount": true,
                                      "tax_inclusive": false
                                  },
                                  "amount": {
                                      "breakdown": {
                                          "custom": {
                                              "label": "Packing Charges",
                                              "amount": {
                                                  "currency_code": "USD",
                                                  "value": "10.00"
                                              }
                                          },
                                          "shipping": {
                                              "amount": {
                                                  "currency_code": "USD",
                                                  "value": "10.00"
                                              },
                                              "tax": {
                                                  "name": "Sales Tax",
                                                  "percent": "7.25"
                                              }
                                          },
                                          "discount": {
                                              "invoice_discount": {
                                                  "percent": "5"
                                              }
                                          }
                                      }
                                  }
                              }
                            ignoreArrayOrder: true
                            ignoreExtraElements: true
                      response:
                        status: 201
                        body: '{"id":"INV2-NS4E-L7P4-RZ6B-KNZY","status":"DRAFT","detail":{"reference":"<The reference data. Includes a post office (PO) number.>","currency_code":"USD","note":"<A note to the invoice recipient. Also appears on the invoice notification email.>","terms_and_conditions":"<The general terms of the invoice. Can include return or cancellation policy and other terms and conditions.>","memo":"<A private bookkeeping note for merchant.>","additional_data":"<Any additional information. Includes business hours.>","category_code":"SHIPPABLE","invoice_number":"17494664982","invoice_date":"2022-02-04","payment_term":{"term_type":"NET_10","due_date":"2022-02-14"},"viewed_by_recipient":false,"group_draft":false,"metadata":{"create_time":"2025-06-09T10:54:58Z","last_update_time":"2025-06-09T10:54:58Z","created_by_flow":"REGULAR_SINGLE","recipient_view_url":"https://www.sandbox.paypal.com/invoice/p/#NS4EL7P4RZ6BKNZY","invoicer_view_url":"https://www.sandbox.paypal.com/invoice/details/INV2-NS4E-L7P4-RZ6B-KNZY","caller_type":"API_V2_INVOICE","spam_info":{}},"archived":false},"invoicer":{"name":{"given_name":"David","surname":"Larusso","full_name":"David Larusso"},"address":{"address_line_1":"123 Townsend St","address_line_2":"Floor 6","admin_area_2":"San Francisco","admin_area_1":"CA","postal_code":"94107","country_code":"US"},"phones":[{"country_code":"001","national_number":"4085551234","phone_type":"MOBILE"}],"website":"www.example.com","tax_id":"XX-XXXXXXX","additional_notes":"<Any additional information. Includes business hours.>","logo_url":"https://example.com/logo.png"},"primary_recipients":[{"billing_info":{"name":{"given_name":"Stephanie","surname":"Meyers","full_name":"Stephanie Meyers"},"address":{"address_line_1":"1234 Main Street","admin_area_2":"Anytown","admin_area_1":"CA","postal_code":"98765","country_code":"US"},"email_address":"foobuyer@example.com"},"shipping_info":{"name":{"given_name":"Stephanie","surname":"Meyers","full_name":"Stephanie Meyers"},"address":{"address_line_1":"1234 Main Street","admin_area_2":"Anytown","admin_area_1":"CA","postal_code":"98765","country_code":"US"}}}],"items":[{"id":"ITEM-4M535543K7257150H","name":"Yoga Mat","description":"Elastic mat to practice yoga.","quantity":"1","unit_amount":{"currency_code":"USD","value":"50.00"},"tax":{"id":"TAX-1R2044969B8060438","name":"Sales Tax","percent":"7.25","amount":{"currency_code":"USD","value":"3.27"}},"discount":{"percent":"5","amount":{"currency_code":"USD","value":"-2.50"}},"unit_of_measure":"QUANTITY"},{"id":"ITEM-0SE42747HP857643T","name":"Yoga t-shirt","quantity":"1","unit_amount":{"currency_code":"USD","value":"10.00"},"tax":{"id":"TAX-1R2044969B8060438","name":"Sales Tax","percent":"7.25","amount":{"currency_code":"USD","value":"0.34"}},"discount":{"amount":{"currency_code":"USD","value":"-5.00"}},"unit_of_measure":"QUANTITY"}],"configuration":{"tax_calculated_after_discount":true,"tax_inclusive":false,"allow_tip":true,"partial_payment":{"allow_partial_payment":true,"minimum_amount_due":{"currency_code":"USD","value":"20.00"}},"allow_only_pay_by_bank":false,"template_id":"TEMP-0P400848HY4308238"},"amount":{"breakdown":{"item_total":{"currency_code":"USD","value":"60.00"},"discount":{"invoice_discount":{"percent":"5","amount":{"currency_code":"USD","value":"-2.63"}},"item_discount":{"currency_code":"USD","value":"-7.50"}},"tax_total":{"currency_code":"USD","value":"4.34"},"shipping":{"amount":{"currency_code":"USD","value":"10.00"},"tax":{"id":"TAX-1R2044969B8060438","name":"Sales Tax","percent":"7.25","amount":{"currency_code":"USD","value":"0.73"}}},"custom":{"label":"Packing Charges","amount":{"currency_code":"USD","value":"10.00"}}},"currency_code":"USD","value":"74.21"},"due_amount":{"currency_code":"USD","value":"74.21"},"links":[{"href":"https://api.sandbox.paypal.com/v2/invoicing/invoices/INV2-NS4E-L7P4-RZ6B-KNZY","rel":"self","method":"GET"},{"href":"https://api.sandbox.paypal.com/v2/invoicing/invoices/INV2-NS4E-L7P4-RZ6B-KNZY/send","rel":"send","method":"POST"},{"href":"https://api.sandbox.paypal.com/v2/invoicing/invoices/INV2-NS4E-L7P4-RZ6B-KNZY","rel":"replace","method":"PUT"},{"href":"https://api.sandbox.paypal.com/v2/invoicing/invoices/INV2-NS4E-L7P4-RZ6B-KNZY","rel":"delete","method":"DELETE"},{"href":"https://api.sandbox.paypal.com/v2/invoicing/invoices/INV2-NS4E-L7P4-RZ6B-KNZY/payments","rel":"record-payment","method":"POST"}],"unilateral":false}'
                        headers:
                          Strict-Transport-Security: max-age=31536000; includeSubDomains
                          Cache-Control: max-age=0, no-cache, no-store, must-revalidate
                          Vary: Accept-Encoding
                          Location: https://api-m.sandbox.paypal.com:8443/v2/invoicing/invoices/INV2-NS4E-L7P4-RZ6B-KNZY
                          Content-Type: application/json
                      persistent: true
          multipart/form-data:
            schema:
              oneOf:
                - title: WireMock Directory
                  description: |-
                    A WireMock directory containing a `mappings` sub-directory and an optional `__files` sub-directory. The name of each part of the multipart request must be the path of the associated file including the root directory (e.g. `Content-Disposition: form-data; name="wiremock/mappings/hello-world.json"; filename="hello-world.json"`). Each file inside the `mappings` sub-directory must be a JSON file defining a stub mapping. See [Get stub mapping by ID](../stub-mappings/get-stub-mapping-by-id) to view the stub mapping schema.
                    Any response body files referenced via `response.bodyFileName` in the stub mappings must be provided in the `__files` sub-directory. Handlebars templates in `bodyFileName` values are not supported and will cause the import to fail.
                  type: object
                  patternProperties:
                    ^[^\/]+\/mappings\/[^\/]+.json$:
                      $ref: '#/components/schemas/stub-mapping'
                    ^[^\/]+\/__files\/[^\/]+$:
                      type: string
                      format: binary
                - title: File with Config
                  description: A multipart version of the standard file import with a separate part containing additional configuration for the import.
                  type: object
                  properties:
                    file:
                      $ref: '#/components/schemas/multi-import-file'
                    config:
                      type: object
                      $ref: '#/components/schemas/import-config'
                  required:
                    - file
        required: true
      responses:
        '200':
          description: Successfully imported
  /v1/mock-apis/{mockApiId}/version-history/commits:
    parameters:
      - $ref: '#/components/parameters/mockApiId'
      - $ref: '#/components/parameters/Limit'
      - $ref: '#/components/parameters/Page'
    get:
      operationId: getMockApiVersionHistoryCommits
      description: List the version history commits for a mock API.
      summary: Get a mock API's versions
      tags:
        - Mock API versioning
      responses:
        '200':
          description: 200 response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/VersionHistoryCommits'
        '403':
          $ref: '#/components/responses/403'
  /v1/mock-apis/{mockApiId}/version-history/commits/{versionCommitId}:
    parameters:
      - $ref: '#/components/parameters/mockApiId'
      - $ref: '#/components/parameters/VersionHistoryCommitId'
    get:
      operationId: getMockApiVersionHistoryCommitById
      description: Retrieve a single version history commit by ID.
      summary: Get a version by ID
      tags:
        - Mock API versioning
      responses:
        '200':
          description: 200 response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/VersionHistoryCommit'
        '403':
          $ref: '#/components/responses/403'
  /v1/mock-apis/{mockApiId}/version-history/commits/{versionCommitId}/items:
    parameters:
      - $ref: '#/components/parameters/mockApiId'
      - $ref: '#/components/parameters/VersionHistoryCommitId'
    get:
      operationId: getMockApiVersionHistoryCommitItems
      description: List every entity (stub, setting, etc.) captured in a given version.
      summary: Get all entities in a given version
      tags:
        - Mock API versioning
      responses:
        '200':
          description: 200 response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/VersionHistoryCommitItems'
        '403':
          $ref: '#/components/responses/403'
  /v1/mock-apis/{mockApiId}/version-history/commits/{versionCommitId}/changes:
    parameters:
      - $ref: '#/components/parameters/mockApiId'
      - $ref: '#/components/parameters/VersionHistoryCommitId'
      - $ref: '#/components/parameters/toLatestCommitParam'
      - $ref: '#/components/parameters/fromPreviousCommitParam'
      - $ref: '#/components/parameters/fromCommitParam'
    get:
      operationId: getMockApiVersionHistoryCommitChanges
      description: List everything that changed between two versions of a mock API.
      summary: Get all changes between one version and another
      tags:
        - Mock API versioning
      responses:
        '200':
          description: 200 response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/VersionHistoryCommitChanges'
        '403':
          $ref: '#/components/responses/403'
  /v1/mock-apis/{mockApiId}/version-history/commits/{versionCommitId}/changes/{entityType}/{entityId}:
    parameters:
      - $ref: '#/components/parameters/mockApiId'
      - $ref: '#/components/parameters/VersionHistoryCommitId'
      - $ref: '#/components/parameters/VersionHistoryEntityTypePathParam'
      - $ref: '#/components/parameters/VersionHistoryEntityIdPathParam'
      - $ref: '#/components/parameters/toLatestCommitParam'
      - $ref: '#/components/parameters/fromPreviousCommitParam'
      - $ref: '#/components/parameters/fromCommitParam'
    get:
      operationId: getMockApiVersionHistoryChange
      description: Retrieve the change to a single entity between two versions of a mock API.
      summary: Get the change to an entity between one version and another
      tags:
        - Mock API versioning
      responses:
        '200':
          description: 200 response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/VersionHistoryChange'
        '403':
          $ref: '#/components/responses/403'
  /v1/mock-apis/{mockApiId}/version-history/commits/{versionCommitId}/blob/{entityType}/{entityId}:
    parameters:
      - $ref: '#/components/parameters/mockApiId'
      - $ref: '#/components/parameters/VersionHistoryCommitId'
      - $ref: '#/components/parameters/VersionHistoryEntityTypePathParam'
      - $ref: '#/components/parameters/VersionHistoryEntityIdPathParam'
    get:
      operationId: getEntityContentsAtVersionHistoryCommit
      description: Retrieve the full contents of a single entity as it existed at a given version.
      summary: Get the contents of a entity at a given version
      tags:
        - Mock API versioning
      responses:
        '200':
          description: 200 response
          content:
            '*/*':
              schema:
                type: string
        '403':
          $ref: '#/components/responses/403'
  /v1/mock-apis/{mockApiId}/version-history/commits/{versionCommitId}/restore/{entityType}/{entityId}:
    parameters:
      - $ref: '#/components/parameters/mockApiId'
      - $ref: '#/components/parameters/VersionHistoryCommitId'
      - $ref: '#/components/parameters/VersionHistoryEntityTypePathParam'
      - $ref: '#/components/parameters/VersionHistoryEntityIdPathParam'
    post:
      operationId: restoreEntityToContentsAtVersionHistoryCommit
      description: Restore a single entity to its contents at a given version.
      summary: Restore the contents of an entity to a given version
      tags:
        - Mock API versioning
      responses:
        '200':
          description: 200 response
        '403':
          $ref: '#/components/responses/403'
  /v1/mock-apis/{mockApiId}/version-history/commits/{versionCommitId}/restore:
    parameters:
      - $ref: '#/components/parameters/mockApiId'
      - $ref: '#/components/parameters/VersionHistoryCommitId'
    post:
      operationId: restoreEntireMockApiToVersionHistoryCommit
      description: Restore every entity in a mock API to its contents at a given version.
      summary: Restore the contents of all mock API entities to a given version
      tags:
        - Mock API versioning
      responses:
        '200':
          description: 200 response
        '403':
          $ref: '#/components/responses/403'
  /v1/organisations/{organisationId}/hosts:
    parameters:
      - $ref: '#/components/parameters/OrganisationId'
    get:
      summary: Retrieve an organisation's mock hosts
      operationId: getOrganisationMockHosts
      description: List the mock hosts belonging to an organisation.
      tags:
        - Organisations
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                allOf:
                  - type: object
                    required:
                      - mockHosts
                    properties:
                      mockHosts:
                        type: array
                        items:
                          $ref: '#/components/schemas/MockHostData'
                  - $ref: '#/components/schemas/PaginationData'
  /v1/hosts/{mockHostId}:
    parameters:
      - in: path
        name: mockHostId
        description: The ID of the mock host
        required: true
        schema:
          type: string
    get:
      summary: Retrieve a mock host by ID
      operationId: getMockHostById
      description: Retrieve a single mock host's details by ID.
      tags:
        - Mock Hosts
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                type: object
                required:
                  - mockHost
                properties:
                  mockHost:
                    $ref: '#/components/schemas/MockHostData'
    put:
      summary: Update a mock host
      operationId: putMockHostById
      description: Update a mock host's details.
      tags:
        - Mock Hosts
      requestBody:
        content:
          application/json:
            schema:
              type: object
              required:
                - mockHost
              properties:
                mockHost:
                  type: object
                  required:
                    - role
                  properties:
                    role:
                      description: If DEFAULT, new Mock APIs will be automatically assigned to this host if it has fewer than any other host with role DEFAULT
                      type: string
                      enum:
                        - DEFAULT
                        - SPECIFIC
        required: true
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                type: object
                required:
                  - mockHost
                properties:
                  mockHost:
                    $ref: '#/components/schemas/MockHostData'
components:
  securitySchemes:
    tokenAuth:
      type: apiKey
      in: header
      name: Authorization
      description: Your [API key](https://app.wiremock.cloud/account/security) prefixed by 'Token '
  responses:
    '400':
      description: 400 Bad Request response
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Errors'
          example:
            errors:
              - title: Invalid query parameter format
                detail: The offset parameter value must be a positive integer
    '401':
      description: 401 Unauthenticated response
      content:
        text/plain:
          schema:
            type: string
          example: Credentials are required to access this resource.
    '403':
      description: 403 Unauthorized response
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Errors'
          example:
            errors:
              - title: Forbidden
                source: {}
    '404':
      description: 404 Not Found response
      content:
        application/json:
          schema:
            type: object
            properties:
              code:
                type: integer
              message:
                type: string
            required:
              - message
          example:
            code: 404
            message: HTTP 404 Not Found
    '409':
      description: 409 response
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Errors'
    '422':
      description: 422 Bad Entity response
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Errors'
          example:
            errors:
              - title: Invalid JSON
                detail: json pointer /mockApi not present; it is required and must have json type object
                source: {}
    '500':
      description: 500 Server Error response
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ServerError'
    CreateDataSourceResponse:
      description: Success
      content:
        application/json:
          schema:
            type: object
            properties:
              dataSource:
                $ref: '#/components/schemas/DataSourceResponse'
            required:
              - dataSource
          examples:
            csvDataSource:
              value:
                dataSource:
                  id: abc123
                  aclObject: jkl789
                  name: My data source
                  lastUpdatedTime: '2024-01-17T11:46:13.481826Z'
                  version: 3
                  type: CSV
                  columnsMetadata:
                    - name: fullname
                      type:
                        name: STRING
                    - name: dob
                      type:
                        name: DATE
                        format: iso8601
                    - name: admin
                      type:
                        name: BOOLEAN
                    - name: retryLimit
                      type:
                        name: INTEGER
                  state: ENABLED
                  links:
                    self: /v1/data-sources/abc123
                    acl: /v1/data-sources/abc123/acl{?subjectId}
            databaseDataSource:
              value:
                dataSource:
                  id: abc123
                  aclObject: jkl789
                  name: My database data source
                  lastUpdatedTime: '2024-01-17T11:46:13.481826Z'
                  version: 3
                  type: DATABASE
                  databaseConnection: zyx321
                  tableName: products
                  state: ENABLED
                  links:
                    self: /v1/data-sources/abc123
                    acl: /v1/data-sources/abc123/acl{?subjectId}
    GetDataSourceResponse:
      description: Success
      content:
        application/json:
          schema:
            type: object
            properties:
              dataSource:
                $ref: '#/components/schemas/GetDataSourceResponse'
            required:
              - dataSource
          examples:
            csvDataSourceNoRows:
              value:
                dataSource:
                  id: abc123
                  aclObject: jkl789
                  name: My data source
                  lastUpdatedTime: '2024-01-17T11:46:13.481826Z'
                  version: 3
                  type: CSV
                  columnsMetadata:
                    - name: fullname
                      type:
                        name: STRING
                    - name: dob
                      type:
                        name: DATE
                        format: iso8601
                    - name: admin
                      type:
                        name: BOOLEAN
                    - name: retryLimit
                      type:
                        name: INTEGER
                  state: ENABLED
                  links:
                    self: /v1/data-sources/abc123
                    acl: /v1/data-sources/abc123/acl{?subjectId}
            csvDataSourcePreviewRows:
              value:
                dataSource:
                  id: abc123
                  aclObject: jkl789
                  name: My data source
                  lastUpdatedTime: '2024-01-17T11:46:13.481826Z'
                  version: 3
                  type: CSV
                  columnsMetadata:
                    - name: fullname
                      type:
                        name: STRING
                    - name: dob
                      type:
                        name: DATE
                        format: iso8601
                    - name: admin
                      type:
                        name: BOOLEAN
                    - name: retryLimit
                      type:
                        name: INTEGER
                  rowsPreview:
                    - - Alice S
                      - '1975-05-31'
                      - 'true'
                      - '3'
                    - - Bob B
                      - '1959-11-16'
                      - 'false'
                      - '1'
                    - - Sam M
                      - '1999-07-02'
                      - 'false'
                      - '0'
                  state: ENABLED
                  links:
                    self: /v1/data-sources/abc123
                    acl: /v1/data-sources/abc123/acl{?subjectId}
            databaseDataSourceNoRows:
              value:
                dataSource:
                  id: abc123
                  aclObject: jkl789
                  name: My database data source
                  lastUpdatedTime: '2024-01-17T11:46:13.481826Z'
                  version: 3
                  type: DATABASE
                  databaseConnection: zyx321
                  tableName: products
                  state: ENABLED
                  links:
                    self: /v1/data-sources/abc123
                    acl: /v1/data-sources/abc123/acl{?subjectId}
            databaseDataSourcePreviewRows:
              value:
                dataSource:
                  id: abc123
                  aclObject: jkl789
                  name: My database data source
                  lastUpdatedTime: '2024-01-17T11:46:13.481826Z'
                  version: 3
                  type: DATABASE
                  databaseConnection: zyx321
                  tableName: products
                  columnsMetadata:
                    - name: fullname
                    - name: dob
                    - name: admin
                    - name: retryLimit
                  rowsPreview:
                    - - Alice S
                      - '1975-05-31'
                      - 'true'
                      - '3'
                    - - Bob B
                      - '1959-11-16'
                      - 'false'
                      - '1'
                    - - Sam M
                      - '1999-07-02'
                      - 'false'
                      - '0'
                  state: ENABLED
                  links:
                    self: /v1/data-sources/abc123
                    acl: /v1/data-sources/abc123/acl{?subjectId}
    CreateDatabaseConnectionResponse:
      description: Success
      content:
        application/json:
          schema:
            type: object
            properties:
              databaseConnection:
                $ref: '#/components/schemas/DatabaseConnectionResponse'
            required:
              - databaseConnection
          examples:
            databaseConnection:
              value:
                databaseConnection:
                  id: abc123
                  connectionName: My database connection
                  databaseType: POSTGRESQL
                  host: my-db.example.com
                  port: 5432
                  databaseName: my-test-data
                  username: alice
                  links:
                    self: /v1/data-connections/abc123
    TestDatabaseConnectionResponse:
      description: Success
      content:
        application/json:
          schema:
            allOf:
              - type: object
                properties:
                  outcome:
                    type: string
                    nullable: false
                    enum:
                      - SUCCESS
                      - FAILURE
                required:
                  - outcome
              - type: object
                properties:
                  errors:
                    type: array
                    nullable: false
                    items:
                      $ref: '#/components/schemas/SingleError'
          examples:
            successOutcome:
              value:
                outcome: SUCCESS
            failureOutcome:
              value:
                outcome: FAILURE
                errors:
                  - title: Could not connect to database.
                    detail: Password authentication attempt was rejected.
    stubMapping:
      description: The stub mapping
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/stub-mapping'
          examples:
            Simple:
              value:
                id: 76ada7b0-49ae-4229-91c4-396a36f18e09
                priority: 3
                request:
                  headers:
                    Accept:
                      equalTo: text/plain
                  method: GET
                  url: /some/thing
                response:
                  body: Hello world!
                  headers:
                    Content-Type: text/plain
                  status: 200
            Dynamic State:
              value:
                id: 76ada7b0-49ae-4229-91c4-396a36f18e09
                request:
                  method: GET
                  url: /some/thing
                  customMatcher:
                    name: require-state
                    parameters:
                      requirements:
                        - context: '{{ request.path.basketId }}'
                          key: basketItems
                          matchesJsonPath: $.[?(@.id == request.path.itemId)]
                response:
                  body: Hello world!
                  headers:
                    Content-Type: text/plain
                  status: 200
                  serveEventListeners:
                    name: change-state
                    parameters:
                      operations:
                        - operation: SET
                          context: '{{ request.path.basketId }}'
                          key: basketItems
                          value: '{{ jsonArrayAdd (val previousValue or=''[]'') request.body }}'
            Data Source:
              value:
                id: 76ada7b0-49ae-4229-91c4-396a36f18e09
                request:
                  method: GET
                  urlPathTemplate: /things/{thingId}
                  customMatcher:
                    name: data-exists
                    parameters:
                      id: jjl8y
                      query: id='{{ request.path.thingId }}' AND dob='1985-08-04'
                response:
                  body: Hello {{ data.items.0.name }}!
                  headers:
                    Content-Type: text/plain
                  status: 200
    badRequestEntity:
      description: Bad request body
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/bad-request-entity'
  schemas:
    UserLinks:
      type: object
      properties:
        self:
          type: string
        features:
          type: string
        teams:
          type: string
        mockApis:
          type: string
        apiTemplateCatalogues:
          type: string
        apiTemplates:
          type: string
        organisation:
          type: string
        plan:
          type: string
        usage:
          type: string
        grants:
          type: string
        catalogue:
          type: string
        next:
          type: string
        previous:
          type: string
        users:
          type: string
        subscription:
          type: string
        invitations:
          type: string
        paymentMethod:
          type: string
        href:
          type: string
    UserData:
      type: object
      properties:
        id:
          type: string
        username:
          type: string
        avatarUrl:
          type: string
        emailAddress:
          type: string
        marketingOptIn:
          type: boolean
        signupDate:
          type: string
        idpUserId:
          type: string
        userHash:
          type: string
        links:
          $ref: '#/components/schemas/UserLinks'
        hasNativeIdp:
          type: boolean
      required:
        - id
        - username
        - avatarUrl
        - emailAddress
        - marketingOptIn
        - signupDate
        - idpUserId
        - userHash
        - links
        - hasNativeIdp
    UserAccount:
      type: object
      properties:
        user:
          $ref: '#/components/schemas/UserData'
      required:
        - user
    SingleError:
      type: object
      properties:
        code:
          type: number
        title:
          type: string
        detail:
          type: string
        source:
          type: object
      required:
        - title
    Errors:
      type: object
      properties:
        errors:
          type: array
          items:
            $ref: '#/components/schemas/SingleError'
      required:
        - errors
    MockApiType:
      type: string
      description: The type of the mock API. Defaults to the "unstructured" type if not specified.
      nullable: true
      enum:
        - openapi
        - grpc
        - graphql
    MockApiData:
      type: object
      properties:
        id:
          type: string
        name:
          type: string
          maxLength: 256
          description: The display name of the mock API.
        description:
          type: string
          maxLength: 256
          description: The description of the mock API.
        type:
          $ref: '#/components/schemas/MockApiType'
        state:
          type: string
          description: Whether the API is running or stopped.
        adminSecurityEnabled:
          type: boolean
          description: Whether security is enabled on the mock API's `/__admin/*` endpoints.
        createdDate:
          type: string
        aclObject:
          description: The ACL object ID of the entity.
          type: string
        mockHost:
          description: The ID of the mock host where this mock API is located.
          type: string
          nullable: true
        links:
          type: object
          properties:
            self:
              type: string
            requests:
              type: string
            mappings:
              type: string
            scenarios:
              type: string
            securitySettings:
              type: string
            recordings:
              type: object
              properties:
                start:
                  type: string
                stop:
                  type: string
                status:
                  type: string
                snapshot:
                  type: string
              required:
                - start
                - stop
                - status
                - snapshot
            imports:
              type: string
            exports:
              type: object
              properties:
                wiremock:
                  type: string
              required:
                - wiremock
            organisation:
              type: string
            invitations:
              type: string
            acl:
              type: string
              description: The link to the access control list for this mock API.
            versionHistoryCommits:
              type: string
          required:
            - self
            - requests
            - mappings
            - scenarios
            - recordings
            - imports
            - organisation
            - invitations
            - acl
            - versionHistoryCommits
        domainNames:
          type: array
          items:
            type: object
            properties:
              domainName:
                type: string
              urls:
                type: array
                items:
                  type: object
                  properties:
                    url:
                      type: string
                  required:
                    - url
            required:
              - domainName
              - urls
        baseUrl:
          type: string
        domains:
          type: array
          description: The list of domain names that can be used to address this mock API.
          items:
            type: string
      required:
        - id
        - name
        - state
        - adminSecurityEnabled
        - exportState
        - createdDate
        - links
        - domainNames
        - baseUrl
        - domains
    PaginationMeta:
      type: object
      properties:
        start:
          type: integer
          minimum: 1
          description: The starting index of the current page
          example: 20
        end:
          type: integer
          minimum: 1
          description: The ending index of the current page
          example: 29
        total:
          type: integer
          minimum: 1
          description: The total number of items available
          example: 48
        page:
          type: integer
          minimum: 1
          description: The current page number
          example: 3
        totalPages:
          type: integer
          minimum: 1
          description: The total number of pages available
          example: 5
      required:
        - start
        - end
        - total
        - page
        - totalPages
    PaginationLinks:
      type: object
      properties:
        self:
          type: string
          description: URL path to the user's APIs with optional query parameters
          example: /v1/users/abc12/apis?q=training&limit=20&page=1
      additionalProperties:
        type: string
        description: URL path for any other link type
      required:
        - self
    MockApis:
      type: object
      properties:
        mockApis:
          type: array
          items:
            $ref: '#/components/schemas/MockApiData'
        meta:
          $ref: '#/components/schemas/PaginationMeta'
        links:
          $ref: '#/components/schemas/PaginationLinks'
      required:
        - mockApis
    TeamData:
      type: object
      properties:
        id:
          type: string
        name:
          type: string
        aclObject:
          description: The ACL object ID of the entity.
          type: string
        aclSubject:
          description: The ACL subject ID of the entity.
          type: string
        links:
          type: object
          properties:
            organisation:
              type: string
            aclSubject:
              type: string
            aclObject:
              type: string
            acl:
              type: string
      required:
        - id
        - name
        - links
    Teams:
      type: object
      properties:
        teams:
          type: array
          items:
            $ref: '#/components/schemas/TeamData'
        meta:
          $ref: '#/components/schemas/PaginationMeta'
        links:
          $ref: '#/components/schemas/PaginationLinks'
    Organisation:
      type: object
      properties:
        organisation:
          type: object
          properties:
            id:
              type: string
            name:
              type: string
            emailAddress:
              type: string
            aclObject:
              description: The ACL object ID of the entity.
              type: string
            aclSubject:
              description: The ACL subject ID of the entity.
              type: string
            links:
              type: object
              properties:
                self:
                  type: string
                users:
                  type: string
                accounts:
                  type: string
                teams:
                  type: string
                subscription:
                  type: string
                paymentMethod:
                  type: string
                invitations:
                  type: string
                s3AuditSinks:
                  type: string
                mockHosts:
                  type: string
                aclSubject:
                  type: string
                aclObject:
                  type: string
                acl:
                  type: string
          required:
            - id
            - name
            - emailAddress
            - links
      required:
        - organisation
    ServerError:
      type: object
      properties:
        code:
          type: number
        message:
          type: string
      required:
        - code
        - message
    IdSchema:
      type: string
      minLength: 5
      maxLength: 10
      example: jjl8y
    UserAccounts:
      type: object
      properties:
        users:
          type: array
          items:
            type: object
            properties:
              id:
                type: string
              username:
                type: string
              avatarUrl:
                type: string
              emailAddress:
                type: string
              links:
                type: object
                properties:
                  self:
                    type: string
                  teams:
                    type: string
                  mockApis:
                    type: string
                  apiTemplateCatalogues:
                    type: string
                  apiTemplates:
                    type: string
                  organisation:
                    type: string
                required:
                  - self
                  - teams
                  - mockApis
                  - apiTemplateCatalogues
                  - apiTemplates
                  - organisation
            required:
              - id
              - username
              - avatarUrl
              - emailAddress
              - links
        meta:
          $ref: '#/components/schemas/PaginationMeta'
        links:
          $ref: '#/components/schemas/PaginationLinks'
      required:
        - users
    InvitationData:
      required:
        - created
        - id
        - links
        - newUser
        - recipientEmailAddress
        - role
        - senderId
      type: object
      properties:
        id:
          type: string
          example: neqek
        senderId:
          type: string
          example: 9gd5l
          description: The ID of the user sending the invitation.
        recipientEmailAddress:
          type: string
          example: tom+docsmember2@wiremock.io
          description: The email address of the user being invited.
        newUser:
          type: boolean
          example: true
          description: Indicates whether the invited user already existed in the system.
        role:
          type: string
          description: The role of the new user within the organisation.
          enum:
            - organisation_admin
            - organisation_member
            - team_admin
            - team_member
            - mock_api_admin
            - mock_api_editor
            - mock_api_user
            - api_template_admin
            - api_template_editor
            - api_template_user
            - api_template_catalogue_admin
            - api_template_catalogue_editor
            - api_template_catalogue_user
            - data_source_admin
            - data_source_editor
            - data_source_user
            - key_admin
            - key_editor
            - key_user
        aclObjectId:
          type: string
          description: The ACL ID of the entity the user is invited to join. If null, the user is not invited to a particular entity, but simply to the organisation.
          example: 8ndxc
          nullable: true
        created:
          type: string
          example: '2024-10-30T19:28:23.802551Z'
        links:
          required:
            - self
          type: object
          properties:
            self:
              type: string
              example: /v1/organisations/mgk7g/invitations/neqek
    InvitationRequest:
      required:
        - invitation
      type: object
      properties:
        invitation:
          required:
            - recipientEmailAddress
            - role
          type: object
          properties:
            role:
              type: string
              enum:
                - organisation_admin
                - organisation_member
                - team_admin
                - team_member
                - mock_api_admin
                - mock_api_editor
                - mock_api_user
                - api_template_admin
                - api_template_editor
                - api_template_user
                - api_template_catalogue_admin
                - api_template_catalogue_editor
                - api_template_catalogue_user
                - data_source_admin
                - data_source_editor
                - data_source_user
                - key_admin
                - key_editor
                - key_user
              example: organisation_admin
              description: The role of the new user within the organisation.
            aclObjectId:
              type: string
              description: |
                The ACL ID of the entity to invite the user to join. The `role` field must be valid for the type of ACL entity the user is being invited to. For instance, if the ACL entity is a team, the provided `role` must be either `team_member` or `team_admin`. If null, the user is not invited to a particular entity, but simply to the organisation.
              example: 8ndxc
              nullable: true
            recipientEmailAddress:
              type: string
              example: docsmember2@example.com
              description: The email address of the user being invited.
    Invitation:
      required:
        - invitation
      type: object
      properties:
        invitation:
          $ref: '#/components/schemas/InvitationData'
    Empty:
      type: object
    DataSourceResponseBase:
      type: object
      properties:
        id:
          type: string
        name:
          type: string
        aclObject:
          description: The ACL object ID of the entity.
          type: string
        lastUpdatedTime:
          type: string
        version:
          type: number
        type:
          type: string
          enum:
            - CSV
            - DATABASE
        state:
          type: string
          enum:
            - ENABLED
            - DISABLED
        links:
          type: object
          properties:
            self:
              type: string
            acl:
              type: string
          required:
            - self
            - acl
      required:
        - id
        - name
        - lastUpdatedTime
        - version
        - type
        - state
        - links
    DataSourceColumnMetadata:
      type: object
      properties:
        name:
          type: string
        type:
          type: object
          properties:
            name:
              type: string
      required:
        - name
        - type
    DataSourceResponseCsvBase:
      type: object
      properties:
        type:
          enum:
            - CSV
        columnsMetadata:
          type: array
          items:
            $ref: '#/components/schemas/DataSourceColumnMetadata'
      required:
        - columnsMetadata
    DataSourceResponseDatabaseBase:
      type: object
      properties:
        type:
          enum:
            - DATABASE
        databaseConnection:
          type: string
        tableName:
          type: string
      required:
        - databaseConnection
        - tableName
    DataSourceResponse:
      allOf:
        - $ref: '#/components/schemas/DataSourceResponseBase'
        - oneOf:
            - title: CSV
              $ref: '#/components/schemas/DataSourceResponseCsvBase'
            - title: Database
              $ref: '#/components/schemas/DataSourceResponseDatabaseBase'
    PaginationData:
      type: object
      properties:
        links:
          type: object
          properties:
            self:
              type: string
            next:
              type: string
            previous:
              type: string
          required:
            - self
        meta:
          type: object
          properties:
            start:
              type: number
            end:
              type: number
            total:
              type: number
            page:
              type: number
            totalPages:
              type: number
          required:
            - start
            - end
            - total
            - page
            - totalPages
      required:
        - links
        - meta
    DataSources:
      allOf:
        - type: object
          properties:
            dataSources:
              type: array
              items:
                $ref: '#/components/schemas/DataSourceResponse'
          required:
            - dataSources
        - $ref: '#/components/schemas/PaginationData'
    GetDataSourceResponse:
      allOf:
        - $ref: '#/components/schemas/DataSourceResponseBase'
        - oneOf:
            - title: CSV
              allOf:
                - $ref: '#/components/schemas/DataSourceResponseCsvBase'
                - type: object
                  properties:
                    rowsPreview:
                      description: A preview of the data contained in the data source. Present if and only if `data-view` query parameter is set to `preview`.
                      type: array
                      nullable: false
                      items:
                        type: array
                        items:
                          type: string
            - title: Database
              allOf:
                - $ref: '#/components/schemas/DataSourceResponseDatabaseBase'
                - type: object
                  properties:
                    columnsMetadata:
                      description: An ordered list of the names of each column of the data contained in the data source. Present if and only if `data-view` query parameter is set to `preview`.
                      type: array
                      nullable: false
                      items:
                        type: object
                        nullable: false
                        properties:
                          name:
                            description: The name of the column.
                            type: string
                            nullable: false
                    rowsPreview:
                      description: A preview of the data contained in the data source. Present if and only if `data-view` query parameter is set to `preview`.
                      type: array
                      nullable: false
                      items:
                        type: array
                        items:
                          type: string
    DatabaseConnectionCoordsBase:
      type: object
      nullable: false
      properties:
        databaseType:
          description: The SQL flavour of the database.
          type: string
          enum:
            - POSTGRESQL
            - MYSQL
            - SQLSERVER
            - ORACLE
        host:
          description: The host name or address of the database.
          type: string
          nullable: false
        port:
          description: The port number of the database.
          type: integer
          nullable: false
        databaseName:
          description: The name of the database.
          type: string
          nullable: false
        username:
          description: The name of the user to connect to the database as.
          type: string
          nullable: false
      required:
        - databaseType
        - host
        - port
        - databaseName
        - username
    DatabaseConnectionBase:
      allOf:
        - type: object
          nullable: false
          properties:
            connectionName:
              description: The name of the connection, for display purposes.
              type: string
              nullable: false
          required:
            - connectionName
        - $ref: '#/components/schemas/DatabaseConnectionCoordsBase'
    DatabaseConnectionResponse:
      allOf:
        - type: object
          properties:
            id:
              description: The ID of the connection.
              type: string
              nullable: false
          required:
            - id
        - $ref: '#/components/schemas/DatabaseConnectionBase'
        - type: object
          properties:
            links:
              type: object
              nullable: false
              properties:
                self:
                  type: string
                  nullable: false
              required:
                - self
          required:
            - links
    DatabaseConnections:
      allOf:
        - type: object
          nullable: false
          properties:
            databaseConnections:
              type: array
              items:
                $ref: '#/components/schemas/DatabaseConnectionResponse'
          required:
            - databaseConnections
        - $ref: '#/components/schemas/PaginationData'
    DatabaseConnectionCoords:
      allOf:
        - $ref: '#/components/schemas/DatabaseConnectionCoordsBase'
        - type: object
          properties:
            password:
              description: The password of the user to connect to the database as.
              type: string
              nullable: false
          required:
            - password
    CreateMockApiRequest:
      type: object
      properties:
        mockApi:
          type: object
          properties:
            name:
              type: string
              maxLength: 256
              description: The display name of the mock API.
            description:
              type: string
              maxLength: 256
              description: The description of the mock API.
            apiTemplateId:
              type: string
              description: The ID of the API template from which to derive this mock API. The mock API will be blank if this is not specified.
            type:
              $ref: '#/components/schemas/MockApiType'
            hostname:
              type: string
              description: |
                The friendly, unqualified domain name for this mock API's base URL
                e.g. in the SaaS edition, for a base URL of `https://my-api.wiremockapi.cloud` this value should be set to `my-api`.
          required:
            - name
    MockApi:
      type: object
      properties:
        mockApi:
          $ref: '#/components/schemas/MockApiData'
      required:
        - mockApi
    UpdateMockApiRequest:
      type: object
      properties:
        mockApi:
          type: object
          properties:
            name:
              type: string
              maxLength: 256
              description: The display name of the mock API.
            description:
              type: string
              maxLength: 256
              description: The description of the mock API.
            adminSecurityEnabled:
              type: boolean
              description: Whether security is enabled on the mock API's `/acl/*` endpoints.
            hostname:
              type: string
              description: |
                The friendly, unqualified domain name for this mock API's base URL
                e.g. in the SaaS edition, for a base URL of `https://my-api.wiremockapi.cloud` this value should be set to `my-api`.
          required:
            - name
      required:
        - mockApi
    Usage:
      type: object
      properties:
        usage:
          type: object
          properties:
            id:
              type: string
            currentPeriodStart:
              type: string
            currentPeriodEnd:
              type: string
            stubCalledCount:
              type: number
            organisationMemberCount:
              type: number
            invitationCount:
              type: number
            seatLimit:
              type:
                - number
                - 'null'
            totalMockApiCount:
              type: number
            totalDataSourceCount:
              type: number
            totalDatabaseConnectionCount:
              type: number
            ownMockApiCount:
              type: number
            teamMockApiCount:
              type: number
            collaboratorCount:
              type: number
            totalSeatCount:
              type: number
            teamMemberCount:
              type: number
            totalTeamCount:
              type: number
          required:
            - id
            - currentPeriodStart
            - currentPeriodEnd
            - stubCalledCount
            - organisationMemberCount
            - invitationCount
            - seatLimit
            - totalMockApiCount
            - totalDataSourceCount
            - totalDatabaseConnectionCount
            - ownMockApiCount
            - teamMockApiCount
            - collaboratorCount
            - totalSeatCount
            - teamMemberCount
            - totalTeamCount
      required:
        - usage
    Team:
      type: object
      properties:
        team:
          $ref: '#/components/schemas/TeamData'
      required:
        - team
    UserSummary:
      type: object
      properties:
        id:
          type: string
          example: 6j84g
        username:
          type: string
          example: docs-teamboss@example.com
        avatarUrl:
          type: string
          example: https://s.gravatar.com/avatar/57cd30a5c7ebfb10eee28b5fbf85e84d?s=480&r=pg&d=https%3A%2F%2Fcdn.auth0.com%2Favatars%2Fto.png
        emailAddress:
          type: string
          example: docs-teamboss@example.com
        links:
          required:
            - apiTemplateCatalogues
            - apiTemplates
            - dataSources
            - features
            - keys
            - mockApis
            - organisation
            - progress
            - self
            - teams
          type: object
          properties:
            self:
              type: string
              example: /v1/users/6j84g
            features:
              type: string
              example: /v1/users/6j84g/features
            progress:
              type: string
              example: /v1/users/6j84g/progress
            teams:
              type: string
              example: /v1/users/6j84g/teams
            mockApis:
              type: string
              example: /v1/users/6j84g/apis
            apiTemplateCatalogues:
              type: string
              example: /v1/users/6j84g/api-template-catalogues
            apiTemplates:
              type: string
              example: /v1/users/6j84g/api-templates
            dataSources:
              type: string
              example: /v1/users/6j84g/data-sources
            keys:
              type: string
              example: /v1/users/6j84g/jwks
            organisation:
              type: string
              example: /v1/organisations/p0wqg
      required:
        - avatarUrl
        - emailAddress
        - id
        - links
        - username
    AddMemberRequest:
      type: object
      properties:
        member:
          required:
            - memberId
            - permissionFriendlyId
          type: object
          properties:
            memberId:
              type: string
              description: The ID of the team member to add.
              example: eglq6
            permissionFriendlyId:
              type: string
              enum:
                - team_member
                - team_admin
              description: The role the member will have in the team. Must be one of team_member or team_admin.
              example: team_member
      required:
        - member
    EntityAclCandidates:
      required:
        - candidates
      type: object
      properties:
        candidates:
          type: array
          items:
            required:
              - links
              - name
            type: object
            properties:
              name:
                type: string
                example: All in organisation
              links:
                required:
                  - self
                type: object
                properties:
                  self:
                    required:
                      - href
                    type: object
                    properties:
                      href:
                        type: string
                        example: /v1/mock-apis/l36le/acl/organisation/mgk7g
    Grant:
      required:
        - grant
      type: object
      properties:
        grant:
          required:
            - role
          type: object
          properties:
            role:
              type: string
              description: |
                The friendly ID of the role. Valid values are dependent on the entity type
                e.g. when the entity type is `mock-api` the valid roles are the ones prefixed with `mock_api_`
              enum:
                - mock_api_user
                - mock_api_editor
                - mock_api_admin
                - team_member
                - team_admin
                - organisation_member
                - organisation_admin
              example: mock_api_editor
    equal-to-pattern:
      title: String equals
      type: object
      required:
        - equalTo
      properties:
        equalTo:
          type: string
        caseInsensitive:
          type: boolean
    base64-string:
      title: Base64 string
      type: string
      pattern: ^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$
      description: A base64 encoded string used to describe binary data.
    binary-equal-to-pattern:
      title: Binary equals
      type: object
      required:
        - binaryEqualTo
      properties:
        binaryEqualTo:
          $ref: '#/components/schemas/base64-string'
    contains-pattern:
      title: String contains
      type: object
      properties:
        contains:
          type: string
      required:
        - contains
    does-not-contain-pattern:
      title: String does not contain
      type: object
      properties:
        doesNotContain:
          type: string
      required:
        - doesNotContain
    matches-pattern:
      title: Regular expression match
      type: object
      properties:
        matches:
          type: string
      required:
        - matches
    does-not-match-pattern:
      title: Negative regular expression match
      type: object
      properties:
        doesNotMatch:
          type: string
      required:
        - doesNotMatch
    content-pattern:
      type: object
      title: Content pattern
      oneOf:
        - $ref: '#/components/schemas/equal-to-pattern'
        - $ref: '#/components/schemas/binary-equal-to-pattern'
        - $ref: '#/components/schemas/contains-pattern'
        - $ref: '#/components/schemas/does-not-contain-pattern'
        - $ref: '#/components/schemas/matches-pattern'
        - $ref: '#/components/schemas/does-not-match-pattern'
        - $ref: '#/components/schemas/not-pattern'
        - $ref: '#/components/schemas/before-pattern'
        - $ref: '#/components/schemas/after-pattern'
        - $ref: '#/components/schemas/equal-to-date-time-pattern'
        - $ref: '#/components/schemas/equal-to-json-pattern'
        - $ref: '#/components/schemas/matches-json-path-pattern'
        - $ref: '#/components/schemas/equal-to-xml-pattern'
        - $ref: '#/components/schemas/matches-xpath-pattern'
        - $ref: '#/components/schemas/matches-json-schema-pattern'
        - $ref: '#/components/schemas/absent-pattern'
        - $ref: '#/components/schemas/and-pattern'
        - $ref: '#/components/schemas/or-pattern'
        - $ref: '#/components/schemas/has-exactly-multivalue-pattern'
        - $ref: '#/components/schemas/includes-multivalue-pattern'
    not-pattern:
      title: NOT modifier
      type: object
      properties:
        not:
          $ref: '#/components/schemas/content-pattern'
      required:
        - not
    dateTimeExpression:
      type: string
      example: now +3 days
    format:
      type: string
      example: yyyy-MM-dd
    truncation:
      type: string
      enum:
        - first second of minute
        - first minute of hour
        - first hour of day
        - first day of month
        - first day of next month
        - last day of month
        - first day of year
        - first day of next year
        - last day of year
      example: first day of month
    before-pattern:
      title: Before datetime
      type: object
      properties:
        before:
          $ref: '#/components/schemas/dateTimeExpression'
        actualFormat:
          $ref: '#/components/schemas/format'
        truncateExpected:
          $ref: '#/components/schemas/truncation'
        truncateActual:
          $ref: '#/components/schemas/truncation'
      required:
        - before
    after-pattern:
      title: Before datetime
      type: object
      properties:
        after:
          $ref: '#/components/schemas/dateTimeExpression'
        actualFormat:
          $ref: '#/components/schemas/format'
        truncateExpected:
          $ref: '#/components/schemas/truncation'
        truncateActual:
          $ref: '#/components/schemas/truncation'
      required:
        - after
    equal-to-date-time-pattern:
      title: Before datetime
      type: object
      properties:
        equalToDateTime:
          $ref: '#/components/schemas/dateTimeExpression'
        actualFormat:
          $ref: '#/components/schemas/format'
        truncateExpected:
          $ref: '#/components/schemas/truncation'
        truncateActual:
          $ref: '#/components/schemas/truncation'
      required:
        - equalToDateTime
    equal-to-json-pattern:
      title: JSON equals
      type: object
      properties:
        equalToJson:
          type: string
          example: |
            { "message": "hello" }
        ignoreExtraElements:
          type: boolean
        ignoreArrayOrder:
          type: boolean
      required:
        - equalToJson
    matches-json-path-pattern:
      title: JSONPath match
      type: object
      properties:
        matchesJsonPath:
          oneOf:
            - type: string
              example: $.name
            - type: object
              allOf:
                - properties:
                    expression:
                      type: string
                      example: $.name
                - $ref: '#/components/schemas/content-pattern'
              required:
                - expression
      required:
        - matchesJsonPath
    equal-to-xml-pattern:
      title: XML equality
      type: object
      properties:
        equalToXml:
          type: string
          example: <amount>123</amount>
        enablePlaceholders:
          type: boolean
        placeholderOpeningDelimiterRegex:
          type: string
          example: '['
        placeholderClosingDelimiterRegex:
          type: string
          example: ']'
      required:
        - equalToXml
    matches-xpath-pattern:
      title: XPath match
      type: object
      properties:
        matchesXPath:
          oneOf:
            - type: string
              example: //Order/Amount
            - type: object
              allOf:
                - properties:
                    expression:
                      type: string
                      example: //Order/Amount
                - $ref: '#/components/schemas/content-pattern'
              required:
                - expression
        xPathNamespaces:
          type: object
          additionalProperties:
            type: string
      required:
        - matchesXPath
    matches-json-schema-pattern:
      title: JSON Schema match
      type: object
      properties:
        matchesJsonSchema:
          oneOf:
            - type: string
              example: //Order/Amount
            - type: object
              allOf:
                - properties:
                    expression:
                      type: string
                      example: //Order/Amount
                - $ref: '#/components/schemas/content-pattern'
              required:
                - expression
        xPathNamespaces:
          type: object
          additionalProperties:
            type: string
      required:
        - matchesJsonSchema
    absent-pattern:
      title: Absent matcher
      type: object
      properties:
        absent:
          type: boolean
      required:
        - absent
    and-pattern:
      title: Logical AND matcher
      type: object
      properties:
        and:
          type: array
          items:
            $ref: '#/components/schemas/content-pattern'
      required:
        - and
    or-pattern:
      title: Logical AND matcher
      type: object
      properties:
        or:
          type: array
          items:
            $ref: '#/components/schemas/content-pattern'
      required:
        - or
    has-exactly-multivalue-pattern:
      title: Has exactly multi value matcher
      type: object
      properties:
        hasExactly:
          type: array
          items:
            $ref: '#/components/schemas/content-pattern'
      required:
        - hasExactly
    includes-multivalue-pattern:
      title: Has exactly multi value matcher
      type: object
      properties:
        includes:
          type: array
          items:
            $ref: '#/components/schemas/content-pattern'
      required:
        - includes
    request-pattern:
      type: object
      example: |
        {
          "urlPath" : "/charges",
          "method" : "POST",
          "headers" : {
            "Content-Type" : {
              "equalTo" : "application/json"
            }
          }
      properties:
        scheme:
          type: string
          enum:
            - http
            - https
          description: The scheme (protocol) part of the request URL
        host:
          type: string
          description: The hostname part of the request URL
        port:
          type: integer
          minimum: 1
          maximum: 65535
          description: The HTTP port number of the request URL
        method:
          type: string
          pattern: ^[A-Z]+$
          description: The HTTP request method e.g. GET
        url:
          type: string
          description: The path and query to match exactly against. Only one of url, urlPattern, urlPath or urlPathPattern may be specified.
        urlPath:
          type: string
          description: The path to match exactly against. Only one of url, urlPattern, urlPath or urlPathPattern may be specified.
        urlPathPattern:
          type: string
          description: The path regex to match against. Only one of url, urlPattern, urlPath or urlPathPattern may be specified.
        urlPattern:
          type: string
          description: The path and query regex to match against. Only one of url, urlPattern, urlPath or urlPathPattern may be specified.
        pathParameters:
          type: object
          description: |
            Path parameter patterns to match against in the <key>: { "<predicate>": "<value>" } form. Can only
            be used when the urlPathPattern URL match type is in use and all keys must be present as variables
            in the path template.
          additionalProperties:
            $ref: '#/components/schemas/content-pattern'
        queryParameters:
          type: object
          description: 'Query parameter patterns to match against in the <key>: { "<predicate>": "<value>" } form'
          additionalProperties:
            $ref: '#/components/schemas/content-pattern'
        formParameters:
          type: object
          description: 'application/x-www-form-urlencoded form parameter patterns to match against in the <key>: { "<predicate>": "<value>" } form'
          additionalProperties:
            $ref: '#/components/schemas/content-pattern'
        headers:
          type: object
          description: 'Header patterns to match against in the <key>: { "<predicate>": "<value>" } form'
          additionalProperties:
            $ref: '#/components/schemas/content-pattern'
        basicAuthCredentials:
          type: object
          description: Pre-emptive basic auth credentials to match against
          properties:
            password:
              type: string
            username:
              type: string
          required:
            - username
            - password
        cookies:
          type: object
          description: 'Cookie patterns to match against in the <key>: { "<predicate>": "<value>" } form'
          additionalProperties:
            $ref: '#/components/schemas/content-pattern'
        bodyPatterns:
          type: array
          description: 'Request body patterns to match against in the <key>: { "<predicate>": "<value>" } form'
          items:
            $ref: '#/components/schemas/content-pattern'
        customMatcher:
          oneOf:
            - title: Dynamic State Matcher
              description: Require the state of the Mock API to match the provided patterns. More information on this feature can be found [here](../../dynamic-state/overview).
              type: object
              properties:
                name:
                  type: string
                  enum:
                    - require-state
                parameters:
                  type: object
                  properties:
                    requirements:
                      type: array
                      items:
                        allOf:
                          - type: object
                            properties:
                              context:
                                description: The context of the item to match. Can be templated.
                                type: string
                              key:
                                description: The key of the item to match. Cannot be templated.
                                type: string
                            required:
                              - key
                          - $ref: '#/components/schemas/content-pattern'
                  required:
                    - requirements
              required:
                - name
                - parameters
            - title: Data Source Matcher
              description: Fetch some data from a data source and, optionally, only match if data is found. More information on this feature can be found [here](../../data-sources/overview).
              type: object
              properties:
                name:
                  type: string
                  enum:
                    - data-exists
                parameters:
                  type: object
                  properties:
                    id:
                      description: The ID of the data source to query.
                      type: string
                      minLength: 5
                      maxLength: 10
                      example: jjl8y
                    query:
                      description: The WHERE clause to apply to the fetch query. Can be templated.
                      type: string
                      default: ''
                    matcherEnabled:
                      description: Whether the fetch query must return some data for the stub to match
                      type: boolean
                      default: true
                  required:
                    - id
              required:
                - name
                - parameters
        multipartPatterns:
          type: array
          description: Multipart patterns to match against headers and body.
          items:
            type: object
            properties:
              name:
                type: string
              matchingType:
                type: string
                description: Determines whether all or any of the parts must match the criteria for an overall match.
                default: ANY
                enum:
                  - ALL
                  - ANY
              headers:
                type: object
                description: 'Header patterns to match against in the <key>: { "<predicate>": "<value>" } form'
                additionalProperties:
                  $ref: '#/components/schemas/content-pattern'
              bodyPatterns:
                type: array
                description: 'Body patterns to match against in the <key>: { "<predicate>": "<value>" } form'
                items:
                  $ref: '#/components/schemas/content-pattern'
    delay-distribution:
      type: object
      description: The delay distribution. Determines how response delays are distributed across requests.
      oneOf:
        - title: Log normal
          description: Log normally distributed random response delay.
          type: object
          properties:
            median:
              type: number
              description: 50th percentile of the distribution in milliseconds.
            sigma:
              type: number
              description: Standard deviation of the underlying normal distribution. A larger value produces a longer tail.
            maxValue:
              type: number
              description: Maximum value in milliseconds to truncate the distribution at. Must be greater than or equal to median. Omit to disable truncation.
            type:
              type: string
              enum:
                - lognormal
          required:
            - median
            - sigma
        - title: Uniform
          description: Uniformly distributed random response delay.
          type: object
          properties:
            lower:
              type: integer
              description: Lower bound of the delay range in milliseconds (inclusive).
            upper:
              type: integer
              description: Upper bound of the delay range in milliseconds (inclusive).
            type:
              type: string
              enum:
                - uniform
          required:
            - lower
            - upper
        - title: Fixed
          description: Fixed response delay.
          type: object
          properties:
            milliseconds:
              type: integer
              description: Fixed delay duration in milliseconds.
            type:
              type: string
              enum:
                - fixed
          required:
            - milliseconds
        - title: None
          description: No delay distribution. Clears any previously configured distribution.
          type: object
          properties:
            type:
              type: string
              enum:
                - none
          required:
            - type
    response-definition:
      allOf:
        - type: object
          properties:
            status:
              type: integer
              description: The HTTP status code to be returned
            statusMessage:
              type: string
              description: The HTTP status message to be returned
            headers:
              type: object
              description: Map of response headers to send
              additionalProperties:
                type: string
            additionalProxyRequestHeaders:
              type: object
              description: Extra request headers to send when proxying to another host.
              additionalProperties:
                type: string
            removeProxyRequestHeaders:
              type: array
              description: Request headers to remove when proxying to another host.
              items:
                type: string
            body:
              type: string
              description: The response body as a string. Only one of body, base64Body, jsonBody or bodyFileName may be specified.
            base64Body:
              $ref: '#/components/schemas/base64-string'
            jsonBody:
              description: The response body as a JSON object. Only one of body, base64Body, jsonBody or bodyFileName may be specified.
            bodyFileName:
              type: string
              description: |
                The path to the file containing the response body, relative to the configured file root. Only one of body, base64Body, jsonBody or bodyFileName may be specified. **Not supported when creating or importing a single stub** — use a WireMock directory import instead. When importing a WireMock directory, the referenced file must exist under `__files`; Handlebars templates in this value are not supported.
              example: user-profile-responses/user1.json
            fault:
              type: string
              description: The fault to apply (instead of a full, valid response).
              enum:
                - CONNECTION_RESET_BY_PEER
                - EMPTY_RESPONSE
                - MALFORMED_RESPONSE_CHUNK
                - RANDOM_DATA_THEN_CLOSE
            fixedDelayMilliseconds:
              type: integer
              description: Number of milliseconds to delay be before sending the response.
            delayDistribution:
              $ref: '#/components/schemas/delay-distribution'
            chunkedDribbleDelay:
              type: object
              description: The parameters for chunked dribble delay - chopping the response into pieces and sending them at delayed intervals
              properties:
                numberOfChunks:
                  type: integer
                totalDuration:
                  type: integer
              required:
                - numberOfChunks
                - totalDuration
            fromConfiguredStub:
              type: boolean
              description: Read-only flag indicating false if this was the default, unmatched response. Not present otherwise.
            proxyBaseUrl:
              type: string
              description: The base URL of the target to proxy matching requests to.
            proxyUrlPrefixToRemove:
              type: string
              description: A path segment to remove from the beginning in incoming request URL paths before proxying to the target.
            transformerParameters:
              type: object
              description: Parameters to apply to response transformers.
            transformers:
              type: array
              description: List of names of transformers to apply to this response.
              items:
                type: string
    stub-mapping:
      type: object
      properties:
        id:
          type: string
          description: This stub mapping's unique identifier
        uuid:
          type: string
          description: Alias for the id
        name:
          type: string
          description: The stub mapping's name
        request:
          $ref: '#/components/schemas/request-pattern'
        response:
          $ref: '#/components/schemas/response-definition'
        persistent:
          type: boolean
          description: Indicates that the stub mapping should be persisted immediately on create/update/delete and survive resets to default.
        priority:
          type: integer
          description: This stub mapping's priority relative to others. 1 is highest.
          minimum: 1
        scenarioName:
          type: string
          description: The name of the scenario that this stub mapping is part of
        requiredScenarioState:
          type: string
          description: The required state of the scenario in order for this stub to be matched.
        newScenarioState:
          type: string
          description: The new state for the scenario to be updated to after this stub is served.
        postServeActions:
          type: object
          description: A map of the names of post serve action extensions to trigger and their parameters.
        serveEventListeners:
          type: array
          description: The list of serve event listeners
          items:
            oneOf:
              - title: Dynamic State Operations
                description: Operations to alter the state of your mock API. More information on this feature can be found [here](../../dynamic-state/overview).
                type: object
                properties:
                  name:
                    type: string
                    enum:
                      - change-state
                  parameters:
                    type: object
                    properties:
                      operations:
                        description: |
                          A set of state related operations to perform when the stub is matched.
                          Each operation can be one of the following type, dictated by the `operation` property:
                          * `SET` - set the value of a state item in the state cache.
                          * `DELETE` - delete a state item from the state cache.
                          * `DELETE_CONTEXT` - delete all state items within a context from the state cache.
                          * `REQUEST_VAR` - set a variable that will be available for the lifetime of the request.
                        type: array
                        items:
                          allOf:
                            - type: object
                              properties:
                                operation:
                                  description: The operation to perform.
                                  type: string
                                  enum:
                                    - SET
                                    - DELETE
                                    - DELETE_CONTEXT
                                    - REQUEST_VAR
                              required:
                                - operation
                            - oneOf:
                                - title: SET
                                  type: object
                                  properties:
                                    operation:
                                      enum:
                                        - SET
                                    context:
                                      description: The context of the item to set the value of. Can be templated.
                                      type: string
                                    key:
                                      description: The key of the item to set the value of. Can be templated.
                                      type: string
                                    value:
                                      description: The value to set the item to. Can be templated.
                                      type: string
                                  required:
                                    - context
                                    - key
                                    - value
                                - title: DELETE
                                  type: object
                                  properties:
                                    operation:
                                      enum:
                                        - DELETE
                                    context:
                                      description: The context of the item to delete. Can be templated.
                                      type: string
                                    key:
                                      description: The key of the item to delete. Can be templated.
                                      type: string
                                  required:
                                    - context
                                    - key
                                - title: DELETE_CONTEXT
                                  type: object
                                  properties:
                                    operation:
                                      enum:
                                        - DELETE_CONTEXT
                                    context:
                                      description: The context to delete. Can be templated.
                                      type: string
                                  required:
                                    - context
                                - title: REQUEST_VAR
                                  type: object
                                  properties:
                                    operation:
                                      enum:
                                        - REQUEST_VAR
                                    key:
                                      description: The key of the variable to create. Cannot be templated.
                                      type: string
                                    value:
                                      description: The value to set the variable to. Can be templated.
                                      type: string
                                  required:
                                    - key
                                    - value
                    required:
                      - operations
        metadata:
          type: object
          description: Arbitrary metadata to be used for e.g. tagging, documentation. Can also be used to find and remove stubs.
      additionalProperties: false
    stub-mappings:
      type: object
      properties:
        mappings:
          type: array
          items:
            $ref: '#/components/schemas/stub-mapping'
        meta:
          type: object
          properties:
            total:
              type: integer
              example: 4
          required:
            - total
      additionalProperties: false
    bad-request-entity:
      title: Bad request entity
      type: object
      properties:
        errors:
          type: array
          items:
            type: object
            properties:
              code:
                type: integer
              source:
                type: string
              title:
                type: string
              detail:
                type: string
    record-spec:
      type: object
      properties:
        captureHeaders:
          type: object
          additionalProperties:
            type: object
            additionalProperties: false
            properties:
              caseInsensitive:
                type: boolean
          description: Headers from the request to include in the generated stub mappings, mapped to parameter objects. The only parameter available is "caseInsensitive", which defaults to false
          example:
            Accept: {}
            Content-Type:
              caseInsensitive: true
        extractBodyCriteria:
          type: object
          description: Criteria for extracting response bodies to a separate file instead of including it in the stub mapping
          example:
            binarySizeThreshold: 1 Mb
            textSizeThreshold: 2 kb
          properties:
            binarySizeThreshold:
              type: string
              default: '0'
              description: Size threshold for extracting binary response bodies. Supports humanized size strings, e.g. "56 Mb". Default unit is bytes.
              example: 18.2 GB
            textSizeThreshold:
              default: '0'
              description: Size threshold for extracting binary response bodies. Supports humanized size strings, e.g. "56 Mb". Default unit is bytes.
              example: 18.2 GB
              type: string
        persist:
          type: boolean
          default: true
          description: Whether to save stub mappings to the file system or just return them
        repeatsAsScenarios:
          type: boolean
          default: true
          description: When true, duplicate requests will be added to a Scenario. When false, duplicates are discarded
        requestBodyPattern:
          type: object
          description: Control the request body matcher used in generated stub mappings
          oneOf:
            - type: object
              description: Automatically determine matcher based on content type (the default)
              properties:
                caseInsensitive:
                  type: boolean
                  default: false
                  description: If equalTo is used, match body use case-insensitive string comparison
                ignoreArrayOrder:
                  type: boolean
                  default: true
                  description: If equalToJson is used, ignore order of array elements
                ignoreExtraElements:
                  type: boolean
                  default: true
                  description: If equalToJson is used, matcher ignores extra elements in objects
                matcher:
                  type: string
                  enum:
                    - auto
            - type: object
              description: Always match request bodies using equalTo
              properties:
                caseInsensitive:
                  default: false
                  description: Match body using case-insensitive string comparison
                  type: boolean
                matcher:
                  enum:
                    - equalTo
                  type: string
            - type: object
              description: Always match request bodies using equalToJson
              properties:
                ignoreArrayOrder:
                  default: true
                  description: Ignore order of array elements
                  type: boolean
                ignoreExtraElements:
                  default: true
                  description: Ignore extra elements in objects
                  type: boolean
                matcher:
                  enum:
                    - equalToJson
                  type: string
            - type: object
              description: Always match request bodies using equalToXml
              properties:
                matcher:
                  type: string
                  enum:
                    - equalToXml
        transformerParameters:
          type: object
          description: List of names of stub mappings transformers to apply to generated stubs
        transformers:
          type: array
          description: Parameters to pass to stub mapping transformers
          items:
            type: string
    scenario:
      type: object
      properties:
        id:
          type: string
          description: The scenario ID
          example: c8d249ec-d86d-48b1-88a8-a660e6848042
        name:
          type: string
          description: The scenario name
          example: my_scenario
        possibleStates:
          type: array
          items:
            default: Started
            description: All the states this scenario can be in
            type: string
          example:
            - Started
            - state_1
            - state_2
        state:
          type: string
          default: Started
          description: The current state of this scenario
          example: state_2
    scenarioSummary:
      type: object
      properties:
        name:
          type: string
          description: The scenario name
          example: my_scenario
        state:
          type: string
          default: Started
          description: The current state of this scenario
          example: state_2
    ChaosSettings:
      type: object
      description: Chaos testing settings for introducing random failures into mock API responses.
      properties:
        enabled:
          type: boolean
          description: Master switch to enable or disable chaos testing.
        percentageFailures:
          type: number
          format: double
          description: Percentage of requests that should receive a failure response.
          minimum: 0
          maximum: 100
        socketClose:
          type: object
          description: Randomly close the socket without sending a response.
          properties:
            enabled:
              type: boolean
        socketReset:
          type: object
          description: Randomly reset the socket connection.
          properties:
            enabled:
              type: boolean
        invalidHttp:
          type: object
          description: Randomly return an invalid HTTP response.
          properties:
            enabled:
              type: boolean
        longDelay:
          type: object
          description: Randomly introduce a long delay before responding.
          properties:
            enabled:
              type: boolean
            durationMillis:
              type: integer
              description: Duration of the delay in milliseconds.
        httpErrors:
          type: array
          description: HTTP error status codes to randomly return.
          items:
            type: object
            properties:
              status:
                type: integer
                description: HTTP status code (400-599).
                minimum: 400
                maximum: 599
    OpenApiSettings:
      type: object
      description: OpenAPI integration settings for the mock API.
      properties:
        portalEnabled:
          type: boolean
          description: Enable or disable the OpenAPI Developer Portal.
        portalSecurity:
          type: object
          description: Security configuration for the Developer Portal.
          required:
            - type
          properties:
            type:
              type: string
              description: The type of security to apply to the Developer Portal.
              enum:
                - NONE
                - OIDC
        validationMode:
          type: string
          default: none
          description: |
            OpenAPI request/response validation mode. See
            [OpenAPI Validation](/openAPI/openapi-validation) for full detail.

            A newly created mock API uses `soft`, and updating a mock API's settings
            without an `openApiSettings` object leaves the mode as `soft`. However,
            when an `openApiSettings` object is supplied with `validationMode` omitted,
            the mode is set to `none` — so set it explicitly to avoid unintentionally
            disabling validation.

            - `none`: no validation; no effect on the mock API.
            - `soft`: requests/responses that do not conform to the OpenAPI document
              are flagged with validation warnings in the request log.
            - `hard`: as `soft`, and invalid requests additionally receive a generic
              error response describing the validation issues.
            - `hard_spec_compliant`: as `hard`, but error responses use the body and
              `Content-Type` declared in your OpenAPI spec, and carry the raw failures
              in an `X-WMC-OpenAPI-Validation-Errors` header.
          enum:
            - none
            - soft
            - hard
            - hard_spec_compliant
        generateOpenApiFromStubs:
          type: boolean
          description: Automatically generate an OpenAPI description from stub mappings.
        generateStubsFromOpenApi:
          type: boolean
          description: Automatically generate stub mappings from the OpenAPI description.
        generateDefaultStubs:
          type: boolean
          description: Generate default/generic stubs from the OpenAPI description.
    StateSettings:
      type: object
      description: State management settings for the mock API.
      properties:
        defaultContextExpression:
          type: string
          description: Default expression used to determine the state context for requests.
    RateLimit:
      type: object
      description: A rate limit configuration.
      required:
        - rate
        - unit
      properties:
        rate:
          type: integer
          description: Number of requests allowed per time unit.
        unit:
          type: string
          description: Time unit for the rate limit.
          enum:
            - seconds
            - minutes
        burst:
          type: integer
          description: Maximum burst capacity. Defaults to the rate value if not specified.
    RateLimitWithId:
      type: object
      description: A rate limit configuration with its identifier.
      required:
        - id
        - rate
        - unit
      properties:
        id:
          type: string
          description: Unique identifier for this rate limit.
        rate:
          type: integer
          description: Number of requests allowed per time unit.
        unit:
          type: string
          description: Time unit for the rate limit.
          enum:
            - seconds
            - minutes
            - hours
            - days
        burst:
          type: integer
          description: Maximum burst capacity. Defaults to the rate value if not specified.
    OpenApi:
      required:
        - openApi
      type: object
      properties:
        openApi:
          required:
            - doc
          type: object
          properties:
            doc:
              type: string
              example: ''
      openapi: 3.1.0
      info:
        title: Customer Contacts Management API
        description: API for managing customer contacts including personal and professional details
        version: 1.0.0
      servers:
        - url: https://dev-openapi-testing.wiremockapi.cloud
    multi-import-file:
      oneOf:
        - title: WireMock mappings JSON
          description: A JSON file containing WireMock stub mappings.
          type: object
          nullable: false
          properties:
            mappings:
              type: array
              nullable: false
              items:
                $ref: '#/components/schemas/stub-mapping'
          required:
            - mappings
        - title: OpenAPI specification
          description: Any valid OpenAPI specification.
          type: string
          format: binary
        - title: Postman collection
          description: Any valid Postman collection.
          type: string
          format: binary
        - title: HAR Log
          description: Any valid HAR (HTTP Archive) log file.
          type: string
          format: binary
        - title: WireMock Request Log
          description: A request log returned from the [Get all requests endpoint](../requests/get-all-requests-in-journal).
          type: object
          nullable: false
          additionalProperties: true
    import-config:
      name: import-config
      description: Configures how stubs should be generated when importing or recording
      type: object
      properties:
        import:
          type: object
          properties:
            duplicatePolicy:
              description: For OpenAPI specification imports only. Whether existing stubs that match endpoints in the OpenAPI specification should be overwritten, or new ones should be generated instead.
              type: string
              enum:
                - ALWAYS_CREATE_NEW
                - ALWAYS_OVERWRITE
              default: ALWAYS_OVERWRITE
            copiedHeaderNames:
              description: Set of header names to copy from the original request when generating stubs
              type: array
              items:
                type: string
              default: []
            basePath:
              description: Base path to prepend to all imported endpoints
              type: string
              default: ''
            prefer400ForInvalidRequestBody:
              description: Whether to prefer 400 status code for invalid request body responses
              type: boolean
              default: false
            useJsonSchemas:
              description: Whether to use JSON schemas for request/response validation
              type: boolean
              default: false
            syncTimeout:
              description: Timeout duration for synchronous operations (ISO 8601 duration format)
              type: string
              format: duration
              default: PT3S
            generateDefaultStubs:
              description: Whether to generate default stubs for endpoints without explicit responses
              type: boolean
              default: true
            stubTemplateTransformationRules:
              type: array
              description: A set of rules for transforming stub templates. All matching rules will be applied to the template. If multiple rules define matchers with the same name, the last rule will win.
              default: []
              items:
                type: object
                properties:
                  filter:
                    description: A filter that must match the serve event for the template to be applied to the generated stub. If not provided the template will always be applied.
                    properties:
                      request:
                        description: Request pattern for filtering
                        $ref: '#/components/schemas/request-pattern'
                  template:
                    description: A template for creating matchers to apply to the generated stub. The macro `{{ recordedValue}}` may be used in the right hand side of a matcher.
                    properties:
                      request:
                        description: Template of matchers to be added to the stub's request pattern
                        $ref: '#/components/schemas/request-pattern'
    VersionHistoryCommitData:
      type: object
      properties:
        id:
          description: The ID of the version.
          type: string
        date:
          description: The date-time that the version was created.
          type: string
        author:
          type: object
          nullable: true
          properties:
            id:
              description: The ID of the user that created this version.
              type: string
            username:
              description: The username of the user that created this version.
              type: string
          required:
            - id
            - username
        links:
          type: object
          properties:
            self:
              type: string
            items:
              type: string
            restore:
              type: string
            changes:
              type: string
          required:
            - self
            - items
            - restore
            - changes
      required:
        - id
        - date
        - author
    VersionHistoryCommits:
      type: object
      properties:
        versionCommits:
          type: array
          items:
            $ref: '#/components/schemas/VersionHistoryCommitData'
        meta:
          $ref: '#/components/schemas/PaginationMeta'
        links:
          $ref: '#/components/schemas/PaginationLinks'
      required:
        - versionCommits
        - meta
        - links
    VersionHistoryCommit:
      type: object
      properties:
        versionCommit:
          $ref: '#/components/schemas/VersionHistoryCommitData'
      required:
        - versionCommit
    VersionHistoryCommitItemData:
      type: object
      properties:
        entityType:
          description: The type of the entity.
          type: string
          enum:
            - stub_mapping
            - settings
            - grpc_descriptor
            - graphql_schema
            - openapi_document
        entityId:
          description: The ID of the entity. This is only relevant for entities of type `stub_mapping`.
          type: string
          nullable: true
        links:
          type: object
          properties:
            self:
              type: string
            contents:
              type: string
            restore:
              type: string
    VersionHistoryCommitItems:
      type: object
      properties:
        items:
          type: array
          items:
            $ref: '#/components/schemas/VersionHistoryCommitItemData'
        meta:
          $ref: '#/components/schemas/PaginationMeta'
        links:
          $ref: '#/components/schemas/PaginationLinks'
      required:
        - items
        - meta
        - links
    VersionHistoryChangeData:
      type: object
      properties:
        operation:
          description: The type of operation that was performed on the entity.
          type: string
          enum:
            - created
            - modified
            - deleted
        entityType:
          description: The type of the entity.
          type: string
          enum:
            - stub_mapping
            - settings
            - grpc_descriptor
            - graphql_schema
            - openapi_document
        entityId:
          description: The ID of the entity. This is only relevant for entities of type `stub_mapping`.
          type: string
          nullable: true
        links:
          type: object
          properties:
            self:
              type: string
            contentsBefore:
              description: A link to the contents of the entity at the version that took place first. No link is supplied if the entity did not exist in this version.
              type: string
              nullable: true
            contentsAfter:
              description: A link to the contents of the entity at the version that took place second. No link is supplied if the entity did not exist in this version.
              type: string
              nullable: true
            restoreBefore:
              description: A link to restore the contents of the entity to the version that took place first.
              type: string
            restoreAfter:
              description: A link to restore the contents of the entity to the version that took place second.
              type: string
          required:
            - self
            - restoreBefore
            - restoreAfter
      required:
        - id
        - operation
        - entityType
        - links
    VersionHistoryChange:
      type: object
      properties:
        versionChange:
          $ref: '#/components/schemas/VersionHistoryChangeData'
      required:
        - versionChange
    VersionHistoryCommitChanges:
      type: object
      properties:
        versionChanges:
          type: array
          items:
            $ref: '#/components/schemas/VersionHistoryChange'
        meta:
          $ref: '#/components/schemas/PaginationMeta'
        links:
          $ref: '#/components/schemas/PaginationLinks'
      required:
        - versionChanges
        - meta
        - links
    MockHostData:
      type: object
      required:
        - id
        - name
        - links
      properties:
        id:
          description: The ID of the mock host.
          type: string
        name:
          description: A human-readable name for the mock host.
          type: string
          nullable: true
        friendlyHostname:
          description: A domain that addresses the mock host.
          type: string
        role:
          description: If DEFAULT, new Mock APIs will be automatically assigned to this host if it has fewer than any other host with role DEFAULT
          type: string
          enum:
            - DEFAULT
            - SPECIFIC
        links:
          type: object
          properties:
            self:
              type: string
  parameters:
    Limit:
      name: limit
      in: query
      required: false
      schema:
        type: integer
        minimum: 1
      example: 10
    Page:
      name: page
      in: query
      required: false
      schema:
        type: integer
        minimum: 1
      example: 3
    OrganisationId:
      in: path
      name: organisationId
      description: The ID of the organisation
      required: true
      schema:
        $ref: '#/components/schemas/IdSchema'
    mockApiId:
      in: path
      name: mockApiId
      description: The ID of the Mock API
      required: true
      schema:
        $ref: '#/components/schemas/IdSchema'
    EntityCollection:
      name: entityCollection
      description: Specifies the plural of the entity type for which ACL candidates should be retrieved.
      in: path
      required: true
      schema:
        type: string
        enum:
          - mock-apis
          - data-sources
      example: mock-apis
    EntityId:
      name: entityId
      description: The ID of the entity (mock API, data source etc.)
      in: path
      required: true
      schema:
        $ref: '#/components/schemas/IdSchema'
    SubjectType:
      name: subjectType
      description: The type of subject in the context of an ACL.
      in: path
      required: true
      schema:
        type: string
        enum:
          - user
          - team
          - organisation
      example: user
    SubjectEntityId:
      name: subjectEntityId
      description: The ID of a subject entity (user, team, organisation)
      in: path
      required: true
      schema:
        $ref: '#/components/schemas/IdSchema'
    VersionHistoryCommitId:
      in: path
      name: versionCommitId
      description: The ID of the version
      required: true
      schema:
        $ref: '#/components/schemas/IdSchema'
    toLatestCommitParam:
      in: query
      name: toLatest
      description: Show the changes between the requested version and the latest version.
      schema:
        type: boolean
    fromPreviousCommitParam:
      in: query
      name: fromPrevious
      description: Show the changes between the requested version and the previous version. This is the default if no parameter is supplied.
      schema:
        type: boolean
    fromCommitParam:
      in: query
      name: fromCommit
      description: |
        Show the changes between the requested version and the version identified by the parameter value. The "from" version must have taken place before the requested version.
      schema:
        $ref: '#/components/schemas/IdSchema'
    VersionHistoryEntityTypePathParam:
      in: path
      name: entityType
      description: The type of the entity.
      required: true
      schema:
        type: string
        enum:
          - mappings
          - settings
          - grpc-dsc
          - graphql-schema
          - openapi-doc
    VersionHistoryEntityIdPathParam:
      in: path
      name: entityId
      required: true
      description: The ID of the entity. This path segment should be provided if and only if the `entityType` path segment is `mappings`.
      schema:
        type: string
  requestBodies:
    CreateDataSourceRequestBody:
      required: true
      content:
        application/json:
          schema:
            type: object
            nullable: false
            properties:
              dataSource:
                allOf:
                  - type: object
                    nullable: false
                    properties:
                      name:
                        description: The name of the data source, for display purposes.
                        type: string
                        nullable: false
                      type:
                        description: The type of the data source. The type of a data source dictates where the data source's data comes from.
                        type: string
                        nullable: false
                        enum:
                          - CSV
                          - DATABASE
                        default: CSV
                    required:
                      - name
                  - oneOf:
                      - title: CSV
                        type: object
                        properties:
                          type:
                            enum:
                              - CSV
                          columnsMetadata:
                            description: A description of the format of each column of the data source's data.
                            type: array
                            nullable: false
                            items:
                              $ref: '#/components/schemas/DataSourceColumnMetadata'
                          rows:
                            description: The data source's data. Each item in the outer array represents a row, while each item in each inner array represents a cell in that row.
                            type: array
                            nullable: false
                            items:
                              type: array
                              nullable: false
                              items:
                                type: string
                        required:
                          - columnsMetadata
                          - rows
                      - title: Database
                        type: object
                        properties:
                          type:
                            enum:
                              - DATABASE
                          databaseConnection:
                            description: The ID of the database connection this data source retrieves its data from.
                            type: string
                            nullable: false
                          tableName:
                            description: The name of the table or view in the database that this data source retrieves its data from.
                            type: string
                            nullable: false
                        required:
                          - type
                          - databaseConnection
                          - tableName
            required:
              - dataSource
          examples:
            csvDataSource:
              value:
                dataSource:
                  name: My data source
                  type: CSV
                  columnsMetadata:
                    - name: fullname
                      type:
                        name: STRING
                    - name: dob
                      type:
                        name: DATE
                        format: iso8601
                    - name: admin
                      type:
                        name: BOOLEAN
                    - name: retryLimit
                      type:
                        name: INTEGER
                  rows:
                    - - Alice S
                      - '1975-05-31'
                      - 'true'
                      - '3'
                    - - Bob B
                      - '1959-11-16'
                      - 'false'
                      - '1'
                    - - Sam M
                      - '1999-07-02'
                      - 'false'
                      - '0'
            databaseDataSource:
              value:
                dataSource:
                  name: My database data source
                  type: DATABASE
                  databaseConnection: zyx321
                  tableName: products
    CreateDatabaseConnectionRequestBody:
      required: true
      content:
        application/json:
          schema:
            type: object
            properties:
              databaseConnection:
                allOf:
                  - $ref: '#/components/schemas/DatabaseConnectionBase'
                  - type: object
                    properties:
                      password:
                        description: The password of the user to connect to the database as.
                        type: string
                        nullable: false
                    required:
                      - password
            required:
              - databaseConnection
          examples:
            databaseConnection:
              value:
                databaseConnection:
                  connectionName: My database connection
                  databaseType: POSTGRESQL
                  host: my-db.example.com
                  port: 5432
                  databaseName: my-test-data
                  username: alice
                  password: mysecretpassword
    UpdateDatabaseConnectionRequestBody:
      required: true
      content:
        application/json:
          schema:
            type: object
            properties:
              databaseConnection:
                allOf:
                  - $ref: '#/components/schemas/DatabaseConnectionBase'
                  - type: object
                    properties:
                      password:
                        description: The password of the user to connect to the database as. If this field is omitted, the password is unchanged.
                        type: string
                        nullable: false
            required:
              - databaseConnection
          examples:
            databaseConnection:
              value:
                databaseConnection:
                  connectionName: My database connection
                  databaseType: POSTGRESQL
                  host: my-db.example.com
                  port: 5432
                  databaseName: my-test-data
                  username: alice
                  password: mysecretpassword
    stubMapping:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/stub-mapping'
          examples:
            Simple:
              value:
                request:
                  method: GET
                  url: /some/thing
                response:
                  body: Hello world!
                  headers:
                    Content-Type: text/plain
                  status: 200
            Dynamic State:
              value:
                id: 76ada7b0-49ae-4229-91c4-396a36f18e09
                request:
                  method: GET
                  url: /some/thing
                  customMatcher:
                    name: require-state
                    parameters:
                      requirements:
                        - context: '{{ request.path.basketId }}'
                          key: basketItems
                          matchesJsonPath: $.[?(@.id == request.path.itemId)]
                response:
                  body: Hello world!
                  headers:
                    Content-Type: text/plain
                  status: 200
                  serveEventListeners:
                    name: change-state
                    parameters:
                      operations:
                        - operation: SET
                          context: '{{ request.path.basketId }}'
                          key: basketItems
                          value: '{{ jsonArrayAdd (val previousValue or=''[]'') request.body }}'
            Data Source:
              value:
                id: 76ada7b0-49ae-4229-91c4-396a36f18e09
                request:
                  method: GET
                  urlPathTemplate: /things/{thingId}
                  customMatcher:
                    name: data-exists
                    parameters:
                      id: jjl8y
                      query: id='{{ request.path.thingId }}' AND dob='1985-08-04'
                response:
                  body: Hello {{ data.items.0.name }}!
                  headers:
                    Content-Type: text/plain
                  status: 200
    requestPattern:
      required: true
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/request-pattern'
          example:
            method: POST
            url: /resource
            headers:
              Content-Type:
                matches: .*/xml
    startRecording:
      required: true
      content:
        application/json:
          schema:
            allOf:
              - $ref: '#/components/schemas/record-spec'
              - properties:
                  filters:
                    allOf:
                      - $ref: '#/components/schemas/request-pattern'
                      - description: Filter requests for which to create stub mapping
                  targetBaseUrl:
                    type: string
                    description: Target URL when using the record and playback API
                    example: https://example.wiremock.org
          example:
            targetBaseUrl: http://example.mocklab.io
            filters:
              urlPathPattern: /api/.*
              method: GET
            captureHeaders:
              Accept: {}
              Content-Type:
                caseInsensitive: true
            requestBodyPattern:
              matcher: equalToJson
              ignoreArrayOrder: false
              ignoreExtraElements: true
            extractBodyCriteria:
              textSizeThreshold: '2048'
              binarySizeThreshold: '10240'
            persist: false
            repeatsAsScenarios: false
            transformers:
              - modify-response-header
            transformerParameters:
              headerValue: '123'
    snapshotRecording:
      required: true
      content:
        application/json:
          schema:
            type: object
            allOf:
              - $ref: '#/components/schemas/record-spec'
              - properties:
                  filters:
                    type: object
                    allOf:
                      - properties:
                          ids:
                            type: array
                            items:
                              type: string
                        type: object
                        description: Filter requests for which to create stub mapping
                      - $ref: '#/components/schemas/request-pattern'
          example:
            filters:
              urlPathPattern: /api/.*
              method: GET
              ids:
                - 40a93c4a-d378-4e07-8321-6158d5dbcb29
            captureHeaders:
              Accept: {}
              Content-Type:
                caseInsensitive: true
            requestBodyPattern:
              matcher: equalToJson
              ignoreArrayOrder: false
              ignoreExtraElements: true
            extractBodyCriteria:
              textSizeThreshold: 2 kb
              binarySizeThreshold: 1 Mb
            outputFormat: FULL
            persist: false
            repeatsAsScenarios: false
            transformers:
              - modify-response-header
            transformerParameters:
              headerValue: '123'
