List users
GET
/users
const url = 'https://docs.ywork.dev/api/v1/users?limit=20';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://docs.ywork.dev/api/v1/users?limit=20' \ --header 'Authorization: Bearer <token>'Returns a paginated list of members in the workspace.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Query Parameters
Section titled “Query Parameters”limit
integer
Maximum number of items to return (1–100). Defaults to 20.
cursor
string
An opaque cursor returned as next_cursor from a previous page. Omit to fetch the first page.
Responses
Section titled “Responses”A paginated list of users.
Media typeapplication/json
object
object
required
string
data
required
Array
pagination
required
object
has_more
required
boolean
next_cursor
required
string | null
data
required
Array<object>
object
id
required
string
object
required
string
email
required
string format: email
name
required
string
role
required
string
created_at
required
string format: date-time
Example
{ "object": "list", "pagination": { "has_more": true, "next_cursor": "eyJvIjoyMH0" }, "data": [ { "id": "usr_3Jk2mQ8zpL", "object": "user", "email": "ada@example.com", "name": "Ada Lovelace", "role": "admin" } ]}No valid API key was provided.
Media typeapplication/json
object
error
required
object
type
required
A broad category for the error.
string
code
required
A short machine-readable code for the specific error.
string
message
required
A human-readable description of the error.
string
request_id
A unique identifier for the request, useful for support.
string
Example
{ "error": { "type": "authentication_error", "code": "missing_api_key", "message": "No API key provided. Send your key as a bearer token in the Authorization header.", "request_id": "req_9f2a1c7b4e" }}The rate limit has been exceeded.
Media typeapplication/json
object
error
required
object
type
required
A broad category for the error.
string
code
required
A short machine-readable code for the specific error.
string
message
required
A human-readable description of the error.
string
request_id
A unique identifier for the request, useful for support.
string
Example
{ "error": { "type": "rate_limit_error", "code": "too_many_requests", "message": "Too many requests. Please retry after the window resets.", "request_id": "req_2d6b8f0a35" }}Headers
Section titled “Headers”Retry-After
integer
Example
12Seconds to wait before retrying.