Trigger an action (deprecated)
curl --request POST \
--url https://api.nango.dev/action/trigger \
--header 'Authorization: Bearer <token>' \
--header 'Connection-Id: <connection-id>' \
--header 'Content-Type: application/json' \
--header 'Provider-Config-Key: <provider-config-key>' \
--data '
{
"action_name": "<string>",
"input": {}
}
'import requests
url = "https://api.nango.dev/action/trigger"
payload = {
"action_name": "<string>",
"input": {}
}
headers = {
"Connection-Id": "<connection-id>",
"Provider-Config-Key": "<provider-config-key>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'Connection-Id': '<connection-id>',
'Provider-Config-Key': '<provider-config-key>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({action_name: '<string>', input: {}})
};
fetch('https://api.nango.dev/action/trigger', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.nango.dev/action/trigger",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'action_name' => '<string>',
'input' => [
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Connection-Id: <connection-id>",
"Content-Type: application/json",
"Provider-Config-Key: <provider-config-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.nango.dev/action/trigger"
payload := strings.NewReader("{\n \"action_name\": \"<string>\",\n \"input\": {}\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Connection-Id", "<connection-id>")
req.Header.Add("Provider-Config-Key", "<provider-config-key>")
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.nango.dev/action/trigger")
.header("Connection-Id", "<connection-id>")
.header("Provider-Config-Key", "<provider-config-key>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"action_name\": \"<string>\",\n \"input\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.nango.dev/action/trigger")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Connection-Id"] = '<connection-id>'
request["Provider-Config-Key"] = '<provider-config-key>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"action_name\": \"<string>\",\n \"input\": {}\n}"
response = http.request(request)
puts response.read_body{
"your-properties": "The data returned by the action"
}{
"message": "<string>"
}{
"error": {
"message": "<string>",
"code": "<string>",
"payload": {},
"upstream": {
"status": 123,
"headers": {
"content-type": "<string>"
},
"body": {}
}
}
}{
"error": {
"message": "<string>",
"code": "<string>",
"payload": {}
}
}Actions (deprecated)
Trigger an action (deprecated)
deprecated
Legacy action execution. Use POST /connections//tools//calls for new synchronous callers. Existing async callers can continue using this endpoint.
POST
/
action
/
trigger
Trigger an action (deprecated)
curl --request POST \
--url https://api.nango.dev/action/trigger \
--header 'Authorization: Bearer <token>' \
--header 'Connection-Id: <connection-id>' \
--header 'Content-Type: application/json' \
--header 'Provider-Config-Key: <provider-config-key>' \
--data '
{
"action_name": "<string>",
"input": {}
}
'import requests
url = "https://api.nango.dev/action/trigger"
payload = {
"action_name": "<string>",
"input": {}
}
headers = {
"Connection-Id": "<connection-id>",
"Provider-Config-Key": "<provider-config-key>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'Connection-Id': '<connection-id>',
'Provider-Config-Key': '<provider-config-key>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({action_name: '<string>', input: {}})
};
fetch('https://api.nango.dev/action/trigger', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.nango.dev/action/trigger",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'action_name' => '<string>',
'input' => [
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Connection-Id: <connection-id>",
"Content-Type: application/json",
"Provider-Config-Key: <provider-config-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.nango.dev/action/trigger"
payload := strings.NewReader("{\n \"action_name\": \"<string>\",\n \"input\": {}\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Connection-Id", "<connection-id>")
req.Header.Add("Provider-Config-Key", "<provider-config-key>")
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.nango.dev/action/trigger")
.header("Connection-Id", "<connection-id>")
.header("Provider-Config-Key", "<provider-config-key>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"action_name\": \"<string>\",\n \"input\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.nango.dev/action/trigger")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Connection-Id"] = '<connection-id>'
request["Provider-Config-Key"] = '<provider-config-key>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"action_name\": \"<string>\",\n \"input\": {}\n}"
response = http.request(request)
puts response.read_body{
"your-properties": "The data returned by the action"
}{
"message": "<string>"
}{
"error": {
"message": "<string>",
"code": "<string>",
"payload": {},
"upstream": {
"status": 123,
"headers": {
"content-type": "<string>"
},
"body": {}
}
}
}{
"error": {
"message": "<string>",
"code": "<string>",
"payload": {}
}
}Deprecated. Use Call a tool for new synchronous callers. Existing async callers can continue using this endpoint; see Actions (deprecated).
Requires an API key with the
environment:tools:call scope. Learn more about API key scopes.Authorizations
Headers
Set to true to trigger the action asynchronously. When true, the response will include a status URL and ID for retrieving the action result later. See Asynchronous action documentation for more details.
Body
application/json
Was this page helpful?