Search people by name or e-mail
const url = 'https://chat.work.optidata.cloud/api/users/search?query=jane&page=1';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://chat.work.optidata.cloud/api/users/search?query=jane&page=1' \ --header 'Authorization: Bearer <token>'Paginated search over the company’s users, excluding the caller. An empty
or omitted query matches everyone.
Authorizations
Section titled “Authorizations”Parameters
Section titled “ Parameters ”Query Parameters
Section titled “Query Parameters”Free text matched against the user’s name and e-mail address.
1-based page number.
Responses
Section titled “ Responses ”Matching users, paginated.
object
A person in the tenant.
object
Numeric id, used on the conversation and participant routes.
Stable identifier of the user across the Optiwork suite.
Identifier of the company the user belongs to.
null for a person. 0 marks the Optiwork AI assistant, 1 a bot and
2 a contact reached over an external messaging integration.
The colour used for this user’s name in the interface.
Set when the user has been removed from the company.
Details of the linked external-messaging contact, present when the user
is reached over an external messaging integration (type 2); null
for an ordinary person. Its keys depend on the integration, so treat it
as an open object.
Example
{ "current_page": 1, "data": [ { "messenger_color": "#2180f3" } ]}Missing, malformed or expired authentication key.
Authentication failures — and a few permission denials — use an error
key rather than message.
object
Examples
No bearer token sent
{ "error": "JWT passport exception: Missing bearer token in request"}The request body or query string failed validation.
object
The first validation message.
Validation messages keyed by field name.
object
Examples
{ "message": "The content field is required.", "errors": { "content": [ "The content field is required." ] }}Rate limit exceeded. Retry after the window resets.
Generic error envelope used by policy, binding and framework failures.
object
Human-readable description of the failure.
Examples
{ "message": "Too Many Attempts."}