nCino Subscriptions API

Endpoints pertaining to webhook subscriptions

OpenAPI Specification

ncino-subscriptions-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Ncino Subscriptions API
  version: '1.0'
  license:
    name: Apache 2.0
    url: http://www.apache.org/licenses/LICENSE-2.0.html
  description: 'Operations tagged Subscriptions across 2 of this provider''s published API definitions: ncino-mortgage-openapi.yml, ncino-mortgage-webhooks-openapi.json. Each path carries the servers of the definition it was published in.'
servers:
- url: https://api.ncinomortgage.com
  description: Production server
security:
- OAuth2: []
tags:
- name: Subscriptions
  description: Endpoints pertaining to webhook subscriptions
paths:
  /webhooks/{webhook_id}/subscriptions:
    servers:
    - url: https://api.ncinomortgage.com
      description: Production server
    post:
      tags:
      - Subscriptions
      operationId: subscriptions-create
      parameters:
      - name: webhook_id
        description: Webhook ID.
        required: true
        in: path
        schema:
          type: string
          format: uuid
      - $ref: '#/components/parameters/ApiVersionHeader'
      responses:
        '201':
          description: Subscription created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ResourceCreated'
          headers:
            X-Api-Version:
              $ref: '#/components/headers/ApiVersionResponseHeader'
            X-Api-Supported-Versions:
              $ref: '#/components/headers/ApiSupportedVersionsResponseHeader'
        '409':
          description: Webhook is already subscribed to event
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorSet'
          headers:
            X-Api-Version:
              $ref: '#/components/headers/ApiVersionResponseHeader'
            X-Api-Supported-Versions:
              $ref: '#/components/headers/ApiSupportedVersionsResponseHeader'
        '400':
          $ref: '#/components/responses/BadRequestError'
        '401':
          $ref: '#/components/responses/UnauthorizedError'
        '403':
          $ref: '#/components/responses/ForbiddenError'
        '404':
          $ref: '#/components/responses/NotFoundError'
        '500':
          $ref: '#/components/responses/InternalServerError'
      description: Create a subscription for a <<glossary:webhook>>
      summary: Create a subscription for a webhook
      requestBody:
        description: ''
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/WebhookSubscriptionSaveBody'
    get:
      tags:
      - Subscriptions
      operationId: subscriptions-index
      parameters:
      - name: webhook_id
        description: Webhook ID.
        required: true
        in: path
        schema:
          type: string
          format: uuid
      - $ref: '#/components/parameters/Page'
      - $ref: '#/components/parameters/PageSize'
      - $ref: '#/components/parameters/CreatedAfter'
      - $ref: '#/components/parameters/CreatedBefore'
      - $ref: '#/components/parameters/UpdatedAfter'
      - $ref: '#/components/parameters/UpdatedBefore'
      - $ref: '#/components/parameters/ApiVersionHeader'
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WebhookSubscriptionPagination'
          headers:
            X-Api-Version:
              $ref: '#/components/headers/ApiVersionResponseHeader'
            X-Api-Supported-Versions:
              $ref: '#/components/headers/ApiSupportedVersionsResponseHeader'
        '400':
          $ref: '#/components/responses/BadRequestError'
        '401':
          $ref: '#/components/responses/UnauthorizedError'
        '403':
          $ref: '#/components/responses/ForbiddenError'
        '404':
          $ref: '#/components/responses/NotFoundError'
        '500':
          $ref: '#/components/responses/InternalServerError'
      description: This endpoint will retrieve all of a <<glossary:webhook>>'s subscription records.
      summary: Retrieve all of a webhook's subscription records
  /webhooks/{webhook_id}/subscriptions/{webhook_subscription_id}:
    servers:
    - url: https://api.ncinomortgage.com
      description: Production server
    get:
      tags:
      - Subscriptions
      operationId: subscriptions-show
      parameters:
      - name: webhook_id
        description: Webhook ID.
        required: true
        in: path
        schema:
          type: string
          format: uuid
      - name: webhook_subscription_id
        description: Subscription ID.
        required: true
        in: path
        schema:
          type: string
          format: uuid
      - $ref: '#/components/parameters/ApiVersionHeader'
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WebhookSubscription'
          headers:
            X-Api-Version:
              $ref: '#/components/headers/ApiVersionResponseHeader'
            X-Api-Supported-Versions:
              $ref: '#/components/headers/ApiSupportedVersionsResponseHeader'
        '400':
          $ref: '#/components/responses/BadRequestError'
        '401':
          $ref: '#/components/responses/UnauthorizedError'
        '403':
          $ref: '#/components/responses/ForbiddenError'
        '404':
          $ref: '#/components/responses/NotFoundError'
        '500':
          $ref: '#/components/responses/InternalServerError'
      description: This endpoint will retrieve a <<glossary:webhook>>'s subscription record.
      summary: Retrieve a webhook's subscription record
    patch:
      tags:
      - Subscriptions
      operationId: subscriptions-update
      parameters:
      - name: webhook_id
        description: Webhook ID.
        required: true
        in: path
        schema:
          type: string
          format: uuid
      - name: webhook_subscription_id
        description: Subscription ID.
        required: true
        in: path
        schema:
          type: string
          format: uuid
      - $ref: '#/components/parameters/ApiVersionHeader'
      responses:
        '204':
          description: Subscription updated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NoContent'
          headers:
            X-Api-Version:
              $ref: '#/components/headers/ApiVersionResponseHeader'
            X-Api-Supported-Versions:
              $ref: '#/components/headers/ApiSupportedVersionsResponseHeader'
        '409':
          description: Webhook is already subscribed to event
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorSet'
          headers:
            X-Api-Version:
              $ref: '#/components/headers/ApiVersionResponseHeader'
            X-Api-Supported-Versions:
              $ref: '#/components/headers/ApiSupportedVersionsResponseHeader'
        '400':
          $ref: '#/components/responses/BadRequestError'
        '401':
          $ref: '#/components/responses/UnauthorizedError'
        '403':
          $ref: '#/components/responses/ForbiddenError'
        '404':
          $ref: '#/components/responses/NotFoundError'
        '500':
          $ref: '#/components/responses/InternalServerError'
      description: This endpoint will update a <<glossary:webhook>>'s subscription record.
      summary: Update a webhook's subscription record
      requestBody:
        description: ''
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/WebhookSubscriptionSaveBody'
    delete:
      tags:
      - Subscriptions
      operationId: subscriptions-destroy
      parameters:
      - name: webhook_id
        description: Webhook ID.
        required: true
        in: path
        schema:
          type: string
          format: uuid
      - name: webhook_subscription_id
        description: Subscription ID.
        required: true
        in: path
        schema:
          type: string
          format: uuid
      - $ref: '#/components/parameters/ApiVersionHeader'
      responses:
        '204':
          description: Subscription removed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NoContent'
          headers:
            X-Api-Version:
              $ref: '#/components/headers/ApiVersionResponseHeader'
            X-Api-Supported-Versions:
              $ref: '#/components/headers/ApiSupportedVersionsResponseHeader'
        '400':
          $ref: '#/components/responses/BadRequestError'
        '401':
          $ref: '#/components/responses/UnauthorizedError'
        '403':
          $ref: '#/components/responses/ForbiddenError'
        '404':
          $ref: '#/components/responses/NotFoundError'
        '500':
          $ref: '#/components/responses/InternalServerError'
      description: This endpoint will delete a <<glossary:webhook>>'s subscription record (i.e. unsubscribes a webhook from an event).
      summary: Delete a webhook's subscription record
