notiflowsDocs
Users

Update user preferences

Update a user's notification preferences. Only provided fields are updated (partial update).

Channel types: Set to false to opt the user out of a channel globally.

Notiflow preferences: Override settings for specific notiflows:

{
  "notiflows": {
    "notiflow_uuid": {
      "enabled": true,
      "channel_types": {
        "email": false
      }
    }
  }
}
PUT
/users/{user_id}/preferences

Authorization

ApiKeyAuth SecretKeyAuth
x-notiflows-api-key<token>

Your project's public API key. Found in Project Settings. Starts with pk_.

In: header

x-notiflows-secret-key<token>

Your project's secret key. Found in Project Settings. Starts with sk_. Keep this secret!

In: header

Path Parameters

user_id*string

User external ID

Request Body

application/json

Preference updates

channel_types?

Global channel type preferences

notiflows?

Per-notiflow preferences (keyed by notiflow ID)

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

curl -X PUT "https://api.notiflows.com/admin/users/user_12345/preferences" \  -H "Content-Type: application/json" \  -d '{    "channel_types": {      "sms": false    },    "notiflows": {      "01HQXYZ123456789ABCDEFGHIJ": {        "channel_types": {          "email": false        },        "enabled": true      }    }  }'
{
  "channel_types": {
    "chat": true,
    "email": true,
    "in_app": true,
    "mobile_push": true,
    "sms": false,
    "web_push": true
  },
  "notiflows": {
    "01HQXYZ123456789ABCDEFGHIJ": {
      "channel_types": {
        "email": true,
        "sms": false
      },
      "enabled": true,
      "name": "Order Updates"
    }
  }
}
{
  "error": {
    "code": "not_found",
    "details": {
      "allowed_statuses": [
        "string"
      ],
      "allowed_transitions": [
        "string"
      ],
      "auth": "api_key",
      "current_status": "string",
      "fields": [
        {
          "field": "email",
          "message": "can't be blank",
          "reason": "required"
        }
      ],
      "id": "string",
      "idempotency_key": "string",
      "limit": 0,
      "param": "string",
      "reason": "string",
      "required_scope": "string",
      "resource": "string",
      "retry_after": 0,
      "window": "string"
    },
    "message": "User not found",
    "request_id": "req_abc123",
    "status": 404,
    "type": "https://docs.notiflows.com/errors/not_found"
  }
}
{
  "error": {
    "code": "not_found",
    "details": {
      "allowed_statuses": [
        "string"
      ],
      "allowed_transitions": [
        "string"
      ],
      "auth": "api_key",
      "current_status": "string",
      "fields": [
        {
          "field": "email",
          "message": "can't be blank",
          "reason": "required"
        }
      ],
      "id": "string",
      "idempotency_key": "string",
      "limit": 0,
      "param": "string",
      "reason": "string",
      "required_scope": "string",
      "resource": "string",
      "retry_after": 0,
      "window": "string"
    },
    "message": "User not found",
    "request_id": "req_abc123",
    "status": 404,
    "type": "https://docs.notiflows.com/errors/not_found"
  }
}
{
  "error": {
    "code": "not_found",
    "details": {
      "allowed_statuses": [
        "string"
      ],
      "allowed_transitions": [
        "string"
      ],
      "auth": "api_key",
      "current_status": "string",
      "fields": [
        {
          "field": "email",
          "message": "can't be blank",
          "reason": "required"
        }
      ],
      "id": "string",
      "idempotency_key": "string",
      "limit": 0,
      "param": "string",
      "reason": "string",
      "required_scope": "string",
      "resource": "string",
      "retry_after": 0,
      "window": "string"
    },
    "message": "User not found",
    "request_id": "req_abc123",
    "status": 404,
    "type": "https://docs.notiflows.com/errors/not_found"
  }
}
{
  "error": {
    "code": "not_found",
    "details": {
      "allowed_statuses": [
        "string"
      ],
      "allowed_transitions": [
        "string"
      ],
      "auth": "api_key",
      "current_status": "string",
      "fields": [
        {
          "field": "email",
          "message": "can't be blank",
          "reason": "required"
        }
      ],
      "id": "string",
      "idempotency_key": "string",
      "limit": 0,
      "param": "string",
      "reason": "string",
      "required_scope": "string",
      "resource": "string",
      "retry_after": 0,
      "window": "string"
    },
    "message": "User not found",
    "request_id": "req_abc123",
    "status": 404,
    "type": "https://docs.notiflows.com/errors/not_found"
  }
}
{
  "error": {
    "code": "not_found",
    "details": {
      "allowed_statuses": [
        "string"
      ],
      "allowed_transitions": [
        "string"
      ],
      "auth": "api_key",
      "current_status": "string",
      "fields": [
        {
          "field": "email",
          "message": "can't be blank",
          "reason": "required"
        }
      ],
      "id": "string",
      "idempotency_key": "string",
      "limit": 0,
      "param": "string",
      "reason": "string",
      "required_scope": "string",
      "resource": "string",
      "retry_after": 0,
      "window": "string"
    },
    "message": "User not found",
    "request_id": "req_abc123",
    "status": 404,
    "type": "https://docs.notiflows.com/errors/not_found"
  }
}