Update your company's notification settings
Changes your company's alert preferences and the Slack channel each kind of notification goes to. Anything you leave out stays as it is; send at least one setting. A channel must be one of your connected Slack workspace's channels, with or without the leading #; null means no channel. The company's name, phone number and address cannot be changed here.
Body
The channels to change. A key left out stays as it is.
Fields
Up to 255 characters.
Up to 255 characters.
Up to 255 characters.
Up to 255 characters.
Up to 255 characters.
Returns
200 The company and its settings as they are now.
Fields of the 200 answer
Your company and its settings. Ids are numbers here, unlike in GET /company.
Fields
Whether you may change the settings.
At least 1.
Fields
The Slack channel each kind of notification goes to, as #name, or null for none. A null deployment_started uses the deployments channel.
Fields
Fields
Whether your company has connected Slack. Slack is connected in the Control Panel.
The state of recent notification deliveries to Slack, one item for each destination. Empty when there is nothing to report.
Fields of each item
What to do, in plain words, when state is needs_attention. Null otherwise.
At least 1.
When the last delivery was tried, in UTC, written with +00:00. Format: date-time.
An opaque id for the destination, 64 hexadecimal characters.
How the notification is sent, such as slack.
Slack's error code for the last delivery, such as channel_not_found. Null after a delivery that worked.
When a notification last arrived. Null when none has. Format: date-time.
healthy, retrying after a delivery that will be tried again, or needs_attention when deliveries have stopped.
healthyretryingneeds_attentionThe connected workspace's name. Null while Slack is not connected.
agencyclientIf it is refused
| Status | Reason | What to do |
|---|---|---|
401 | none | Send a valid token as Authorization: Bearer <token>. |
403 | scope_required | Use a token with the scope named in scope. |
404 | none | Check the id. You see only what your account can reach. |
409 | not_connected | The outside account this needs is not connected for your company. Connect it first; the message names it. |
422 | invalid | Fix the field named in field; errors says why. |
429 | rate_limited | Wait for the seconds in Retry-After. |
Reasons are listed by name in Errors and refusals.
The same task elsewhere
curl -X PUT https://manage.corefinity.com/api/company \
-H "Authorization: Bearer $COREFINITY_TOKEN" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-d '{
"alerts_notifications": false,
"deployment_started_notifications": true
}'use Illuminate\Support\Facades\Http;
$response = Http::withToken(env('COREFINITY_TOKEN'))
->acceptJson()
->put('https://manage.corefinity.com/api/company', [
'alerts_notifications' => false,
'deployment_started_notifications' => true,
]);
$data = $response->json();const res = await fetch('https://manage.corefinity.com/api/company', {
method: 'PUT',
headers: {
Authorization: `Bearer ${process.env.COREFINITY_TOKEN}`,
Accept: 'application/json',
'Content-Type': 'application/json',
},
body: JSON.stringify({
alerts_notifications: false,
deployment_started_notifications: true,
}),
});
// An answer with no body (204) has nothing to parse.
const text = await res.text();
const data = text && JSON.parse(text);import os
import requests
res = requests.put(
"https://manage.corefinity.com/api/company",
headers={
"Authorization": f"Bearer {os.environ['COREFINITY_TOKEN']}",
"Accept": "application/json",
},
json={
"alerts_notifications": False,
"deployment_started_notifications": True,
},
)
data = res.json() if res.content else None{
"data": {
"address": "14 Quay Street, Anytown, AB1 2CD",
"can_change": true,
"country": "GB",
"id": 1204,
"name": "Harbour & Finch",
"phone": "+44 20 7946 0142",
"settings": {
"alerts_notifications": false,
"deployment_started_notifications": true,
"slack_channels": {
"alerts": "#alerts",
"deployment_started": null,
"deployments": "#deployments",
"maintenance_windows": null,
"tickets": null
}
},
"slack": {
"connected": true,
"delivery": [],
"workspace": "harbourandfinch"
},
"type": "client"
}
}{
"message": "Unauthenticated."
}{
"code": "scope_required",
"message": "This access token does not have the destructive scope this needs. Use a token with the destructive scope.",
"reason": "scope_required",
"scope": "destructive"
}{
"message": "Not found."
}{
"code": "not_connected",
"message": "Your company has not connected Slack, so a Slack channel cannot be chosen. Connect Slack on the My Company page first.",
"reason": "not_connected",
"status": "error"
}{
"code": "invalid",
"errors": {
"slack_channels.alerts": [
"Your Slack workspace has no channel #releases that the Corefinity app can post to."
]
},
"field": "slack_channels.alerts",
"message": "Your Slack workspace has no channel #releases that the Corefinity app can post to.",
"reason": "invalid"
}{
"code": "rate_limited",
"message": "Too many requests. Try again in 60 seconds.",
"reason": "rate_limited",
"retry_after_seconds": 60
}