Webhooks
Test team webhook
Creates a synthetic team event and a traceable webhook delivery.
Requires a team API key with webhooks:manage. Project tokens are not accepted.
POST
/
platform
/
webhooks
/
{webhookId}
/
tests
Test team webhook
curl --request POST \
--url https://api.polymorfa.com/platform/webhooks/{webhookId}/tests \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: <idempotency-key>' \
--data '{}'const options = {
method: 'POST',
headers: {
'Idempotency-Key': '<idempotency-key>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({})
};
fetch('https://api.polymorfa.com/platform/webhooks/{webhookId}/tests', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.polymorfa.com/platform/webhooks/{webhookId}/tests"
payload = {}
headers = {
"Idempotency-Key": "<idempotency-key>",
"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.polymorfa.com/platform/webhooks/{webhookId}/tests"
payload := strings.NewReader("{}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Idempotency-Key", "<idempotency-key>")
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))
}false{
"data": {
"operationId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"idempotency": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"key": "<string>",
"replayed": true,
"createdAt": "2023-11-07T05:31:56Z",
"expiresAt": "2023-11-07T05:31:56Z"
},
"eventId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"deliveryId": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
}{
"error": {
"type": "invalid_request_error",
"code": "<string>",
"message": "<string>",
"param": "<string>"
},
"data": null,
"docs": "<string>"
}{
"error": {
"type": "invalid_request_error",
"code": "<string>",
"message": "<string>",
"param": "<string>"
},
"data": null,
"docs": "<string>"
}{
"error": {
"type": "invalid_request_error",
"code": "<string>",
"message": "<string>",
"param": "<string>"
},
"data": null,
"docs": "<string>"
}{
"error": {
"type": "invalid_request_error",
"code": "<string>",
"message": "<string>",
"param": "<string>"
},
"data": null,
"docs": "<string>"
}{
"error": {
"type": "invalid_request_error",
"code": "<string>",
"message": "<string>",
"param": "<string>"
},
"data": null,
"docs": "<string>"
}Authorizations
Send your team API key or project token as Authorization: Bearer <token>. The credential must have the required permissions. Project tokens can access only their own project.
Headers
Specifies idempotency key for this header parameter.
Value constraints
| Constraint | Accepted input |
|---|---|
| String length | 1 through 255 characters |
Required string length:
1 - 255Path Parameters
Identifier for the webhook.
Value constraints
| Constraint | Accepted input |
|---|---|
| Format | uuid |
Body
application/json
- Option 1
- Option 2
Category assigned to event.
Value constraints
| Constraint | Accepted input |
|---|---|
| Pattern | ^[a-z0-9][a-z0-9_.-]{0,127}$ |
Pattern:
^[a-z0-9][a-z0-9_.-]{0,127}$Response
Success
Structured data carried by this object.
Show child attributes
Show child attributes
Was this page helpful?
⌘I
Test team webhook
curl --request POST \
--url https://api.polymorfa.com/platform/webhooks/{webhookId}/tests \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: <idempotency-key>' \
--data '{}'const options = {
method: 'POST',
headers: {
'Idempotency-Key': '<idempotency-key>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({})
};
fetch('https://api.polymorfa.com/platform/webhooks/{webhookId}/tests', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.polymorfa.com/platform/webhooks/{webhookId}/tests"
payload = {}
headers = {
"Idempotency-Key": "<idempotency-key>",
"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.polymorfa.com/platform/webhooks/{webhookId}/tests"
payload := strings.NewReader("{}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Idempotency-Key", "<idempotency-key>")
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))
}false{
"data": {
"operationId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"idempotency": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"key": "<string>",
"replayed": true,
"createdAt": "2023-11-07T05:31:56Z",
"expiresAt": "2023-11-07T05:31:56Z"
},
"eventId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"deliveryId": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
}{
"error": {
"type": "invalid_request_error",
"code": "<string>",
"message": "<string>",
"param": "<string>"
},
"data": null,
"docs": "<string>"
}{
"error": {
"type": "invalid_request_error",
"code": "<string>",
"message": "<string>",
"param": "<string>"
},
"data": null,
"docs": "<string>"
}{
"error": {
"type": "invalid_request_error",
"code": "<string>",
"message": "<string>",
"param": "<string>"
},
"data": null,
"docs": "<string>"
}{
"error": {
"type": "invalid_request_error",
"code": "<string>",
"message": "<string>",
"param": "<string>"
},
"data": null,
"docs": "<string>"
}{
"error": {
"type": "invalid_request_error",
"code": "<string>",
"message": "<string>",
"param": "<string>"
},
"data": null,
"docs": "<string>"
}