components:
  responses:
    ForbiddenError:
      description: Forbidden
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorSet'
      headers:
        X-Api-Version:
          $ref: '#/components/headers/ApiVersionResponseHeader'
        X-Api-Supported-Versions:
          $ref: '#/components/headers/ApiSupportedVersionsResponseHeader'
    InternalServerError:
      description: Internal server error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorSet'
      headers:
        X-Api-Version:
          $ref: '#/components/headers/ApiVersionResponseHeader'
        X-Api-Supported-Versions:
          $ref: '#/components/headers/ApiSupportedVersionsResponseHeader'
    NotFoundError:
      description: Not found
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorSet'
      headers:
        X-Api-Version:
          $ref: '#/components/headers/ApiVersionResponseHeader'
        X-Api-Supported-Versions:
          $ref: '#/components/headers/ApiSupportedVersionsResponseHeader'
    UnauthorizedError:
      description: Unauthorized
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorSet'
      headers:
        X-Api-Version:
          $ref: '#/components/headers/ApiVersionResponseHeader'
        X-Api-Supported-Versions:
          $ref: '#/components/headers/ApiSupportedVersionsResponseHeader'
    BadRequestError:
      description: Bad request
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorSet'
      headers:
        X-Api-Version:
          $ref: '#/components/headers/ApiVersionResponseHeader'
        X-Api-Supported-Versions:
          $ref: '#/components/headers/ApiSupportedVersionsResponseHeader'
  schemas:
    AbstractResourceModel:
      allOf:
      - $ref: '#/components/schemas/AbstractModel'
      - type: object
        properties:
          id:
            type: string
            format: uuid
            description: Unique identifier for the record.
        required:
        - id
        additionalProperties: false
    NoContent:
      type: object
      properties: {}
      additionalProperties: false
    Error:
      type: object
      properties:
        id:
          type: string
          description: A unique ID (useful as a reference when debugging an error with support)
        status:
          type: integer
          description: The HTTP status code
        title:
          type: string
          description: A generic title
        detail:
          type: string
          description: A detailed message
        _links:
          type: object
          description: A list of relevant links
      required:
      - id
      - status
      - title
      example:
        id: 123abc
        status: 400
        title: Generic title for the error
        detail: Detailed message for the error
        _links:
          resource: contextual resource if applicable
    ResourceCreated:
      allOf:
      - $ref: '#/components/schemas/AbstractResourceModel'
      description: Resource created model
    AbstractModel:
      type: object
      properties:
        _self:
          type: string
          description: The model's resource link to itself.
        _type:
          type: string
          description: The model's type.
        _links:
          type: object
          description: A list of links for the model's associations.
      required:
      - _self
      - _type
      additionalProperties: false
    WebhookSubscriptionSaveBody:
      type: object
      properties:
        event:
          allOf:
          - $ref: '#/components/schemas/WebhookEventName'
          description: Event being subscribed to.
      required:
      - event
      description: Available properties for creating or updating a webhook's subscription.
      additionalProperties: false
      minProperties: 1
    ErrorSet:
      type: object
      properties:
        errors:
          type: array
          items:
            $ref: '#/components/schemas/Error'
      required:
      - errors
      example:
        errors:
        - id: 123abc
          status: 400
          title: Generic title for the error
          detail: Detailed message for the error
          _links:
            resource: contextual resource if applicable
    WebhookEventName:
      type: string
      enum:
      - account_assignment_created
      - account_assignment_deleted
      - document_created
      - document_updated
      - document_uploaded
      - job_status_changed
      - loan_activated
      - loan_app_abandoned
      - loan_app_imported
      - loan_app_started
      - loan_app_submitted
      - loan_app_updated
      - loan_created
      - loan_deactivated
      - loan_deleted
      - loan_milestone_completed
      - loan_milestone_updated
      - loan_officer_demoted
      - loan_officer_promoted
      - loan_updated
      - milestone_created
      - milestone_deleted
      - milestones_reordered
      - organization_created
      - organization_deleted
      - state_license_created
      - state_license_deleted
      - state_license_updated
      - user_created
      - user_deleted
      - user_disabled
      - user_enabled
      - user_first_login
      - user_updated
      - verification_available
      description: Webhook event name.
    AbstractPagination:
      allOf:
      - $ref: '#/components/schemas/AbstractCollection'
      - type: object
        properties:
          total_pages:
            type: integer
            description: The total number of pages in the collection.
          total:
            type: integer
            description: The total number of items in the collection.
        additionalProperties: false
    AbstractCollection:
      allOf:
      - $ref: '#/components/schemas/AbstractModel'
      - type: object
        properties:
          contents:
            type: array
            items:
              type: object
            description: The contents for the collection.
        required:
        - contents
        additionalProperties: false
    WebhookSubscription:
      allOf:
      - $ref: '#/components/schemas/AbstractResourceModel'
      - type: object
        properties:
          event:
            allOf:
            - $ref: '#/components/schemas/WebhookEventName'
            description: Event that the webhook is subscribed to.
        required:
        - event
        additionalProperties: false
      description: Webhook subscription record
    WebhookSubscriptionPagination:
      allOf:
      - $ref: '#/components/schemas/AbstractPagination'
      - type: object
        properties:
          contents:
            type: array
            items:
              $ref: '#/components/schemas/WebhookSubscription'
        required:
        - contents
  parameters:
    ApiVersionHeader:
      name: X-Api-Version
      description: Specify API version, for example '1.0'. By default, the version configured in the company settings is used.
      required: false
      in: header
      schema:
        type: string
    CreatedBefore:
      name: created_before
      description: The date which a resource must be created before to be returned.
      required: false
      in: query
      schema:
        type: string
        format: date-time
    UpdatedBefore:
      name: updated_before
      description: The date which a resource must be updated before to be returned.
      required: false
      in: query
      schema:
        type: string
        format: date-time
    Page:
      name: page
      description: The page to retrieve.
      required: false
      in: query
      schema:
        type: integer
    UpdatedAfter:
      name: updated_after
      description: The date which a resource must be updated after to be returned.
      required: false
      in: query
      schema:
        type: string
        format: date-time
    PageSize:
      name: page_size
      description: The number of records returned in each page.
      required: false
      in: query
      schema:
        type: integer
    CreatedAfter:
      name: created_after
      description: The date which a resource must be created after to be returned.
      required: false
      in: query
      schema:
        type: string
        format: date-time
  headers:
    ApiSupportedVersionsResponseHeader:
      description: API supported versions for endpoint.
      schema:
        type: string
    ApiVersionResponseHeader:
      description: API version.
      schema:
        type: string
  securitySchemes:
    OAuth2:
      type: oauth2
      description: OAuth 2.0 Access Token (Default)
      flows:
        clientCredentials:
          tokenUrl: /oauth/token
          scopes: {}
x-refined-from:
- ncino-mortgage-openapi.yml
- ncino-mortgage-webhooks-openapi.json