Add an endpoint
curl --request POST \
--url https://api.fastcac.com/v1/webhooks/endpoints \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"url": "<string>",
"description": "",
"event_types": [
"<string>"
]
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({url: '<string>', description: '', event_types: ['<string>']})
};
fetch('https://api.fastcac.com/v1/webhooks/endpoints', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.fastcac.com/v1/webhooks/endpoints"
payload = {
"url": "<string>",
"description": "",
"event_types": ["<string>"]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.fastcac.com/v1/webhooks/endpoints"
payload := strings.NewReader("{\n \"url\": \"<string>\",\n \"description\": \"\",\n \"event_types\": [\n \"<string>\"\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))
}<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.fastcac.com/v1/webhooks/endpoints",
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' => '<string>',
'description' => '',
'event_types' => [
'<string>'
]
]),
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;
}{
"id": "<string>",
"url": "<string>",
"description": "<string>",
"event_types": [
"<string>"
],
"disabled": true,
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"object": "webhook_endpoint"
}{
"error": {
"type": "invalid_request_error",
"code": "<string>",
"message": "<string>",
"param": "<string>",
"request_id": "<string>"
}
}{
"error": {
"type": "authentication_error",
"code": "api_key_missing",
"message": "Send your API key as `Authorization: Bearer <key>`.",
"param": null,
"request_id": "req_kdwpKsFMKS4VzLjqZJ0ntdrl"
}
}{
"error": {
"type": "permission_error",
"code": "live_mode_unavailable",
"message": "Live registrations aren't open yet. Use a test key (fc_test_…) for now.",
"param": null,
"request_id": "req_oYVCIHqeYbgIA3lIzwG0PO5r"
}
}{
"error": {
"type": "not_found_error",
"code": "resource_missing",
"message": "No such registration: reg_0000000000000000000000.",
"param": "id",
"request_id": "req_RlcFqswqrJZos4pnRMH3wa8d"
}
}{
"error": {
"type": "invalid_request_error",
"code": "<string>",
"message": "<string>",
"param": "<string>",
"request_id": "<string>"
}
}{
"error": {
"type": "invalid_request_error",
"code": "<string>",
"message": "<string>",
"param": "<string>",
"request_id": "<string>"
}
}Webhooks
Add an endpoint
POST
/
webhooks
/
endpoints
Add an endpoint
curl --request POST \
--url https://api.fastcac.com/v1/webhooks/endpoints \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"url": "<string>",
"description": "",
"event_types": [
"<string>"
]
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({url: '<string>', description: '', event_types: ['<string>']})
};
fetch('https://api.fastcac.com/v1/webhooks/endpoints', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.fastcac.com/v1/webhooks/endpoints"
payload = {
"url": "<string>",
"description": "",
"event_types": ["<string>"]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.fastcac.com/v1/webhooks/endpoints"
payload := strings.NewReader("{\n \"url\": \"<string>\",\n \"description\": \"\",\n \"event_types\": [\n \"<string>\"\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))
}<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.fastcac.com/v1/webhooks/endpoints",
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' => '<string>',
'description' => '',
'event_types' => [
'<string>'
]
]),
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;
}{
"id": "<string>",
"url": "<string>",
"description": "<string>",
"event_types": [
"<string>"
],
"disabled": true,
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"object": "webhook_endpoint"
}{
"error": {
"type": "invalid_request_error",
"code": "<string>",
"message": "<string>",
"param": "<string>",
"request_id": "<string>"
}
}{
"error": {
"type": "authentication_error",
"code": "api_key_missing",
"message": "Send your API key as `Authorization: Bearer <key>`.",
"param": null,
"request_id": "req_kdwpKsFMKS4VzLjqZJ0ntdrl"
}
}{
"error": {
"type": "permission_error",
"code": "live_mode_unavailable",
"message": "Live registrations aren't open yet. Use a test key (fc_test_…) for now.",
"param": null,
"request_id": "req_oYVCIHqeYbgIA3lIzwG0PO5r"
}
}{
"error": {
"type": "not_found_error",
"code": "resource_missing",
"message": "No such registration: reg_0000000000000000000000.",
"param": "id",
"request_id": "req_RlcFqswqrJZos4pnRMH3wa8d"
}
}{
"error": {
"type": "invalid_request_error",
"code": "<string>",
"message": "<string>",
"param": "<string>",
"request_id": "<string>"
}
}{
"error": {
"type": "invalid_request_error",
"code": "<string>",
"message": "<string>",
"param": "<string>",
"request_id": "<string>"
}
}Authorizations
Your secret API key: fc_test_… in test mode, fc_live_… in live mode.
Body
application/json
Response
Successful Response
Only these events; null means all.
Allowed value:
"webhook_endpoint"