Create or update user
Create a new user or update an existing user by external ID (upsert operation).
- If the user doesn't exist, they will be created with the provided attributes.
- If the user exists, their attributes will be updated (merge behavior).
custom_fieldsare deep-merged with existing values.
Returns:
201 Createdwhen a new user is created200 OKwhen an existing user is updated
Authorization
ApiKeyAuth SecretKeyAuth Your project's public API key. Found in Project Settings. Starts with pk_.
In: header
Your project's secret key. Found in Project Settings. Starts with sk_. Keep this secret!
In: header
Path Parameters
User external ID
Request Body
application/json
User attributes
URL to user's avatar image (must start with http:// or https://)
uriInitial channel settings (e.g., device tokens for push)
Custom attributes. Deep-merged with existing values on update.
User's email address
emailYour system's unique identifier for this user. Required for creating new users.
User's first name
User's last name
BCP 47 locale code (e.g., en-US, es-ES, fr-FR)
User's phone number in E.164 format
Initial notification preferences (optional)
IANA timezone (e.g., America/New_York, Europe/London)
Response Body
application/json
application/json
application/json
application/json
application/json
application/json
application/json
curl -X PUT "https://api.notiflows.com/admin/users/user_12345" \ -H "Content-Type: application/json" \ -d '{ "custom_fields": { "company": "Acme Inc", "plan": "premium" }, "email": "jane.doe@example.com", "external_id": "user_12345", "first_name": "Jane", "last_name": "Doe", "locale": "en-US", "timezone": "America/New_York" }'{
"avatar": "https://example.com/avatars/jane.jpg",
"created_at": "2024-01-15T10:30:00Z",
"custom_fields": {
"company": "Acme Inc",
"plan": "premium"
},
"email": "jane.doe@example.com",
"external_id": "user_12345",
"first_name": "Jane",
"id": "01HQXYZ123456789ABCDEFGHIJ",
"last_name": "Doe",
"locale": "en-US",
"phone": "+15551234567",
"timezone": "America/New_York",
"updated_at": "2024-01-20T14:45:00Z"
}{
"avatar": "https://example.com/avatars/jane.jpg",
"created_at": "2024-01-15T10:30:00Z",
"custom_fields": {
"company": "Acme Inc",
"plan": "premium"
},
"email": "jane.doe@example.com",
"external_id": "user_12345",
"first_name": "Jane",
"id": "01HQXYZ123456789ABCDEFGHIJ",
"last_name": "Doe",
"locale": "en-US",
"phone": "+15551234567",
"timezone": "America/New_York",
"updated_at": "2024-01-20T14:45:00Z"
}{
"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"
}
}