Webhook & API Documentation

Our API can be used to trigger and pass data to your automations from external services.

Please note this funcionality is only available to users with an Axiom pro tier subscription or higher.

# Generate an API token

Your API token can be generated from the Axiom extension by clicking on the 'Google Sheets and API key' link in the main menu and clicking the 'Create API Token' button. Please note down your API token and keep it somewhere safe, for security reasons it is not displayed within the extension. If you need to generate a new token it will invalidate previously generated tokens - you will then need to replace the invalid token anywhere that it has been previously used.

# Run an Axiom with the Axiom API

Trigger an automation on your cloud instance by sending a POST request to https://lar.axiom.ai/api/v3/trigger from the external service.

The format of the POST should be JSON, and should have the following fields:

  • key: your API token, see here for instructions on how to generate your token;
  • name: the name of the Axiom to trigger;
  • data: either a list of comma seperated values, or a 2d array representing the data you want to send, organised as an array of columns of data. Example: [['Row 1 colA', 'Row 1 colB', 'Row 1 colC'], ['Row 2 colA', 'Row 2 colB', 'Row 2 colC']]

Example:

{
    "key": "1jf8SSbf73gfa",
    "name": "My Axiom",
    "data": [["A1", "B1", "C1"], ["A2", "B2", "C2"]]
}

# Use passed data in your automation

There are two ways to send data to axiom:

  1. Use Receive data from another app widget as the first step in your automation. The data sent when the automation is triggered will then be available to your automation as a token.
  2. Use Read data from Google Sheet as the first step in your automation. Before triggering your axiom, write to the Google sheet. This is our recommended approach, as it allows data to be inspected easily.

# Retrieve the status and results of an Axiom run

You can retrieve the current status of an axiom, as well as any data that was written to Google Sheets, by sending a POST request to https://lar.axiom.ai/api/v3/run-data.

The format of the POST should be JSON, and should have the following fields:

Example:

{
    "key": "1jf8SSbf73gfa",
    "name": "My Axiom",
}

The API call will return the status of the automation, which will be one of the following:

  • Running: the automation is still running
  • Success: the automation ran successfully
  • Failure: the automation ended with an error

It will also return the data currently written to any Google Sheet you have connected to the bot. The sheet data will be returned in a JSON object, keyed by the token name of each Google sheet.

Example:

{
    "status": "Success",
    "data": {"google-sheet-data": [["A1", "B1", "C1"], ["A2", "B2", "C2"]]}
}