Skip to main content
Actions are TypeScript functions that run on demand and return a result. Unlike syncs, they execute immediately in response to an API call and are designed for write operations or any task that requires a direct response — creating a record, sending a message, fetching computed data, and so on.
All requests must include an Authorization: Bearer <secret-key> header. See Authentication for details.

Trigger action

POST /action/trigger Executes an action function for a specific connection and returns the function’s output. The action function receives the input you provide and executes with the credentials of the specified connection. Execution is synchronous — the request waits until the function completes and returns its result.

Headers

string
required
Bearer <secret-key>
string
required
The ID of the connection the action runs on behalf of.
string
required
The integration ID (unique key) for the connection.

Body

string
required
The name of the action to trigger, as defined in nango.yaml.
any
Input data passed to the action function as nango.input. Can be any JSON-serializable value — object, array, string, or number. The expected shape is defined by your action’s input model in nango.yaml.

Response

The response body is the value returned by the action function’s return statement. The shape is defined by your action’s output model in nango.yaml. If the action returns an object, the response is that object. If it returns void, the response body is empty.
Response
Node SDK signature

Trigger action asynchronously

POST /action/trigger with X-Async: true Triggers the action and returns immediately with a job ID, without waiting for the function to complete. Poll the status URL to retrieve the result when it is ready.

Additional header

string
Set to true to trigger the action asynchronously.

Response

string
required
Unique ID for the async action job.
string
required
URL to poll for the result. Make a GET request to this URL with your secret key to retrieve the output when complete.
Response
Node SDK signatures

Error handling

Action errors

When an action function throws an error, the API returns a 400 response with the error message from the function.

Timeout

Actions have a maximum execution time. If the function runs longer than the allowed limit, the request returns a 408 response.

Connection not found

If the specified connection does not exist, the API returns 404.

Missing action

If the action name does not match a deployed action for the integration, the API returns 404.

Example: sending a Slack message

Example: creating a HubSpot contact