All available operations for sending and manipulating preferences
This endpoint returns information about all preferences set for a specific user.
GET https://api.cord.com/v1/users/<USER_ID>/preferences
This REST endpoint has no request body.
The response is a JSON array of objects with the following fields:
notification_channels
controls how users get notified about Cord activity.This is an object with the following fields:
This endpoint updates preferences for a user.
PUT https://api.cord.com/v1/<USER_ID>/preferences
notification_channels
controls how users get notified about Cord activity.{
"value": { "sendViaSlack": "false" },
}
This is an object with the following fields:
In this example, suppose a user with the ID 123
exists. If you want to disable email notifications for this user, you can send this request:
curl "https://api.cord.com/v1/123/preferences" \
-X PUT \
-H 'Authorization: Bearer <ACCESS_TOKEN>' \
-H 'Content-Type: application/json' \
-d '{
"key": "notification_channels",
"value": {"sendViaSlack": false}
}'
If the request succeeds, the response will be:
{
"success": true,
"message": "✅ You successfully updated user 123 preferences",
}
If the request does not succeed, the response will instead contain anerror
and message
explaining what went wrong:
{
"error": "<ERROR_CODE>",
"message": "An explanation of the error code."
}