Search users
GET
/users/search
const url = 'https://feed.work.optidata.cloud/api/users/search?query=ana&limit=10';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://feed.work.optidata.cloud/api/users/search?query=ana&limit=10' \ --header 'Authorization: Bearer <token>'Finds colleagues by name or e-mail, for mentions and recipient pickers. Returns a light user record. Cached for one hour.
Authorizations
Section titled “Authorizations”Parameters
Section titled “ Parameters ”Query Parameters
Section titled “Query Parameters”query
string
Text to match.
limit
integer
Maximum results (1–100).
Responses
Section titled “ Responses ”Matching users.
Media typeapplication/json
object
users
required
Array<object>
A light user record for pickers.
object
id
required
integer
name
string | null
uuid
required
string format: uuid
email
string | null
avatar_url
string | null
Examples
Exampleexample
{ "users": [ { "id": 38, "name": "Ana Souza", "uuid": "9ba64b0e-69b4-4639-a01b-4ac5c5f70a24", "email": "ana.souza@example.com", "avatar_url": "https://media.optidata.cloud/avatars/ana.webp" } ]}No authentication key was sent.
Media typeapplication/json
Authentication failures use an error key.
object
error
required
string
Examples
Exampleexample
{ "error": "JWT passport exception: Missing bearer token in request"}The authentication key is expired or not recognised. Get a fresh one and retry.
Media typeapplication/json
Authentication failures use an error key.
object
error
required
string
Examples
Exampleexample
{ "error": "JWT passport expired: Passport expired"}The request failed validation.
Media typeapplication/json
object
message
required
The first validation message.
string
errors
required
Messages keyed by field name.
object
key
additional properties
Array<string>
Examples
Exampleexample
{ "message": "The name field is required.", "errors": { "name": [ "The name field is required." ] }}