Vic.ai Authentication API

To initiate the authentication process, send a POST request to `/v0/token` with the payload as shown in the example below: ```json { "client_id": "VIC_CLIENT_ID", "client_secret": "VIC_CLIENT_SECRET" } ``` Here is an example of how to do this: ```bash curl -X POST https://api.us.vic.ai/v0/token \ -H "Content-Type: application/json" \ -d '{"client_id": "VIC_CLIENT_ID", "client_secret": "VIC_CLIENT_SECRET"}' ``` Upon providing a valid client ID and client secret, you should receive a response similar to the following: ```json { "access_token": "YOUR_ACCESS_TOKEN", "token_type": "Bearer", "expires_in": 3600 } ``` **Token Storage:** If you are storing the `access_token`, ensure your storage mechanism does not impose a character limit. Access tokens use JWT format and may be 530 characters or longer. For subsequent calls, use the value in `access_token` in the `Authorization` field. Here is an example: ```bash curl https://api.us.vic.ai/v0/healthCheck \ -H "Content-Type: application/json" \ -H "Authorization: Bearer YOUR_ACCESS_TOKEN" ``` The response should resemble the following: ```bash {"company":"Your Company Name","status":"PASS","version":"0.19.0"} ```

OpenAPI Specification

vicai-authentication-api-openapi.yml Raw ↑
openapi: 3.1.0
info:
  version: v10.40.4
  contact: {}
  title: Vic.ai Accounts Authentication API
  description: "## Introduction\n\nThe Vic.ai API provides a seamless connection between your Enterprise Resource\nPlanning (ERP) system and the Vic.ai product suite.\n\nThe API is designed to offer three main areas of functionality:\n\n- **Syncing master data:** This refers to the data in your ERP that Vic.ai\n  interacts with. You are required to supply and update this data in Vic.ai, and\n  you also have the option to verify the copy of the masterdata in Vic.ai.\n\n- **Syncing training data:** We need historical data to train your AI model. To\n  that end, the API provides endpoints to sync historical invoices into Vic.ai\n  and to confirm their presence.\n\n- **Subscribing to and receiving webhooks:** Webhooks enable users or automated\n  tasks to interact with your ERP through various actions in the Vic.ai product\n  suite, such as posting an invoice, payment or purchase order or requesting\n  synchronization. You will receive a notification via a webhook when these\n  actions occur.\n\n\nFor US-based integrations, please use the following base API URL:\n\n```\nhttps://api.us.vic.ai\n```\n\nFor integrations based in Norway, use the following base API URL:\n\n```\nhttps://api.no.vic.ai\n```\n\nAll paths mentioned in this documentation should use one of these URLs as the\nbase.\n\nExample:\n\n```bash\ncurl https://api.us.vic.ai/v0/healthCheck \\\n    -H \"Content-Type: application/json\" \\\n    -H \"Authorization: Bearer YOUR_ACCESS_TOKEN\"\n```\n\n## Getting Started\n\nTo begin interacting with the Vic.ai API, you will need the following\ncredentials:\n\n* A Vic.ai client ID\n* A Vic.ai client secret.\n\nThese can be provided to you securely by a Vic.ai representative\n[upon request](https://www.vic.ai/book-a-demo).\n\n**Please note:** These credentials are essentially the keys to your ERP\nintegration. If they fall into the wrong hands, unauthorized parties could\nimpersonate you, gain access to sensitive data, and potentially perform\nmalicious actions. Therefore, it's crucial to keep these credentials safe at all\ntimes to protect your application's integrity and your clients' data.\n\n### Limitations\n\nThe Vic.ai API has the following limitations:\n\n**Rate Limiting:** The API is rate-limited to 500 requests per 10-second time\nframe. If you exceed this limit, you will receive a `429 Too Many Requests`\nresponse. The limit is per Oauth client ID. If you continue to receive `429`s,\nplease contact support with a request id from the response headers.\n"
servers:
- url: https://api.no.stage.vic.ai
  description: staging server, NO
- url: https://api.us.vic.ai
  description: production server, US
- url: https://api.no.vic.ai
  description: production server, NO
