Register a webhook endpoint
curl --request POST \
--url https://mag3nt.com/api/webhooks \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"url": "https://api.acme.com/hooks/mag3nt",
"description": "<string>"
}
'import requests
url = "https://mag3nt.com/api/webhooks"
payload = {
"url": "https://api.acme.com/hooks/mag3nt",
"description": "<string>"
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({url: 'https://api.acme.com/hooks/mag3nt', description: '<string>'})
};
fetch('https://mag3nt.com/api/webhooks', 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://mag3nt.com/api/webhooks",
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://api.acme.com/hooks/mag3nt',
'description' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"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://mag3nt.com/api/webhooks"
payload := strings.NewReader("{\n \"url\": \"https://api.acme.com/hooks/mag3nt\",\n \"description\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<api-key>")
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://mag3nt.com/api/webhooks")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"url\": \"https://api.acme.com/hooks/mag3nt\",\n \"description\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://mag3nt.com/api/webhooks")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"url\": \"https://api.acme.com/hooks/mag3nt\",\n \"description\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"id": "wh_3b9fe670abcdef...",
"url": "<string>",
"description": "<string>",
"status": "ACTIVE",
"secret": "whsec_1a2b3c4d5e6f...",
"note": "<string>"
}{
"error": "Card not found"
}{
"error": "Card not found"
}Webhooks
Register a webhook endpoint
Register an HTTPS endpoint to receive signed payment.settled events when your pay links settle. The signing secret is returned ONCE in this response and cannot be retrieved again. Use it to verify the X-mag3nt-Signature header on each delivery. Max 5 active webhooks per wallet. URLs must be https and may not target private/loopback hosts.
POST
/
api
/
webhooks
Register a webhook endpoint
curl --request POST \
--url https://mag3nt.com/api/webhooks \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"url": "https://api.acme.com/hooks/mag3nt",
"description": "<string>"
}
'import requests
url = "https://mag3nt.com/api/webhooks"
payload = {
"url": "https://api.acme.com/hooks/mag3nt",
"description": "<string>"
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({url: 'https://api.acme.com/hooks/mag3nt', description: '<string>'})
};
fetch('https://mag3nt.com/api/webhooks', 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://mag3nt.com/api/webhooks",
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://api.acme.com/hooks/mag3nt',
'description' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"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://mag3nt.com/api/webhooks"
payload := strings.NewReader("{\n \"url\": \"https://api.acme.com/hooks/mag3nt\",\n \"description\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<api-key>")
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://mag3nt.com/api/webhooks")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"url\": \"https://api.acme.com/hooks/mag3nt\",\n \"description\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://mag3nt.com/api/webhooks")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"url\": \"https://api.acme.com/hooks/mag3nt\",\n \"description\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"id": "wh_3b9fe670abcdef...",
"url": "<string>",
"description": "<string>",
"status": "ACTIVE",
"secret": "whsec_1a2b3c4d5e6f...",
"note": "<string>"
}{
"error": "Card not found"
}{
"error": "Card not found"
}Authorizations
API key prefixed with 'Bearer sx_live_...'
Body
application/json
Response
Webhook registered (secret shown once)
Returned ONLY when a webhook is created. The secret is used to verify the X-mag3nt-Signature header on delivered events and cannot be retrieved again.