Bridge Plaid API

The Plaid API from Bridge — 2 operation(s) for plaid.

OpenAPI Specification

bridge-plaid-api-openapi.yml Raw ↑
openapi: 3.0.2
info:
  title: Bridge API Keys Plaid API
  description: APIs to move into, out of, and between any form of a dollar
  version: '1'
servers:
- url: https://api.bridge.xyz/v0
  description: The base path for all resources
security:
- ApiKey: []
tags:
- name: Plaid
paths:
  /customers/{customerID}/plaid_link_requests:
    post:
      summary: Generate a Plaid Link token for a customer
      tags:
      - Plaid
      parameters:
      - $ref: '#/components/parameters/IdempotencyKeyParameter'
      - $ref: '#/components/parameters/CustomerIDParameter'
      responses:
        '201':
          description: Plaid Link token generated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PlaidLinkRequest'
              examples:
                PlaidLinkRequestSuccessResponse:
                  $ref: '#/components/examples/PlaidLinkRequestSuccessResponse'
        '401':
          $ref: '#/components/responses/AuthenticationError'
        '400':
          $ref: '#/components/responses/BadRequestError'
        '500':
          $ref: '#/components/responses/UnexpectedError'
  /plaid_exchange_public_token/{link_token}:
    post:
      summary: Exchange Plaid public token for an access token
      tags:
      - Plaid
      parameters:
      - name: link_token
        in: path
        required: true
        schema:
          type: string
        description: Plaid Link token
      requestBody:
        description: Plaid public token to be exchanged
        required: true
        content:
          application/json:
            schema:
              required:
              - id
              - type
              $ref: '#/components/schemas/PlaidExchangePublicToken'
      responses:
        '201':
          description: Plaid public token exchanged
          content:
            application/json:
              schema:
                title: Plaid public token exchanged
                type: object
                properties:
                  message:
                    type: string
                    description: Message indicating the status of the request
              examples:
                PlaidExchangePublicTokenSuccessResponse:
                  $ref: '#/components/examples/PlaidExchangePublicTokenSuccessResponse'
        '401':
          $ref: '#/components/responses/AuthenticationError'
        '400':
          $ref: '#/components/responses/BadRequestError'
        '500':
          $ref: '#/components/responses/UnexpectedError'
components:
  responses:
    AuthenticationError:
      description: Missing or invalid API key
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          examples:
            MissingTokenError:
              summary: No Api-Key header
              description: The header may be missing or misspelled.
              value:
                code: required
                location: header
                name: Api-Key
                message: Missing Api-Key header
            InvalidTokenError:
              summary: Invalid key in Api-Key header
              value:
                code: invalid
                location: header
                name: Api-Key
                message: Invalid Api-Key header
    BadRequestError:
      description: Request containing missing or invalid parameters.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          examples:
            BadCustomerRequestErrorExample:
              summary: Bad customer request
              value:
                code: bad_customer_request
                message: fields missing from customer body.
                name: first_name,ssn
    UnexpectedError:
      description: Unexpected error. User may try and send the request again.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          examples:
            UnexpectedError:
              summary: An unexpected error
              value:
                errors:
                - code: unexpected
                  message: An expected error occurred, you may try again later
  parameters:
    IdempotencyKeyParameter:
      in: header
      name: Idempotency-Key
      required: true
      schema:
        type: string
    CustomerIDParameter:
      name: customerID
      in: path
      required: true
      schema:
        $ref: '#/components/schemas/Id'
  schemas:
    Error:
      required:
      - code
      - message
      properties:
        code:
          type: string
          minLength: 1
          maxLength: 256
        message:
          type: string
          minLength: 1
          maxLength: 512
        source:
          title: ErrorSource
          required:
          - location
          - key
          properties:
            location:
              type: string
              enum:
              - path
              - query
              - body
              - header
            key:
              type: string
              description: Comma separated names of the properties or parameters causing the error
    Id:
      description: A UUID that uniquely identifies a resource
      type: string
      pattern: '[a-z0-9]*'
      minLength: 1
      maxLength: 42
    PlaidExchangePublicToken:
      required:
      - public_token
      properties:
        public_token:
          type: string
          description: Public token generated via the Plaid Link SDK
    PlaidLinkRequest:
      properties:
        link_token:
          type: string
          description: Link token generated via the Plaid Link SDK
        link_token_expires_at:
          type: string
          description: Expiration time of the link token
          format: date-time
        callback_url:
          type: string
          description: URL to call through Plaid Link Flow's onSuccess callback with the public token passed in the body of the request
  examples:
    PlaidLinkRequestSuccessResponse:
      summary: Successful Plaid Link token creation
      value:
        link_token: plaid_link_token_123
        link_token_expires_at: '2023-03-23T03:22:34.086Z'
        callback_url: https://api.bridge.xyz/v0/plaid_exchange_public_token/plaid_link_token_123
    PlaidExchangePublicTokenSuccessResponse:
      summary: Successful Plaid public token exchange
      value:
        message: Successfully exchanged public token for access token
  securitySchemes:
    ApiKey:
      type: apiKey
      name: Api-Key
      in: header