Create webhook subscription
curl --request POST \
--url https://api.nexspace365.com/api/webhooks \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "Ops Slack bridge",
"url": "https://hooks.example.com/nexspace",
"events": [
"shift_filled",
"credential_expired"
],
"facilityId": 1
}
'import requests
url = "https://api.nexspace365.com/api/webhooks"
payload = {
"name": "Ops Slack bridge",
"url": "https://hooks.example.com/nexspace",
"events": ["shift_filled", "credential_expired"],
"facilityId": 1
}
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({
name: 'Ops Slack bridge',
url: 'https://hooks.example.com/nexspace',
events: ['shift_filled', 'credential_expired'],
facilityId: 1
})
};
fetch('https://api.nexspace365.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://api.nexspace365.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([
'name' => 'Ops Slack bridge',
'url' => 'https://hooks.example.com/nexspace',
'events' => [
'shift_filled',
'credential_expired'
],
'facilityId' => 1
]),
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.nexspace365.com/api/webhooks"
payload := strings.NewReader("{\n \"name\": \"Ops Slack bridge\",\n \"url\": \"https://hooks.example.com/nexspace\",\n \"events\": [\n \"shift_filled\",\n \"credential_expired\"\n ],\n \"facilityId\": 1\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.nexspace365.com/api/webhooks")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Ops Slack bridge\",\n \"url\": \"https://hooks.example.com/nexspace\",\n \"events\": [\n \"shift_filled\",\n \"credential_expired\"\n ],\n \"facilityId\": 1\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.nexspace365.com/api/webhooks")
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 \"name\": \"Ops Slack bridge\",\n \"url\": \"https://hooks.example.com/nexspace\",\n \"events\": [\n \"shift_filled\",\n \"credential_expired\"\n ],\n \"facilityId\": 1\n}"
response = http.request(request)
puts response.read_body{
"id": 3,
"orgId": 1,
"name": "Ops Slack bridge",
"url": "https://hooks.example.com/nexspace",
"events": [
"shift_filled",
"credential_expired"
],
"isActive": true,
"facilityId": 1,
"createdAt": "2026-04-01T10:00:00Z",
"updatedAt": "2026-05-01T10:00:00Z"
}{
"error": {
"message": "Invalid or revoked API key",
"code": "UNAUTHENTICATED",
"suggestion": "Send a valid `Authorization: Bearer <token>` (nex_live_/nex_pat_ key, JWT, or OAuth access token).",
"retryable": false
}
}{
"error": {
"message": "Insufficient API key scope",
"code": "INSUFFICIENT_SCOPE",
"suggestion": "Mint or rotate a key that includes the required scope, or grant a wildcard like `resource:*`.",
"retryable": false
}
}{
"error": {
"message": "Rate limit exceeded for this API key",
"code": "API_KEY_RATE_LIMITED",
"suggestion": "Wait until X-RateLimit-Reset before retrying, or batch operations.",
"retryable": true
}
}Webhooks
Create webhook subscription
Register a URL to receive outbound events. The signing secret is returned
once in this response — use it to verify X-NexSpace-Signature headers.
Required API-key scope: integrations:write
POST
/
api
/
webhooks
Create webhook subscription
curl --request POST \
--url https://api.nexspace365.com/api/webhooks \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "Ops Slack bridge",
"url": "https://hooks.example.com/nexspace",
"events": [
"shift_filled",
"credential_expired"
],
"facilityId": 1
}
'import requests
url = "https://api.nexspace365.com/api/webhooks"
payload = {
"name": "Ops Slack bridge",
"url": "https://hooks.example.com/nexspace",
"events": ["shift_filled", "credential_expired"],
"facilityId": 1
}
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({
name: 'Ops Slack bridge',
url: 'https://hooks.example.com/nexspace',
events: ['shift_filled', 'credential_expired'],
facilityId: 1
})
};
fetch('https://api.nexspace365.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://api.nexspace365.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([
'name' => 'Ops Slack bridge',
'url' => 'https://hooks.example.com/nexspace',
'events' => [
'shift_filled',
'credential_expired'
],
'facilityId' => 1
]),
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.nexspace365.com/api/webhooks"
payload := strings.NewReader("{\n \"name\": \"Ops Slack bridge\",\n \"url\": \"https://hooks.example.com/nexspace\",\n \"events\": [\n \"shift_filled\",\n \"credential_expired\"\n ],\n \"facilityId\": 1\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.nexspace365.com/api/webhooks")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Ops Slack bridge\",\n \"url\": \"https://hooks.example.com/nexspace\",\n \"events\": [\n \"shift_filled\",\n \"credential_expired\"\n ],\n \"facilityId\": 1\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.nexspace365.com/api/webhooks")
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 \"name\": \"Ops Slack bridge\",\n \"url\": \"https://hooks.example.com/nexspace\",\n \"events\": [\n \"shift_filled\",\n \"credential_expired\"\n ],\n \"facilityId\": 1\n}"
response = http.request(request)
puts response.read_body{
"id": 3,
"orgId": 1,
"name": "Ops Slack bridge",
"url": "https://hooks.example.com/nexspace",
"events": [
"shift_filled",
"credential_expired"
],
"isActive": true,
"facilityId": 1,
"createdAt": "2026-04-01T10:00:00Z",
"updatedAt": "2026-05-01T10:00:00Z"
}{
"error": {
"message": "Invalid or revoked API key",
"code": "UNAUTHENTICATED",
"suggestion": "Send a valid `Authorization: Bearer <token>` (nex_live_/nex_pat_ key, JWT, or OAuth access token).",
"retryable": false
}
}{
"error": {
"message": "Insufficient API key scope",
"code": "INSUFFICIENT_SCOPE",
"suggestion": "Mint or rotate a key that includes the required scope, or grant a wildcard like `resource:*`.",
"retryable": false
}
}{
"error": {
"message": "Rate limit exceeded for this API key",
"code": "API_KEY_RATE_LIMITED",
"suggestion": "Wait until X-RateLimit-Reset before retrying, or batch operations.",
"retryable": true
}
}Authorizations
bearerAuthapiKeyAuth
JWT token authentication
Query Parameters
Target organization unit (team) id. Internal operators with cross-org access use this for webhook CRUD; facility-scoped sessions omit it and the org is resolved from context.
Body
application/json
Available options:
shift_posted, shift_filled, credential_expired, timesheet_approved, lead_qualified, payroll_completed, staff_onboarded, agent_run.pending_approval, agent_run.completed, agent_run.failed, * Alternative to orgUnitId query — internal operators only
Arbitrary key-value metadata stored with the subscription
⌘I