security:
- BearerAuth: []
tags:
- name: Authentication
  description: "To initiate the authentication process, send a POST request to `/v0/token` with\nthe payload as shown in the example below:\n\n```json\n{\n    \"client_id\": \"VIC_CLIENT_ID\",\n    \"client_secret\": \"VIC_CLIENT_SECRET\"\n}\n```\n\nHere is an example of how to do this:\n\n```bash\ncurl -X POST https://api.us.vic.ai/v0/token \\\n    -H \"Content-Type: application/json\" \\\n    -d '{\"client_id\": \"VIC_CLIENT_ID\", \"client_secret\": \"VIC_CLIENT_SECRET\"}'\n```\n\nUpon providing a valid client ID and client secret, you should receive a\nresponse similar to the following:\n\n```json\n{\n    \"access_token\": \"YOUR_ACCESS_TOKEN\",\n    \"token_type\": \"Bearer\",\n    \"expires_in\": 3600\n}\n```\n\n**Token Storage:** If you are storing the `access_token`, ensure your storage\nmechanism does not impose a character limit. Access tokens use JWT format and\nmay be 530 characters or longer.\n\nFor subsequent calls, use the value in `access_token` in the `Authorization`\nfield.\n\nHere is an example:\n\n```bash\ncurl https://api.us.vic.ai/v0/healthCheck \\\n    -H \"Content-Type: application/json\" \\\n    -H \"Authorization: Bearer YOUR_ACCESS_TOKEN\"\n```\n\nThe response should resemble the following:\n\n```bash\n{\"company\":\"Your Company Name\",\"status\":\"PASS\",\"version\":\"0.19.0\"}\n```\n"
paths:
  /v0/token:
    post:
      description: 'Use this endpoint to obtain an access token that can be used to authenticate subsequent requests to the API.

        '
      summary: Obtain an access token
      operationId: obtainToken
      tags:
      - Authentication
      security: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/GetTokenInput'
      responses:
        '200':
          $ref: '#/components/responses/TokenCreatedResponse'
        4XX:
          $ref: '#/components/responses/ErrorResponse'
components:
  schemas:
    GetTokenInput:
      type: object
      required:
      - client_id
      - client_secret
      properties:
        client_id:
          type: string
        client_secret:
          type: string
    ErrorString:
      type: string
      maxLength: 255
    Error:
      description: 'generic error message in JSON format.  Note the ''code'' field should

        match the HTTP status code of the wrapping HTTP request.

        '
      type: object
      required:
      - code
      - message
      properties:
        code:
          type: integer
          minimum: 100
          maximum: 599
        message:
          $ref: '#/components/schemas/ErrorString'
    GetTokenResult:
      type: object
      required:
      - access_token
      - token_type
      - expires_in
      properties:
        access_token:
          type: string
        token_type:
          type: string
          enum:
          - Bearer
        expires_in:
          type: integer
  responses:
    ErrorResponse:
      description: An unexpected error has occurred. Check the body for more details.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    TokenCreatedResponse:
      description: Successful access token request
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/GetTokenResult'
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
x-tagGroups:
- name: Integration
  tags:
  - Authentication
  - Pagination
  - Webhooks
  - Webhook Subscriptions
  - Webhook Events
  - Synchronizing
  - Status
- name: Master Data
  tags:
  - Accounts
  - Dimensions
  - Vendors
  - Vendor Groups
  - Vendor Tags
  - Tags
  - Tax Codes
  - VAT Codes
  - Payment Terms
- name: Organization & Access
  tags:
  - Partners
  - Organizations
  - Companies
  - Users
- name: Invoices & Bills
  tags:
  - Invoices
  - Bills
  - Attachments
  - Invoice Approval Flows
  - Invoice Posting Guide
  - Training Invoices
- name: Purchase Orders
  tags:
  - Purchase Orders
  - Purchase Order Line Items
  - Purchase Order Matching Guide
- name: Payments
  tags:
  - Payment Batches
  - Payment Confirmations
  - Credit Confirmations
- name: Reporting
  tags:
  - CSV Reports
- name: Reference
  tags:
  - Changelog