Create or update a notification rule
curl --request PATCH \ --url https://example.com/api/v1/notification-rules \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "channelIds": [ "example" ], "days": [ 1 ], "enabled": true, "mentionMemberIds": [ "example" ], "options": { "additionalProperty": "example" }, "scope": { "id": "example", "type": "WORKSPACE" }, "source": "PM_DIGEST", "times": [ "example" ] }'Upserts the rule of one source at one scope: it is created when there is none. A field left out keeps its value, or its default on a new rule; times, days, channelIds and mentionMemberIds replace the saved list, and options are merged over the saved ones. Channels, mentioned members, orders and the scope’s record must belong to the workspace. GET /notification-rules/sources lists what each source accepts. Requires the settings.manage permission.
Authorizations
Section titled “Authorizations”Request Body
Section titled “Request Body”object
The complete set of notification channel ids it posts to.
The weekdays it is sent, 0 (Sunday) to 6 (Saturday). Only for a scheduled one.
Whether the notification is sent.
The complete set of team member ids it mentions through their Chat ID.
Options only some notifications have, merged over the saved ones, such as the overage digest’s language (en or es) and excludedOrderIds. See GET /notification-rules/sources.
object
Which notification a rule configures. GET /notification-rules/sources lists what each one accepts.
The times of day it is sent. Only for a scheduled notification.
Responses
Section titled “Responses”The rule as saved.
object
A chat notification: what is sent (source), when, to which channels and whom it mentions. Channel URLs are never returned.
object
object
Chat provider detected from the channel’s webhook URL.
Null for a source’s default rule, which has no saved row.
True when the source sends without a saved rule and this is what it does.
object
What a rule is narrowed to: the whole workspace, or one team, company (CLIENT) or project.
Which notification a rule configures. GET /notification-rules/sources lists what each one accepts.
Example
{ "data": { "destinations": [ { "provider": "discord" } ], "scopeType": "WORKSPACE", "source": "PM_DIGEST" }}Validation error. Parse failures include field paths and expectations.
Validation error with safe field paths and expected values; submitted values are never returned.
object
object
Stable machine-readable error code.
object
Human-readable error message.
HTTP status code, mirrored in the body.
Example
{ "error": { "code": "UNAUTHORIZED" }}Unauthorized.
Standard error envelope.
object
object
Stable machine-readable error code.
Human-readable error message.
HTTP status code, mirrored in the body.
Example
{ "error": { "code": "UNAUTHORIZED" }}Forbidden.
Standard error envelope.
object
object
Stable machine-readable error code.
Human-readable error message.
HTTP status code, mirrored in the body.
Example
{ "error": { "code": "UNAUTHORIZED" }}Invalid input, with field-level messages.
Error envelope with field-level messages.
object
object
Stable machine-readable error code.
Message per offending field; a list item is keyed <field>.<index>.<key>.
object
Human-readable error message.
HTTP status code, mirrored in the body.
Example
{ "error": { "code": "UNAUTHORIZED" }}Rate limit exceeded. Wait for Retry-After before retrying.
Standard error envelope.
object
object
Stable machine-readable error code.
Human-readable error message.
HTTP status code, mirrored in the body.
Example
{ "error": { "code": "UNAUTHORIZED" }}Headers
Section titled “Headers”Maximum requests in the current quota window.
Quota policy in requests and window seconds, for example 60;w=60.
Requests left in this quota window (zero when blocked).
Seconds until the current quota window resets, when available from the rate-limit store.
Seconds until another request may be attempted.
Chelsea is operated by Arepa Labs LLC