Codat Companies API

Create and manage your SMB users' companies.

OpenAPI Specification

codat-companies-api-openapi.yml Raw ↑
openapi: 3.1.0
info:
  title: Bank Feeds Account mapping Companies API
  version: 3.0.0
  contact:
    email: support@codat.io
    name: Codat
  description: 'Bank Feeds solution enables your SMB users to set up bank feeds from accounts in your application to supported accounting software.


    A bank feed is a connection between a source bank account in your application and a target bank account in a supported accounting software.


    [Explore solution](https://docs.codat.io/bank-feeds-api/overview) | [See OpenAPI spec](https://github.com/codatio/oas)


    ---

    <!-- Start Codat Tags Table -->

    ## Endpoints


    | Endpoints | Description |

    | :- |:- |

    | Companies | Create and manage your SMB users'' companies. |

    | Connections | Create new and manage existing data connections for a company. |

    | Source accounts | Provide and manage lists of source bank accounts. |

    | Account mapping | Extra functionality for building an account management UI. |

    | Company information | Get detailed information about a company from the underlying platform. |

    | Transactions | Create new bank account transactions for a company''s connections, and see previous operations. |

    <!-- End Codat Tags Table -->'
  termsOfService: https://www.codat.io/legals/
servers:
- description: Production
  url: https://api.codat.io
security:
- auth_header: []
tags:
- name: Companies
  description: Create and manage your SMB users' companies.
paths:
  /companies:
    post:
      summary: Create company
      tags:
      - Companies
      operationId: create-company
      responses:
        '200':
          description: OK
          content:
            application/json:
              x-speakeasy-usage-example: true
              schema:
                $ref: '#/components/schemas/Company'
              examples:
                With no description:
                  value:
                    id: ab12c58d-a678-4ebf-a159-ae99e1807bd0
                    name: Technicalium
                    description: ''
                    platform: ''
                    redirect: https://link.codat.io/company/ab12c58d-a678-4ebf-a159-ae99e1807bd0
                    dataConnections: []
                    created: '2022-11-10T10:45:18.1950523Z'
                    createdByUserName: Dan Tzabar
                    products:
                    - spend-insights
                    referenceSubsidiaryCompanies: []
                With a description:
                  value:
                    id: ab12c58d-a678-4ebf-a159-ae99e1807bd0
                    name: Technicalium
                    description: Technology services, including web and app design and development
                    platform: ''
                    redirect: https://link.codat.io/company/ab12c58d-a678-4ebf-a159-ae99e1807bd0
                    dataConnections: []
                    created: '2022-11-10T10:45:18.1950523Z'
                    createdByUserName: Dan Tzabar
                    products:
                    - spend-insights
                    referenceSubsidiaryCompanies: []
                With a tag:
                  value:
                    id: ab12c58d-a678-4ebf-a159-ae99e1807bd0
                    name: Technicalium
                    description: ''
                    platform: ''
                    redirect: https://link.codat.io/company/ab12c58d-a678-4ebf-a159-ae99e1807bd0
                    dataConnections: []
                    created: '2022-11-10T10:45:18.1950523Z'
                    createdByUserName: Dan Tzabar
                    products:
                    - spend-insights
                    tags:
                      region: us
                    referenceSubsidiaryCompanies: []
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '402':
          $ref: '#/components/responses/Payment-Required'
        '403':
          $ref: '#/components/responses/Forbidden'
        '429':
          $ref: '#/components/responses/Too-Many-Requests'
        '500':
          $ref: '#/components/responses/Internal-Server-Error'
        '503':
          $ref: '#/components/responses/Service-Unavailable'
      description: "\uFEFFUse the *Create company* endpoint to create a new [company](https://docs.codat.io/bank-feeds-api#/schemas/Company) that represents your customer in Codat. \n\nA [company](https://docs.codat.io/bank-feeds-api#/schemas/Company) represents a business sharing access to their data.\nEach company can have multiple [connections](https://docs.codat.io/bank-feeds-api#/schemas/Connection) to different data sources, such as one connection to Xero for accounting data, two connections to Plaid for two bank accounts, and a connection to Zettle for POS data.\n\nIf forbidden characters (see `name` pattern) are present in the request, a company will be created with the forbidden characters removed. For example, `Company (Codat[1])` with be created as `Company Codat1`."
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CompanyRequestBody'
            examples:
              With no description:
                value:
                  name: Technicalium
              With a description:
                value:
                  name: Technicalium
                  description: Technology services, including web and app design and development
    get:
      summary: List companies
      tags:
      - Companies
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Companies'
              examples:
                One company:
                  value:
                    results:
                    - id: 3fa85f64-5717-4562-b3fc-2c963f66afa6
                      name: My Test Company
                      description: My Test Company make testing software
                      platform: ''
                      redirect: https://link.codat.io/company/3fa85f64-5717-4562-b3fc-2c963f66afa6
                      lastSync: '2022-01-01T12:30:00.000Z'
                      dataConnections:
                      - id: 51baa045-4836-4317-a42e-3542e991e581
                        integrationId: 1c312d69-e638-46d4-ad31-72e6c3ba8390
                        integrationKey: vjms
                        sourceId: 396c3158-5dd7-481b-a7c4-a795ca31792b
                        platformName: Pandle
                        linkUrl: https://link-api.codat.io/companies/3fa85f64-5717-4562-b3fc-2c963f66afa6/connections/51baa045-4836-4317-a42e-3542e991e581/start
                        status: Linked
                        lastSync: '2022-01-01T12:30:00.000Z'
                        created: '2022-01-01T11:30:00Z'
                        sourceType: Accounting
                      created: '2022-01-01T11:30:00Z'
                      createdByUserName: Mike Smith
                      products:
                      - spend-insights
                      - lending
                      - expenses-v1
                      - commerce
                      referenceSubsidiaryCompanies: []
                    pageNumber: 1
                    pageSize: 100
                    totalResults: 1
                    _links:
                      current:
                        href: /companies?page=1&pageSize=100
                      self:
                        href: /companies
                List of Companies:
                  value:
                    results:
                    - id: d1568dde-adf6-11ed-afa1-0242ac120002
                      name: Technicalium
                      description: Technology services, including web and app design and development
                      platform: ''
                      redirect: https://link.codat.io/company/d1568dde-adf6-11ed-afa1-0242ac120002
                      lastSync: '2022-01-01T12:30:00.000Z'
                      dataConnections:
                      - id: 51baa045-4836-4317-a42e-3542e991e581
                        integrationId: 1c312d69-e638-46d4-ad31-72e6c3ba8390
                        integrationKey: vjms
                        sourceId: 396c3158-5dd7-481b-a7c4-a795ca31792b
                        platformName: Pandle
                        linkUrl: https://link-api.codat.io/companies/d1568dde-adf6-11ed-afa1-0242ac120002/connections/51baa045-4836-4317-a42e-3542e991e581/start
                        status: Linked
                        lastSync: '2022-01-01T12:30:00.000Z'
                        created: '2022-01-01T11:30:00Z'
                        sourceType: Accounting
                      created: '2022-01-01T11:30:00Z'
                      createdByUserName: Joe Bloggs
                      products:
                      - spend-insights
                      - lending
                      - payables-v2
                      referenceSubsidiaryCompanies: []
                    - id: ab12c58d-a678-4ebf-a159-ae99e1807bd0
                      name: Toft stores
                      redirect: https://link.codat.io/company/ab12c58d-a678-4ebf-a159-ae99e1807bd0
                      dataConnections: []
                      created: '2022-11-10T10:45:18Z'
                      createdByUserName: Dan Tzabar
                      products:
                      - spend-insights
                      referenceSubsidiaryCompanies:
                      - id: c8d3af58-7011-47ce-b3f2-89faf300ef6d
                        name: Toft stores UK
                        links:
                          portal: https://app.codat.io/companies/c8d3af58-7011-47ce-b3f2-89faf300ef6d/summary
                      - id: db94eddc-9212-4568-9b5c-3eab0e325913
                        name: Toft stores US
                        links:
                          portal: https://app.codat.io/companies/db94eddc-9212-4568-9b5c-3eab0e325913/summary
                    - id: c8d3af58-7011-47ce-b3f2-89faf300ef6d
                      name: Toft stores UK
                      redirect: https://link.codat.io/company/c8d3af58-7011-47ce-b3f2-89faf300ef6d
                      dataConnections:
                      - id: d5ab61b7-1ad0-46fd-9f9f-b6761047941e
                        integrationId: cc750323-5a47-4f28-8d8e-30fbbf2ce137
                        integrationKey: akxx
                        sourceId: 9815b998-024d-4415-a40b-89903b2cad6f
                        platformName: Oracle NetSuite
                        linkUrl: https://link-api.codat.io/companies/c8d3af58-7011-47ce-b3f2-89faf300ef6d/connections/d5ab61b7-1ad0-46fd-9f9f-b6761047941e/start
                        status: Linked
                        lastSync: '2022-01-01T12:30:00.000Z'
                        created: '2022-01-01T11:30:00Z'
                        sourceType: Accounting
                      created: '2022-11-10T10:45:18Z'
                      createdByUserName: Dan Tzabar
                      products:
                      - lending
                      - spend-insights
                      - payables
                      referenceParentCompany:
                        id: ab12c58d-a678-4ebf-a159-ae99e1807bd0
                        name: Toft stores
                        links:
                          portal: https://app.codat.io/companies/ab12c58d-a678-4ebf-a159-ae99e1807bd0/summary
                      referenceSubsidiaryCompanies: []
                    - id: db94eddc-9212-4568-9b5c-3eab0e325913
                      name: Toft stores US
                      redirect: https://link.codat.io/company/db94eddc-9212-4568-9b5c-3eab0e325913
                      dataConnections:
                      - id: 1e5c8c9e-27fd-4ba9-9a2a-d02ba65bc2fb
                        integrationId: cc750323-5a47-4f28-8d8e-30fbbf2ce137
                        integrationKey: akxx
                        sourceId: 9815b998-024d-4415-a40b-89903b2cad6f
                        platformName: Oracle NetSuite
                        linkUrl: https://link-api.codat.io/companies/db94eddc-9212-4568-9b5c-3eab0e325913/connections/1e5c8c9e-27fd-4ba9-9a2a-d02ba65bc2fb/start
                        status: Linked
                        lastSync: '2022-01-01T12:30:00.000Z'
                        created: '2022-01-01T11:30:00Z'
                        sourceType: Accounting
                      created: '2022-11-10T10:45:18Z'
                      createdByUserName: Dan Tzabar
                      products:
                      - spend-insights
                      referenceParentCompany:
                        id: ab12c58d-a678-4ebf-a159-ae99e1807bd0
                        name: Toft stores
                        links:
                          portal: https://app.codat.io/companies/ab12c58d-a678-4ebf-a159-ae99e1807bd0/summary
                      referenceSubsidiaryCompanies: []
                    pageNumber: 1
                    pageSize: 100
                    totalResults: 3
                    _links:
                      current:
                        href: /companies?page=1&pageSize=100
                      self:
                        href: /companies
        '400':
          $ref: '#/components/responses/Malformed-Query'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '402':
          $ref: '#/components/responses/Payment-Required'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/Not-Found'
        '429':
          $ref: '#/components/responses/Too-Many-Requests'
        '500':
          $ref: '#/components/responses/Internal-Server-Error'
        '503':
          $ref: '#/components/responses/Service-Unavailable'
      operationId: list-companies
      description: "\uFEFFThe *List companies* endpoint returns a list of [companies](https://docs.codat.io/bank-feeds-api#/schemas/Company) associated to your instances.\n\nA [company](https://docs.codat.io/bank-feeds-api#/schemas/Company) represents a business sharing access to their data.\nEach company can have multiple [connections](https://docs.codat.io/bank-feeds-api#/schemas/Connection) to different data sources, such as one connection to Xero for accounting data, two connections to Plaid for two bank accounts, and a connection to Zettle for POS data.\n\n## Filter by tags\n\nThe *List companies* endpoint supports the filtering of companies using [tags](https://docs.codat.io/using-the-api/managing-companies#add-metadata-to-a-company). It supports the following operators with [Codat’s query language](https://docs.codat.io/using-the-api/querying):\n\n- equals (`=`)\n- not equals (`!=`)\n- contains (`~`)\n\nFor example, you can use the querying to filter companies tagged with a specific foreign key, region, or owning team: \n- Foreign key: `uid = {yourCustomerId}`\n- Region: `region != uk`\n- Owning team and region: `region = uk && owningTeam = invoice-finance`"
      parameters:
      - $ref: '#/components/parameters/page'
      - $ref: '#/components/parameters/pageSize'
      - $ref: '#/components/parameters/query'
      - $ref: '#/components/parameters/orderBy'
      - name: tags
        in: query
        schema:
          type: string
        example: region=uk && team=invoice-finance
        description: Filter companies by tags using the "equals" (=), "not equals" (!=), and "contains" (~) operators with [Codat’s query language](https://docs.codat.io/using-the-api/querying).
  /companies/{companyId}:
    get:
      summary: Get company
      operationId: get-company
      description: "\uFEFFThe *Get company* endpoint returns a single company for a given `companyId`.\n\nA [company](https://docs.codat.io/bank-feeds-api#/schemas/Company) represents a business sharing access to their data.\nEach company can have multiple [connections](https://docs.codat.io/bank-feeds-api#/schemas/Connection) to different data sources, such as one connection to Xero for accounting data, two connections to Plaid for two bank accounts, and a connection to Zettle for POS data.\n"
      parameters:
      - $ref: '#/components/parameters/companyId'
      tags:
      - Companies
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Company'
              examples:
                Simple company:
                  value:
                    id: ab12c58d-a678-4ebf-a159-ae99e1807bd0
                    name: Toft stores holdings
                    description: ''
                    platform: ''
                    redirect: https://link.codat.io/company/ab12c58d-a678-4ebf-a159-ae99e1807bd0
                    dataConnections: []
                    created: '2022-11-10T10:45:18Z'
                    createdByUserName: Dan Tzabar
                    products:
                    - spend-insights
                    - lending
                    - expenses-v1
                    - commerce
                    referenceSubsidiaryCompanies: []
                Parent multi-entity company:
                  value:
                    id: ab12c58d-a678-4ebf-a159-ae99e1807bd0
                    name: Toft stores
                    description: ''
                    platform: ''
                    redirect: https://link.codat.io/company/ab12c58d-a678-4ebf-a159-ae99e1807bd0
                    dataConnections: []
                    created: '2022-11-10T10:45:18Z'
                    createdByUserName: Dan Tzabar
                    products:
                    - spend-insights
                    - lending
                    - expenses-v1
                    - commerce
                    referenceSubsidiaryCompanies:
                    - id: c8d3af58-7011-47ce-b3f2-89faf300ef6d
                      name: Toft stores UK
                      links:
                        portal: https://app.codat.io/companies/c8d3af58-7011-47ce-b3f2-89faf300ef6d/summary
                    - id: db94eddc-9212-4568-9b5c-3eab0e325913
                      name: Toft stores US
                      links:
                        portal: https://app.codat.io/companies/db94eddc-9212-4568-9b5c-3eab0e325913/summary
                Subsidiary multi-entity company:
                  value:
                    id: c8d3af58-7011-47ce-b3f2-89faf300ef6d
                    name: Toft stores UK
                    description: ''
                    platform: ''
                    redirect: https://link.codat.io/company/c8d3af58-7011-47ce-b3f2-89faf300ef6d
                    dataConnections:
                    - id: d5ab61b7-1ad0-46fd-9f9f-b6761047941e
                      integrationId: cc750323-5a47-4f28-8d8e-30fbbf2ce137
                      integrationKey: akxx
                      sourceId: 9815b998-024d-4415-a40b-89903b2cad6f
                      platformName: Oracle NetSuite
                      linkUrl: https://link-api.codat.io/companies/c8d3af58-7011-47ce-b3f2-89faf300ef6d/connections/d5ab61b7-1ad0-46fd-9f9f-b6761047941e/start
                      status: Linked
                      lastSync: '2022-01-01T12:30:00.000Z'
                      created: '2022-01-01T11:30:00Z'
                      sourceType: Accounting
                    created: '2022-11-10T10:45:18Z'
                    createdByUserName: Dan Tzabar
                    products:
                    - spend-insights
                    - lending
                    - expenses-v1
                    - commerce
                    referenceParentCompany:
                      id: ab12c58d-a678-4ebf-a159-ae99e1807bd0
                      name: Toft stores
                      links:
                        portal: https://app.codat.io/companies/ab12c58d-a678-4ebf-a159-ae99e1807bd0/summary
                    referenceSubsidiaryCompanies: []
        '401':
          $ref: '#/components/responses/Unauthorized'
        '402':
          $ref: '#/components/responses/Payment-Required'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/Not-Found'
        '429':
          $ref: '#/components/responses/Too-Many-Requests'
        '500':
          $ref: '#/components/responses/Internal-Server-Error'
        '503':
          $ref: '#/components/responses/Service-Unavailable'
    delete:
      summary: Delete a company
      operationId: delete-company
      parameters:
      - $ref: '#/components/parameters/companyId'
      description: "\uFEFFThe *Delete company* endpoint permanently deletes a [company](https://docs.codat.io/bank-feeds-api#/schemas/Company), its [connections](https://docs.codat.io/bank-feeds-api#/schemas/Connection) and any cached data. This operation is irreversible.\n\nA [company](https://docs.codat.io/bank-feeds-api#/schemas/Company) represents a business sharing access to their data.\nEach company can have multiple [connections](https://docs.codat.io/bank-feeds-api#/schemas/Connection) to different data sources, such as one connection to Xero for accounting data, two connections to Plaid for two bank accounts, and a connection to Zettle for POS data.\n"
      tags:
      - Companies
      responses:
        '204':
          description: No Content
        '401':
          $ref: '#/components/responses/Unauthorized'
        '402':
          $ref: '#/components/responses/Payment-Required'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/Not-Found'
        '429':
          $ref: '#/components/responses/Too-Many-Requests'
        '500':
          $ref: '#/components/responses/Internal-Server-Error'
        '503':
          $ref: '#/components/responses/Service-Unavailable'
    put:
      summary: Replace company
      description: "\uFEFFUse the *Replace company* endpoint to replace the existing name, description, and tags of the company. Calling the endpoint will replace existing values even if new values haven't been defined in the payload.\n\nA [company](https://docs.codat.io/bank-feeds-api#/schemas/Company) represents a business sharing access to their data.\nEach company can have multiple [connections](https://docs.codat.io/bank-feeds-api#/schemas/Connection) to different data sources, such as one connection to Xero for accounting data, two connections to Plaid for two bank accounts, and a connection to Zettle for POS data."
      operationId: replace-company
      x-speakeasy-name-override: replace
      parameters:
      - $ref: '#/components/parameters/companyId'
      tags:
      - Companies
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Company'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '402':
          $ref: '#/components/responses/Payment-Required'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/Not-Found'
        '429':
          $ref: '#/components/responses/Too-Many-Requests'
        '500':
          $ref: '#/components/responses/Internal-Server-Error'
        '503':
          $ref: '#/components/responses/Service-Unavailable'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CompanyRequestBody'
            examples:
              Update name:
                value:
                  name: New Name
              Update description:
                value:
                  name: Same name
                  description: Additional documents required
    patch:
      summary: Update company
      description: "\uFEFFUse the *Update company* endpoint to update the name, description, or tags of the company.\n\nThe *Update company* endpoint doesn't have any required fields. If any of the fields provided are `null` or not provided, they won't be included in the update.  \n\nA [company](https://docs.codat.io/bank-feeds-api#/schemas/Company) represents a business sharing access to their data."
      operationId: update-company
      parameters:
      - $ref: '#/components/parameters/companyId'
      tags:
      - Companies
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Company'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '402':
          $ref: '#/components/responses/Payment-Required'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/Not-Found'
        '429':
          $ref: '#/components/responses/Too-Many-Requests'
        '500':
          $ref: '#/components/responses/Internal-Server-Error'
        '503':
          $ref: '#/components/responses/Service-Unavailable'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CompanyUpdateRequest'
            examples:
              Update tags:
                value:
                  tags:
                    refrence: new reference
              Update name:
                value:
                  name: New Name
  /companies/{companyId}/accessToken:
    get:
      summary: Get company access token
      operationId: get-company-access-token
      x-speakeasy-name-override: get-access-token
      description: "Use the _Get company access token_ endpoint to return an access token for the specified company ID. The token is valid for one day. \n\nThe token is required by Codat's embeddable UIs (such as [Connections SDK](https://docs.codat.io/auth-flow/optimize/connection-management) and [Link SDK](https://docs.codat.io/auth-flow/authorize-embedded-link)) to verify the identity of the user and improve the reliability of data provided by them."
      parameters:
      - $ref: '#/components/parameters/companyId'
      tags:
      - Companies
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CompanyAccessToken'
              examples:
                Simple company:
                  value:
                    expiresIn: 86400
                    accessToken: string
                    tokenType: Bearer
        '401':
          $ref: '#/components/responses/Unauthorized'
        '402':
          $ref: '#/components/responses/Payment-Required'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/Not-Found'
        '429':
          $ref: '#/components/responses/Too-Many-Requests'
        '500':
          $ref: '#/components/responses/Internal-Server-Error'
        '503':
          $ref: '#/components/responses/Service-Unavailable'
  /companies/{companyId}/products/{productIdentifier}:
    parameters:
    - $ref: '#/components/parameters/companyId_2'
    - $ref: '#/components/parameters/productIdentifier'
    put:
      summary: Add product
      operationId: add-product
      x-speakeasy-name-override: add-product
      description: 'Use the *Add product* endpoint to enable a product for the company specified by `companyId`.


        > Note: This feature is currently in alpha and available only to participants in the development program.'
      tags:
      - Companies
      responses:
        '204':
          description: OK
        '401':
          $ref: '#/components/responses/Unauthorized'
        '402':
          $ref: '#/components/responses/Payment-Required'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/Not-Found'
        '429':
          $ref: '#/components/responses/Too-Many-Requests'
        '500':
          $ref: '#/components/responses/Internal-Server-Error'
        '503':
          $ref: '#/components/responses/Service-Unavailable'
    delete:
      summary: Remove product
      operationId: remove-product
      x-speakeasy-name-override: remove-product
      description: 'Use the *Remove product* endpoint to disable a product for the company specified by `companyId`.


        > Note: This feature is currently in alpha and available only to participants in the development program.'
      tags:
      - Companies
      responses:
        '204':
          description: OK
        '401':
          $ref: '#/components/responses/Unauthorized'
        '402':
          $ref: '#/components/responses/Payment-Required'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/Not-Found'
        '429':
          $ref: '#/components/responses/Too-Many-Requests'
        '500':
          $ref: '#/components/responses/Internal-Server-Error'
        '503':
          $ref: '#/components/responses/Service-Unavailable'
  /companies/{companyId}/products/{productIdentifier}/refresh:
    parameters:
    - $ref: '#/components/parameters/companyId_2'
    - $ref: '#/components/parameters/productIdentifier'
    post:
      summary: Refresh product data
      operationId: refresh-product-data
      x-speakeasy-name-override: refresh-product-data
      description: "Use the **Refresh product data** endpoint to manually refresh data for a custom product for a specific company.\n\n### Tips and traps\n\n- This endpoint only supports refreshing data for **custom products** and can't be used for Codat's standard solutions. Refer to [individual solutions' documentation](https://docs.codat.io/) instead.\n- If a data sync is already in progress for a custom product, the refresh request will return a `Bad request (400)` response.\n- If a company has multiple custom products enabled, you can refresh data for each product individually.\n - Optionally include a request body with `dataTypes` to refresh only selected data types for the specified product. If omitted, the product's scheduled refresh is triggered as usual.\n - When specifying `dataTypes`, each value must be a valid data type supported by the product. Invalid values will result in a `Bad request (400)` response listing valid options."
      tags:
      - Companies
      requestBody:
        required: false
        description: Optionally specify one or more data types to refresh for the given custom product. If omitted, the product's scheduled refresh is triggered as usual. When provided, each data type must be valid for the specified product.
        content:
          application/json:
            schema:
              type: object
              properties:
                dataTypes:
                  type: array
                  description: One or more data types to refresh for the product.
                  items:
                    type: string
              additionalProperties: false
            examples:
              Filter specific data types:
                value:
                  dataTypes:
                  - invoices
                  - payments
      responses:
        '202':
          description: OK
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorMessage'
              examples:
                Standard product not supported:
                  value:
                    statusCode: 400
                    service: PublicApi
                    error: Bank Feeds doesn't support data refreshing. For more information, refer to your solution’s documentation [here](https://docs.codat.io).
                    correlationId: bc997528a9d7abb9161ef45f05d38599
                    canBeRetried: Unknown
                    detailedErrorCode: 0
                Read in progress:
                  value:
                    statusCode: 400
                    service: PublicApi
                    error: Data cannot be refreshed while a read operation is in progress. Allow the read to complete before attempting to refresh.
                    correlationId: bc997528a9d7abb9161ef45f05d38599
                    canBeRetried: Unknown
                    detailedErrorCode: 0
        '401':
          $ref: '#/components/responses/Unauthorized'
        '402':
          $ref: '#/components/responses/Payment-Required'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/Not-Found'
        '429':
          $ref: '#/components

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