curl --request POST \
--url https://api.nango.dev/functions/deployments \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"type": "function",
"integration_id": "<string>",
"function_name": "<string>",
"code": "<string>",
"version": "<string>",
"allow_destructive": true
}
'import requests
url = "https://api.nango.dev/functions/deployments"
payload = {
"type": "function",
"integration_id": "<string>",
"function_name": "<string>",
"code": "<string>",
"version": "<string>",
"allow_destructive": True
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
type: 'function',
integration_id: '<string>',
function_name: '<string>',
code: '<string>',
version: '<string>',
allow_destructive: true
})
};
fetch('https://api.nango.dev/functions/deployments', 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/functions/deployments",
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([
'type' => 'function',
'integration_id' => '<string>',
'function_name' => '<string>',
'code' => '<string>',
'version' => '<string>',
'allow_destructive' => true
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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/functions/deployments"
payload := strings.NewReader("{\n \"type\": \"function\",\n \"integration_id\": \"<string>\",\n \"function_name\": \"<string>\",\n \"code\": \"<string>\",\n \"version\": \"<string>\",\n \"allow_destructive\": true\n}")
req, _ := http.NewRequest("POST", url, payload)
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/functions/deployments")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"type\": \"function\",\n \"integration_id\": \"<string>\",\n \"function_name\": \"<string>\",\n \"code\": \"<string>\",\n \"version\": \"<string>\",\n \"allow_destructive\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.nango.dev/functions/deployments")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"type\": \"function\",\n \"integration_id\": \"<string>\",\n \"function_name\": \"<string>\",\n \"code\": \"<string>\",\n \"version\": \"<string>\",\n \"allow_destructive\": true\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"status": "waiting",
"created_at": "2023-11-07T05:31:56Z"
}{
"error": {
"code": "<string>",
"message": "<string>",
"errors": [
{}
]
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"errors": [
{}
]
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"errors": [
{}
]
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"errors": [
{}
]
}
}{
"error": {
"code": "template_already_deployed",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"errors": [
{}
]
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"errors": [
{}
]
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"errors": [
{}
]
}
}Create a function deployment
Deploys a function to an existing integration. Use type: function to deploy submitted TypeScript
source code, or type: template to deploy a template from the provider catalog. Requires an API key with the
environment:deploy scope.
curl --request POST \
--url https://api.nango.dev/functions/deployments \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"type": "function",
"integration_id": "<string>",
"function_name": "<string>",
"code": "<string>",
"version": "<string>",
"allow_destructive": true
}
'import requests
url = "https://api.nango.dev/functions/deployments"
payload = {
"type": "function",
"integration_id": "<string>",
"function_name": "<string>",
"code": "<string>",
"version": "<string>",
"allow_destructive": True
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
type: 'function',
integration_id: '<string>',
function_name: '<string>',
code: '<string>',
version: '<string>',
allow_destructive: true
})
};
fetch('https://api.nango.dev/functions/deployments', 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/functions/deployments",
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([
'type' => 'function',
'integration_id' => '<string>',
'function_name' => '<string>',
'code' => '<string>',
'version' => '<string>',
'allow_destructive' => true
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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/functions/deployments"
payload := strings.NewReader("{\n \"type\": \"function\",\n \"integration_id\": \"<string>\",\n \"function_name\": \"<string>\",\n \"code\": \"<string>\",\n \"version\": \"<string>\",\n \"allow_destructive\": true\n}")
req, _ := http.NewRequest("POST", url, payload)
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/functions/deployments")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"type\": \"function\",\n \"integration_id\": \"<string>\",\n \"function_name\": \"<string>\",\n \"code\": \"<string>\",\n \"version\": \"<string>\",\n \"allow_destructive\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.nango.dev/functions/deployments")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"type\": \"function\",\n \"integration_id\": \"<string>\",\n \"function_name\": \"<string>\",\n \"code\": \"<string>\",\n \"version\": \"<string>\",\n \"allow_destructive\": true\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"status": "waiting",
"created_at": "2023-11-07T05:31:56Z"
}{
"error": {
"code": "<string>",
"message": "<string>",
"errors": [
{}
]
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"errors": [
{}
]
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"errors": [
{}
]
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"errors": [
{}
]
}
}{
"error": {
"code": "template_already_deployed",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"errors": [
{}
]
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"errors": [
{}
]
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"errors": [
{}
]
}
}environment:deploy scope. Learn more about API key scopes.type: function) or a template from the provider catalog (type: template).Authorizations
An Environment API key from your Nango environment, or an Account API key for account-level endpoints.
Body
- Option 1
- Option 2
Deploy submitted function source code.
function The integration ID (unique_key) that you created in Nango.
The sync or action function name.
action, sync The TypeScript source code for the function.
1Optional version tag for this deployment.
Allow overwriting an existing standalone function with the same name.
Response
Deployment record. status may be any of waiting, running, success, or failed. If it is not
success, poll GET /functions/deployments/{id} for the final status and details.
Was this page helpful?