tread.io Accounts API

The Accounts API from tread.io — 19 operation(s) for accounts.

OpenAPI Specification

treadio-accounts-api-openapi.yml Raw ↑
openapi: 3.0.3
info:
  title: Horizon API V1 AccountExternalTruckIdentifier Accounts API
  version: '1.0'
  contact:
    name: Tread
    url: https://tread.io
    email: developers@tread.io
  description: 'This is the Version 1 implementation.


    When in doubt we default to the practices outlined [here](https://www.vinaysahni.com/best-practices-for-a-pragmatic-restful-api#advanced-queries)'
  license:
    name: Private
    url: https://tread.io
servers:
- description: production
  url: https://api.tread-horizon.com
security:
- bearerAuth: []
tags:
- name: Accounts
paths:
  /v1/accounts:
    parameters:
    - $ref: '#/components/parameters/Accept-Language'
    post:
      summary: Create a new Account
      operationId: post-v1-accounts
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                type: object
                required:
                - data
                properties:
                  data:
                    $ref: '#/components/schemas/Account-Read'
        '400':
          $ref: '#/components/responses/Error'
        '401':
          $ref: '#/components/responses/UnauthenticatedError'
        '403':
          $ref: '#/components/responses/Error'
        '406':
          $ref: '#/components/responses/Error'
        '415':
          $ref: '#/components/responses/Error'
        '422':
          $ref: '#/components/responses/ModelError'
      x-stoplight:
        id: 85gw0eby5khks
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Account-Create'
      description: 'Create a new `Account`


        This endpoint requires the `create_account` permission'
      tags:
      - Accounts
    get:
      summary: Retrieve all Accounts visible to the current Company
      operationId: get-v1-accounts
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    x-stoplight:
                      id: nrsnmuc7twn2k
                    type: array
                    items:
                      $ref: '#/components/schemas/Account-Read'
                required:
                - data
          headers:
            Link:
              schema:
                type: string
              description: Contains prev and next links for pagination
        '401':
          $ref: '#/components/responses/UnauthenticatedError'
        '406':
          $ref: '#/components/responses/Error'
        '422':
          $ref: '#/components/responses/ModelError'
      x-stoplight:
        id: vw1abhy4q38wk
      tags:
      - Accounts
      description: "Retrieve `Accounts` visible to the currently authenticated `Company`.\n\nDatagrid search (`search[datagrid]`) queries against the following properties:\n * `name`\n\nFilter usage:\n * to filter a single state: `filter[account_types][]=customer`\n * to filter multiple states: `filter[account_types][]=customer&filter[account_types][]=vendor`"
      parameters:
      - $ref: '#/components/parameters/page-limit'
      - $ref: '#/components/parameters/page-after'
      - $ref: '#/components/parameters/page-before'
      - $ref: '#/components/parameters/search-datagrid'
      - $ref: '#/components/parameters/filter-account_types'
      - $ref: '#/components/parameters/filter-material_rates'
      - $ref: '#/components/parameters/filter-discarded'
      - $ref: '#/components/parameters/filter-department_ids'
      - $ref: '#/components/parameters/filter-connected_company-company_types'
      - $ref: '#/components/parameters/filter-auto_add_ons'
      - $ref: '#/components/parameters/filter-label_ids'
  /v1/accounts/bulk_update:
    parameters:
    - $ref: '#/components/parameters/Accept-Language'
    patch:
      summary: Bulk update Accounts
      tags:
      - Accounts
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                required:
                - data
                properties:
                  data:
                    type: array
                    x-stoplight:
                      id: 043ctqwh4vocf
                    items:
                      $ref: '#/components/schemas/Account-Read'
        '400':
          $ref: '#/components/responses/Error'
        '401':
          $ref: '#/components/responses/UnauthenticatedError'
        '403':
          $ref: '#/components/responses/Error'
        '406':
          $ref: '#/components/responses/Error'
        '415':
          $ref: '#/components/responses/Error'
        '422':
          $ref: '#/components/responses/ModelError'
      operationId: patch-v1-accounts-bulk_update
      x-stoplight:
        id: 9sf3s62gim4pp
      description: 'Perform select bulk updates to `Accounts`.


        Requires the `edit_account` permission.'
      x-internal: true
      requestBody:
        content:
          application/json:
            schema:
              type: object
              required:
              - data
              properties:
                data:
                  type: array
                  x-stoplight:
                    id: czk9oddnxv50n
                  items:
                    $ref: '#/components/schemas/Account-Update-Bulk'
  /v1/accounts/connected:
    parameters:
    - $ref: '#/components/parameters/Accept-Language'
    post:
      summary: Create a connected Account
      tags:
      - Accounts
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                type: object
                required:
                - data
                properties:
                  data:
                    $ref: '#/components/schemas/Account-Read'
        '401':
          $ref: '#/components/responses/UnauthenticatedError'
        '403':
          $ref: '#/components/responses/Error'
        '406':
          $ref: '#/components/responses/Error'
        '415':
          $ref: '#/components/responses/Error'
        '422':
          $ref: '#/components/responses/ModelError'
      operationId: post-v1-accounts-connected
      x-stoplight:
        id: ee581r2nsvq13
      description: "Create a connected `Account` between two `Companies`. \n\nThis endpoint creates two complimentary connected `Accounts`:\n * a \"sender\" `Account` owned by the `Company` specified by `sender_company_id` which has the provided `sender_account_types`\n * a \"receiver\" `Account` owned by the `Company` specified by `receiver_company_id` which has the opposite `account_types`\n \nThe newly created \"sender\" `Account` is returned.\n\nThis endpoint requires the `platform_admin` `IamRole`. "
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Account-Connected-Platform-Admin-Create'
    get:
      summary: Retrieve all connected Accounts visible to the current Company
      tags:
      - Accounts
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                required:
                - data
                properties:
                  data:
                    type: array
                    x-stoplight:
                      id: soszlt7ej40ta
                    items:
                      $ref: '#/components/schemas/Account-Read'
          headers:
            Link:
              schema:
                type: string
              description: Contains prev and next links for pagination
        '401':
          $ref: '#/components/responses/UnauthenticatedError'
        '406':
          $ref: '#/components/responses/Error'
      operationId: get-v1-accounts-connected
      x-stoplight:
        id: 19p2w6pnte1t2
      description: Retrieve all connected `Accounts` visible to the currently authenticated `Company`.
      parameters:
      - $ref: '#/components/parameters/page-limit'
      - $ref: '#/components/parameters/page-after'
      - $ref: '#/components/parameters/page-before'
  /v1/accounts/invite:
    parameters:
    - $ref: '#/components/parameters/Accept-Language'
    post:
      summary: Invite a Company to connect through an Account
      operationId: post-v1-accounts-invite
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    $ref: '#/components/schemas/Account-Read'
                required:
                - data
        '400':
          $ref: '#/components/responses/Error'
        '401':
          $ref: '#/components/responses/UnauthenticatedError'
        '403':
          $ref: '#/components/responses/Error'
        '406':
          $ref: '#/components/responses/Error'
        '415':
          $ref: '#/components/responses/Error'
        '422':
          $ref: '#/components/responses/ModelError'
      x-stoplight:
        id: o9p7fcv3vchcq
      description: "Invite a `Company` which is not yet on the `Tread` platform to connect through an `Account`.\n\nThis will create:\n * a new `Company` named `name` using `contact` data for `primary_contact ` and `billing_contact` \n * a new `User` with information from `contact` that has the `Company Admin` `IamRole`\n * a new `Account` owned by the currently authenticated `User`'s `Company` and connected to the newly created `Company`\n\nNote that all fields in `contact` are required.\n\nThe following unique constraints must be met or a `422` will be returned:\n * `name` must be globally unique to `Companies` \n * `contact.email` and `contact.phone` must be globally unique to `Users`\n\nIf successful the newly created `Account` will be returned.\n \nThis endpoint requires the `create_account` `IamPermission`\n \n"
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Account-Invite'
      tags:
      - Accounts
  /v1/accounts/typeahead:
    parameters:
    - $ref: '#/components/parameters/Accept-Language'
    get:
      summary: Typeahead search on Accounts
      tags:
      - Accounts
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    x-stoplight:
                      id: wvfdabnd4w4ar
                    items:
                      $ref: '#/components/schemas/Account-Read-Typeahead'
                required:
                - data
          headers:
            Link:
              schema:
                type: string
              description: Contains prev and next links for pagination
        '401':
          $ref: '#/components/responses/UnauthenticatedError'
        '406':
          $ref: '#/components/responses/Error'
        '422':
          $ref: '#/components/responses/ModelError'
      operationId: get-v1-accounts-typeahead
      x-stoplight:
        id: 249lre4wlspeo
      description: 'Typeahead search against the `name` property for `Accounts` visible to the currently authenticated `Company`.

        '
      x-internal: true
      parameters:
      - $ref: '#/components/parameters/page-limit'
      - $ref: '#/components/parameters/page-after'
      - $ref: '#/components/parameters/page-before'
      - $ref: '#/components/parameters/search-query'
      - $ref: '#/components/parameters/filter-account_types'
      - $ref: '#/components/parameters/filter-connected'
      - $ref: '#/components/parameters/filter-date'
  /v1/accounts/{account-id}/scheduled_time_offs:
    parameters:
    - schema:
        type: string
      name: account-id
      in: path
      required: true
      description: Account Id
    - $ref: '#/components/parameters/Accept-Language'
    post:
      summary: Create Scheduled Time Off
      tags:
      - Accounts
      responses:
        '201':
          description: Create Schedule Time off
          content:
            application/json:
              schema:
                type: object
                required:
                - data
                properties:
                  data:
                    $ref: '#/components/schemas/Scheduled-Time-Off-Read'
        '401':
          $ref: '#/components/responses/UnauthenticatedError'
        '403':
          $ref: '#/components/responses/Error'
        '406':
          $ref: '#/components/responses/Error'
        '415':
          $ref: '#/components/responses/Error'
        '422':
          $ref: '#/components/responses/ModelError'
      operationId: post-v1-accounts-id-scheduled_time_offs
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Scheduled-Time-Off-Create'
      description: Create a Scheduled Time Off for an `Account`
      x-stoplight:
        id: 1olm57uqimcn6
    get:
      summary: Retrieve Scheduled Time Offs for an Account
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                required:
                - data
                properties:
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/Scheduled-Time-Off-Read'
          headers:
            Link:
              schema:
                type: string
              description: Contains prev and next links for pagination
        '400':
          $ref: '#/components/responses/Error'
        '401':
          $ref: '#/components/responses/UnauthenticatedError'
        '404':
          $ref: '#/components/responses/Error'
        '406':
          $ref: '#/components/responses/Error'
      operationId: get-v1-accounts-account-id-scheduled-time-offs
      description: Retrieve all active `ScheduledTimeOffs` visible to your `Company` for an `Account`
      tags:
      - Accounts
      x-stoplight:
        id: jgfv1mbmm1pbz
  /v1/accounts/{account-id}/scheduled_time_offs/available:
    parameters:
    - schema:
        type: string
      name: account-id
      in: path
      required: true
      description: Account Id
    - $ref: '#/components/parameters/Accept-Language'
    put:
      summary: Mark Schedule Available
      tags:
      - Accounts
      responses:
        '202':
          description: Shared Response
          content:
            application/json:
              schema:
                type: object
                properties: {}
        '401':
          $ref: '#/components/responses/UnauthenticatedError'
        '403':
          $ref: '#/components/responses/Error'
        '404':
          $ref: '#/components/responses/Error'
        '406':
          $ref: '#/components/responses/Error'
        '422':
          $ref: '#/components/responses/ModelError'
      operationId: put-v1-accounts-account-id-scheduled_time_offs-available
      description: Mark current `Account` as available and disable any `Scheduled Time Off`
      x-stoplight:
        id: j5d2axo7kl23u
  /v1/accounts/{account-id}/scheduled_time_offs/unavailable:
    parameters:
    - schema:
        type: string
      name: account-id
      in: path
      required: true
      description: Account Id
    - $ref: '#/components/parameters/Accept-Language'
    put:
      summary: Mark Schedule Unavailable
      tags:
      - Accounts
      responses:
        '202':
          description: Shared Response
          content:
            application/json:
              schema:
                type: object
                properties: {}
        '401':
          $ref: '#/components/responses/UnauthenticatedError'
        '403':
          $ref: '#/components/responses/Error'
        '404':
          $ref: '#/components/responses/Error'
        '406':
          $ref: '#/components/responses/Error'
        '422':
          $ref: '#/components/responses/ModelError'
      operationId: put-v1-accounts-account-id-scheduled_time_offs-unavailable
      description: Mark current `Account` as unavailable and create a new `Scheduled time off`
      x-stoplight:
        id: vyxq886egaykj
  /v1/accounts/{account-id}/scheduled_time_offs/{id}:
    parameters:
    - schema:
        type: string
      name: id
      in: path
      required: true
      description: Scheduled time off id
    - schema:
        type: string
      name: account-id
      in: path
      required: true
      description: Account Id
    - $ref: '#/components/parameters/Accept-Language'
    delete:
      summary: Delete a Scheduled Time Off
      tags:
      - Accounts
      responses:
        '204':
          description: No Content
        '401':
          $ref: '#/components/responses/UnauthenticatedError'
        '403':
          $ref: '#/components/responses/Error'
        '404':
          $ref: '#/components/responses/Error'
        '406':
          $ref: '#/components/responses/Error'
        '422':
          $ref: '#/components/responses/ModelError'
      operationId: delete-v1-accounts-account-id-scheduled_time_offs-id
      description: Delete Scheduled Time Off for an `Account`
      x-stoplight:
        id: d6xald6a3166r
  /v1/accounts/{id}:
    parameters:
    - schema:
        type: string
      name: id
      in: path
      required: true
      description: Account ID
    - $ref: '#/components/parameters/Accept-Language'
    get:
      summary: Retrieve a single Account
      operationId: get-v1-accounts-id
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    $ref: '#/components/schemas/Account-Read'
                required:
                - data
        '401':
          $ref: '#/components/responses/UnauthenticatedError'
        '404':
          $ref: '#/components/responses/Error'
        '406':
          $ref: '#/components/responses/Error'
      x-stoplight:
        id: z83cux1tsowcw
      description: Retrieve `Account` by ID
      tags:
      - Accounts
    patch:
      summary: Update an Account
      operationId: patch-v1-accounts-id
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    $ref: '#/components/schemas/Account-Read'
                required:
                - data
        '400':
          $ref: '#/components/responses/Error'
        '401':
          $ref: '#/components/responses/UnauthenticatedError'
        '403':
          $ref: '#/components/responses/Error'
        '404':
          $ref: '#/components/responses/Error'
        '406':
          $ref: '#/components/responses/Error'
        '415':
          $ref: '#/components/responses/Error'
        '422':
          $ref: '#/components/responses/ModelError'
      x-stoplight:
        id: zsfr920ta0thd
      description: 'Update an `Account` by ID.


        This endpoint requires the `edit_account` permission'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Account-Update'
      tags:
      - Accounts
    delete:
      summary: Delete an Account
      operationId: delete-v1-accounts-id
      responses:
        '204':
          description: No Content
        '401':
          $ref: '#/components/responses/UnauthenticatedError'
        '403':
          $ref: '#/components/responses/Error'
        '404':
          $ref: '#/components/responses/Error'
        '406':
          $ref: '#/components/responses/Error'
        '422':
          $ref: '#/components/responses/ModelError'
      x-stoplight:
        id: xrjr1vnm5auyn
      tags:
      - Accounts
      description: 'Delete an `Account` by ID


        This endpoint requires the `delete_account` permission'
  /v1/agave/linked_accounts/{linked-account-id}/customers/accounts/typeahead:
    parameters:
    - schema:
        type: string
        format: uuid
      name: linked-account-id
      in: path
      required: true
      description: Agave-LinkedAccount ID
    - name: Accept-Language
      in: header
      schema:
        type: string
        default: en
        example: en
      description: 'The Accept-Language request HTTP header indicates the natural language and locale that the client prefers. '
    get:
      summary: Typeahead search on customer Accounts scoped to an Agave-LinkedAccount
      tags:
      - Accounts
      responses:
        '200':
          description: OK
          headers:
            Link:
              schema:
                type: string
              description: Contains prev and next links for pagination
          content:
            application/json:
              schema:
                type: object
                required:
                - data
                properties:
                  data:
                    type: array
                    x-stoplight:
                      id: 1h86is9cxx3ug
                    items:
                      $ref: '#/components/schemas/Account-Read-Typeahead'
        '401':
          $ref: '#/components/responses/UnauthenticatedError'
        '403':
          $ref: '#/components/responses/Error'
        '404':
          $ref: '#/components/responses/Error'
        '406':
          $ref: '#/components/responses/Error'
      operationId: get-v1-linked_accounts-linked-account-id-customers-accounts-typeahead
      x-stoplight:
        id: njqxhggv410ww
      x-internal: true
      description: '`Typeahead` search on customer `Accounts` scoped to an `Agave-LinkedAccount`.


        This endpoint requires the `manage_accounting_integration` `IamPermission`.'
      parameters:
      - $ref: '#/components/parameters/page-limit'
      - $ref: '#/components/parameters/page-after'
      - $ref: '#/components/parameters/page-before'
      - $ref: '#/components/parameters/search-query'
  /v1/agave/linked_accounts/{linked-account-id}/vendors/accounts/typeahead:
    parameters:
    - schema:
        type: string
        format: uuid
      name: linked-account-id
      in: path
      required: true
      description: Agave-LinkedAccount ID
    - $ref: '#/components/parameters/Accept-Language'
    get:
      summary: Typeahead search on vendor Accounts scoped to an Agave-LinkedAccount
      tags:
      - Accounts
      responses:
        '200':
          description: OK
          headers:
            Link:
              schema:
                type: string
              description: Contains prev and next links for pagination
          content:
            application/json:
              schema:
                type: object
                required:
                - data
                properties:
                  data:
                    type: array
                    x-stoplight:
                      id: jg82x33oj649k
                    items:
                      $ref: '#/components/schemas/Account-Read-Typeahead'
        '401':
          $ref: '#/components/responses/UnauthenticatedError'
        '403':
          $ref: '#/components/responses/Error'
        '404':
          $ref: '#/components/responses/Error'
        '406':
          $ref: '#/components/responses/Error'
      operationId: get-v1-linked_accounts-linked-account-id-vendors-accounts-typeahead
      x-stoplight:
        id: wzm19zmjd4piz
      x-internal: true
      description: '`Typeahead` search on vendor `Accounts` scoped to an `Agave-LinkedAccount`.


        This endpoint requires the `manage_accounting_integration` `IamPermission`.'
      parameters:
      - $ref: '#/components/parameters/page-limit'
      - $ref: '#/components/parameters/page-after'
      - $ref: '#/components/parameters/page-before'
      - $ref: '#/components/parameters/search-query'
  /v1/companies/{company-id}/accounts:
    parameters:
    - schema:
        type: string
      name: company-id
      in: path
      required: true
      description: Company ID
    - $ref: '#/components/parameters/Accept-Language'
    get:
      summary: Retrieve Accounts that belong to a Company
      tags:
      - Accounts
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    x-stoplight:
                      id: qrkdu1jkmgt50
                    items:
                      $ref: '#/components/schemas/Account-Read'
                required:
                - data
          headers:
            Link:
              schema:
                type: string
              description: Contains prev and next links for pagination
        '401':
          $ref: '#/components/responses/UnauthenticatedError'
        '404':
          $ref: '#/components/responses/Error'
        '406':
          $ref: '#/components/responses/Error'
        '422':
          $ref: '#/components/responses/ModelError'
      operationId: get-v1-companies-company-id-accounts
      x-stoplight:
        id: dn0zfz8ziwm6x
      description: "Retrieve `Accounts` for a `Company`.\n\nFilter usage:\n * to filter a single state: `filter[account_types][]=customer`\n * to filter multiple states: `filter[account_types][]=customer&filter[account_types][]=vendor`"
      parameters:
      - $ref: '#/components/parameters/page-limit'
      - $ref: '#/components/parameters/page-after'
      - $ref: '#/components/parameters/page-before'
      - $ref: '#/components/parameters/filter-account_types'
      - $ref: '#/components/parameters/search-datagrid'
      - $ref: '#/components/parameters/filter-material_rates'
      - $ref: '#/components/parameters/filter-discarded'
      - $ref: '#/components/parameters/filter-department_ids'
      - $ref: '#/components/parameters/filter-connected_company-company_types'
      - $ref: '#/components/parameters/filter-auto_add_ons'
      x-internal: false
  /v1/companies/{company-id}/accounts/capacity/typeahead:
    parameters:
    - schema:
        type: string
      name: company-id
      in: path
      required: true
      description: Company ID
    - $ref: '#/components/parameters/Accept-Language'
    get:
      summary: Typeahead search on Accounts for a Company with with Capacity Data
      tags:
      - Accounts
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                required:
                - data
                properties:
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/Account-Read-Capacity-Typeahead'
          headers:
            Link:
              schema:
                type: string
              description: Contains prev and next links for pagination
        '401':
          $ref: '#/components/responses/UnauthenticatedError'
        '404':
          $ref: '#/components/responses/Error'
        '406':
          $ref: '#/components/responses/Error'
        '422':
          $ref: '#/components/responses/ModelError'
      operationId: get-v1-companies-accounts-capacity-typeahead
      description: 'Typeahead search against the `name` property on `Accounts` for a `Company`.


        Unlike the standard typeahead, this endpoint includes additional fields with capacity data.


        Additionally, this endpoint automatically filters to:


        - Connnected Accoubts

        - Vendor-type Accounts

        - Accounts that are currently scheduled on


        The `availability` filter can be set to true/false to only include Accounts that are scheduled on or off for the `date` specified. If no `date` is specified then the current day is used.'
      x-internal: true
      parameters:
      - $ref: '#/components/parameters/page-limit'
      - $ref: '#/components/parameters/page-after'
      - $ref: '#/components/parameters/page-before'
      - $ref: '#/components/parameters/search-query'
      - $ref: '#/components/parameters/filter-availability'
      - $ref: '#/components/parameters/filter-show_all'
      - $ref: '#/components/parameters/filter-label_ids'
      - schema:
          type: string
        in: query
        name: date
        description: The date to query for regarding capacity. In YYYY-MM-DD format.
        required: true
      x-stoplight:
        id: ki83zc9q4cndp
  /v1/companies/{company-id}/accounts/connected:
    parameters:
    - schema:
        type: string
      name: company-id
      in: path
      required: true
      description: Company ID
    - $ref: '#/components/parameters/Accept-Language'
    post:
      summary: Create a connected Account
      tags:
      - Accounts
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                type: object
                required:
                - data
                properties:
                  data:
                    $ref: '#/components/schemas/Account-Read'
        '401':
          $ref: '#/components/responses/UnauthenticatedError'
        '403':
          $ref: '#/components/responses/Error'
        '404':
          $ref: '#/components/responses/Error'
        '406':
          $ref: '#/components/responses/Error'
        '415':
          $ref: '#/components/responses/Error'
        '422':
          $ref: '#/components/responses/ModelError'
      operationId: post-v1-companies-company-id-accounts-connected
      x-stoplight:
        id: et13o92j8q1dx
      description: "Create a connected `Account` between two `Companies` by use of a `tread_id`.\n\nThis endpoint creates two complimentary connected `Accounts`:\n * a \"sender\" `Account` owned by the `Company` specified in the `company-id` path param which has the provided `account_types`.\n * a \"receiver\" `Account` owned by the `Company` specified in the `tread_id` which has the opposite `account_types`\n \nThe newly created \"sender\" `Account` is returned.\n\nThis endpoint must be called by a principal authorized to act on behalf of the \"sender\" `Company`.\n\nThis endpoint requires the `connect_companies` `IamPermission`."
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Account-Connected-Customer-Create'
      x-internal: true
    get:
      summary: Retrieve connected Accounts that belong to a Company
      tags:
      - Accounts
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                required:
                - data
                properties:
                  data:
                    type: array
                    x-stoplight:
                      id: tm4j0ddqabdz8
                    items:
                      $ref: '#/components/schemas/Account-Read'
          headers:
            Link:
              schema:
                type: string
              description: Contains prev and next links for pagination
        '401':
          $ref: '#/components/responses/UnauthenticatedError'
        '404':
          $ref: '#/components/responses/Error'
        '406':
          $ref: '#/components/responses/Error'
      operationId: get-v1-companies-company-id-accounts-connected
      x-stoplight:
        id: pcg42w16g8q9d
      description: Retrieve connected `Accounts` for a `Company`.
      parameters:
      - $ref: '#/components/parameters/page-limit'
      - $ref: '#/components/parameters/page-after'
      - $ref: '#/components/parameters/page-before'
      - $ref: '#/components/parameters/search-datagrid'
      - $ref: '#/components/parameters/filter-account_types'
      - $ref: '#/components/parameters/filter-discarded'
  /v1/companies/{company-id}/accounts/invite:
    parameters:
    - schema:
        type: string
        format: uuid
      name: company-id
      in: path
      required: true
      description: Company ID
    - $ref: '#/components/parameters/Accept-Language'
    post:
      summary: Invite a Company to connect through an Accoun

# --- truncated at 32 KB (92 KB total) ---
# Full source: https://raw.githubusercontent.com/api-evangelist/treadio/refs/heads/main/openapi/treadio-accounts-api-openapi.yml