openapi: 3.0.0
servers:
  - url: 'https://api.devbank.apiture.com/approvals'
info:
  title: Approvals
  description: |
    This API manages state-transition based approvals for Financial
    Institutions.  Approvals are useful in confirming that part or all
    of a process is complete. An Approval is a resource which represents
    something that the financial institution must approve.
    Examples of approvals may include Identity Verification Document approval or
    Account Application approval.


    Approval States may be one of the following:

      * **`open`** Created but not yet ready for review
      * **`submitted`** Pending review by approver
      * **`approved`** Approval granted
      * **`rejected`** Approval denied
      * **`waived`** Approval forgiven
      * **`returned`** Approver returns approval for modification
      * **`canceled`** Approval request withdrawn

    Allowed state transitions are:

      * `open` -> `submitted`
      * `open` -> `waived`
      * `submitted` -> `approved`
      * `submitted` -> `rejected`
      * `submitted` -> `waived`
      * `submitted` -> `returned`
      * `returned` -> `submitted`
      * `open` -> `canceled`
      * `submitted` -> `canceled`
      * `returned` -> `canceled`


    An approval may only be deleted if its `state` is `open` or `canceled`. In
    order to change the state, use `POST` to the `href` in the corresponding
    links (`apiture:approve`, `apiture:submit`, `apiture:reject`, etc.) in the
    approval resource as described fully in the _approval_ schema.

    ## Approval type resources

    All approval resources contain an _approval type_, a resource that is also managed in this API. Approval
    types provide financial institutions the ability to track, reconcile and group specific approvals. Some
    examples of approval types may be specific documents related to new account opening that need to be manually
    approved, account applications or transfer requests. There can be many approval resources per approval type.
    In addition, metadata regarding specific types of approvals can be stored on the approval type. Approval
    types may only be deleted if they are not in use by any existing approvals.


    Approval types may also indicate which approval states are not allowed. For
    example, some approval types disallow `waived` or `returned`. See the
    `disallowedStates` property.

    ## Approval targets

    The _target_ of the approval, which may be any resource, is not required but
    may be provided on the `POST` operation that creates the approval. The target
    is defined in the `_links` in the request body, with the link relation `apiture:target`.
    Alternatively, the content to be approved may be embedded within the
    `attributes` on the approval request. It will also be conveyed in the
    approval representation in the `GET` operation on the instance and the
    summary representation in the `/approvals` collection.
    Examples of targets may include an account application or a document.

    ## Approval attributes

    An approval or approval type may store additional data in the
    resource's `attributes` property. Attributes can be modified through `PATCH`.
    Attributes are _*not*_ copied from the approval type to the approval.

    # Error Types

    Error responses in this API may have one of the `type` values described below.
    See [Errors](https://developer.apiture.com/docs/concepts/errors) for more information
    on error responses and error types.



    <h2 class='errorType' id="err-approvalTypeInUse">approvalTypeInUse</h2>

    **Description**: Approval Types may only be deleted if they are not being used by an Approval. <br>
    **Remediation**: Check to see if any Approval resources are linked to the supplied Approval Type.


    <h2 class='errorType' id="err-approveApprovalInvalidState">approveApprovalInvalidState</h2>

    **Description**: Approvals may only be approved if they are in a submitted state. <br>
    **Remediation**: Check the state of your Approval and the applicable allowed state transitions in the Approvals API documentation.

    The `attributes` object in the error may have the following properties:

    | Property | Type | Description |
    |----------|------|-------------|
    | disallowedStates | [string] | States that are disallowed for this instance. |
    | currentState | string | The current state of the instance |
    | requestedState | string | The requested new state for the instance |


    <h2 class='errorType' id="err-cancelApprovalInvalidState">cancelApprovalInvalidState</h2>

    **Description**: Approvals may only be canceled if they are in a submitted, open or returned state. <br>
    **Remediation**: Check the state of your Approval and the applicable allowed state transitions in the Approvals API documentation.


    <h2 class='errorType' id="err-deleteApprovalInvalidState">deleteApprovalInvalidState</h2>

    **Description**: Approvals may only be deleted if they are in an open or canceled state. <br>
    **Remediation**: Check the state of your Approval and the applicable allowed state transitions in the Approvals API documentation.

    The `attributes` object in the error may have the following properties:

    | Property | Type | Description |
    |----------|------|-------------|
    | requiredStates | [string] | The approval must be in one of the listed states before it is eligible for deletion. |


    <h2 class='errorType' id="err-ifMatchHeaderMissing">ifMatchHeaderMissing</h2>

    **Description**: The "If-Match" header was not supplied. <br>
    **Remediation**: Verify you are supplying an "If-Match" header in the request.

    This error type may be included in error responses for the following HTTP status code: 428


    <h2 class='errorType' id="err-invalidApprovalId">invalidApprovalId</h2>

    **Description**: No approvals were found for the specified approvalId. <br>
    **Remediation**: Check to make sure that the supplied approvalId corresponds to an apiture approval resource.


    <h2 class='errorType' id="err-invalidApprovalTypeId">invalidApprovalTypeId</h2>

    **Description**: No approvalTypes were found for the specified approvalTypeId. <br>
    **Remediation**: Check to make sure that the supplied approvalTypeId corresponds to an apiture approvalType resource.


    <h2 class='errorType' id="err-invalidApprovalTypeLink">invalidApprovalTypeLink</h2>

    **Description**: No approvalType link was supplied. <br>
    **Remediation**: Your request must contain a link to a valid approvalType.


    <h2 class='errorType' id="err-invalidTargetLink">invalidTargetLink</h2>

    **Description**: Invalid target link. <br>
    **Remediation**: Your request must contain a link to a valid approvalType.


    <h2 class='errorType' id="err-malformedRequestBody">malformedRequestBody</h2>

    **Description**: The supplied request body was malformed. <br>
    **Remediation**: Check to make sure that your request body exists and that it does not contain syntax errors.


    <h2 class='errorType' id="err-nameAndDomainMustBeUnique">nameAndDomainMustBeUnique</h2>

    **Description**: The combination of name and domain must be unique across ApprovalTypes. <br>
    **Remediation**: Check the existing ApprovalTypes for an existing resource that matches the name and domain on your request.


    <h2 class='errorType' id="err-rejectApprovalInvalidState">rejectApprovalInvalidState</h2>

    **Description**: Approvals may only be rejected if they are in a submitted state. <br>
    **Remediation**: Check the state of your Approval and the applicable allowed state transitions in the Approvals API documentation.


    <h2 class='errorType' id="err-returnApprovalInvalidState">returnApprovalInvalidState</h2>

    **Description**: Approvals may only be returned if they are in a submitted state. <br>
    **Remediation**: Check the state of your Approval and the applicable allowed state transitions in the Approvals API documentation.


    <h2 class='errorType' id="err-stateDisallowedByApprovalType">stateDisallowedByApprovalType</h2>

    **Description**: The approval's request new state is disallowed by the approval's type. <br>
    **Remediation**: Avoid attempts to change the state to a disallowed state.

    The `attributes` object in the error may have the following properties:

    | Property | Type | Description |
    |----------|------|-------------|
    | currentState | string | The current `state` of the the approval.<br>Example: `submitted` |
    | requestedState | string | The requested new `state` value in the request.<br>Example: `canceled` |
    | disallowedStates | [string] | The set of states that are forbidden for the approvalType<br>Example: `waived,canceled` |


    <h2 class='errorType' id="err-submitApprovalInvalidState">submitApprovalInvalidState</h2>

    **Description**: Approvals may only be submitted if they are in an open or returned state. <br>
    **Remediation**: Check the state of your Approval and the applicable allowed state transitions in the Approvals API documentation.


    <h2 class='errorType' id="err-waiveApprovalInvalidState">waiveApprovalInvalidState</h2>

    **Description**: Approvals may only be waived if they are in an open or submitted state. <br>
    **Remediation**: Check the state of your Approval and the applicable allowed state transitions in the Approvals API documentation.
  version: 0.12.2
  contact:
    name: Apiture
    url: 'https://developer.apiture.com'
    email: api@apiture.com
  termsOfService: 'https://developer.apiture.com/docs/Apiture-Open-API-License-Agreement.pdf'
tags:
  - name: Approval
    description: Approval
  - name: Approval Actions
    description: Actions on Approval Resources
  - name: Approval Type
    description: The type of an Approval
  - name: API
    description: The Approvals API
paths:
  /approvals:
    get:
      summary: Return a collection of approvals
      description: >-
        Return a [paginated](https://developer.apiture.com/docs/concepts/pagination) [sortable](https://developer.apiture.com/docs/concepts/sorting)
        [filterable](https://developer.apiture.com/docs/concepts/filtering) [searchable](https://developer.apiture.com/docs/concepts/searchable)
        collection of approvals. The [links](https://developer.apiture.com/docs/concepts/links) in the response include pagination links.
      operationId: getApprovals
      security:
        - apiKey: []
          accessToken:
            - data/read
      x-apiture-implemented: true
      tags:
        - Approval
      x-apiture-traits:
        sortBy:
          - state
          - label
          - createdAt
        itemSchema: Approval
        filters:
          state:
            filter:
              - eq
              - ne
              - in
          label:
            filter:
              - eq
              - ne
              - lt
              - le
              - gt
              - ge
              - startsWith
              - endsWith
              - contains
              - search
          _id:
            filter:
              - eq
              - in
          target:
            filter:
              - eq
              - contains
          typeName:
            filter:
              - eq
              - contains
        link:
          rel: approvals
          title: List Approvals
      parameters:
        - name: start
          in: query
          description: The zero-based index of the first approval item to include in this page. The default 0 denotes the beginning of the collection.
          schema:
            type: integer
            format: int64
            default: 0
        - name: limit
          in: query
          description: The maximum number of approval representations to return in this page.
          schema:
            type: integer
            format: int32
            default: 100
        - name: sortBy
          in: query
          description: >-
            Optional sort criteria. See [sort criteria format](https://developer.apiture.com/docs/concepts/sorting), such as
            `?sortBy=field1,-field2`.<br>This collection may be sorted by following properties:<br>&bullet; `state`<br>&bullet; `label`<br>&bullet;
            `createdAt`
          schema:
            type: string
        - name: filter
          in: query
          description: >-
            Optional filter criteria. See [filtering](https://developer.apiture.com/docs/concepts/filtering).<br>This collection may be filtered by
            following properties and functions:<br>&bullet;  Property `state` using functions `eq`,  `ne`,  `in`<br>&bullet;  Property `label` using
            functions `eq`,  `ne`,  `lt`,  `le`,  `gt`,  `ge`,  `startsWith`,  `endsWith`,  `contains`,  `search`<br>&bullet;  Property `_id` using
            functions `eq`,  `in`<br>&bullet;  Property `target` using functions `eq`,  `contains`<br>&bullet;  Property `typeName` using functions
            `eq`,  `contains`
          schema:
            type: string
        - $ref: '#/components/parameters/qQueryParam'
        - $ref: '#/components/parameters/stateQueryParam'
        - $ref: '#/components/parameters/labelQueryParam'
        - name: _id
          in: query
          description: >-
            Subset the approvals collection to those whose `_id` matches this value. Use `|` to separate multiple values. This is combined with an
            implicit `and` with other filters if they are used. See [filtering](https://developer.apiture.com/docs/concepts/filtering). Example:
            `?_id=id-1|id-2|id-3`
          schema:
            type: array
            items:
              type: string
            minLength: 1
            uniqueItems: true
      responses:
        '200':
          description: OK
          content:
            application/hal+json:
              schema:
                $ref: '#/components/schemas/approvals'
            application/json:
              schema:
                $ref: '#/components/schemas/approvals'
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
        '422':
          $ref: '#/components/responses/422'
    post:
      summary: Create a new approval
      description: >-
        Create a new approval in the approvals collection.  The link to an Approval Type resource is required in order to create a new Approval
        resource. This link should be passed in the `_links` in the request with an `apiture:approvalType` key. The optional target of an approval may
        be passed on in either the `_links`  with the link relation `apiture:target`, or in `attributes`.
      operationId: createApproval
      security:
        - apiKey: []
          accessToken:
            - data/write
      x-apiture-implemented: true
      tags:
        - Approval
      responses:
        '201':
          description: Created
          headers:
            Location:
              description: >-
                The URI of the new resource. If the URI begins with / it is relative to the API root context. Else, it is a full URI starting with
                *`scheme`*`://host`
              schema:
                type: string
                format: uri
            ETag:
              description: >-
                The `ETag` response header specifies an entity tag which may be provided in an `If-Match` request header for *`PUT`* or *`PATCH`*
                operations which update the resource.
              schema:
                type: string
          content:
            application/hal+json:
              schema:
                $ref: '#/components/schemas/approval'
            application/json:
              schema:
                $ref: '#/components/schemas/approval'
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
      requestBody:
        content:
          application/hal+json:
            schema:
              $ref: '#/components/schemas/createApproval'
          application/json:
            schema:
              $ref: '#/components/schemas/createApproval'
        description: The data necessary to create a new approval.
        required: true
  '/approvals/{approvalId}':
    get:
      summary: Fetch a representation of this approval
      description: 'Return a [HAL](https://developer.apiture.com/docs/concepts/hal) representation of this approval resource.'
      operationId: getApproval
      security:
        - apiKey: []
          accessToken:
            - data/read
      x-apiture-implemented: true
      tags:
        - Approval
      parameters:
        - $ref: '#/components/parameters/approvalIdPathParam'
        - $ref: '#/components/parameters/ifNoneMatchHeaderParam'
        - name: embed
          in: query
          description: >-
            The `embed` query parameter specifies which related resources to include in the `_embedded` object in the response. `embed` supports the
            following comma-separated values: <ul> <li>`approvalType` : include the approval type in the `_embedded.approvalType` object. (See the
            `approvalEmbeddedObjects` schema.)</li> <li>`target` : include the approval target.</li> </ul> For example, to embed both the
            `approvalType` and `target` for approvals use `GET .../approval/{approvalId}?embed=approvalType,target`. To embed the target only, use
            `GET .../approval/{approvalId}?embed=target`.
          schema:
            type: array
            items:
              type: string
              enum:
                - approvalType
                - target
            default: approvalType
      responses:
        '200':
          description: OK
          headers:
            ETag:
              description: >-
                The `ETag` response header specifies an entity tag which may be provided in an `If-Match` request header for *`PUT`* or *`PATCH`*
                operations which update this approval resource.
              schema:
                type: string
          content:
            application/hal+json:
              schema:
                $ref: '#/components/schemas/approval'
            application/json:
              schema:
                $ref: '#/components/schemas/approval'
        '304':
          $ref: '#/components/responses/304'
        '401':
          $ref: '#/components/responses/401'
        '404':
          $ref: '#/components/responses/404Approval'
    put:
      summary: Update this approval
      description: >-
        Perform a complete replacement of this approval. Nested `_embedded` and `_links` are ignored if included. The `state` is not updated by this
        operation; use the state-change operations described in the `approval` schema.
      operationId: updateApproval
      security:
        - apiKey: []
          accessToken:
            - data/write
      x-apiture-implemented: true
      tags:
        - Approval
      parameters:
        - $ref: '#/components/parameters/approvalIdPathParam'
        - $ref: '#/components/parameters/ifMatchHeaderParam'
      responses:
        '200':
          description: OK
          headers:
            ETag:
              description: >-
                The `ETag` response header specifies an entity tag which may be provided in an `If-Match` request header for *`PUT`* or *`PATCH`*
                operations which update this approval resource.
              schema:
                type: string
          content:
            application/hal+json:
              schema:
                $ref: '#/components/schemas/approval'
            application/json:
              schema:
                $ref: '#/components/schemas/approval'
        '400':
          description: >-
            Bad Request.  The request body or one or more of the query parameters was not well formed.  The `_error` field in the response will
            contain details about the request error.


            This error response may have one of the following `type` values:

            * [`invalidTargetLink`](#err-invalidTargetLink)

            * [`invalidApprovalTypeLink`](#err-invalidApprovalTypeLink)

            * [`invalidApprovalTypeId`](#err-invalidApprovalTypeId)
          x-apiture-errors:
            - invalidTargetLink
            - invalidApprovalTypeLink
            - invalidApprovalTypeId
          content:
            application/hal+json:
              schema:
                $ref: '#/components/schemas/errorResponse'
            application/json:
              schema:
                $ref: '#/components/schemas/errorResponse'
        '401':
          $ref: '#/components/responses/401'
        '404':
          $ref: '#/components/responses/404Approval'
        '412':
          $ref: '#/components/responses/412'
        '422':
          $ref: '#/components/responses/422'
      requestBody:
        content:
          application/hal+json:
            schema:
              $ref: '#/components/schemas/approval'
          application/json:
            schema:
              $ref: '#/components/schemas/approval'
        required: true
    patch:
      summary: Update this approval
      description: >-
        Perform a partial update of this approval. Omitted fields are not updated. Nested `_embedded` and `_links` are ignored if included. The
        `state` is not updated by this operation; use the state-change operations described in the `approval` schema.
      operationId: patchApproval
      security:
        - apiKey: []
          accessToken:
            - data/write
      x-apiture-implemented: true
      tags:
        - Approval
      parameters:
        - $ref: '#/components/parameters/approvalIdPathParam'
        - $ref: '#/components/parameters/ifMatchHeaderParam'
      responses:
        '200':
          description: OK
          headers:
            ETag:
              description: >-
                The `ETag` response header specifies an entity tag which may be provided in an `If-Match` request header for *`PUT`* or *`PATCH`*
                operations which update this approval resource.
              schema:
                type: string
          content:
            application/hal+json:
              schema:
                $ref: '#/components/schemas/approval'
            application/json:
              schema:
                $ref: '#/components/schemas/approval'
        '400':
          description: >-
            Bad Request.  The request body or one or more of the query parameters was not well formed.  The `_error` field in the response will
            contain details about the request error.


            This error response may have one of the following `type` values:

            * [`invalidTargetLink`](#err-invalidTargetLink)

            * [`invalidApprovalTypeLink`](#err-invalidApprovalTypeLink)

            * [`invalidApprovalTypeId`](#err-invalidApprovalTypeId)
          x-apiture-errors:
            - invalidTargetLink
            - invalidApprovalTypeLink
            - invalidApprovalTypeId
          content:
            application/hal+json:
              schema:
                $ref: '#/components/schemas/errorResponse'
            application/json:
              schema:
                $ref: '#/components/schemas/errorResponse'
        '401':
          $ref: '#/components/responses/401'
        '404':
          $ref: '#/components/responses/404Approval'
        '412':
          $ref: '#/components/responses/412'
        '422':
          $ref: '#/components/responses/422'
      requestBody:
        content:
          application/hal+json:
            schema:
              $ref: '#/components/schemas/approval'
          application/json:
            schema:
              $ref: '#/components/schemas/approval'
        required: true
    delete:
      summary: Delete this approval resource
      description: Delete this approval resource and any resources that are owned by it. An approval may only be deleted if its state is `open` or `canceled`.
      operationId: deleteApproval
      security:
        - apiKey: []
          accessToken:
            - data/delete
      x-apiture-implemented: true
      tags:
        - Approval
      parameters:
        - $ref: '#/components/parameters/ifMatchHeaderParam'
        - $ref: '#/components/parameters/approvalIdPathParam'
      responses:
        '204':
          $ref: '#/components/responses/204Deleted'
        '401':
          $ref: '#/components/responses/401'
        '412':
          $ref: '#/components/responses/412'
  /approvedApprovals:
    post:
      summary: Approve an approval
      description: |-
        Approve an approval.


        Only approvals which are `submitted` may be `approved`.


        This operation is invoked from the `apiture:approve` link on a product
        type when it is eligible to be approved.


        This changes the `state` to `approved`.
      operationId: approveApproval
      security:
        - apiKey: []
          accessToken:
            - admin/write
      x-apiture-implemented: true
      tags:
        - Approval Actions
      parameters:
        - $ref: '#/components/parameters/approvalQueryParam'
        - $ref: '#/components/parameters/ifMatchHeaderParam'
      responses:
        '200':
          description: OK
          content:
            application/hal+json:
              schema:
                $ref: '#/components/schemas/approval'
            application/json:
              schema:
                $ref: '#/components/schemas/approval'
        '400':
          description: Bad Request. The `approval` or `approvalUri` parameter was malformed or does not refer to an approval.
        '401':
          $ref: '#/components/responses/401'
        '409':
          $ref: '#/components/responses/409ApprovalConflict'
        '422':
          $ref: '#/components/responses/422'
  /rejectedApprovals:
    post:
      summary: Reject an approval
      description: >-
        Reject an approval. Only approvals which are `submitted` may be `rejected`.  This operation is invoked from the `apiture:reject` link on an
        approval when it is eligible to be rejected. This changes the `state` to `rejected`.
      operationId: rejectApproval
      security:
        - apiKey: []
          accessToken:
            - admin/write
      x-apiture-implemented: true
      tags:
        - Approval Actions
      parameters:
        - $ref: '#/components/parameters/approvalQueryParam'
        - $ref: '#/components/parameters/ifMatchHeaderParam'
      responses:
        '200':
          description: OK
          content:
            application/hal+json:
              schema:
                $ref: '#/components/schemas/approval'
            application/json:
              schema:
                $ref: '#/components/schemas/approval'
        '400':
          description: Bad Request. The `approval` or `approvalUri` was malformed or does not refer to an approval.
        '401':
          $ref: '#/components/responses/401'
        '409':
          $ref: '#/components/responses/409ApprovalConflict'
        '422':
          $ref: '#/components/responses/422'
  /waivedApprovals:
    post:
      summary: Waive an approval
      description: >-
        Waive an approval. Only approvals which are `open` or `submitted` may be `waived`. This operation is invoked from the `apiture:waive` link on
        an approval when it is eligible to be waived. This changes the `state` to `waived`.
      operationId: waiveApproval
      security:
        - apiKey: []
          accessToken:
            - admin/write
      x-apiture-implemented: true
      tags:
        - Approval Actions
      parameters:
        - $ref: '#/components/parameters/approvalQueryParam'
        - $ref: '#/components/parameters/ifMatchHeaderParam'
      responses:
        '200':
          description: OK
          content:
            application/hal+json:
              schema:
                $ref: '#/components/schemas/approval'
            application/json:
              schema:
                $ref: '#/components/schemas/approval'
        '400':
          description: Bad Request. The 'approval` or `approvalUri` was malformed or does not refer to an approval.
        '401':
          $ref: '#/components/responses/401'
        '409':
          $ref: '#/components/responses/409ApprovalConflict'
        '422':
          $ref: '#/components/responses/422'
  /submittedApprovals:
    post:
      summary: Submit an approval
      description: >-
        Submit an approval. Only approvals which are `open` or `returned` may be `submitted`. This operation is invoked from the `apiture:submit` link
        on an approval when it is eligible to be submitted. This changes the `state` to `submitted`.
      operationId: submitApproval
      security:
        - apiKey: []
          accessToken:
            - data/write
      x-apiture-implemented: true
      tags:
        - Approval Actions
      parameters:
        - $ref: '#/components/parameters/approvalQueryParam'
        - $ref: '#/components/parameters/ifMatchHeaderParam'
      responses:
        '200':
          description: OK
          content:
            application/hal+json:
              schema:
                $ref: '#/components/schemas/approval'
            application/json:
              schema:
                $ref: '#/components/schemas/approval'
        '400':
          description: Bad Request. The `approval` or `approvalUri` was malformed or does not refer to an approval.
        '401':
          $ref: '#/components/responses/401'
        '409':
          $ref: '#/components/responses/409ApprovalConflict'
        '422':
          $ref: '#/components/responses/422'
  /returnedApprovals:
    post:
      summary: Return an approval
      description: >-
        Return an approval. Only approvals which are `submitted` may be `returned`. This operation is invoked from the `apiture:return` link on an
        approval when it is eligible to be returned. This changes the `state` to `returned`.
      operationId: returnApproval
      security:
        - apiKey: []
          accessToken:
            - admin/write
      x-apiture-implemented: true
      tags:
        - Approval Actions
      parameters:
        - $ref: '#/components/parameters/approvalQueryParam'
        - $ref: '#/components/parameters/ifMatchHeaderParam'
      responses:
        '200':
          description: OK
          content:
            application/hal+json:
              schema:
                $ref: '#/components/schemas/approval'
            application/json:
              schema:
                $ref: '#/components/schemas/approval'
        '400':
          description: Bad Request. The `approval` or `approvalUri` was malformed or does not refer to an approval.
        '401':
          $ref: '#/components/responses/401'
        '409':
          $ref: '#/components/responses/409ApprovalConflict'
        '422':
          $ref: '#/components/responses/422'
  /canceledApprovals:
    post:
      summary: Cancel an approval
      description: >-
        Cancel an approval. Only approvals which are `open`, `submitted` or `returned` may be `canceled`. This operation is invoked from the
        `apiture:cancel` link on an approval when it is eligible to be canceled. This changes the `state` to `canceled`.
      operationId: cancelApproval
      security:
        - apiKey: []
          accessToken:
            - admin/write
      x-apiture-implemented: true
      tags:
        - Approval Actions
      parameters:
        - $ref: '#/components/parameters/approvalQueryParam'
        - $ref: '#/components/parameters/ifMatchHeaderParam'
      responses:
        '200':
          description: OK
          content:
            application/hal+json:
              schema:
                $ref: '#/components/schemas/approval'
            application/json:
              schema:
                $ref: '#/components/schemas/approval'
        '400':
          description: Bad Request. The `approval` or `approvalUri` was malformed or does not refer to an approval.
        '401':
          $ref: '#/components/responses/401'
        '409':
          $ref: '#/components/responses/409ApprovalConflict'
        '422':
          $ref: '#/components/responses/422'
  /approvalTypes:
    get:
      summary: Return a collection of approval types
      description: >-
        Return a [paginated](https://developer.apiture.com/docs/concepts/pagination) [sortable](https://developer.apiture.com/docs/concepts/sorting)
        [filterable](https://developer.apiture.com/docs/concepts/filtering) [searchable](https://developer.apiture.com/docs/concepts/searchable)
        collection of approvals. The [links](https://developer.apiture.com/docs/concepts/links) in the response include pagination links.
      operationId: getApprovalTypes
      security:
        - apiKey: []
          accessToken:
            - data/read
      x-apiture-implemented: true
      tags:
        - Approval Type
      x-apiture-traits:
        sortBy:
          - label
          - name
        itemSchema: Approval Type
        filters:
          label:
            filter:
              - eq
              - ne
              - lt
              - le
              - gt
              - ge
              - startsWith
              - endsWith
              - contains
              - search
          name:
            filter:
              - eq
              - ne
              - lt
              - le
              - gt
              - ge
              - startsWith
              - endsWith
              - contains
              - search
          _id:
            filter:
              - eq
              - in
        link:
          rel: approvalTypes
          title: List Approval Types
      parameters:
        - name: start
          in: query
          description: The zero-based index of the first approval type item to include in this page. The default 0 denotes the beginning of the collection.
          schema:
            type: integer
            format: int64
            default: 0
        - name: limit
          in: query
          description: The maximum number of approval type representations to return in this page.
          schema:
            type: integer
            format: int32
            default: 100
        - name: sortBy
          in: query
          description: >-
            Optional sort criteria. See [sort criteria format](https://developer.apiture.com/docs/concepts/sorting), such as
            `?sortBy=field1,-field2`.<br>This collection may be sorted by following properties:<br>&bullet; `label`<br>&bullet; `name`
          schema:
            type: string
        - name: filter
          in: query
          description: >-
            Optional filter criteria. See [filtering](https://developer.apiture.com/docs/concepts/filtering).<br>This collection may be filtered by
            following properties and functions:<br>&bullet;  Property `label` using functions `eq`,  `ne`,  `lt`,  `le`,  `gt`,  `ge`,  `startsWith`, 
            `endsWith`,  `contains`,  `search`<br>&bullet;  Property `name` using functions `eq`,  `ne`,  `lt`,  `le`,  `gt`,  `ge`,  `startsWith`, 
            `endsWith`,  `contains`,  `search`<br>&bullet;  Property `_id` using functions `eq`,  `in`
          schema:
            type: string
        - $ref: '#/components/parameters/qQueryParam'
        - $ref: '#/components/parameters/labelQueryParam'
        - $ref: '#/components/parameters/nameQueryParam'
      responses:
        '200':
          description: OK
          content:
            application/hal+json:
              schema:
                $ref: '#/components/schemas/approvalTypes'
            application/json:
              schema:
                $ref: '#/components/schemas/approvalTypes'
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
        '422':
          $ref: '#/components/responses/422'
    post:
      summary: Create a new approval type
      description: 'Create a new approval type in the approval types collection. '
      operationId: createApprovalType
      security:
        - apiKey: []
          accessToken:
            - data/write
      x-apiture-implemented: true
      tags:
        - Approval Type
      responses:
        '201':
          description: Created
          headers:
            Location:
              description: >-
                The URI of the new resource. If the URI begins with / it is relative to the API root context. Else, it is a full URI starting with
                *`scheme`*`://host`
              schema:
                type: string
                format: uri
            ETag:
              description: >-
                The `ETag` response header specifies an entity tag which may be provided in an `If-Match` request header for *`PUT`* or *`PATCH`*
                operations which update the resource.
              schema:
                type: string
          content:
            application/hal+json:
              schema:
                $ref: '#/components/schemas/approvalType'
            application/json:
              schema:
                $ref: '#/components/schemas/approvalType'
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
        '409':
          $ref: '#/components/responses/409ApprovalTypeConflict'
      requestBody:
        content:
          application/hal+json:
            schema:
              $ref: '#/components/schemas/createApprovalType'
          application/json:
            schema:
              $ref: '#/components/schemas/createApprovalType'
        description: The data necessary to create a new approval type.
        required: true
  '/approvalTypes/{approvalTypeId}':
    get:
      summary: Fetch a representation of this approval type
      description: 'Return a [HAL](https://developer.apiture.com/docs/concepts/hal) representation of this approval type resource.'
      operationId: getApprovalType
      security:
        - apiKey: []
          accessToken:
            - data/read
      x-apiture-implemented: true
      tags:
        - Approval Type
      parameters:
        - $ref: '#/components/parameters/approvalTypeIdPathParam'
        - $ref: '#/components/parameters/ifNoneMatchHeaderParam'
      responses:
        '200':
          description: OK
          headers:
            ETag:
              description: >-
                The `ETag` response header specifies an entity tag which may be provided in an `If-Match` request header for *`PUT`* or *`PATCH`*
                operations which update this approval type resource.
              schema:
                type: string
          content:
            application/hal+json:
              schema:
                $ref: '#/components/schemas/approvalType'
            application/json:
              schema:
                $ref: '#/components/schemas/approvalType'
        '304':
          $ref: '#/components/responses/304'
        '401':
          $ref: '#/components/responses/401'
        '404':
          $ref: '#/components/responses/404ApprovalType'
        '412':
          $ref: '#/components/responses/412'
    put:
      summary: Update this approval type
      description: Perform a complete replacement of this approval type.
      operationId: updateApprovalType
      security:
        - apiKey: []
          accessToken:
            - data/write
      x-apiture-implemented: true
      tags:
        - Approval Type
      parameters:
        - $ref: '#/components/parameters/approvalTypeIdPathParam'
        - $ref: '#/components/parameters/ifMatchHeaderParam'
      responses:
        '200':
          description: OK
          headers:
            ETag:
              description: >-
                The `ETag` response header specifies an entity tag which may be provided in an `If-Match` request header for *`PUT`* or *`PATCH`*
                operations which update this approval type resource.
              schema:
                type: string
          content:
            application/hal+json:
              schema:
                $ref: '#/components/schemas/approvalType'
            application/json:
              schema:
                $ref: '#/components/schemas/approvalType'
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
        '404':
          $ref: '#/components/responses/404ApprovalType'
        '412':
          $ref: '#/components/responses/412'
        '422':
          $ref: '#/components/responses/422'
      requestBody:
        content:
          application/hal+json:
            schema:
              $ref: '#/components/schemas/approvalType'
          application/json:
            schema:
              $ref: '#/components/schemas/approvalType'
        required: true
    patch:
      summary: Update this approval type
      description: >-
        Perform a partial update of this approval type. Fields which are omitted are not updated. Nested `_embedded` and `_links` are ignored if
        included.
      operationId: patchApprovalType
      security:
        - apiKey: []
          accessToken:
            - data/write
      x-apiture-implemented: true
      tags:
        - Approval Type
      parameters:
        - $ref: '#/components/parameters/approvalTypeIdPathParam'
        - $ref: '#/components/parameters/ifMatchHeaderParam'
      responses:
        '200':
          description: OK
          headers:
            ETag:
              description: >-
                The `ETag` response header specifies an entity tag which may be provided in an `If-Match` request header for *`PUT`* or *`PATCH`*
                operations which update this approval type resource.
              schema:
                type: string
          content:
            application/hal+json:
              schema:
                $ref: '#/components/schemas/approvalType'
            application/json:
              schema:
                $ref: '#/components/schemas/approvalType'
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
        '404':
          $ref: '#/components/responses/404ApprovalType'
        '412':
          $ref: '#/components/responses/412'
        '422':
          $ref: '#/components/responses/422'
      requestBody:
        content:
          application/hal+json:
            schema:
              $ref: '#/components/schemas/approvalType'
          application/json:
            schema:
              $ref: '#/components/schemas/approvalType'
        required: true
    delete:
      summary: Delete this approval type resource
      description: >-
        Delete this approval type resource and any resources that are owned by it.  Deleting an Approval Type is only allowed if it is not in use by
        any existing Approvals.
      operationId: deleteApprovalType
      security:
        - apiKey: []
          accessToken:
            - data/delete
      x-apiture-implemented: true
      tags:
        - Approval Type
      parameters:
        - $ref: '#/components/parameters/ifMatchHeaderParam'
        - $ref: '#/components/parameters/approvalTypeIdPathParam'
      responses:
        '204':
          $ref: '#/components/responses/204Deleted'
        '401':
          $ref: '#/components/responses/401'
        '409':
          $ref: '#/components/responses/409ApprovalTypeConflict'
        '412':
          $ref: '#/components/responses/412'
  /:
    get:
      summary: Top-level resources and operations in this API
      description: Return links to the top-level resources and operations in this API.
      operationId: getApi
      security:
        - apiKey: []
      x-apiture-implemented: true
      responses:
        '200':
          description: OK
          content:
            application/hal+json:
              schema:
                $ref: '#/components/schemas/root'
            application/json:
              schema:
                $ref: '#/components/schemas/root'
      tags:
        - API
  /apiDoc:
    get:
      summary: Return API definition document
      description: Return the OpenAPI document that describes this API.
      operationId: getApiDoc
      security:
        - apiKey: []
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
            application/openapi+json;version=2.0:
              schema:
                type: object
            application/openapi+yaml;version=2.0:
              schema:
                type: object
            application/hal+json:
              schema:
                type: object
      tags:
        - API
  /labels:
    get:
      summary: Localized Labels
      description: |-
        Return a JSON object which defines labels
        for enumeration types defined by the schemas
        defined in this API.


        The labels in the response may not all match the
        requested language; some may be in the default
        language (`en-us`).
      operationId: getLabels
      security:
        - apiKey: []
      x-apiture-implemented: true
      parameters:
        - name: Accept-Language
          in: header
          description: >-
            The weighted language tags which indicate the user's preferred natural language for the localized labels in the response, as per [RFC
            7231](https://tools.ietf.org/html/rfc7231#section-5.3.5).
          schema:
            type: string
      responses:
        '200':
          description: OK
          content:
            application/hal+json:
              schema:
                $ref: '#/components/schemas/labelGroups'
            application/json:
              schema:
                $ref: '#/components/schemas/labelGroups'
      tags:
        - API
x-apiture-errors:
  invalidApprovalId:
    description: No approvals were found for the specified approvalId
    remediation: Check to make sure that the supplied approvalId corresponds to an apiture approval resource
  invalidTargetLink:
    description: Invalid target link
    remediation: Your request must contain a link to a valid approvalType
  invalidApprovalTypeLink:
    description: No approvalType link was supplied
    remediation: Your request must contain a link to a valid approvalType
  invalidApprovalTypeId:
    description: No approvalTypes were found for the specified approvalTypeId
    remediation: Check to make sure that the supplied approvalTypeId corresponds to an apiture approvalType resource
  malformedRequestBody:
    description: The supplied request body was malformed
    remediation: Check to make sure that your request body exists and that it does not contain syntax errors
  ifMatchHeaderMissing:
    description: The "If-Match" header was not supplied
    remediation: Verify you are supplying an "If-Match" header in the request
    implicit:
      - 428
  deleteApprovalInvalidState:
    description: Approvals may only be deleted if they are in an open or canceled state
    remediation: Check the state of your Approval and the applicable allowed state transitions in the Approvals API documentation
    attributes:
      properties:
        requiredStates:
          description: The approval must be in one of the listed states before it is eligible for deletion.
          type: array
          items:
            type: string
        example:
          - canceled
          - open
  approveApprovalInvalidState:
    description: Approvals may only be approved if they are in a submitted state
    remediation: Check the state of your Approval and the applicable allowed state transitions in the Approvals API documentation
    attributes:
      properties:
        disallowedStates:
          description: States that are disallowed for this instance.
          type: array
          items:
            type: string
        currentState:
          description: The current state of the instance
          type: string
        requestedState:
          description: The requested new state for the instance
          type: string
  cancelApprovalInvalidState:
    description: 'Approvals may only be canceled if they are in a submitted, open or returned state'
    remediation: Check the state of your Approval and the applicable allowed state transitions in the Approvals API documentation
  rejectApprovalInvalidState:
    description: Approvals may only be rejected if they are in a submitted state
    remediation: Check the state of your Approval and the applicable allowed state transitions in the Approvals API documentation
  returnApprovalInvalidState:
    description: Approvals may only be returned if they are in a submitted state
    remediation: Check the state of your Approval and the applicable allowed state transitions in the Approvals API documentation
  submitApprovalInvalidState:
    description: Approvals may only be submitted if they are in an open or returned state
    remediation: Check the state of your Approval and the applicable allowed state transitions in the Approvals API documentation
  waiveApprovalInvalidState:
    description: Approvals may only be waived if they are in an open or submitted state
    remediation: Check the state of your Approval and the applicable allowed state transitions in the Approvals API documentation
  stateDisallowedByApprovalType:
    description: The approval's request new state is disallowed by the approval's type
    remediation: Avoid attempts to change the state to a disallowed state.
    attributes:
      properties:
        currentState:
          type: string
          description: The current `state` of the the approval.
          example: submitted
        requestedState:
          type: string
          description: The requested new `state` value in the request.
          example: canceled
        disallowedStates:
          type: array
          items:
            type: string
          description: The set of states that are forbidden for the approvalType
          example:
            - waived
            - canceled
  nameAndDomainMustBeUnique:
    description: The combination of name and domain must be unique across ApprovalTypes
    remediation: Check the existing ApprovalTypes for an existing resource that matches the name and domain on your request
  approvalTypeInUse:
    description: Approval Types may only be deleted if they are not being used by an Approval
    remediation: Check to see if any Approval resources are linked to the supplied Approval Type
x-apiture-traits:
  - api:
      title: Approvals
      basePath: approvals
      links:
        - getApprovals
        - createApproval
        - getApprovalTypes
        - createApprovalType
        - getApi
        - getApiDoc
        - getLabels
  - resource:
      name: approval
      description: An Approval record represents a blocking action that must be acknowledged in order to progress in the current process.
      simpleModelSchema: true
  - resource:
      name: approval type
      description: An Approval Type record contains information specific to the type of Approval being requested.  All Approvals will have Approval Types.
      simpleModelSchema: true
  - security:
      baseScope: data
x-apiture-annotated-at: '2020-10-02T13:38:29.020Z'
components:
  schemas:
    approvalState:
      title: Approval State (v1.0.0)
      description: |-
        The state of this approval.

        <strong><code>approvalState</code></strong> strings may have one of the following
        [enumerated values](https://developer.apiture.com/concepts/label-groups#enumerations):

        <table>
        <tr>
          <th>Value</th><th>Description</th>
        </tr>

        <tr>
            <td><strong><code>open</code></strong></td><td>Open: An approval that has been created but not submitted for review.</td>
            </tr>
        <tr>
            <td><strong><code>submitted</code></strong></td><td>Submitted: An approval that has been submitted for review but not yet reviewed.</td>
            </tr>
        <tr>
            <td><strong><code>approved</code></strong></td><td>Approved: An approval which has been approved by the financial institution.</td>
            </tr>
        <tr>
            <td><strong><code>rejected</code></strong></td><td>Rejected: An approval which has been rejected by the financial institution.</td>
            </tr>
        <tr>
            <td><strong><code>waived</code></strong></td><td>Waived: An approval which has been waived by the financial institution.</td>
            </tr>
        <tr>
            <td><strong><code>returned</code></strong></td><td>Returned: An approval which has been returned by the financial institution. The user should update the data that is the target of the review.</td>
            </tr>
        <tr>
            <td><strong><code>canceled</code></strong></td><td>Canceled: An approval which has been canceled by the user or the financial institution.</td>
            </tr>
        </table>


        These enumeration values are further described by the [label group](https://developer.apiture.com/concepts/label-groups)
        named `approvalState` in the response from the [`getLabels`](#op-getLabels) operation.
      type: string
      x-apiture-enum: approvalState
      enum:
        - open
        - submitted
        - approved
        - rejected
        - waived
        - returned
        - canceled
      default: open
      x-apiture-version: 1.0.0
      x-apiture-flattened: true
    approvalFields:
      title: Approval Fields (v1.0.0)
      description: 'Common fields of the approval resource, used to define other model schemas.'
      properties:
        label:
          description: 'The approval''s common name.  If omitted on create request, this will default to the label of the Approval Type.'
          type: string
        description:
          description: 'The approval''s description.  If omitted on create request, this will default to the description of the Approval Type.'
          type: string
        state:
          description: >-
            The state of this approval. This property is derived and immutable. Its value can only be changed by using the corresponding `POST`
            operations, `submitApproval`, `approveApproval`, `rejectApproval`, `waiveApproval`, `returnApproval`, and `cancelApproval`, if the
            corresponding links exist on the approval resource, as determined by the existing state of the approval and the allowed states determined
            by the approval type.
          allOf:
            - $ref: '#/components/schemas/approvalState'
          readOnly: true
        done:
          description: >-
            If `done` is true, the approval is in a terminal state and may no longer be acted upon.  Done states include `canceled`, `approved`,
            `waived` or `rejected`. This property is derived from the `state` field and is immutable.
          type: boolean
          readOnly: true
        typeName:
          description: The name of the Approval Type.  This field is immutable and derived from the name of the Approval Type.
          type: string
        reviewedBy:
          description: The id of the User that reviewed the approval.
          type: string
          readOnly: true
        reviewedAt:
          description: The date-time when the approval was reviewed.
          type: string
          format: date-time
          readOnly: true
      example:
        state: active
        done: true
        label: Government Issued ID
        typeName: governmentId
        description: A document that identifies a user
        reviewedBy: /users/users/0399abed-fd3d-4830-a88b-30f38b8a365c
        reviewedAt: '2018-04-17T10:12:58.375Z'
      x-apiture-version: 1.0.0
      type: object
      x-apiture-flattened: true
    createApproval:
      title: Create Approval (v1.0.1)
      description: >-
        Representation used to create a new approval.  A link to an `apiture:approvalType` is required to perform this operation.  An optional
        `apiture:target` link may also be specified to represent the target resource for the approval. The target can be any resource, for example, an
        account application or a document.
      x-apiture-version: 1.0.1
      example:
        _profile: 'https://api.apiture.com/schemas/approvals/createApproval/v1.0.1/profile.json'
        _links:
          'apiture:approvalType':
            href: 'https://api.apiture.com/approval/approvalType/40884353-266e-4891-9612-57e786bc8d7c'
      x-apiture-composition:
        - $ref: '#/components/schemas/abstractResource'
        - $ref: '#/components/schemas/approvalFields'
        - properties:
            - attributes
      properties:
        _links:
          description: 'An optional map of links, mapping each link relation to a link object. This model defines the `_links` object of HAL representations.'
          allOf:
            - $ref: '#/components/schemas/links'
        _embedded:
          description: 'An optional map of nested resources, mapping each nested resource name to a nested resource representation.'
          type: object
        _profile:
          description: 'The URI of a [resource profile](https://developer.apiture.com/docs/concepts/profiles/) which describes the representation.'
          type: string
          format: uri
        _error:
          description: An object which describes an error. This value is omitted if the operation succeeded without error.
          type: object
          allOf:
            - $ref: '#/components/schemas/error'
        label:
          description: 'The approval''s common name.  If omitted on create request, this will default to the label of the Approval Type.'
          type: string
        description:
          description: 'The approval''s description.  If omitted on create request, this will default to the description of the Approval Type.'
          type: string
        state:
          description: >-
            The state of this approval. This property is derived and immutable. Its value can only be changed by using the corresponding `POST`
            operations, `submitApproval`, `approveApproval`, `rejectApproval`, `waiveApproval`, `returnApproval`, and `cancelApproval`, if the
            corresponding links exist on the approval resource, as determined by the existing state of the approval and the allowed states determined
            by the approval type.
          allOf:
            - $ref: '#/components/schemas/approvalState'
          readOnly: true
        done:
          description: >-
            If `done` is true, the approval is in a terminal state and may no longer be acted upon.  Done states include `canceled`, `approved`,
            `waived` or `rejected`. This property is derived from the `state` field and is immutable.
          type: boolean
          readOnly: true
        typeName:
          description: The name of the Approval Type.  This field is immutable and derived from the name of the Approval Type.
          type: string
        reviewedBy:
          description: The id of the User that reviewed the approval.
          type: string
          readOnly: true
        reviewedAt:
          description: The date-time when the approval was reviewed.
          type: string
          format: date-time
          readOnly: true
        attributes:
          description: An optional map of name/value pairs which provide additional metadata about the approval.
          allOf:
            - $ref: '#/components/schemas/attributes'
      type: object
      x-apiture-flattened: true
    summaryApproval:
      title: Approval Summary (v1.0.1)
      description: >-
        Summary representation of an approval resource in approvals collections. This representation normally does not contain any `_embedded`
        objects. If needed, call the `GET` operation on the item's `self` link to get `_embedded` objects.
      x-apiture-version: 1.0.1
      example:
        _id: 0399abed-fd3d-4830-a88b-30f38b8a365c
        _profile: 'https://api.apiture.com/schemas/approvals/summaryApproval/v1.0.1/profile.json'
        _links:
          self:
            href: 'https://api.apiture.com/approvals/approvals/0399abed-fd3d-4830-a88b-30f38b8a365c'
      x-apiture-composition:
        - $ref: '#/components/schemas/abstractResource'
        - $ref: '#/components/schemas/approvalFields'
        - properties:
            - _id
      properties:
        _links:
          description: 'An optional map of links, mapping each link relation to a link object. This model defines the `_links` object of HAL representations.'
          allOf:
            - $ref: '#/components/schemas/links'
        _embedded:
          description: 'An optional map of nested resources, mapping each nested resource name to a nested resource representation.'
          type: object
        _profile:
          description: 'The URI of a [resource profile](https://developer.apiture.com/docs/concepts/profiles/) which describes the representation.'
          type: string
          format: uri
        _error:
          description: An object which describes an error. This value is omitted if the operation succeeded without error.
          type: object
          allOf:
            - $ref: '#/components/schemas/error'
        label:
          description: 'The approval''s common name.  If omitted on create request, this will default to the label of the Approval Type.'
          type: string
        description:
          description: 'The approval''s description.  If omitted on create request, this will default to the description of the Approval Type.'
          type: string
        state:
          description: >-
            The state of this approval. This property is derived and immutable. Its value can only be changed by using the corresponding `POST`
            operations, `submitApproval`, `approveApproval`, `rejectApproval`, `waiveApproval`, `returnApproval`, and `cancelApproval`, if the
            corresponding links exist on the approval resource, as determined by the existing state of the approval and the allowed states determined
            by the approval type.
          allOf:
            - $ref: '#/components/schemas/approvalState'
          readOnly: true
        done:
          description: >-
            If `done` is true, the approval is in a terminal state and may no longer be acted upon.  Done states include `canceled`, `approved`,
            `waived` or `rejected`. This property is derived from the `state` field and is immutable.
          type: boolean
          readOnly: true
        typeName:
          description: The name of the Approval Type.  This field is immutable and derived from the name of the Approval Type.
          type: string
        reviewedBy:
          description: The id of the User that reviewed the approval.
          type: string
          readOnly: true
        reviewedAt:
          description: The date-time when the approval was reviewed.
          type: string
          format: date-time
          readOnly: true
        _id:
          description: The unique identifier for this approval resource. This is an immutable opaque string.
          readOnly: true
          type: string
      type: object
      x-apiture-flattened: true
    updateApproval:
      title: Update Approval (v1.0.1)
      description: >-
        Representation used to update or patch an approval.  The `state` field is immutable and not updated by this operation, but by the `state
        transition` POST operations such as `approve` or `reject` (ex. `apiture:approve` and `apiture:reject`).<br>**Warning**: The schema
        `updateApproval` was deprecated on version `v0.12.0` of the API. Use `approval` schema instead. `updateApproval` will be removed on version
        `v0.13.0` of the API.
      x-apiture-deprecated:
        removeOn: 0.13.0
        replacement: '`approval` schema'
        since: 0.12.0
      x-apiture-version: 1.0.1
      example:
        _id: 0399abed-fd3d-4830-a88b-30f38b8a365c
        _profile: 'https://api.apiture.com/schemas/approvals/updateApproval/v1.0.1/profile.json'
      x-apiture-composition:
        - $ref: '#/components/schemas/approval'
        - properties:
            - attributes
      properties:
        _links:
          description: 'An optional map of links, mapping each link relation to a link object. This model defines the `_links` object of HAL representations.'
          allOf:
            - $ref: '#/components/schemas/links'
        _embedded:
          description: Embedded objects.
          allOf:
            - $ref: '#/components/schemas/approvalEmbeddedObjects'
        _profile:
          description: 'The URI of a [resource profile](https://developer.apiture.com/docs/concepts/profiles/) which describes the representation.'
          type: string
          format: uri
        _error:
          description: An object which describes an error. This value is omitted if the operation succeeded without error.
          type: object
          allOf:
            - $ref: '#/components/schemas/error'
        label:
          description: 'The approval''s common name.  If omitted on create request, this will default to the label of the Approval Type.'
          type: string
        description:
          description: 'The approval''s description.  If omitted on create request, this will default to the description of the Approval Type.'
          type: string
        state:
          description: >-
            The state of this approval. This property is derived and immutable. Its value can only be changed by using the corresponding `POST`
            operations, `submitApproval`, `approveApproval`, `rejectApproval`, `waiveApproval`, `returnApproval`, and `cancelApproval`, if the
            corresponding links exist on the approval resource, as determined by the existing state of the approval and the allowed states determined
            by the approval type.
          allOf:
            - $ref: '#/components/schemas/approvalState'
          readOnly: true
        done:
          description: >-
            If `done` is true, the approval is in a terminal state and may no longer be acted upon.  Done states include `canceled`, `approved`,
            `waived` or `rejected`. This property is derived from the `state` field and is immutable.
          type: boolean
          readOnly: true
        typeName:
          description: The name of the Approval Type.  This field is immutable and derived from the name of the Approval Type.
          type: string
        reviewedBy:
          description: The id of the User that reviewed the approval.
          type: string
          readOnly: true
        reviewedAt:
          description: The date-time when the approval was reviewed.
          type: string
          format: date-time
          readOnly: true
        _id:
          description: The unique identifier for this approval resource. This is an immutable opaque string.
          readOnly: true
          type: string
        reason:
          description: 'The reason given for the last state change, such as why the approval was approved, rejected, waived, canceled, or returned.'
          type: string
          maxLength: 512
        createdAt:
          description: 'The approval''s creation date-time, in [RFC 3339](https://tools.ietf.org/html/rfc3339) `YYYY-MM-DDThh:mm:ss.sssZ` format.'
          type: string
          format: date-time
          readOnly: true
        updatedAt:
          description: 'The date-time of the approval''s most recent update, in [RFC 3339](https://tools.ietf.org/html/rfc3339) `YYYY-MM-DDThh:mm:ss.sssZ` format.'
          type: string
          format: date-time
          readOnly: true
        attributes:
          description: An optional map of name/value pairs which provide additional metadata about the approval.
          allOf:
            - $ref: '#/components/schemas/attributes'
      type: object
      x-apiture-flattened: true
    approval:
      title: Approval (v1.1.0)
      description: >
        An approval represents the _review_ of some process, activity or resource,

        such as a document or an application. The state of the approval is

        recorded in its `state` property. The target of the approval is in the

        link named `apiture:target`; see the _Create Approval_ schema and

        `createApproval` operation.



        Links on an approval convey which state transitions are available.

        The client should use `POST` to invoke these operations, using the `href`

        on the named link object. No request body is used on these operations.



        The absence of a link indicates that the particular state transition is

        not available at that time or that the caller is not authorized to make

        the change. For example, a bank customer may lack permissions to approve a wire

        transfer they submitted.



        <h3 class='schema-links' id="approval-links" >Links</h3>


        Response and request bodies using this <strong><code>approval</code></strong> schema may contain

        the following <a href='https://developer.apiture.com/docs/concepts/links'>links</a>:


        <table>

        <tr>
          <th>Rel</th><th>Summary</th><th>Method</th>
        </tr>


        <tr>

        <td><a href='#op-getApproval'><strong><code>self</code></strong></a></td><td>Fetch a representation of this
        approval</td><td><code>GET</code></td>

        </tr>


        <tr>

        <td><a href='#op-approveApproval'><strong><code>apiture:approve</code></strong></a></td><td>Approve an approval</td><td><code>POST</code></td>

        </tr>


        <tr>

        <td><a href='#op-rejectApproval'><strong><code>apiture:reject</code></strong></a></td><td>Reject an approval</td><td><code>POST</code></td>

        </tr>


        <tr>

        <td><a href='#op-waiveApproval'><strong><code>apiture:waive</code></strong></a></td><td>Waive an approval</td><td><code>POST</code></td>

        </tr>


        <tr>

        <td><a href='#op-returnApproval'><strong><code>apiture:return</code></strong></a></td><td>Return an approval</td><td><code>POST</code></td>

        </tr>


        <tr>

        <td><a href='#op-submitApproval'><strong><code>apiture:submit</code></strong></a></td><td>Submit an approval</td><td><code>POST</code></td>

        </tr>


        <tr>

        <td><a href='#op-cancelApproval'><strong><code>apiture:cancel</code></strong></a></td><td>Cancel an approval</td><td><code>POST</code></td>

        </tr>

        </table>
      x-apiture-version: 1.1.0
      x-apiture-links:
        - rel: self
          operationId: getApproval
        - rel: 'apiture:approve'
          operationId: approveApproval
        - rel: 'apiture:reject'
          operationId: rejectApproval
        - rel: 'apiture:waive'
          operationId: waiveApproval
        - rel: 'apiture:return'
          operationId: returnApproval
        - rel: 'apiture:submit'
          operationId: submitApproval
        - rel: 'apiture:cancel'
          operationId: cancelApproval
      example:
        _id: 0399abed-fd3d-4830-a88b-30f38b8a365c
        _profile: 'https://api.apiture.com/schemas/approvals/approval/v1.1.0/profile.json'
        reason: Invalid U.S. Address
        createdAt: '2018-04-17T10:04:46.375Z'
        updatedAt: '2018-04-17T10:12:58.375Z'
        _links:
          self:
            href: 'https://api.apiture.com/approvals/approvals/0399abed-fd3d-4830-a88b-30f38b8a365c'
          'apiture:approvalType':
            href: 'https://api.apiture.com/approvals/approvalTypes/e4f09b4d-eba6-46da-86d3-ba28595067cd'
          'apiture:target':
            href: 'https://api.apiture.com/vault/files/e4f09b4d-eba6-46da-86d3-hjr434fuhe'
        _embedded:
          approvalType:
            _id: 0399abed-fd3d-4830-a88b-30f38b8a365c
            _profile: 'https://api.apiture.com/schemas/approvals/approvalType/v1.1.0/profile.json'
            _links:
              self:
                href: 'https://api.apiture.com/approvals/approvalTypes/0399abed-fd3d-4830-a88b-30f38b8a365c'
            name: governmentId
            label: Government Issued ID
            description: A document that identifies a user
      x-apiture-composition:
        - $ref: '#/components/schemas/abstractResource'
        - $ref: '#/components/schemas/approvalFields'
        - properties:
            - _id
            - reason
            - createdAt
            - updatedAt
            - attributes
            - _embedded
      properties:
        _links:
          description: 'An optional map of links, mapping each link relation to a link object. This model defines the `_links` object of HAL representations.'
          allOf:
            - $ref: '#/components/schemas/links'
        _embedded:
          description: Embedded objects.
          allOf:
            - $ref: '#/components/schemas/approvalEmbeddedObjects'
        _profile:
          description: 'The URI of a [resource profile](https://developer.apiture.com/docs/concepts/profiles/) which describes the representation.'
          type: string
          format: uri
        _error:
          description: An object which describes an error. This value is omitted if the operation succeeded without error.
          type: object
          allOf:
            - $ref: '#/components/schemas/error'
        label:
          description: 'The approval''s common name.  If omitted on create request, this will default to the label of the Approval Type.'
          type: string
        description:
          description: 'The approval''s description.  If omitted on create request, this will default to the description of the Approval Type.'
          type: string
        state:
          description: >-
            The state of this approval. This property is derived and immutable. Its value can only be changed by using the corresponding `POST`
            operations, `submitApproval`, `approveApproval`, `rejectApproval`, `waiveApproval`, `returnApproval`, and `cancelApproval`, if the
            corresponding links exist on the approval resource, as determined by the existing state of the approval and the allowed states determined
            by the approval type.
          allOf:
            - $ref: '#/components/schemas/approvalState'
          readOnly: true
        done:
          description: >-
            If `done` is true, the approval is in a terminal state and may no longer be acted upon.  Done states include `canceled`, `approved`,
            `waived` or `rejected`. This property is derived from the `state` field and is immutable.
          type: boolean
          readOnly: true
        typeName:
          description: The name of the Approval Type.  This field is immutable and derived from the name of the Approval Type.
          type: string
        reviewedBy:
          description: The id of the User that reviewed the approval.
          type: string
          readOnly: true
        reviewedAt:
          description: The date-time when the approval was reviewed.
          type: string
          format: date-time
          readOnly: true
        _id:
          description: The unique identifier for this approval resource. This is an immutable opaque string.
          readOnly: true
          type: string
        reason:
          description: 'The reason given for the last state change, such as why the approval was approved, rejected, waived, canceled, or returned.'
          type: string
          maxLength: 512
        createdAt:
          description: 'The approval''s creation date-time, in [RFC 3339](https://tools.ietf.org/html/rfc3339) `YYYY-MM-DDThh:mm:ss.sssZ` format.'
          type: string
          format: date-time
          readOnly: true
        updatedAt:
          description: 'The date-time of the approval''s most recent update, in [RFC 3339](https://tools.ietf.org/html/rfc3339) `YYYY-MM-DDThh:mm:ss.sssZ` format.'
          type: string
          format: date-time
          readOnly: true
        attributes:
          description: An optional map of name/value pairs which provide additional metadata about the approval.
          allOf:
            - $ref: '#/components/schemas/attributes'
      type: object
      x-apiture-flattened: true
    approvals:
      title: Approval Collection (v1.0.1)
      description: |-
        Collection of approvals. The items in the collection are ordered in the `_embedded.items` array; the `name` is `approvals`.
         The top-level `_links` object may contain pagination links (`self`, `next`, `prev`, `first`, `last`, `collection`).
      x-apiture-version: 1.0.1
      example:
        _profile: 'https://api.apiture.com/schemas/approvals/approvals/v1.0.1/profile.json'
        start: 10
        limit: 10
        count: 67
        name: approvals
        _links:
          self:
            href: 'https://api.apiture.com/approvals/approvals?start=10&limit=10'
          first:
            href: 'https://api.apiture.com/approvals/approvals?start=0&limit=10'
          next:
            href: 'https://api.apiture.com/approvals/approvals?start=20&limit=10'
          collection:
            href: 'https://api.apiture.com/approvals/approvals'
        _embedded:
          items:
            _id: 0399abed-fd3d-4830-a88b-30f38b8a365c
            _profile: 'https://api.apiture.com/schemas/approvals/summaryApproval/v1.0.1/profile.json'
            _links:
              self:
                href: 'https://api.apiture.com/approvals/approvals/0399abed-fd3d-4830-a88b-30f38b8a365c'
            state: active
            done: true
            label: Government Issued ID
            description: A document that identifies a user
            reviewedBy: /users/users/0399abed-fd3d-4830-a88b-30f38b8a365c
            reviewedAt: '2018-04-17T10:12:58.375Z'
      x-apiture-composition:
        - $ref: '#/components/schemas/collection'
        - properties:
            - _embedded
      properties:
        _links:
          description: 'An optional map of links, mapping each link relation to a link object. This model defines the `_links` object of HAL representations.'
          allOf:
            - $ref: '#/components/schemas/links'
        _embedded:
          type: object
          description: Embedded objects.
          properties:
            items:
              description: An array containing a page of approval items.
              type: array
              items:
                $ref: '#/components/schemas/summaryApproval'
        _profile:
          description: 'The URI of a [resource profile](https://developer.apiture.com/docs/concepts/profiles/) which describes the representation.'
          type: string
          format: uri
        _error:
          description: An object which describes an error. This value is omitted if the operation succeeded without error.
          type: object
          allOf:
            - $ref: '#/components/schemas/error'
        count:
          description: >-
            The number of items in the collection. This value is _optional_ and may be omitted if the count is not computable efficiently. If a filter
            is applied to the collection (either implicitly or explicitly), the count, if present, indicates the number of items that satisfy the
            filter.
          type: integer
        start:
          description: The start index of this page of items.
          type: integer
        limit:
          description: The maximum number of items per page.
          type: integer
        name:
          description: The name of the collection.
          type: string
      type: object
      x-apiture-flattened: true
    disallowedState:
      title: Disallowed State (v1.0.0)
      description: |-
        A disallowed state for an approval. Approvals of this type may not be set to any of the states defined by this.

        <strong><code>disallowedState</code></strong> strings may have one of the following
        [enumerated values](https://developer.apiture.com/concepts/label-groups#enumerations):

        <table>
        <tr>
          <th>Value</th><th>Description</th>
        </tr>

        <tr>
            <td><strong><code>returned</code></strong></td><td>Returned: The `returned` state is not allowed for approvals of this type.</td>
            </tr>
        <tr>
            <td><strong><code>rejected</code></strong></td><td>Waived: The `rejected` state is not allowed for approvals of this type.</td>
            </tr>
        <tr>
            <td><strong><code>waived</code></strong></td><td>Waived: The `waived` state is not allowed for approvals of this type.</td>
            </tr>
        <tr>
            <td><strong><code>canceled</code></strong></td><td>Canceled: The `canceled` state is not allowed for approvals of this type.</td>
            </tr>
        </table>


        These enumeration values are further described by the [label group](https://developer.apiture.com/concepts/label-groups)
        named `disallowedState` in the response from the [`getLabels`](#op-getLabels) operation.
      type: string
      x-apiture-enum: disallowedState
      enum:
        - rejected
        - waived
        - returned
        - canceled
      x-apiture-version: 1.0.0
      x-apiture-flattened: true
    approvalTypeFields:
      title: Approval Type Fields (v1.0.0)
      description: Common fields of the approval resource used to build other model schemas.
      properties:
        name:
          description: The approval's name.
          type: string
        label:
          description: The approval's common name.
          type: string
        description:
          description: The approval's description.
          type: string
        domain:
          description: >-
            A namespace for grouping related resources, to keep them separate from other resources. For example, a department or bank branch may
            define a domain, and all Approval Type instances  they define will use that domain, so that they can avoid conflicting with Approval Type
            names in other domains. An API or service may define a domain for new Approval Types that it defines. The combination of `domain` and
            `name` must be unique within the set of all approval types. It is a best practice to define `domain` with a URI or a URN.
          type: string
        disallowedStates:
          description: >-
            An optional array of states that are not allowed for this approval type. If omitted, all state transitions are allowed. The states `open`
            and `approved` are always allowed, so this enumeration set is a subset of the `approvalState` enumeration on an approval.
          type: array
          items:
            $ref: '#/components/schemas/disallowedState'
      example:
        name: governmentId
        label: Government Issued ID
        description: A document that identifies a user. `governmentId` approvals may not be waived or canceled.
        disallowedStates:
          - waived
          - canceled
        domain: 'http://api.apiture.com/domains/approvals/documentRequirement'
      x-apiture-version: 1.0.0
      type: object
      x-apiture-flattened: true
    approvalTypes:
      title: Approval Types Collection (v1.0.1)
      description: |-
        Collection of approval types. The items in the collection are ordered in the `_embedded.items` array; the `name` is `approvals`.
         The top-level `_links` object may contain pagination links (`self`, `next`, `prev`, `first`, `last`, `collection`).
      x-apiture-version: 1.0.1
      example:
        _profile: 'https://api.apiture.com/schemas/approvals/approvalTypes/v1.0.1/profile.json'
        start: 10
        limit: 10
        count: 67
        name: approvalTypes
        _links:
          self:
            href: 'https://api.apiture.com/approvals/approvalTypes?start=10&limit=10'
          first:
            href: 'https://api.apiture.com/approvals/approvalTypes?start=0&limit=10'
          next:
            href: 'https://api.apiture.com/approvals/approvalTypes?start=20&limit=10'
          collection:
            href: 'https://api.apiture.com/approvals/approvalTypes'
        _embedded:
          items:
            _id: 0399abed-fd3d-4830-a88b-30f38b8a365c
            _profile: 'https://api.apiture.com/schemas/approvals/summaryApprovalType/v1.0.1/profile.json'
            _links:
              self:
                href: 'https://api.apiture.com/approvals/approvalTypes/0399abed-fd3d-4830-a88b-30f38b8a365c'
            name: governmentId
            label: Government Issued ID
            description: A document that identifies a user
      x-apiture-composition:
        - $ref: '#/components/schemas/collection'
        - properties:
            - _embedded
      properties:
        _links:
          description: 'An optional map of links, mapping each link relation to a link object. This model defines the `_links` object of HAL representations.'
          allOf:
            - $ref: '#/components/schemas/links'
        _embedded:
          type: object
          description: Embedded objects.
          properties:
            items:
              description: An array containing a page of approval type items.
              type: array
              items:
                $ref: '#/components/schemas/summaryApprovalType'
        _profile:
          description: 'The URI of a [resource profile](https://developer.apiture.com/docs/concepts/profiles/) which describes the representation.'
          type: string
          format: uri
        _error:
          description: An object which describes an error. This value is omitted if the operation succeeded without error.
          type: object
          allOf:
            - $ref: '#/components/schemas/error'
        count:
          description: >-
            The number of items in the collection. This value is _optional_ and may be omitted if the count is not computable efficiently. If a filter
            is applied to the collection (either implicitly or explicitly), the count, if present, indicates the number of items that satisfy the
            filter.
          type: integer
        start:
          description: The start index of this page of items.
          type: integer
        limit:
          description: The maximum number of items per page.
          type: integer
        name:
          description: The name of the collection.
          type: string
      type: object
      x-apiture-flattened: true
    createApprovalType:
      title: Create Approval Type (v1.0.1)
      description: Representation used to create a new approval type.
      required:
        - name
      x-apiture-version: 1.0.1
      example:
        _profile: 'https://api.apiture.com/schemas/approvals/createApprovalType/v1.0.1/profile.json'
        name: governmentId
        label: Government Identification
        description: 'An image of the applicant''s government-issued ID card, such as a driver''s license or passport.'
        domain: 'http://api.apiture.com/domains/approvals/documentRequirement'
      x-apiture-composition:
        - $ref: '#/components/schemas/abstractResource'
        - $ref: '#/components/schemas/approvalTypeFields'
        - properties:
            - attributes
      properties:
        _links:
          description: 'An optional map of links, mapping each link relation to a link object. This model defines the `_links` object of HAL representations.'
          allOf:
            - $ref: '#/components/schemas/links'
        _embedded:
          description: 'An optional map of nested resources, mapping each nested resource name to a nested resource representation.'
          type: object
        _profile:
          description: 'The URI of a [resource profile](https://developer.apiture.com/docs/concepts/profiles/) which describes the representation.'
          type: string
          format: uri
        _error:
          description: An object which describes an error. This value is omitted if the operation succeeded without error.
          type: object
          allOf:
            - $ref: '#/components/schemas/error'
        name:
          description: The approval's name.
          type: string
        label:
          description: The approval's common name.
          type: string
        description:
          description: The approval's description.
          type: string
        domain:
          description: >-
            A namespace for grouping related resources, to keep them separate from other resources. For example, a department or bank branch may
            define a domain, and all Approval Type instances  they define will use that domain, so that they can avoid conflicting with Approval Type
            names in other domains. An API or service may define a domain for new Approval Types that it defines. The combination of `domain` and
            `name` must be unique within the set of all approval types. It is a best practice to define `domain` with a URI or a URN.
          type: string
        disallowedStates:
          description: >-
            An optional array of states that are not allowed for this approval type. If omitted, all state transitions are allowed. The states `open`
            and `approved` are always allowed, so this enumeration set is a subset of the `approvalState` enumeration on an approval.
          type: array
          items:
            $ref: '#/components/schemas/disallowedState'
        attributes:
          description: An optional map of name/value pairs which provide additional metadata about the approval type.
          allOf:
            - $ref: '#/components/schemas/attributes'
      type: object
      x-apiture-flattened: true
    approvalType:
      title: Approval Type (v1.1.0)
      description: >-
        All Approval resources contain an Approval Type, a resource that is also managed in this API. Approval Types provide Financial Institutions
        the ability to track, reconcile and group specific Approvals. In addition, metadata regarding specific types of Approvals can be stored on the
        Approval Type. Approval Types may only be deleted if they are not in use by any existing Approvals. Some examples of Approval Types may be
        specific documents related to New Account Opening that need  to be manually approved, Account Applications or Transfer requests.
      x-apiture-version: 1.1.0
      example:
        _profile: 'https://api.apiture.com/schemas/approvals/approvalType/v1.1.0/profile.json'
        _id: 40884353-266e-4891-9612-57e786bc8d7c
        name: accountApplication
        state: approved
        createAt: '2020-08-17T06:31:32.375Z'
        updatedAt: '2020-08-17T010:45:37.000Z'
        _links:
          self:
            href: 'https://api..com/approvals/approvalTypes/0399abed-fd3d-4830-a88b-30f38b8a365c'
      x-apiture-composition:
        - $ref: '#/components/schemas/summaryApprovalType'
        - properties:
            - attributes
            - createdAt
            - updatedAt
      properties:
        _links:
          description: 'An optional map of links, mapping each link relation to a link object. This model defines the `_links` object of HAL representations.'
          allOf:
            - $ref: '#/components/schemas/links'
        _embedded:
          description: 'An optional map of nested resources, mapping each nested resource name to a nested resource representation.'
          type: object
        _profile:
          description: 'The URI of a [resource profile](https://developer.apiture.com/docs/concepts/profiles/) which describes the representation.'
          type: string
          format: uri
        _error:
          description: An object which describes an error. This value is omitted if the operation succeeded without error.
          type: object
          allOf:
            - $ref: '#/components/schemas/error'
        name:
          description: The approval's name.
          type: string
        label:
          description: The approval's common name.
          type: string
        description:
          description: The approval's description.
          type: string
        domain:
          description: >-
            A namespace for grouping related resources, to keep them separate from other resources. For example, a department or bank branch may
            define a domain, and all Approval Type instances  they define will use that domain, so that they can avoid conflicting with Approval Type
            names in other domains. An API or service may define a domain for new Approval Types that it defines. The combination of `domain` and
            `name` must be unique within the set of all approval types. It is a best practice to define `domain` with a URI or a URN.
          type: string
        disallowedStates:
          description: >-
            An optional array of states that are not allowed for this approval type. If omitted, all state transitions are allowed. The states `open`
            and `approved` are always allowed, so this enumeration set is a subset of the `approvalState` enumeration on an approval.
          type: array
          items:
            $ref: '#/components/schemas/disallowedState'
        _id:
          description: The unique identifier for this approval resource. This is an immutable opaque string.
          readOnly: true
          type: string
        attributes:
          description: An optional map of name/value pairs which provide additional metadata about the approval type.
          allOf:
            - $ref: '#/components/schemas/attributes'
        createdAt:
          description: 'The approval types''s creation date-time, in [RFC 3339](https://tools.ietf.org/html/rfc3339) `YYYY-MM-DDThh:mm:ss.sssZ` format.'
          type: string
          format: date-time
          readOnly: true
        updatedAt:
          description: >-
            The date-time of the approval type's most recent update, in [RFC 3339](https://tools.ietf.org/html/rfc3339) `YYYY-MM-DDThh:mm:ss.sssZ`
            format.
          type: string
          format: date-time
          readOnly: true
      type: object
      x-apiture-flattened: true
    updateApprovalType:
      title: Update Approval Type (v1.0.1)
      required:
        - name
      description: >-
        Representation used to update or patch an approval type.<br>**Warning**: The schema `updateApprovalType` was deprecated on version `v0.12.0`
        of the API. Use `approvalType` schema instead. `updateApprovalType` will be removed on version `v0.13.0` of the API.
      x-apiture-version: 1.0.1
      x-apiture-deprecated:
        removeOn: 0.13.0
        replacement: '`approvalType` schema'
        since: 0.12.0
      example:
        _id: 0399abed-fd3d-4830-a88b-30f38b8a365c
        _profile: 'https://api.apiture.com/schemas/approvals/updateApprovalType/v1.0.1/profile.json'
      x-apiture-composition:
        - $ref: '#/components/schemas/approvalType'
        - properties:
            - attributes
      properties:
        _links:
          description: 'An optional map of links, mapping each link relation to a link object. This model defines the `_links` object of HAL representations.'
          allOf:
            - $ref: '#/components/schemas/links'
        _embedded:
          description: 'An optional map of nested resources, mapping each nested resource name to a nested resource representation.'
          type: object
        _profile:
          description: 'The URI of a [resource profile](https://developer.apiture.com/docs/concepts/profiles/) which describes the representation.'
          type: string
          format: uri
        _error:
          description: An object which describes an error. This value is omitted if the operation succeeded without error.
          type: object
          allOf:
            - $ref: '#/components/schemas/error'
        name:
          description: The approval's name.
          type: string
        label:
          description: The approval's common name.
          type: string
        description:
          description: The approval's description.
          type: string
        domain:
          description: >-
            A namespace for grouping related resources, to keep them separate from other resources. For example, a department or bank branch may
            define a domain, and all Approval Type instances  they define will use that domain, so that they can avoid conflicting with Approval Type
            names in other domains. An API or service may define a domain for new Approval Types that it defines. The combination of `domain` and
            `name` must be unique within the set of all approval types. It is a best practice to define `domain` with a URI or a URN.
          type: string
        disallowedStates:
          description: >-
            An optional array of states that are not allowed for this approval type. If omitted, all state transitions are allowed. The states `open`
            and `approved` are always allowed, so this enumeration set is a subset of the `approvalState` enumeration on an approval.
          type: array
          items:
            $ref: '#/components/schemas/disallowedState'
        _id:
          description: The unique identifier for this approval resource. This is an immutable opaque string.
          readOnly: true
          type: string
        attributes:
          description: An optional map of name/value pairs which provide additional metadata about the approval type.
          allOf:
            - $ref: '#/components/schemas/attributes'
        createdAt:
          description: 'The approval types''s creation date-time, in [RFC 3339](https://tools.ietf.org/html/rfc3339) `YYYY-MM-DDThh:mm:ss.sssZ` format.'
          type: string
          format: date-time
          readOnly: true
        updatedAt:
          description: >-
            The date-time of the approval type's most recent update, in [RFC 3339](https://tools.ietf.org/html/rfc3339) `YYYY-MM-DDThh:mm:ss.sssZ`
            format.
          type: string
          format: date-time
          readOnly: true
      type: object
      x-apiture-flattened: true
    patchApprovalType:
      title: Update Approval Type (v1.0.1)
      description: >-
        Representation used to update or patch an approval type.<br>**Warning**: The schema `patchApprovalType` was deprecated on version `v0.12.0` of
        the API. Use `approvalType` schema instead. `patchApprovalType` will be removed on version `v0.13.0` of the API.
      x-apiture-version: 1.0.1
      x-apiture-deprecated:
        removeOn: 0.13.0
        replacement: '`approvalType` schema'
        since: 0.12.0
      example:
        _id: 0399abed-fd3d-4830-a88b-30f38b8a365c
        _profile: 'https://api.apiture.com/schemas/approvals/patchApprovalType/v1.0.1/profile.json'
      x-apiture-composition:
        - $ref: '#/components/schemas/summaryApprovalType'
        - properties:
            - attributes
      properties:
        _links:
          description: 'An optional map of links, mapping each link relation to a link object. This model defines the `_links` object of HAL representations.'
          allOf:
            - $ref: '#/components/schemas/links'
        _embedded:
          description: 'An optional map of nested resources, mapping each nested resource name to a nested resource representation.'
          type: object
        _profile:
          description: 'The URI of a [resource profile](https://developer.apiture.com/docs/concepts/profiles/) which describes the representation.'
          type: string
          format: uri
        _error:
          description: An object which describes an error. This value is omitted if the operation succeeded without error.
          type: object
          allOf:
            - $ref: '#/components/schemas/error'
        name:
          description: The approval's name.
          type: string
        label:
          description: The approval's common name.
          type: string
        description:
          description: The approval's description.
          type: string
        domain:
          description: >-
            A namespace for grouping related resources, to keep them separate from other resources. For example, a department or bank branch may
            define a domain, and all Approval Type instances  they define will use that domain, so that they can avoid conflicting with Approval Type
            names in other domains. An API or service may define a domain for new Approval Types that it defines. The combination of `domain` and
            `name` must be unique within the set of all approval types. It is a best practice to define `domain` with a URI or a URN.
          type: string
        disallowedStates:
          description: >-
            An optional array of states that are not allowed for this approval type. If omitted, all state transitions are allowed. The states `open`
            and `approved` are always allowed, so this enumeration set is a subset of the `approvalState` enumeration on an approval.
          type: array
          items:
            $ref: '#/components/schemas/disallowedState'
        _id:
          description: The unique identifier for this approval resource. This is an immutable opaque string.
          readOnly: true
          type: string
        attributes:
          description: An optional map of name/value pairs which provide additional metadata about the approval type.
          allOf:
            - $ref: '#/components/schemas/attributes'
      type: object
      x-apiture-flattened: true
    summaryApprovalType:
      title: Approval Type Summary (v1.0.1)
      description: >-
        Summary representation of an approval type resource in approvals collections. This representation normally does not contain any `_embedded`
        objects. If needed, call the `GET` operation on the item's `self` link to get `_embedded` objects.
      x-apiture-version: 1.0.1
      example:
        _id: 0399abed-fd3d-4830-a88b-30f38b8a365c
        _profile: 'https://api.apiture.com/schemas/approvals/summaryApprovalType/v1.0.1/profile.json'
        _links:
          self:
            href: 'https://api.apiture.com/approvals/approvalTypes/0399abed-fd3d-4830-a88b-30f38b8a365c'
      x-apiture-composition:
        - $ref: '#/components/schemas/abstractResource'
        - $ref: '#/components/schemas/approvalTypeFields'
        - properties:
            - _id
      properties:
        _links:
          description: 'An optional map of links, mapping each link relation to a link object. This model defines the `_links` object of HAL representations.'
          allOf:
            - $ref: '#/components/schemas/links'
        _embedded:
          description: 'An optional map of nested resources, mapping each nested resource name to a nested resource representation.'
          type: object
        _profile:
          description: 'The URI of a [resource profile](https://developer.apiture.com/docs/concepts/profiles/) which describes the representation.'
          type: string
          format: uri
        _error:
          description: An object which describes an error. This value is omitted if the operation succeeded without error.
          type: object
          allOf:
            - $ref: '#/components/schemas/error'
        name:
          description: The approval's name.
          type: string
        label:
          description: The approval's common name.
          type: string
        description:
          description: The approval's description.
          type: string
        domain:
          description: >-
            A namespace for grouping related resources, to keep them separate from other resources. For example, a department or bank branch may
            define a domain, and all Approval Type instances  they define will use that domain, so that they can avoid conflicting with Approval Type
            names in other domains. An API or service may define a domain for new Approval Types that it defines. The combination of `domain` and
            `name` must be unique within the set of all approval types. It is a best practice to define `domain` with a URI or a URN.
          type: string
        disallowedStates:
          description: >-
            An optional array of states that are not allowed for this approval type. If omitted, all state transitions are allowed. The states `open`
            and `approved` are always allowed, so this enumeration set is a subset of the `approvalState` enumeration on an approval.
          type: array
          items:
            $ref: '#/components/schemas/disallowedState'
        _id:
          description: The unique identifier for this approval resource. This is an immutable opaque string.
          readOnly: true
          type: string
      type: object
      x-apiture-flattened: true
    approvalEmbeddedObjects:
      title: Approval Embedded Objects (v1.0.0)
      description: The objects which participate in this approval.
      type: object
      properties:
        approvalType:
          description: The type of this approval.
          allOf:
            - $ref: '#/components/schemas/summaryApprovalType'
        target:
          description: The target of this approval.
          type: object
      x-apiture-version: 1.0.0
      x-apiture-flattened: true
    errorResponse:
      x-apiture-version: 2.0.0
      title: Error Response (v2.0.0)
      description: |-
        Describes an error response, typically returned on 4xx or 5xx errors from API operations. The `_error` object contains the error details.

        This schema was resolved from [`common/errorResponse`](https://production.api.apiture.com/schemas/common/errorResponse/v2.0.0/model.json).
      example:
        _profile: 'https://api.apiture.com/schemas/common/errorResponse/v2.0.0/profile.json'
        _error:
          _id: 2eae46e1-575c-4d69-8a8f-0a7b0115a4b3
          message: The value for deposit must be greater than 0.
          statusCode: 422
          type: positiveNumberRequired
          attributes:
            value: -125.5
          remediation: Provide a value which is greater than 0
          occurredAt: '2018-01-25T05:50:52.375Z'
          _links:
            describedby:
              href: 'https://api.apiture.com/errors/positiveNumberRequired'
          _embedded:
            errors: []
      x-apiture-resolved-from: 'https://production.api.apiture.com/schemas/common/errorResponse/v2.0.0/model.json'
      x-apiture-namespace: common
      x-apiture-composition:
        - $ref: '#/components/schemas/abstractResource'
      properties:
        _links:
          description: 'An optional map of links, mapping each link relation to a link object. This model defines the `_links` object of HAL representations.'
          allOf:
            - $ref: '#/components/schemas/links'
        _embedded:
          description: 'An optional map of nested resources, mapping each nested resource name to a nested resource representation.'
          type: object
        _profile:
          description: 'The URI of a [resource profile](https://developer.apiture.com/docs/concepts/profiles/) which describes the representation.'
          type: string
          format: uri
        _error:
          description: An object which describes an error. This value is omitted if the operation succeeded without error.
          type: object
          allOf:
            - $ref: '#/components/schemas/error'
      type: object
      x-apiture-flattened: true
    root:
      x-apiture-version: 2.0.0
      title: API Root (v2.0.0)
      description: |-
        A HAL response, with hypermedia `_links` for the top-level resources and operations in API.

        This schema was resolved from [`common/root`](https://production.api.apiture.com/schemas/common/root/v2.0.0/model.json).
      example:
        id: apiName
        name: API name
        apiVersion: 1.0.0
        _profile: 'https://production.api.apiture.com/schemas/common/root/v2.0.0/profile.json'
        _links: {}
      x-apiture-resolved-from: 'https://production.api.apiture.com/schemas/common/root/v2.0.0/model.json'
      x-apiture-namespace: common
      x-apiture-composition:
        - $ref: '#/components/schemas/abstractResource'
        - properties:
            - _id
            - name
            - apiVersion
      properties:
        _links:
          description: 'An optional map of links, mapping each link relation to a link object. This model defines the `_links` object of HAL representations.'
          allOf:
            - $ref: '#/components/schemas/links'
        _embedded:
          description: 'An optional map of nested resources, mapping each nested resource name to a nested resource representation.'
          type: object
        _profile:
          description: 'The URI of a [resource profile](https://developer.apiture.com/docs/concepts/profiles/) which describes the representation.'
          type: string
          format: uri
        _error:
          description: An object which describes an error. This value is omitted if the operation succeeded without error.
          type: object
          allOf:
            - $ref: '#/components/schemas/error'
        _id:
          description: This API's unique ID.
          readOnly: true
          type: string
        name:
          type: string
          description: This API's name.
        apiVersion:
          type: string
          description: This API's version.
      type: object
      x-apiture-flattened: true
    labelGroups:
      title: Label Groups (v1.0.1)
      description: |-
        A set of named groups of labels, each of which contains multiple item labels.


        The abbreviated example shows two groups, one named `structure` and one named `estimatedAnnualRevenue`.
        The first has items with names such as `corporation`, `llc` and `soleProprietorship`,
        with text labels for each in the default and in French. The second has
        items for estimated revenue *ranges* but no localized labels. For example, the item named `from1to10Million`
        has the `label` "$1M to $10M" and the range `[1000000.00,10000000.00)`.

        This schema was resolved from [`common/labelGroups`](https://production.api.apiture.com/schemas/common/labelGroups/v1.0.1/model.json).
      x-apiture-version: 1.0.1
      example:
        _profile: 'https://api.apiture.com/schemas/common/labelGroups/v1.0.1/profile.json'
        groups:
          structure:
            unknown:
              label: Unknown
              code: '0'
              hidden: true
            corporation:
              label: Corporation
              code: '1'
              variants:
                fr:
                  label: Soci\u00e9t\u00e9
            partnership:
              label: Partnership
              code: '2'
              variants:
                fr:
                  label: Partenariat
            llc:
              label: Limited Liability Company
              code: '2'
              variants:
                fr:
                  label: Soci\u00e9t\u00e9 \u00e9 Responsabilit\u00e9 Limit\u00e9e
            nonProfit:
              label: Non Profit
              code: '4'
              variants:
                fr:
                  label: Non Lucratif
            financialInstitution:
              label: Financial Institution
              code: '8'
              variants:
                fr:
                  label: Institution financi\u00e8re
            soleProprietorship:
              label: Sole Proprietorship
              code: '11'
              variants:
                fr:
                  label: Entreprise individuelle
            other:
              label: Other
              code: '254'
              variants:
                fr:
                  label: Autre
          estimatedAnnualRevenue:
            unknown:
              label: Unknown
              code: '0'
            under1Million:
              label: Under $1M
              code: '1'
              range: '[0,1000000.00)'
            from1to10Million:
              label: $1M to $10M
              code: '2'
              range: '[1000000.00,10000000.00)'
            from10to100Million:
              label: $10M to $100M
              code: '3'
              range: '[10000000.00,100000000.00)'
            over100Million:
              label: 'Over $100,000,000.00'
              code: '4'
              range: '[100000000.00,]'
            other:
              label: Other
              code: '254'
      x-apiture-resolved-from: 'https://production.api.apiture.com/schemas/common/labelGroups/v1.0.1/model.json'
      x-apiture-namespace: common
      x-apiture-composition:
        - $ref: '#/components/schemas/abstractResource'
        - properties:
            - groups
      properties:
        _links:
          description: 'An optional map of links, mapping each link relation to a link object. This model defines the `_links` object of HAL representations.'
          allOf:
            - $ref: '#/components/schemas/links'
        _embedded:
          description: 'An optional map of nested resources, mapping each nested resource name to a nested resource representation.'
          type: object
        _profile:
          description: 'The URI of a [resource profile](https://developer.apiture.com/docs/concepts/profiles/) which describes the representation.'
          type: string
          format: uri
        _error:
          description: An object which describes an error. This value is omitted if the operation succeeded without error.
          type: object
          allOf:
            - $ref: '#/components/schemas/error'
        groups:
          description: 'Groups of localized labels. This maps *group names* &rarr; [*a group of labels*](#schema-labelgroup) within that group.'
          x-apiture-key: groupName
          additionalProperties:
            $ref: '#/components/schemas/labelGroup'
      type: object
      x-apiture-flattened: true
    abstractResource:
      x-apiture-version: 2.0.0
      title: Abstract Resource (v2.0.0)
      description: >-
        An abstract schema used to define other schemas for request and response bodies. This is a
        [HAL](https://tools.ietf.org/html/draft-kelly-json-hal-08) resource representation. This model contains hypermedia `_links`, and either
        optional domain object data with `_profile` and optional `_embedded` objects, or an `_error` object. In responses, if the operation was
        successful, this object will not include the `_error`, but if the operation was a 4xx or 5xx error, this object will not include `_embedded`
        or any data fields, only `_error` and optionally `_links`.


        This schema was resolved from
        [`common/abstractResource`](https://production.api.apiture.com/schemas/common/abstractResource/v2.0.0/model.json).
      example:
        _profile: '{uri of resource profile.json}'
        _links:
          self:
            href: '{uri of current resource}'
      x-apiture-resolved-from: 'https://production.api.apiture.com/schemas/common/abstractResource/v2.0.0/model.json'
      x-apiture-namespace: common
      x-apiture-composition:
        - $ref: '#/components/schemas/abstractRequest'
        - properties:
            - _error
      properties:
        _links:
          description: 'An optional map of links, mapping each link relation to a link object. This model defines the `_links` object of HAL representations.'
          allOf:
            - $ref: '#/components/schemas/links'
        _embedded:
          description: 'An optional map of nested resources, mapping each nested resource name to a nested resource representation.'
          type: object
        _profile:
          description: 'The URI of a [resource profile](https://developer.apiture.com/docs/concepts/profiles/) which describes the representation.'
          type: string
          format: uri
        _error:
          description: An object which describes an error. This value is omitted if the operation succeeded without error.
          type: object
          allOf:
            - $ref: '#/components/schemas/error'
      type: object
      x-apiture-flattened: true
    attributes:
      x-apiture-version: 2.0.0
      title: Attributes (v2.0.0)
      description: |-
        An optional map of name/value pairs which contains additional dynamic data about the resource.

        This schema was resolved from [`common/attributes`](https://production.api.apiture.com/schemas/common/attributes/v2.0.0/model.json).
      type: object
      x-apiture-key: attributeName
      additionalProperties:
        $ref: '#/components/schemas/attributeValue'
      x-apiture-resolved-from: 'https://production.api.apiture.com/schemas/common/attributes/v2.0.0/model.json'
      x-apiture-namespace: common
      properties: {}
      x-apiture-flattened: true
    collection:
      x-apiture-version: 2.0.0
      title: Collection (v2.0.0)
      description: |-
        A collection of resources. This is an abstract model schema which is extended to define specific resource collections.

        This schema was resolved from [`common/collection`](https://production.api.apiture.com/schemas/common/collection/v2.0.0/model.json).
      x-apiture-resolved-from: 'https://production.api.apiture.com/schemas/common/collection/v2.0.0/model.json'
      x-apiture-namespace: common
      x-apiture-composition:
        - $ref: '#/components/schemas/abstractResource'
        - properties:
            - count
            - start
            - limit
            - name
      properties:
        _links:
          description: 'An optional map of links, mapping each link relation to a link object. This model defines the `_links` object of HAL representations.'
          allOf:
            - $ref: '#/components/schemas/links'
        _embedded:
          description: 'An optional map of nested resources, mapping each nested resource name to a nested resource representation.'
          type: object
        _profile:
          description: 'The URI of a [resource profile](https://developer.apiture.com/docs/concepts/profiles/) which describes the representation.'
          type: string
          format: uri
        _error:
          description: An object which describes an error. This value is omitted if the operation succeeded without error.
          type: object
          allOf:
            - $ref: '#/components/schemas/error'
        count:
          description: >-
            The number of items in the collection. This value is _optional_ and may be omitted if the count is not computable efficiently. If a filter
            is applied to the collection (either implicitly or explicitly), the count, if present, indicates the number of items that satisfy the
            filter.
          type: integer
        start:
          description: The start index of this page of items.
          type: integer
        limit:
          description: The maximum number of items per page.
          type: integer
        name:
          description: The name of the collection.
          type: string
      type: object
      x-apiture-flattened: true
    abstractRequest:
      x-apiture-version: 2.0.0
      title: Abstract Request (v2.0.0)
      description: >-
        An abstract schema used to define other request-only schemas. This is a [HAL](https://tools.ietf.org/html/draft-kelly-json-hal-08) resource
        representation, minus the `_error` defined in `abstractResource`.


        This schema was resolved from [`common/abstractRequest`](https://production.api.apiture.com/schemas/common/abstractRequest/v2.0.0/model.json).
      properties:
        _links:
          description: 'An optional map of links, mapping each link relation to a link object. This model defines the `_links` object of HAL representations.'
          allOf:
            - $ref: '#/components/schemas/links'
        _embedded:
          description: 'An optional map of nested resources, mapping each nested resource name to a nested resource representation.'
          type: object
        _profile:
          description: 'The URI of a [resource profile](https://developer.apiture.com/docs/concepts/profiles/) which describes the representation.'
          type: string
          format: uri
      example:
        _profile: '{uri of resource profile.json}'
        _links:
          self:
            href: '{uri of current resource}'
      x-apiture-resolved-from: 'https://production.api.apiture.com/schemas/common/abstractRequest/v2.0.0/model.json'
      x-apiture-namespace: common
      type: object
      x-apiture-flattened: true
    error:
      x-apiture-version: 2.0.0
      title: Error (v2.0.0)
      description: |-
        Describes an error in an API request or in a service called via the API.

        This schema was resolved from [`common/error`](https://production.api.apiture.com/schemas/common/error/v2.0.0/model.json).
      required:
        - message
      properties:
        message:
          type: string
          description: A localized message string describing the error condition.
        _id:
          description: >-
            A unique identifier for this error instance. This may be used as a correlation ID with the root cause error (i.e. this ID may be logged at
            the source of the error). This is is an opaque string.
          readOnly: true
          type: string
        statusCode:
          description: The HTTP status code associate with this error.
          type: integer
          minimum: 100
          maximum: 599
          example: 422
        type:
          type: string
          description: >-
            An error identifier which indicates the category of error and associate it with API support documentation or which the UI tier can use to
            render an appropriate message or hint. This provides a finer level of granularity than the `statusCode`. For example, instead of just 400
            Bad Request, the `type` may be much more specific. such as `integerValueNotInAllowedRange` or `numericValueExceedsMaximum` or
            `stringValueNotInAllowedSet`.
        occurredAt:
          type: string
          format: date-time
          description: 'An [RFC 3339](https://tools.ietf.org/html/rfc3339) UTC time stamp indicating when the error occurred.'
          example: '2018-02-02T03:37:15.375Z'
        attributes:
          description: >-
            Informative values or constraints which describe the error. For example, for a value out of range error, the attributes may specify the
            `minimum` and `maximum` values. This allows clients to present error messages as they see fit (the API does not assume the
            client/presentation tier). The set of attributes varies by error `type`.
          allOf:
            - $ref: '#/components/schemas/attributes'
        remediation:
          type: string
          description: An optional localized string which provides hints for how the user or client can resolve the error.
        errors:
          description: An optional array of nested error objects. This property is not always present.
          type: array
          items:
            $ref: '#/components/schemas/error'
        _links:
          $ref: '#/components/schemas/links'
      example:
        _id: 2eae46e1575c0a7b0115a4b3
        message: Descriptive error message...
        statusCode: 422
        type: errorType1
        remediation: Remediation string...
        occurredAt: '2018-01-25T05:50:52.375Z'
        errors:
          - _id: ccdbe2c5c938a230667b3827
            message: An optional embedded error
          - _id: dbe9088dcfe2460f229338a3
            message: Another optional embedded error
        _links:
          describedby:
            href: 'https://developer.apiture.com/errors/errorType1'
      x-apiture-resolved-from: 'https://production.api.apiture.com/schemas/common/error/v2.0.0/model.json'
      x-apiture-namespace: common
      type: object
      x-apiture-flattened: true
    attributeValue:
      x-apiture-version: 2.0.0
      title: Attribute Value (v2.0.0)
      description: |-
        The data associated with this attribute.

        This schema was resolved from [`common/attributeValue`](https://production.api.apiture.com/schemas/common/attributeValue/v2.0.0/model.json).
      x-apiture-resolved-from: 'https://production.api.apiture.com/schemas/common/attributeValue/v2.0.0/model.json'
      x-apiture-namespace: common
      type: object
      properties: {}
      x-apiture-flattened: true
    labelGroup:
      title: Label Group (v1.0.0)
      description: >-
        A map that defines labels for the items in a group. This is a map from each item *name* &rarr; *a [`labelItem`](#schema-labelitem) object*.
        For example, consider a JSON response that includes a property named `revenueEstimate`; the values for `revenueEstimate` must be one of the
        items in the group named `estimatedAnnualRevenue`, with options ranging `under1Million`, to `over100Million`. The item name is used as the
        selected value in an Apiture representation, such as `{ ..., "revenueEstimate" : "from10to100Million" , ...}`, and the item with the name
        `from10to100Million` defines the presentation labels for that item, as well as other metadata about that choice: this is the range
        `[10000000.00,100000000.00)`.


        This allows the client to let the user select a value from a list, such as the following derivde from the labels in the example:

          * Unknown
          * Under $1M
          * $1M to $10M
          * $10M to $100M
          * $100M or more

        Note that the `other` item is hidden from the selection list, as that item is marked as `hidden`. For items which define numeric ranges, a
        client may instead let the customer *directly* enter their estimated annual revenue as a number, such as 4,500,000.00. The client can then
        match that number to one of ranges in the items and set the `revenueEstimate` to the corresponding item's name: `{ ..., "revenueEstimate" :
        "from1to10Million", ... }`.


        This schema was resolved from [`common/labelGroup`](https://production.api.apiture.com/schemas/common/labelGroup/v1.0.0/model.json).
      x-apiture-key: labelName
      x-apiture-version: 1.0.0
      additionalProperties:
        $ref: '#/components/schemas/labelItem'
      example:
        unknown:
          label: Unknown
          code: '0'
          hidden: true
        under1Million:
          label: Under $1M
          code: '1'
          range: '[0,1000000.00)'
          variants:
            fr:
              label: Moins de $1M
        from1to10Million:
          label: $1M to $10M
          code: '2'
          range: '[1000000.00,10000000.00)'
          variants:
            fr:
              label: $1M \u00e0 $10M
        from10to100Million:
          label: $10M to $100M
          code: '3'
          range: '[10000000.00,100000000.00)'
          variants:
            fr:
              - label $10M \u00e0 $100M
        over100Million:
          label: 'Over $100,000,000.00'
          code: '4'
          range: '[100000000.00,]'
          variants:
            fr:
              label: Plus de $10M
        other:
          label: Other
          code: 254
      x-apiture-resolved-from: 'https://production.api.apiture.com/schemas/common/labelGroup/v1.0.0/model.json'
      x-apiture-namespace: common
      type: object
      properties: {}
      x-apiture-flattened: true
    links:
      title: Links (v1.0.0)
      x-apiture-version: 1.0.0
      description: |-
        An optional map of links, mapping each link relation to a link object. This model defines the `_links` object of HAL representations.

        This schema was resolved from [`common/links`](https://production.api.apiture.com/schemas/common/links/v1.0.0/model.json).
      type: object
      x-apiture-key: linkRelationName
      additionalProperties:
        $ref: '#/components/schemas/link'
      x-apiture-resolved-from: 'https://production.api.apiture.com/schemas/common/links/v1.0.0/model.json'
      x-apiture-namespace: common
      properties: {}
      x-apiture-flattened: true
    labelItem:
      title: Label Item (v1.0.0)
      description: >-
        An item in a [`labelGroup`](#schema-labelgroup), with a set of `variants` which contains different localized labels for the item. Each
        ([`simpleLabel`](#schema-simpleLabel)) variant defines the presentation text label and optional description for a language. Items may also
        have a lookup `code` to map to external syststems, a numeric range, and a `hidden` boolean to indicate the item is normally hidden in the UI.


        This schema was resolved from [`common/labelItem`](https://production.api.apiture.com/schemas/common/labelItem/v1.0.0/model.json).
      x-apiture-version: 1.0.0
      example:
        over100Million:
          label: 'Over $100,000,000.00'
          code: '4'
          range: '[100000000.00,]'
          variants:
            fr:
              label: Plus de $10M
      x-apiture-resolved-from: 'https://production.api.apiture.com/schemas/common/labelItem/v1.0.0/model.json'
      x-apiture-namespace: common
      x-apiture-composition:
        - $ref: '#/components/schemas/simpleLabel'
        - properties:
            - variants
            - code
            - hidden
            - range
      properties:
        label:
          type: string
          description: A label or title which may be used as labels or other UI controls which present a value.
          example: Board of Directors
        description:
          type: string
          description: A more detailed localized description of a localizable label.
        variants:
          description: >-
            The language-specific variants of this label. The keys in this object are [RFC 7231](https://tools.ietf.org/html/rfc7231#section-3.1.3.1)
            language codes.
          x-apiture-key: languageCode
          type: object
          additionalProperties:
            $ref: '#/components/schemas/simpleLabel'
          example:
            en:
              label: More then $10M
            es:
              label: Mas de $10M
            fr:
              label: Plus de $10M
        code:
          type: string
          description: 'If the localized value is associated with an external standard or definition, this is a lookup code or key or URI for that value.'
          example: '3'
          minLength: 1
        hidden:
          type: boolean
          description: 'If `true`, this item is normally hidden from the User Interface.'
        range:
          description: >-
            The range of values, if the item describes a bounded numeric value. This is range notation such as `[min,max]`, `(exclusiveMin,max]`,
            `[min,exclusiveMax)`, or `(exclusiveMin,exclusiveMax)`. For example, `[0,100)` is the range greater than or equal to 0 and less than 100.
            If the *min* or *max* value are omitted, that end of the range is unbounded. For example, `(,1000.00)` means less than 1000.00 and
            `[20000.00,]` means 20000.00 or more. The ranges do not overlap or have gaps.
          type: string
          pattern: '^[\[\(](-?(0|[1-9][0-9]*)(\.[0-9]+)?)?,(-?(0|[1-9][0-9]*)(\.[0-9]+)?)?[\]\)]$'
      type: object
      x-apiture-flattened: true
    link:
      x-apiture-version: 1.0.0
      title: Link (v1.0.0)
      description: >-
        Describes a hypermedia link within a `_links` object in HAL representations. In Apiture APIs, links are [HAL
        links](https://developer.apiture.com/docs/concepts/links), but Apiture APIs do not use the `name` or `hreflang` properties of HAL. Apiture
        links _may_ include a `method` property.


        This schema was resolved from [`common/link`](https://production.api.apiture.com/schemas/common/link/v1.0.0/model.json).
      required:
        - href
      properties:
        href:
          type: string
          format: uri
          description: The URI or URI template for the resource/operation this link refers to.
        type:
          type: string
          description: The media type for the resource.
        templated:
          type: boolean
          description: 'If true, the link''s href is a [URI template](https://tools.ietf.org/html/rfc6570).'
        title:
          type: string
          description: An optional human-readable localized title for the link.
        deprecation:
          type: string
          format: uri
          description: 'If present, the containing link is deprecated and the value is a URI which provides human-readable text information about the deprecation.'
        profile:
          type: string
          format: uri
          description: 'The URI of a profile document, a JSON document which describes the target resource/operation.'
      example:
        href: /contacts/contacts/328f6bf6-d762-422f-a077-ab91ca4d0b6f
        title: Applicant
      x-apiture-resolved-from: 'https://production.api.apiture.com/schemas/common/link/v1.0.0/model.json'
      x-apiture-namespace: common
      type: object
      x-apiture-flattened: true
    simpleLabel:
      title: Simple Label (v1.0.0)
      description: |-
        A text label and optional description.

        This schema was resolved from [`common/simpleLabel`](https://production.api.apiture.com/schemas/common/simpleLabel/v1.0.0/model.json).
      x-apiture-version: 1.0.0
      type: object
      required:
        - label
      properties:
        label:
          type: string
          description: A label or title which may be used as labels or other UI controls which present a value.
          example: Board of Directors
        description:
          type: string
          description: A more detailed localized description of a localizable label.
      x-apiture-resolved-from: 'https://production.api.apiture.com/schemas/common/simpleLabel/v1.0.0/model.json'
      x-apiture-namespace: common
      x-apiture-flattened: true
  responses:
    '304':
      description: Not Modified. The resource has not been modified since it was last fetched.
    '400':
      description: >-
        Bad Request.  The request body or one or more of the query parameters was not well formed.  The `_error` field in the response will contain
        details about the request error.


        This error response may have one of the following `type` values:

        * [`malformedRequestBody`](#err-malformedRequestBody)
      x-apiture-errors:
        - malformedRequestBody
      content:
        application/hal+json:
          schema:
            $ref: '#/components/schemas/errorResponse'
        application/json:
          schema:
            $ref: '#/components/schemas/errorResponse'
    '401':
      description: Unauthorized. The request has not been applied because it lacks valid authentication  credentials for the target resource.
      content:
        application/hal+json:
          schema:
            $ref: '#/components/schemas/errorResponse'
        application/json:
          schema:
            $ref: '#/components/schemas/errorResponse'
    '412':
      description: >-
        Precondition Failed. The supplied `if-Match` header value does not match the most recent `ETag` response header value. The resource has
        changed in the interim.
      content:
        application/hal+json:
          schema:
            $ref: '#/components/schemas/errorResponse'
        application/json:
          schema:
            $ref: '#/components/schemas/errorResponse'
    '422':
      description: >-
        Unprocessable Entity. One or more of the query parameters was well formed but otherwise invalid. The `_error` field in the response will
        contain details about the request error.
      content:
        application/hal+json:
          schema:
            $ref: '#/components/schemas/errorResponse'
        application/json:
          schema:
            $ref: '#/components/schemas/errorResponse'
    404Approval:
      description: >-
        Not Found. There is no such approval resource at the specified `{approvalId}`. The `_error` field in the response will contain details about
        the request error.


        This error response may have one of the following `type` values:

        * [`invalidApprovalId`](#err-invalidApprovalId)
      x-apiture-errors:
        - invalidApprovalId
      content:
        application/hal+json:
          schema:
            $ref: '#/components/schemas/errorResponse'
        application/json:
          schema:
            $ref: '#/components/schemas/errorResponse'
    404ApprovalType:
      description: >-
        Not Found. There is no such approval type resource at the specified `{approvalTypeId}`. The `_error` field in the response will contain
        details about the request error.


        This error response may have one of the following `type` values:

        * [`invalidApprovalTypeId`](#err-invalidApprovalTypeId)
      x-apiture-errors:
        - invalidApprovalTypeId
      content:
        application/hal+json:
          schema:
            $ref: '#/components/schemas/errorResponse'
        application/json:
          schema:
            $ref: '#/components/schemas/errorResponse'
    409ApprovalConflict:
      description: |-
        Conflict. There is a conflict between the request and the current state of the resource. It may be one of the following:
          * The `state` of an Approval resource may only be changed in accordance with the state transitions described in this specification.

        This error response may have one of the following `type` values:
        * [`approveApprovalInvalidState`](#err-approveApprovalInvalidState)
        * [`deleteApprovalInvalidState`](#err-deleteApprovalInvalidState)
        * [`cancelApprovalInvalidState`](#err-cancelApprovalInvalidState)
        * [`rejectApprovalInvalidState`](#err-rejectApprovalInvalidState)
        * [`returnApprovalInvalidState`](#err-returnApprovalInvalidState)
        * [`submitApprovalInvalidState`](#err-submitApprovalInvalidState)
        * [`waiveApprovalInvalidState`](#err-waiveApprovalInvalidState)
        * [`stateDisallowedByApprovalType`](#err-stateDisallowedByApprovalType)
      x-apiture-errors:
        - approveApprovalInvalidState
        - deleteApprovalInvalidState
        - cancelApprovalInvalidState
        - rejectApprovalInvalidState
        - returnApprovalInvalidState
        - submitApprovalInvalidState
        - waiveApprovalInvalidState
        - stateDisallowedByApprovalType
      content:
        application/hal+json:
          schema:
            $ref: '#/components/schemas/errorResponse'
        application/json:
          schema:
            $ref: '#/components/schemas/errorResponse'
    409ApprovalTypeConflict:
      description: |-
        Conflict. There is a conflict between the request and the current state of the resource. It may be one of the following:
          * The `name` and `domain` of the Approval Type must be a unique combination within the FI Approval Type Resources.
          * The Approval Type is in use and cannot be deleted.

        This error response may have one of the following `type` values:
        * [`nameAndDomainMustBeUnique`](#err-nameAndDomainMustBeUnique)
        * [`approvalTypeInUse`](#err-approvalTypeInUse)
      x-apiture-errors:
        - nameAndDomainMustBeUnique
        - approvalTypeInUse
      content:
        application/hal+json:
          schema:
            $ref: '#/components/schemas/errorResponse'
        application/json:
          schema:
            $ref: '#/components/schemas/errorResponse'
    204Deleted:
      description: No Content. The resource was deleted successfully.
  parameters:
    approvalIdPathParam:
      name: approvalId
      description: The unique identifier of this approval. This is an opaque string.
      in: path
      required: true
      schema:
        type: string
    approvalQueryParam:
      name: approval
      description: A server-generated key which identifies an existing approval resource.
      in: query
      required: true
      schema:
        type: string
    approvalTypeIdPathParam:
      name: approvalTypeId
      description: The unique identifier of this approval type. This is an opaque string.
      in: path
      required: true
      schema:
        type: string
    filterQueryParam:
      name: filter
      in: query
      description: 'Optional filter criteria. See [filtering](https://developer.apiture.com/docs/concepts/filtering).'
      schema:
        type: string
    qQueryParam:
      name: q
      in: query
      description: 'Optional search string. See [searching](https://developer.apiture.com/docs/concepts/searching).'
      schema:
        type: string
    nameQueryParam:
      name: name
      in: query
      description: >-
        Subset the approvals collection to those with this name value. Use `|` to separate multiple values. For example, `?name=Bartell` will match
        only items whose name is Bartell; `?name=Bartell|kirsten` will match items whose name is Bartell or kirsten. This is combined with an implicit
        and with other filters if they are used. See [filtering](https://developer.apiture.com/docs/concepts/filtering).
      schema:
        type: string
    stateQueryParam:
      name: state
      in: query
      description: >-
        Subset the approvals collection to those whose `state` matches this value. Use `|` to separate multiple values. For example,
        `?state=submitted` matches only items whose `state` is `submitted`; `?state=rejected|approved` matches items whose `state` is `rejected` or
        `approved`. The value or `|`-separated values should be from the `approvalState` enumeration. This is combined with an implicit `and` with
        other filters if they are used. See [filtering](https://developer.apiture.com/docs/concepts/filtering).
      schema:
        type: array
        items:
          type: string
          enum:
            - open
            - submitted
            - approved
            - rejected
            - waived
            - returned
            - canceled
        minLength: 1
        maxLength: 5
        uniqueItems: true
    labelQueryParam:
      name: label
      in: query
      description: >-
        Subset the approvals collection to those with this label value. Use `|` to separate multiple values. For example, `?label=email_verification`
        matches only items whose label is `email_verification`; `?label=email_verification|account_verification` will match items whose label is
        `email_verification` or `account_verification`. This is combined with an implicit and with other filters if they are used. See
        [filtering](https://developer.apiture.com/docs/concepts/filtering).
      schema:
        type: string
    ifMatchHeaderParam:
      name: If-Match
      description: 'The entity tag that was returned in the `ETag` response. If supplied, this must match the current entity tag of the resource.'
      in: header
      schema:
        type: string
    ifNoneMatchHeaderParam:
      name: If-None-Match
      description: >-
        The entity tag that was returned in the `ETag` response. If the resource's current entity tag matches, the `GET` will return 304 (Not
        Modified) and no response body, else the resource representation will be returned.
      in: header
      schema:
        type: string
  requestBodies:
    approval:
      content:
        application/hal+json:
          schema:
            $ref: '#/components/schemas/approval'
        application/json:
          schema:
            $ref: '#/components/schemas/approval'
      required: true
    approvalType:
      content:
        application/hal+json:
          schema:
            $ref: '#/components/schemas/approvalType'
        application/json:
          schema:
            $ref: '#/components/schemas/approvalType'
      required: true
  securitySchemes:
    apiKey:
      type: apiKey
      name: API-Key
      in: header
      description: >-
        API Key based authentication. Each client application must pass its private, unique API key, allocated in the developer portal, via the
        `API-Key: {api-key}` request header.
    accessToken:
      type: oauth2
      description: >-
        OAuth2 client access token authentication. The client authenticates against the server at `authorizationUrl`, passing the client's private
        `clientId` (and optional and `clientSecret`) as part of this flow. The client obtains an access token from the server at `tokenUrl`. It then
        passes the received access token via the `Authorization: Bearer {access-token}` header in subsequent API calls. The authorization process also
        returns a refresh token which the client should use to renew the access token before it expires.
      flows:
        authorizationCode:
          authorizationUrl: 'https://auth.devbank.apiture.com/auth/oauth2/authorize'
          tokenUrl: 'https://api.devbank.apiture.com/auth/oauth2/token'
          scopes:
            data/read: 'Read access to non-account, non-profile data.'
            data/write: 'Write (update) access to non-account, non-profile data.'
            data/delete: 'Delete access to non-account, non-profile data.'
            data/full: 'Full access to non-account, non-profile data.'
            admin/write: 'Admin write (update) access to non-account, non-profile data.'
