Create a webhook subscription and return its signing secret once
curl --request POST \
--url https://api.acornops.dev/api/v1/workspaces/{workspaceId}/webhooks \
--header 'Content-Type: application/json' \
--cookie acornops_cp_session= \
--data '
{
"name": "PagerDuty webhook",
"url": "https://example.com/acornops/webhook",
"eventTypes": [
"run.completed.v1",
"run.failed.v1"
],
"targetId": null,
"enabled": true
}
'const options = {
method: 'POST',
headers: {cookie: 'acornops_cp_session=', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'PagerDuty webhook',
url: 'https://example.com/acornops/webhook',
eventTypes: ['run.completed.v1', 'run.failed.v1'],
targetId: null,
enabled: true
})
};
fetch('https://api.acornops.dev/api/v1/workspaces/{workspaceId}/webhooks', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"workspaceId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"url": "<string>",
"eventTypes": [
"<string>"
],
"enabled": true,
"secret": "<string>",
"targetId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"createdBy": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
}{
"error": {
"code": "<string>",
"message": "<string>",
"retryable": true,
"details": {}
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"retryable": true,
"details": {}
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"retryable": true,
"details": {}
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"retryable": true,
"details": {}
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"retryable": true,
"details": {}
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"retryable": true,
"details": {}
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"retryable": true,
"details": {}
}
}Webhooks
Create a webhook subscription and return its signing secret once
Create a webhook subscription and return its signing secret once
curl --request POST \
--url https://api.acornops.dev/api/v1/workspaces/{workspaceId}/webhooks \
--header 'Content-Type: application/json' \
--cookie acornops_cp_session= \
--data '
{
"name": "PagerDuty webhook",
"url": "https://example.com/acornops/webhook",
"eventTypes": [
"run.completed.v1",
"run.failed.v1"
],
"targetId": null,
"enabled": true
}
'const options = {
method: 'POST',
headers: {cookie: 'acornops_cp_session=', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'PagerDuty webhook',
url: 'https://example.com/acornops/webhook',
eventTypes: ['run.completed.v1', 'run.failed.v1'],
targetId: null,
enabled: true
})
};
fetch('https://api.acornops.dev/api/v1/workspaces/{workspaceId}/webhooks', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"workspaceId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"url": "<string>",
"eventTypes": [
"<string>"
],
"enabled": true,
"secret": "<string>",
"targetId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"createdBy": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
}{
"error": {
"code": "<string>",
"message": "<string>",
"retryable": true,
"details": {}
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"retryable": true,
"details": {}
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"retryable": true,
"details": {}
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"retryable": true,
"details": {}
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"retryable": true,
"details": {}
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"retryable": true,
"details": {}
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"retryable": true,
"details": {}
}
}Authorizations
Path Parameters
Example:
"4b930d98-add9-4924-ab26-3c16d96ec373"
Body
application/json
Response
Webhook subscription created. Response includes secret once.
Webhook subscription response. Includes signing secret once.