Webhooks
Create webhook config
POST
/
webhooks
/
configs
Create webhook config
curl --request POST \
--url https://api.gonitro.dev/webhooks/configs \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"url": "https://customer.example.com/webhook",
"events": [
"EnvelopeCreated",
"EnvelopeSigningCompleted"
]
}
'import requests
url = "https://api.gonitro.dev/webhooks/configs"
payload = {
"url": "https://customer.example.com/webhook",
"events": ["EnvelopeCreated", "EnvelopeSigningCompleted"]
}
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({
url: 'https://customer.example.com/webhook',
events: ['EnvelopeCreated', 'EnvelopeSigningCompleted']
})
};
fetch('https://api.gonitro.dev/webhooks/configs', 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.gonitro.dev/webhooks/configs",
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([
'url' => 'https://customer.example.com/webhook',
'events' => [
'EnvelopeCreated',
'EnvelopeSigningCompleted'
]
]),
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.gonitro.dev/webhooks/configs"
payload := strings.NewReader("{\n \"url\": \"https://customer.example.com/webhook\",\n \"events\": [\n \"EnvelopeCreated\",\n \"EnvelopeSigningCompleted\"\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.gonitro.dev/webhooks/configs")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"url\": \"https://customer.example.com/webhook\",\n \"events\": [\n \"EnvelopeCreated\",\n \"EnvelopeSigningCompleted\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.gonitro.dev/webhooks/configs")
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 \"url\": \"https://customer.example.com/webhook\",\n \"events\": [\n \"EnvelopeCreated\",\n \"EnvelopeSigningCompleted\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"accountId": "<string>",
"applicationId": "<string>",
"url": "<string>",
"secret": "<string>",
"subscribedEvents": [
"<string>"
],
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
}{
"type": "https://developers.gonitro.com/docs/build-nitro/errors#400-bad-request",
"title": "Bad Request",
"status": 400,
"detail": "Request validation failed",
"instance": "/sign/envelopes",
"validation_errors": {
"name": "must not be blank"
}
}{
"type": "https://developers.gonitro.com/docs/build-nitro/errors#401-unauthorized",
"title": "Unauthorized",
"status": 401,
"detail": "Missing or invalid Authorization header",
"instance": "/sign/envelopes"
}{
"type": "https://developers.gonitro.com/docs/build-nitro/errors#403-forbidden",
"title": "Forbidden",
"status": 403,
"detail": "Forbidden",
"instance": "/webhooks/configs"
}{
"type": "https://developers.gonitro.com/docs/build-nitro/errors#409-conflict",
"title": "Conflict",
"status": 409,
"detail": "Too many documents in the same package",
"instance": "/sign/envelopes/%s/documents"
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
application/json
The customer endpoint URL to deliver webhooks to
Minimum string length:
1Example:
"https://customer.example.com/webhook"
List of event types to subscribe to, or ["AllEvents"] to subscribe to all supported event types including ones introduced in the future
Minimum array length:
1Example:
[
"EnvelopeCreated",
"EnvelopeSigningCompleted"
]
Response
Created
Unique identifier
Account identifier
Application identifier
Endpoint URL
Signing secret, returned only once in the create response; store it securely
Subscribed event types, or ["AllEvents"] when subscribed to all
Creation timestamp
Last update timestamp
⌘I
Create webhook config
curl --request POST \
--url https://api.gonitro.dev/webhooks/configs \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"url": "https://customer.example.com/webhook",
"events": [
"EnvelopeCreated",
"EnvelopeSigningCompleted"
]
}
'import requests
url = "https://api.gonitro.dev/webhooks/configs"
payload = {
"url": "https://customer.example.com/webhook",
"events": ["EnvelopeCreated", "EnvelopeSigningCompleted"]
}
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({
url: 'https://customer.example.com/webhook',
events: ['EnvelopeCreated', 'EnvelopeSigningCompleted']
})
};
fetch('https://api.gonitro.dev/webhooks/configs', 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.gonitro.dev/webhooks/configs",
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([
'url' => 'https://customer.example.com/webhook',
'events' => [
'EnvelopeCreated',
'EnvelopeSigningCompleted'
]
]),
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.gonitro.dev/webhooks/configs"
payload := strings.NewReader("{\n \"url\": \"https://customer.example.com/webhook\",\n \"events\": [\n \"EnvelopeCreated\",\n \"EnvelopeSigningCompleted\"\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.gonitro.dev/webhooks/configs")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"url\": \"https://customer.example.com/webhook\",\n \"events\": [\n \"EnvelopeCreated\",\n \"EnvelopeSigningCompleted\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.gonitro.dev/webhooks/configs")
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 \"url\": \"https://customer.example.com/webhook\",\n \"events\": [\n \"EnvelopeCreated\",\n \"EnvelopeSigningCompleted\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"accountId": "<string>",
"applicationId": "<string>",
"url": "<string>",
"secret": "<string>",
"subscribedEvents": [
"<string>"
],
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
}{
"type": "https://developers.gonitro.com/docs/build-nitro/errors#400-bad-request",
"title": "Bad Request",
"status": 400,
"detail": "Request validation failed",
"instance": "/sign/envelopes",
"validation_errors": {
"name": "must not be blank"
}
}{
"type": "https://developers.gonitro.com/docs/build-nitro/errors#401-unauthorized",
"title": "Unauthorized",
"status": 401,
"detail": "Missing or invalid Authorization header",
"instance": "/sign/envelopes"
}{
"type": "https://developers.gonitro.com/docs/build-nitro/errors#403-forbidden",
"title": "Forbidden",
"status": 403,
"detail": "Forbidden",
"instance": "/webhooks/configs"
}{
"type": "https://developers.gonitro.com/docs/build-nitro/errors#409-conflict",
"title": "Conflict",
"status": 409,
"detail": "Too many documents in the same package",
"instance": "/sign/envelopes/%s/documents"
}