Get a user
GET
const url = 'https://optlo.com/api/v1/users/example';const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
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://optlo.com/api/v1/users/example \ --header 'Authorization: Bearer <token>'Requires users:read.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”userId
required
string
Unique identifier for the user.
Response
Section titled “Response”Success
Media typeapplication/json
Show child attributes
id
required
Unique identifier for the user.
string
name
required
User’s display name.
nullable string
email
required
User’s email address.
nullable string
externalId
required
User identifier in your system. String and numeric IDs are distinct.
nullableor
string
number
avatarUrl
required
URL of the user’s avatar image.
nullable string
attrs
required
Custom attributes attached to the user, such as plan or company. Values can be strings, numbers, booleans, or null.
Show child attributes
key
additional properties
nullableoror
string
number
boolean
createdAt
required
Time the user was created.
string format: date-time
lastVisitedAt
required
Time of the user’s most recent visit. Null if no visit has been recorded.
nullable string format: date-time
Example
{ "id": "user_kR7mP3xB9nQ2vL5z", "name": "Sam Rivera", "email": "sam@example.com", "externalId": "customer_1042", "avatarUrl": null, "attrs": { "plan": "pro", "company": "Acme" }, "createdAt": "2026-10-13T09:00:00.000Z", "lastVisitedAt": "2026-10-13T09:05:00.000Z"}