Skip to content

Set the Slack webhook

PUT
/v1/integrations/slack
curl --request PUT \
--url https://api.pealboard.com/v1/integrations/slack \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "webhookUrl": "https://hooks.slack.com/services/T00000000/B00000000/XXXXXXXXXXXXXXXXXXXXXXXX", "enabledKinds": [ "issue.assigned", "issue.mentioned", "portal.request_received", "sync.failed" ] }'

Replaces whatever was stored. The URL must be a Slack incoming webhook on hooks.slack.com — an arbitrary host is refused, because a Worker that will POST workspace content to any URL an admin names is a request forwarder.

Send webhookUrl to change the URL, or omit it and send only enabledKinds to change which notifications reach a webhook that is already stored.

Access. Requires the admin role or above (admin, owner). A webhook URL posts into the customer’s own Slack channel as the workspace. API-key scope: workspace:write.

Media typeapplication/json
object
webhookUrl

The Slack incoming webhook URL. Omit to keep the one already stored.

string
Example
https://hooks.slack.com/services/T00000000/B00000000/XXXXXXXXXXXXXXXXXXXXXXXX
enabledKinds

The notification kinds that reach Slack. Empty means none, which is a workspace that saved a URL and then turned everything off — different from having no webhook at all.

Array<string>
default: issue.assigned,issue.mentioned,portal.request_received,sync.failed
Allowed values: issue.assigned issue.mentioned portal.request_received sync.failed

The integration.

Media typeapplication/json
object
configured
required
boolean
hostHint
required

hooks.slack.com. The URL itself is never returned.

string | null
pathLast4
required

The last four characters of the webhook path, to recognise which URL is stored.

string | null
enabledKinds
required
Array<string>
Allowed values: issue.assigned issue.mentioned portal.request_received sync.failed
lastDeliveryAt
required
string | null format: date-time
lastError
required

Slack’s own refusal from the last failed post, or null after a success.

string | null
Example
{
"enabledKinds": [
"issue.assigned"
]
}

No valid credentials.

Media typeapplication/json
object
error
required
object
code
required

A stable identifier for the kind of failure. Safe to branch on.

string
message
required

What went wrong, written for a person.

string
detail

Structured particulars, when there are any.

object
key
additional properties
remedy

What to do about it, when there is something to do.

string
requestId
required

Quote this when asking about a specific failure.

string
Examplegenerated
{
"error": {
"code": "example",
"message": "example",
"detail": {
"additionalProperty": "example"
},
"remedy": "example",
"requestId": "example"
}
}

Authenticated, but not permitted.

Media typeapplication/json
object
error
required
object
code
required

A stable identifier for the kind of failure. Safe to branch on.

string
message
required

What went wrong, written for a person.

string
detail

Structured particulars, when there are any.

object
key
additional properties
remedy

What to do about it, when there is something to do.

string
requestId
required

Quote this when asking about a specific failure.

string
Examplegenerated
{
"error": {
"code": "example",
"message": "example",
"detail": {
"additionalProperty": "example"
},
"remedy": "example",
"requestId": "example"
}
}

No such resource, or it is not visible to you.

Media typeapplication/json
object
error
required
object
code
required

A stable identifier for the kind of failure. Safe to branch on.

string
message
required

What went wrong, written for a person.

string
detail

Structured particulars, when there are any.

object
key
additional properties
remedy

What to do about it, when there is something to do.

string
requestId
required

Quote this when asking about a specific failure.

string
Examplegenerated
{
"error": {
"code": "example",
"message": "example",
"detail": {
"additionalProperty": "example"
},
"remedy": "example",
"requestId": "example"
}
}

The request conflicts with the current state.

Media typeapplication/json
object
error
required
object
code
required

A stable identifier for the kind of failure. Safe to branch on.

string
message
required

What went wrong, written for a person.

string
detail

Structured particulars, when there are any.

object
key
additional properties
remedy

What to do about it, when there is something to do.

string
requestId
required

Quote this when asking about a specific failure.

string
Examplegenerated
{
"error": {
"code": "example",
"message": "example",
"detail": {
"additionalProperty": "example"
},
"remedy": "example",
"requestId": "example"
}
}

The request did not match the expected shape.

Media typeapplication/json
object
error
required
object
code
required

A stable identifier for the kind of failure. Safe to branch on.

string
message
required

What went wrong, written for a person.

string
detail

Structured particulars, when there are any.

object
key
additional properties
remedy

What to do about it, when there is something to do.

string
requestId
required

Quote this when asking about a specific failure.

string
Examplegenerated
{
"error": {
"code": "example",
"message": "example",
"detail": {
"additionalProperty": "example"
},
"remedy": "example",
"requestId": "example"
}
}

Rate limited. Retry after the interval in the header.

Media typeapplication/json
object
error
required
object
code
required

A stable identifier for the kind of failure. Safe to branch on.

string
message
required

What went wrong, written for a person.

string
detail

Structured particulars, when there are any.

object
key
additional properties
remedy

What to do about it, when there is something to do.

string
requestId
required

Quote this when asking about a specific failure.

string
Examplegenerated
{
"error": {
"code": "example",
"message": "example",
"detail": {
"additionalProperty": "example"
},
"remedy": "example",
"requestId": "example"
}
}

GitHub or another dependency refused or did not answer. Nothing in the workspace changed.

Media typeapplication/json
object
error
required
object
code
required

A stable identifier for the kind of failure. Safe to branch on.

string
message
required

What went wrong, written for a person.

string
detail

Structured particulars, when there are any.

object
key
additional properties
remedy

What to do about it, when there is something to do.

string
requestId
required

Quote this when asking about a specific failure.

string
Examplegenerated
{
"error": {
"code": "example",
"message": "example",
"detail": {
"additionalProperty": "example"
},
"remedy": "example",
"requestId": "example"
}
}