openapi: 3.0.0
info:
  title: apps-directory API
  description: |
    API for apps-directory.
  contact:
    name: API Integration Support
    email: integration@dintero.com
  version: LATEST
  license:
    name: UNLICENSED
    url: https://dintero.com
security:
  - JWT: []
paths:
  /accounts/{aid}/apps-directory/apps/{app_id}/{id}/{type}/{signature}:
    get:
      operationId: api_apps_directory_app_id_type_sig_get
      summary: api_apps_directory_app_id_type_sig_get
      description: |
        Check if the app is configured to support events posted
        to this resource.
      tags:
        - apps
      security: []
      parameters:
        - $ref: '#/components/parameters/aid'
        - $ref: '#/components/parameters/app_id'
        - $ref: '#/components/parameters/id'
        - $ref: '#/components/parameters/type'
        - $ref: '#/components/parameters/signature'
      responses:
        '200':
          description: app Event supported
          content:
            application/json:
              schema:
                type: object
        '401':
          $ref: '#/components/responses/AccessForbidden'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/ServerError'
      x-mint:
        metadata:
          title: Support app Event
          sidebarTitle: Support app Event
    post:
      operationId: api_apps_directory_app_id_type_sig_post
      summary: api_apps_directory_app_id_type_sig_post
      description: |
        Send data to be processed by the app. The operation is async.
      tags:
        - apps
      security: []
      parameters:
        - $ref: '#/components/parameters/aid'
        - $ref: '#/components/parameters/app_id'
        - $ref: '#/components/parameters/id'
        - $ref: '#/components/parameters/type'
        - $ref: '#/components/parameters/signature'
      requestBody:
        content:
          application/json:
            schema:
              type: object
        required: true
      responses:
        '200':
          description: Queued
          content:
            application/json:
              schema:
                type: object
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/AccessForbidden'
        '403':
          $ref: '#/components/responses/Forbidden'
        '500':
          $ref: '#/components/responses/ServerError'
      x-mint:
        metadata:
          title: Send app Event
          sidebarTitle: Send app Event
servers:
  - url: https://api.dintero.com/v1
components:
  parameters:
    aid:
      name: aid
      description: An id that uniquely identifies the account.
      in: path
      required: true
      schema:
        type: string
        minLength: 9
        maxLength: 9
        pattern: ^[PT]{1}\d{8}$
    app_id:
      name: app_id
      in: path
      required: true
      description: The app that will handle the request
      schema:
        type: string
    id:
      name: id
      in: path
      required: true
      description: The installed app that will be used to handle the request
      schema:
        type: string
    type:
      name: type
      in: path
      required: true
      description: The request event type.
      schema:
        type: string
        enum:
          - dintero_event
          - external_event
    signature:
      name: signature
      in: path
      required: true
      description: Signature validating the request
      schema:
        type: string
  responses:
    AccessForbidden:
      description: Access forbidden, invalid JWT token was used
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    Forbidden:
      description: Forbidden
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    NotFound:
      description: Resource was not found
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    ServerError:
      description: Unexpected Error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    BadRequest:
      description: Bad / Invalid request
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  securitySchemes:
    JWT:
      type: http
      description: >
        Bearer authentication (token authentication) should be used for
        accessing the API.


        Use [Get Token](/api-reference/authenticate/aid_auths_oauth_token_post)
        to get an access token for client credentials.

        Pass the token in the request header:

            Authorization: Bearer {access_token}

        where the **access_token** is JSON Web Tokens (JWT).
      scheme: bearer
      bearerFormat: JWT
  schemas:
    Error:
      type: object
      required:
        - error
      properties:
        error:
          type: object
          required:
            - message
          properties:
            code:
              type: string
              description: The code used to identify the error/warning
            errors:
              type: array
              description: The nested error(s) encountered during validation
              items:
                type: object
            message:
              type: string
              description: The human readable description of the error/warning
