Skip to content
Update a user

Update a user

Update the email metadata of an existing represented user.

PATCH/api/v1/users/:id

Request#

TypeScript
const 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#

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.

Request body#

emailstring | nullrequired

New 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.

200 response
{
  "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.