curl --request POST \
--url https://api.scoutworks.app/api/v1/webhook-endpoints \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"url": "<string>",
"eventTypes": []
}
'import requests
url = "https://api.scoutworks.app/api/v1/webhook-endpoints"
payload = {
"url": "<string>",
"eventTypes": []
}
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: '<string>', eventTypes: []})
};
fetch('https://api.scoutworks.app/api/v1/webhook-endpoints', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"data": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"url": "<string>",
"description": "<string>",
"eventTypes": [
"member.section.transitioned"
],
"status": "active",
"disabledReason": "admin",
"failingSince": "2023-11-07T05:31:56Z",
"createdAt": "2023-11-07T05:31:56Z",
"secret": "<string>"
}
}{
"data": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"url": "<string>",
"description": "<string>",
"eventTypes": [
"member.section.transitioned"
],
"status": "active",
"disabledReason": "admin",
"failingSince": "2023-11-07T05:31:56Z",
"createdAt": "2023-11-07T05:31:56Z",
"secret": "<string>"
}
}{
"error": {
"code": "invalid_api_key",
"message": "<string>"
},
"errorRef": "<string>",
"retryAfter": 0,
"matchingIds": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
]
}{
"error": {
"code": "invalid_api_key",
"message": "<string>"
},
"errorRef": "<string>",
"retryAfter": 0,
"matchingIds": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
]
}{
"error": {
"code": "invalid_api_key",
"message": "<string>"
},
"errorRef": "<string>",
"retryAfter": 0,
"matchingIds": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
]
}{
"error": {
"code": "invalid_api_key",
"message": "<string>"
},
"errorRef": "<string>",
"retryAfter": 0,
"matchingIds": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
]
}{
"error": {
"code": "invalid_api_key",
"message": "<string>"
},
"errorRef": "<string>",
"retryAfter": 0,
"matchingIds": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
]
}{
"error": {
"code": "invalid_api_key",
"message": "<string>"
},
"errorRef": "<string>",
"retryAfter": 0,
"matchingIds": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
]
}Add a webhook endpoint
Adds an endpoint and answers with its signing secret, once: store it now. The address must be https:// on a public domain name, as in Scoutworks. One more than 10 endpoints answers 409. A key may subscribe an endpoint only to events whose records it can read: each event’s read scope is in the webhooks guide. Another event answers 403 insufficient_scope. Payment events can be chosen only in Scoutworks. A key sees and manages only endpoints whose every event it can read: another reads as 404. A change is recorded as made by the admin who created the key, and marked with the key. An endpoint the key adds stops sending if that admin stops being an admin, as the key stops working. Not in the demo. Writes count towards the key’s usual limit and a second one of 30 changes a minute.
You may send an Idempotency-Key header (unique per webhook endpoint) so a retry after a timeout cannot make it twice. For 24 hours, the same key with the same body answers 200 with the first webhook endpoint and an Idempotent-Replayed: true header; with a different body it answers 400; while the first request is still running it answers 409 conflict.
curl --request POST \
--url https://api.scoutworks.app/api/v1/webhook-endpoints \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"url": "<string>",
"eventTypes": []
}
'import requests
url = "https://api.scoutworks.app/api/v1/webhook-endpoints"
payload = {
"url": "<string>",
"eventTypes": []
}
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: '<string>', eventTypes: []})
};
fetch('https://api.scoutworks.app/api/v1/webhook-endpoints', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"data": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"url": "<string>",
"description": "<string>",
"eventTypes": [
"member.section.transitioned"
],
"status": "active",
"disabledReason": "admin",
"failingSince": "2023-11-07T05:31:56Z",
"createdAt": "2023-11-07T05:31:56Z",
"secret": "<string>"
}
}{
"data": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"url": "<string>",
"description": "<string>",
"eventTypes": [
"member.section.transitioned"
],
"status": "active",
"disabledReason": "admin",
"failingSince": "2023-11-07T05:31:56Z",
"createdAt": "2023-11-07T05:31:56Z",
"secret": "<string>"
}
}{
"error": {
"code": "invalid_api_key",
"message": "<string>"
},
"errorRef": "<string>",
"retryAfter": 0,
"matchingIds": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
]
}{
"error": {
"code": "invalid_api_key",
"message": "<string>"
},
"errorRef": "<string>",
"retryAfter": 0,
"matchingIds": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
]
}{
"error": {
"code": "invalid_api_key",
"message": "<string>"
},
"errorRef": "<string>",
"retryAfter": 0,
"matchingIds": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
]
}{
"error": {
"code": "invalid_api_key",
"message": "<string>"
},
"errorRef": "<string>",
"retryAfter": 0,
"matchingIds": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
]
}{
"error": {
"code": "invalid_api_key",
"message": "<string>"
},
"errorRef": "<string>",
"retryAfter": 0,
"matchingIds": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
]
}{
"error": {
"code": "invalid_api_key",
"message": "<string>"
},
"errorRef": "<string>",
"retryAfter": 0,
"matchingIds": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
]
}Authorizations
Headers
Body
1member.section.transitioned, event.created, event.updated, event.cancelled, event.deleted, member.created, member.updated, member.left, waiting-list.application.received, badge.awarded, badge.requirement.completed, event.rsvp.changed, task.created, task.updated, transaction.created, expense-claim.submitted, expense-claim.approved, attendance.recorded, payment.confirmed, payment.failed, hire.booking.created, refund.created, transfer.created, user.invited, user.updated, user.removed, user.access-changed, equipment.checked-out, equipment.overdue