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
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
application/json
application/json
application/json
application/json
application/json
application/json
curl -X PUT "https://api.notiflows.com/admin/v1/users/user_12345" \ -H "Content-Type: application/json" \ -d '{ "custom_fields": { "company": "Acme Inc", "plan": "premium" }, "email": "jane.doe@example.com", "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://notiflows.com/docs/api/errors#not_found-404"
}
}{
"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://notiflows.com/docs/api/errors#not_found-404"
}
}{
"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://notiflows.com/docs/api/errors#not_found-404"
}
}{
"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://notiflows.com/docs/api/errors#not_found-404"
}
}{
"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://notiflows.com/docs/api/errors#not_found-404"
}
}