Skip to main content

Use a webhook as a source

Push data into an automation from another application with a POST request.

Written by Jonatan Gomes

Use a webhook source to push data into an automation from another application. The application sends a POST request to an address Sheetgo gives you, and the data it sends becomes the rows your automation processes.

Add a webhook as a source

  1. Open an automation in the automation builder.

  2. Under APPS & SERVICES, choose Webhook from the source list.

  3. Select Copy URL to copy the address shown under DISPATCH URL.

  4. Select Next step and choose where the data should be written.

Each webhook source has its own dispatch URL. Send data to that address and it arrives in that automation.

Authorize the request

Every request needs an Authorization header carrying your Sheetgo API key as a bearer token:

Authorization: Bearer <your API key>

The source step shows the key currently in use under AUTHORIZATION, with the middle characters hidden. Select Manage API key to create a key or replace the existing one.

Treat the dispatch URL and the API key as secrets. Anyone who has both can write data into your automation.

Format the request body

Send a JSON object with a values array. Each entry in the array is one row, and each row is an array of cell values. The first row becomes the header row:

{  "values": [    [      "Header 1",      "Header 2"    ],    [      "row1.a",      "row1.b"    ]  ]}

The source step shows this example under EXAMPLE REQUEST BODY. Select Copy body to copy it.

Choose a destination

A webhook source writes to a Google Sheets, Excel, or CSV destination.

To publish the data at an API endpoint or send it to another webhook, build a second automation that reads from the file the first one writes. The API endpoint destination publishes the result at a private URL that other systems read on demand. The Webhook destination sends data out in a POST request. The builder suggests this two-automation approach when a destination is not available for the source you picked.

Run the workflow when data arrives

To run the workflow each time a webhook source receives a request, set up an automation trigger:

  1. Open the workflow's Triggers panel using the Triggers icon in the workflow sidebar.

  2. Turn on the switch at the top ("Auto-Run" or "Run automatically", depending on where you open it).

  3. Under "Trigger options", choose "On webhook event".

  4. In the "Webhook source" field, keep "Any webhook source". The workflow will run each time any of its webhook sources receives a request.

  5. Select "Save changes".

If the workflow has no webhook source, the panel says: "This workflow does not have a webhook source connection. Add one so the trigger has something to listen to." Add a webhook source connection before setting up the trigger.

The workflow consumes automation credits each time a webhook source receives a request, so total usage depends on how often the producer sends data. The Triggers panel shows an estimate "per webhook event".

For step-by-step instructions, see Run a workflow when a webhook receives data.

Related articles

Keep reading: to send data out to another system instead, see Send automation data to a webhook.

Did this answer your question?