API referenceNotifications

Get notification email preferences

Returns the caller's notification email preferences as one entry per category.

Endpoint
GET https://api.dairo.app/v1/notifications/preferences

Returns the caller's notification email preferences as one entry per category. The preferences array always contains all five categories — account, billing, usage, security, and product — each with a resolved emailEnabled boolean, so a client never has to know the category catalog in advance. A category with no stored preference resolves to emailEnabled: true, so a brand-new account is opted in to everything without any setup. Dairo checks these preferences before sending each notification email, so a category set to false here mutes that entire class of mail. Requires the account:read scope.

Scope: account:read. Send the API key as a bearer token; Scopes lists what each one reaches.

Request

cURL
curl "https://api.dairo.app/v1/notifications/preferences" \
  -H "Authorization: Bearer $DAIRO_API_KEY"

Response

200 Success. Body: application/json, NotificationPreferencesResponse.

FieldTypeRequiredDescription
object"notification_preferences"yes
preferencesarray of NotificationPreferenceyesOne entry per notification category, with its resolved emailEnabled flag.
200
{
  "object": "notification_preferences",
  "preferences": [
    {
      "category": "account",
      "emailEnabled": true
    }
  ]
}

Errors

Every error has the same body, {"error": {"type", "code", "message", "param"}}; branch on code. Errors lists every code.

StatusMeaning
400The request is malformed or a value is invalid (invalid_request, invalid_domain, idempotency_key_mismatch).
401The API key is missing or invalid.
403The key lacks the scope this endpoint needs (scope_missing) or may not do this (not_permitted).
404No such resource in this account (resource_not_found).
422The request is well-formed but a field failed validation (validation_failed).
429Rate limit, plan limit, budget or spend cap reached (rate_limited, plan_limit_reached, budget_exceeded, spend_cap_reached).
500An unexpected error; retry with backoff, then contact support (internal_error).

On this page