Skip to content
Get a user

Get a user

Read a represented user by your application's user ID.

GET/api/v1/users/:id

Request#

TypeScript
const response = await fetch("https://api.smallworld.sh/api/v1/users/customer_123", {
  method: "GET",
  headers: { Authorization: `Bearer ${apiKey}` },
});
if (!response.ok) throw new Error(`HTTP ${response.status}: ${await response.text()}`);
const result = await response.json();

Use your server-side apiKey. Replace the example IDs.

Path parameters#

idstringrequired

Your application's user ID, URL-encoded. At most 512 characters, with no surrounding whitespace or null bytes. Encode the IDs . and .. as %2E and %2E%2E: curl sends these as written, but JavaScript's fetch removes them even when encoded.

Responses#

Returns id, nullable email, groupIds, and ISO 8601 createdAt and updatedAt timestamps. The ID is your application's identifier; groupIds lists your IDs for the user's current groups, ordered by ID, and is empty when they belong to none.

200 response
{
  "id": "customer_123",
  "email": "customer@example.com",
  "groupIds": [],
  "createdAt": "2026-10-10T12:00:00.000Z",
  "updatedAt": "2026-10-10T12:00:00.000Z"
}
More about this endpoint

Public user IDs are identifiers from your application, not Smallworld's internal database IDs. Derive them from your authenticated user on your backend.

URL-encode user IDs when constructing the path.