Update a user
Update the email metadata of an existing represented user.
/api/v1/users/:idconst response = await fetch("https://api.smallworld.sh/api/v1/users/customer_123", {
method: "PATCH",
headers: { Authorization: `Bearer ${apiKey}`, "Content-Type": "application/json" },
body: JSON.stringify({
"email": "updated@example.com"
}),
});
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#
idstringrequiredYour application's user ID, URL-encoded. At most 512 characters, with no surrounding whitespace or null bytes. Encode the IDs
.and..as%2Eand%2E%2E: curl sends these as written, but JavaScript'sfetchremoves them even when encoded.
Request body#
emailstring | nullrequiredNew email metadata: a valid address of at most 254 characters after trimming. null or an empty string clears the value.
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.
{
"id": "customer_123",
"email": "updated@example.com",
"groupIds": [],
"createdAt": "2026-10-10T12:00:00.000Z",
"updatedAt": "2026-10-10T12:00:00.000Z"
}
More about this endpoint
The ID cannot be changed through this endpoint. An empty body is invalid.