Skip to content

Update the signed-in user

PATCH
/v1/id/user-details
curl --request PATCH \
--url https://your-tenant-host/v1/id/user-details \
--header 'Content-Type: application/json' \
--header 'x-edgekit-site-id: site_example' \
--cookie ek.session_token=<ek.session_token> \
--data '{ "name": "Ada Lovelace", "firstName": "Ada", "lastName": "Lovelace", "userTraits": { "job_industry": "01926f3a-8b51-7e99-9aaa-8b9c0d1e2f3a", "newsletter_note": null } }'

Writes the user’s own fields. userTraits is merged per key: a key you send replaces its stored value, an explicit null deletes it, and a key you omit keeps whatever the user last chose. Validation runs against the merged result, so a one-key patch is never refused for a trait it did not touch. A value naming an item the organization has since retired is accepted and dropped rather than refused. Safe to retry: the same body writes the same values.

x-edgekit-site-id
required

The site this request is for, within this tenant. Every official EdgeKit SDK sets it from the client you configured; set it yourself only when calling this API directly.

string
>= 1 characters <= 128 characters

Example

site_example

The site this request is for, within this tenant. Every official EdgeKit SDK sets it from the client you configured; set it yourself only when calling this API directly.

Media typeapplication/json
object
name
string
>= 1 characters <= 200 characters

Example

Ada Lovelace
firstName
string | null
>= 1 characters <= 100 characters

Example

Ada
lastName
string | null
>= 1 characters <= 100 characters

Example

Lovelace
userTraits
object
key
additional properties

Example

{
"job_industry": "01926f3a-8b51-7e99-9aaa-8b9c0d1e2f3a",
"newsletter_note": null
}

The updated user.

Media typeapplication/json
object
id
required
string format: uuid
email
required
string
emailVerified
required
boolean
name
required
string | null
firstName
required
string | null
lastName
required
string | null
image
required
string | null
userTraits
required
object
key
additional properties

Example

{
"id": "01926f3a-8b4c-7d2e-9f10-2a3b4c5d6e7f",
"email": "user@example.com",
"emailVerified": true,
"name": "Ada Lovelace",
"firstName": "Ada",
"lastName": "Lovelace",
"image": null,
"userTraits": {
"job_industry": "01926f3a-8b51-7e99-9aaa-8b9c0d1e2f3a",
"sectors": [
"01926f3a-8b52-7fbb-acc0-9c0d1e2f3a4b"
]
}
}

Invalid request.

Media typeapplication/json
object
error
required
object
code
required
string
message
required
string
details

Example

{
"error": {
"code": "unauthorized",
"message": "Invalid or missing API key."
}
}

Missing or invalid credential.

Media typeapplication/json
object
error
required
object
code
required
string
message
required
string
details

Example

{
"error": {
"code": "unauthorized",
"message": "Invalid or missing API key."
}
}

Not allowed.

Media typeapplication/json
object
error
required
object
code
required
string
message
required
string
details

Example

{
"error": {
"code": "unauthorized",
"message": "Invalid or missing API key."
}
}

Resource not found.

Media typeapplication/json
object
error
required
object
code
required
string
message
required
string
details

Example

{
"error": {
"code": "unauthorized",
"message": "Invalid or missing API key."
}
}

Request validation failed.

Media typeapplication/json
object
error
required
object
code
required
string
message
required
string
details

Example

{
"error": {
"code": "unauthorized",
"message": "Invalid or missing API key."
}
}

Unexpected error.

Media typeapplication/json
object
error
required
object
code
required
string
message
required
string
details

Example

{
"error": {
"code": "unauthorized",
"message": "Invalid or missing API key."
}
}