Auth0 user signup webhook
curl --request POST \
--url http://localhost:9001/api/v1/webhooks/auth0/signup \
--header 'Content-Type: application/json' \
--header 'x-webhook-secret: <api-key>' \
--data '
{
"event": "user_signup",
"timestamp": "2024-01-15T10:30:00Z",
"user": {
"user_id": "auth0|abc123",
"email": "user@example.com",
"name": "John Doe",
"picture": "https://example.com/avatar.jpg",
"email_verified": false
}
}
'import requests
url = "http://localhost:9001/api/v1/webhooks/auth0/signup"
payload = {
"event": "user_signup",
"timestamp": "2024-01-15T10:30:00Z",
"user": {
"user_id": "auth0|abc123",
"email": "user@example.com",
"name": "John Doe",
"picture": "https://example.com/avatar.jpg",
"email_verified": False
}
}
headers = {
"x-webhook-secret": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-webhook-secret': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
event: 'user_signup',
timestamp: '2024-01-15T10:30:00Z',
user: {
user_id: 'auth0|abc123',
email: 'user@example.com',
name: 'John Doe',
picture: 'https://example.com/avatar.jpg',
email_verified: false
}
})
};
fetch('http://localhost:9001/api/v1/webhooks/auth0/signup', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_PORT => "9001",
CURLOPT_URL => "http://localhost:9001/api/v1/webhooks/auth0/signup",
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([
'event' => 'user_signup',
'timestamp' => '2024-01-15T10:30:00Z',
'user' => [
'user_id' => 'auth0|abc123',
'email' => 'user@example.com',
'name' => 'John Doe',
'picture' => 'https://example.com/avatar.jpg',
'email_verified' => false
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-webhook-secret: <api-key>"
],
]);
$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 := "http://localhost:9001/api/v1/webhooks/auth0/signup"
payload := strings.NewReader("{\n \"event\": \"user_signup\",\n \"timestamp\": \"2024-01-15T10:30:00Z\",\n \"user\": {\n \"user_id\": \"auth0|abc123\",\n \"email\": \"user@example.com\",\n \"name\": \"John Doe\",\n \"picture\": \"https://example.com/avatar.jpg\",\n \"email_verified\": false\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-webhook-secret", "<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("http://localhost:9001/api/v1/webhooks/auth0/signup")
.header("x-webhook-secret", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"event\": \"user_signup\",\n \"timestamp\": \"2024-01-15T10:30:00Z\",\n \"user\": {\n \"user_id\": \"auth0|abc123\",\n \"email\": \"user@example.com\",\n \"name\": \"John Doe\",\n \"picture\": \"https://example.com/avatar.jpg\",\n \"email_verified\": false\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("http://localhost:9001/api/v1/webhooks/auth0/signup")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Post.new(url)
request["x-webhook-secret"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"event\": \"user_signup\",\n \"timestamp\": \"2024-01-15T10:30:00Z\",\n \"user\": {\n \"user_id\": \"auth0|abc123\",\n \"email\": \"user@example.com\",\n \"name\": \"John Doe\",\n \"picture\": \"https://example.com/avatar.jpg\",\n \"email_verified\": false\n }\n}"
response = http.request(request)
puts response.read_body{
"received": true,
"processed_at": "2024-01-15T10:30:01Z"
}
Webhooks
User Signup
Port: 9001 (public) - Called by Auth0 Post-Registration Action.
This endpoint is triggered by Auth0 immediately after a user completes registration. It creates the user record in the local database with their Auth0 information.
Authentication: Secured with Auth0 webhook secret via custom header.
Important: Always returns 200 OK to prevent Auth0 from retrying, even on errors. This prevents duplicate registration attempts and information leakage.
POST
/
api
/
v1
/
webhooks
/
auth0
/
signup
Auth0 user signup webhook
curl --request POST \
--url http://localhost:9001/api/v1/webhooks/auth0/signup \
--header 'Content-Type: application/json' \
--header 'x-webhook-secret: <api-key>' \
--data '
{
"event": "user_signup",
"timestamp": "2024-01-15T10:30:00Z",
"user": {
"user_id": "auth0|abc123",
"email": "user@example.com",
"name": "John Doe",
"picture": "https://example.com/avatar.jpg",
"email_verified": false
}
}
'import requests
url = "http://localhost:9001/api/v1/webhooks/auth0/signup"
payload = {
"event": "user_signup",
"timestamp": "2024-01-15T10:30:00Z",
"user": {
"user_id": "auth0|abc123",
"email": "user@example.com",
"name": "John Doe",
"picture": "https://example.com/avatar.jpg",
"email_verified": False
}
}
headers = {
"x-webhook-secret": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-webhook-secret': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
event: 'user_signup',
timestamp: '2024-01-15T10:30:00Z',
user: {
user_id: 'auth0|abc123',
email: 'user@example.com',
name: 'John Doe',
picture: 'https://example.com/avatar.jpg',
email_verified: false
}
})
};
fetch('http://localhost:9001/api/v1/webhooks/auth0/signup', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_PORT => "9001",
CURLOPT_URL => "http://localhost:9001/api/v1/webhooks/auth0/signup",
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([
'event' => 'user_signup',
'timestamp' => '2024-01-15T10:30:00Z',
'user' => [
'user_id' => 'auth0|abc123',
'email' => 'user@example.com',
'name' => 'John Doe',
'picture' => 'https://example.com/avatar.jpg',
'email_verified' => false
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-webhook-secret: <api-key>"
],
]);
$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 := "http://localhost:9001/api/v1/webhooks/auth0/signup"
payload := strings.NewReader("{\n \"event\": \"user_signup\",\n \"timestamp\": \"2024-01-15T10:30:00Z\",\n \"user\": {\n \"user_id\": \"auth0|abc123\",\n \"email\": \"user@example.com\",\n \"name\": \"John Doe\",\n \"picture\": \"https://example.com/avatar.jpg\",\n \"email_verified\": false\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-webhook-secret", "<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("http://localhost:9001/api/v1/webhooks/auth0/signup")
.header("x-webhook-secret", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"event\": \"user_signup\",\n \"timestamp\": \"2024-01-15T10:30:00Z\",\n \"user\": {\n \"user_id\": \"auth0|abc123\",\n \"email\": \"user@example.com\",\n \"name\": \"John Doe\",\n \"picture\": \"https://example.com/avatar.jpg\",\n \"email_verified\": false\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("http://localhost:9001/api/v1/webhooks/auth0/signup")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Post.new(url)
request["x-webhook-secret"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"event\": \"user_signup\",\n \"timestamp\": \"2024-01-15T10:30:00Z\",\n \"user\": {\n \"user_id\": \"auth0|abc123\",\n \"email\": \"user@example.com\",\n \"name\": \"John Doe\",\n \"picture\": \"https://example.com/avatar.jpg\",\n \"email_verified\": false\n }\n}"
response = http.request(request)
puts response.read_body{
"received": true,
"processed_at": "2024-01-15T10:30:01Z"
}
Authorizations
Auth0 webhook secret for authenticating webhook requests. For local development only, use 'dev-bypass' to skip authentication.
Body
application/json
Response
200 - application/json
Webhook received and processed (or acknowledged with error logged)
⌘I
