Read the signed-in user
const url = 'https://your-tenant-host/v1/id/user-details';const options = { method: 'GET', headers: { cookie: 'ek.session_token=<ek.session_token>', 'x-edgekit-site-id': 'site_example' }};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url https://your-tenant-host/v1/id/user-details \ --header 'x-edgekit-site-id: site_example' \ --cookie ek.session_token=<ek.session_token>The caller’s own record and the traits they wrote about themselves. userTraits carries stored values verbatim: an item the organization has since retired is still reported, and no default is substituted, so a client reconciles against GET /v1/id/traits rather than trusting every id to be labellable. The organization-written trait tier is never included.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Header Parameters
Section titled “Header Parameters”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.
Example
site_exampleThe 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.
Responses
Section titled “Responses”The signed-in user, with their own traits.
object
object
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.
object
object
Example
{ "error": { "code": "unauthorized", "message": "Invalid or missing API key." }}Missing or invalid credential.
object
object
Example
{ "error": { "code": "unauthorized", "message": "Invalid or missing API key." }}Not allowed.
object
object
Example
{ "error": { "code": "unauthorized", "message": "Invalid or missing API key." }}Resource not found.
object
object
Example
{ "error": { "code": "unauthorized", "message": "Invalid or missing API key." }}Request validation failed.
object
object
Example
{ "error": { "code": "unauthorized", "message": "Invalid or missing API key." }}Unexpected error.
object
object
Example
{ "error": { "code": "unauthorized", "message": "Invalid or missing API key." }}