Create Authentication
curl --request POST \
--url https://api.zapier.com/v2/authentications \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"data": {
"title": "My new auth",
"app": "8cdbc496-c95c-4f19-b3a3-fee03ed5f924",
"authentication_fields": {
"secret": "example_E4CrHVvRuxTXrPFLyyZFeRJwJcx2ELQZ"
}
}
}
'import requests
url = "https://api.zapier.com/v2/authentications"
payload = { "data": {
"title": "My new auth",
"app": "8cdbc496-c95c-4f19-b3a3-fee03ed5f924",
"authentication_fields": { "secret": "example_E4CrHVvRuxTXrPFLyyZFeRJwJcx2ELQZ" }
} }
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({
data: {
title: 'My new auth',
app: '8cdbc496-c95c-4f19-b3a3-fee03ed5f924',
authentication_fields: {secret: 'example_E4CrHVvRuxTXrPFLyyZFeRJwJcx2ELQZ'}
}
})
};
fetch('https://api.zapier.com/v2/authentications', 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.zapier.com/v2/authentications",
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([
'data' => [
'title' => 'My new auth',
'app' => '8cdbc496-c95c-4f19-b3a3-fee03ed5f924',
'authentication_fields' => [
'secret' => 'example_E4CrHVvRuxTXrPFLyyZFeRJwJcx2ELQZ'
]
]
]),
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.zapier.com/v2/authentications"
payload := strings.NewReader("{\n \"data\": {\n \"title\": \"My new auth\",\n \"app\": \"8cdbc496-c95c-4f19-b3a3-fee03ed5f924\",\n \"authentication_fields\": {\n \"secret\": \"example_E4CrHVvRuxTXrPFLyyZFeRJwJcx2ELQZ\"\n }\n }\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.zapier.com/v2/authentications")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"data\": {\n \"title\": \"My new auth\",\n \"app\": \"8cdbc496-c95c-4f19-b3a3-fee03ed5f924\",\n \"authentication_fields\": {\n \"secret\": \"example_E4CrHVvRuxTXrPFLyyZFeRJwJcx2ELQZ\"\n }\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.zapier.com/v2/authentications")
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 \"data\": {\n \"title\": \"My new auth\",\n \"app\": \"8cdbc496-c95c-4f19-b3a3-fee03ed5f924\",\n \"authentication_fields\": {\n \"secret\": \"example_E4CrHVvRuxTXrPFLyyZFeRJwJcx2ELQZ\"\n }\n }\n}"
response = http.request(request)
puts response.read_body{
"links": {
"next": null,
"prev": null
},
"meta": {
"count": 1,
"limit": 1,
"offset": 0
},
"data": [
{
"type": "authentication",
"id": "019487c8-7d3b-7e2f-a04e-3b2c1d5e6f70",
"app": "a8aaed31-e257-4479-aaa9-ca02fe2fab04",
"is_expired": false,
"title": "Example zapier@example.com #5"
}
]
}{
"errors": [
{
"status": 400,
"code": "parse_error",
"title": "ParseError",
"detail": "Malformed request.",
"source": null,
"meta": {
"source": "ZAPIER",
"full_details": {
"message": "Malformed request.",
"code": "parse_error"
}
}
}
]
}{
"errors": [
{
"status": 123,
"code": "<string>",
"title": "<string>",
"detail": "<string>",
"source": {
"pointer": "<string>",
"parameter": "<string>",
"header": "<string>"
},
"meta": {}
}
]
}{
"errors": [
{
"status": 123,
"code": "<string>",
"title": "<string>",
"detail": "<string>",
"source": {
"pointer": "<string>",
"parameter": "<string>",
"header": "<string>"
},
"meta": {}
}
]
}{
"errors": [
{
"status": 123,
"code": "<string>",
"title": "<string>",
"detail": "<string>",
"source": {
"pointer": "<string>",
"parameter": "<string>",
"header": "<string>"
},
"meta": {}
}
]
}{
"errors": [
{
"status": 123,
"code": "<string>",
"title": "<string>",
"detail": "<string>",
"source": {
"pointer": "<string>",
"parameter": "<string>",
"header": "<string>"
},
"meta": {}
}
]
}{
"errors": [
{
"status": 500,
"code": "error",
"title": "APIException",
"detail": "A server error occurred.",
"source": null,
"meta": {
"source": "ZAPIER",
"full_details": {
"message": "A server error occurred.",
"code": "error"
}
}
}
]
}{
"errors": [
{
"status": 123,
"code": "<string>",
"title": "<string>",
"detail": "<string>",
"source": {
"pointer": "<string>",
"parameter": "<string>",
"header": "<string>"
},
"meta": {}
}
]
}{
"errors": [
{
"status": 123,
"code": "<string>",
"title": "<string>",
"detail": "<string>",
"source": {
"pointer": "<string>",
"parameter": "<string>",
"header": "<string>"
},
"meta": {}
}
]
}Authentications
Create Authentication
Creates a new Authentication for the provided App. See our Adding an Authentication guide to get started.
When using OAuth
This endpoint requires the connection:write OAuth scope.
POST
/
v2
/
authentications
Create Authentication
curl --request POST \
--url https://api.zapier.com/v2/authentications \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"data": {
"title": "My new auth",
"app": "8cdbc496-c95c-4f19-b3a3-fee03ed5f924",
"authentication_fields": {
"secret": "example_E4CrHVvRuxTXrPFLyyZFeRJwJcx2ELQZ"
}
}
}
'import requests
url = "https://api.zapier.com/v2/authentications"
payload = { "data": {
"title": "My new auth",
"app": "8cdbc496-c95c-4f19-b3a3-fee03ed5f924",
"authentication_fields": { "secret": "example_E4CrHVvRuxTXrPFLyyZFeRJwJcx2ELQZ" }
} }
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({
data: {
title: 'My new auth',
app: '8cdbc496-c95c-4f19-b3a3-fee03ed5f924',
authentication_fields: {secret: 'example_E4CrHVvRuxTXrPFLyyZFeRJwJcx2ELQZ'}
}
})
};
fetch('https://api.zapier.com/v2/authentications', 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.zapier.com/v2/authentications",
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([
'data' => [
'title' => 'My new auth',
'app' => '8cdbc496-c95c-4f19-b3a3-fee03ed5f924',
'authentication_fields' => [
'secret' => 'example_E4CrHVvRuxTXrPFLyyZFeRJwJcx2ELQZ'
]
]
]),
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.zapier.com/v2/authentications"
payload := strings.NewReader("{\n \"data\": {\n \"title\": \"My new auth\",\n \"app\": \"8cdbc496-c95c-4f19-b3a3-fee03ed5f924\",\n \"authentication_fields\": {\n \"secret\": \"example_E4CrHVvRuxTXrPFLyyZFeRJwJcx2ELQZ\"\n }\n }\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.zapier.com/v2/authentications")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"data\": {\n \"title\": \"My new auth\",\n \"app\": \"8cdbc496-c95c-4f19-b3a3-fee03ed5f924\",\n \"authentication_fields\": {\n \"secret\": \"example_E4CrHVvRuxTXrPFLyyZFeRJwJcx2ELQZ\"\n }\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.zapier.com/v2/authentications")
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 \"data\": {\n \"title\": \"My new auth\",\n \"app\": \"8cdbc496-c95c-4f19-b3a3-fee03ed5f924\",\n \"authentication_fields\": {\n \"secret\": \"example_E4CrHVvRuxTXrPFLyyZFeRJwJcx2ELQZ\"\n }\n }\n}"
response = http.request(request)
puts response.read_body{
"links": {
"next": null,
"prev": null
},
"meta": {
"count": 1,
"limit": 1,
"offset": 0
},
"data": [
{
"type": "authentication",
"id": "019487c8-7d3b-7e2f-a04e-3b2c1d5e6f70",
"app": "a8aaed31-e257-4479-aaa9-ca02fe2fab04",
"is_expired": false,
"title": "Example zapier@example.com #5"
}
]
}{
"errors": [
{
"status": 400,
"code": "parse_error",
"title": "ParseError",
"detail": "Malformed request.",
"source": null,
"meta": {
"source": "ZAPIER",
"full_details": {
"message": "Malformed request.",
"code": "parse_error"
}
}
}
]
}{
"errors": [
{
"status": 123,
"code": "<string>",
"title": "<string>",
"detail": "<string>",
"source": {
"pointer": "<string>",
"parameter": "<string>",
"header": "<string>"
},
"meta": {}
}
]
}{
"errors": [
{
"status": 123,
"code": "<string>",
"title": "<string>",
"detail": "<string>",
"source": {
"pointer": "<string>",
"parameter": "<string>",
"header": "<string>"
},
"meta": {}
}
]
}{
"errors": [
{
"status": 123,
"code": "<string>",
"title": "<string>",
"detail": "<string>",
"source": {
"pointer": "<string>",
"parameter": "<string>",
"header": "<string>"
},
"meta": {}
}
]
}{
"errors": [
{
"status": 123,
"code": "<string>",
"title": "<string>",
"detail": "<string>",
"source": {
"pointer": "<string>",
"parameter": "<string>",
"header": "<string>"
},
"meta": {}
}
]
}{
"errors": [
{
"status": 500,
"code": "error",
"title": "APIException",
"detail": "A server error occurred.",
"source": null,
"meta": {
"source": "ZAPIER",
"full_details": {
"message": "A server error occurred.",
"code": "error"
}
}
}
]
}{
"errors": [
{
"status": 123,
"code": "<string>",
"title": "<string>",
"detail": "<string>",
"source": {
"pointer": "<string>",
"parameter": "<string>",
"header": "<string>"
},
"meta": {}
}
]
}{
"errors": [
{
"status": 123,
"code": "<string>",
"title": "<string>",
"detail": "<string>",
"source": {
"pointer": "<string>",
"parameter": "<string>",
"header": "<string>"
},
"meta": {}
}
]
}This API is rate limited.
Authorizations
See our OAuth2 authentication documentation here: https://docs.zapier.com/powered-by-zapier/api-reference/authentication
Body
application/json
Response
Base Response definition to be used in other Response Serializers.
Be sure to include the data field after using this class
Was this page helpful?