Skip to content
Sursa Developers

GET/v1/groups

List groups of the organization

list_groups

Without kind, returns regular groups, “All members” and role groups. Personal groups (single_user) are returned only with an explicit kind=single_user. Membership of all_members, role and single_user groups is computed from the organization's users, and so is their members_count.

Authentication

Send an API key in the Authorization header: Authorization: Bearer <key>.

Query parameters

  • limitinteger

    Page size. Without limit and cursor the whole list is returned; with it, at most limit items, and the next page is given in the Link (rel="next") and X-Next-Cursor headers.

    ≥ 1, ≤ 200

  • cursorstring

    Cursor of the next page from X-Next-Cursor or next_cursor of the previous response with the same filters; it carries the page size. Together with offset: 422 validation.failed; a cursor of another list, other filters or a malformed one: 400 api.cursor_invalid.

    length ≤ 512

  • updated_sincestring (date-time)

    Only objects with updated_at at or after this moment (RFC 3339 with an offset), for synchronization. With it, the list is sorted by updated_at ascending, then by id, and the cursor continues in that order. Deleted objects are not listed: deletions come as events.

    length ≤ 512

Responses

200OK

Response headers

  • Link

    Address of the next page, <…>; rel="next". No header means this is the last page.

  • X-Next-Cursor

    Cursor of the next page for the cursor parameter. No header means this is the last page.

  • RateLimit-Policy

    Limits in effect, in the format of the IETF draft draft-ietf-httpapi-ratelimit-headers: comma-separated items "<name>";q=<quota>;w=<window in seconds>. key is the request rate of the API key (the quota is the burst, the window is the time to refill it fully; for a session it is user, without credentials ip); minute, day and month are the organization's quotas for the calendar minute, day and month in UTC.

  • RateLimit

    What is left of each limit in RateLimit-Policy: "<name>";r=<remaining>;t=<seconds until reset>.

  • X-RateLimit-Limit

    Limit of the strictest entry in RateLimit-Policy (the one with the fewest requests left).

  • X-RateLimit-Remaining

    Requests left under the strictest limit.

  • X-RateLimit-Reset

    Seconds until the strictest limit resets.

application/json

Object: GroupList

array of Group
  • idintegerrequired
  • org_idintegerrequired
  • keystringrequired

    Stable key: all, role:<role>, user:<id> or the key of a regular group. The interface translates built-in groups by key.

  • titlestringrequired
  • kindGroupKindrequired
  • user_idinteger | nullrequired

    Personal groups only.

  • role_keyRole | nullrequired

    Role groups only.

  • managed_byGroupManagedByrequired
  • members_countintegerrequired

    Number of active members. Deactivated users are not members of groups.

  • disabledbooleanrequired

    The personal group of a deactivated user: its grants are kept but have no effect while the user is inactive. false for all other groups.

  • created_atstring (date-time)required
  • updated_atstring (date-time)required
401No credentials were sent (neither a session cookie nor an API key), or the key was not found.

Response headers

  • RateLimit-Policy

    Limits in effect, in the format of the IETF draft draft-ietf-httpapi-ratelimit-headers: comma-separated items "<name>";q=<quota>;w=<window in seconds>. key is the request rate of the API key (the quota is the burst, the window is the time to refill it fully; for a session it is user, without credentials ip); minute, day and month are the organization's quotas for the calendar minute, day and month in UTC.

  • RateLimit

    What is left of each limit in RateLimit-Policy: "<name>";r=<remaining>;t=<seconds until reset>.

  • X-RateLimit-Limit

    Limit of the strictest entry in RateLimit-Policy (the one with the fewest requests left).

  • X-RateLimit-Remaining

    Requests left under the strictest limit.

  • X-RateLimit-Reset

    Seconds until the strictest limit resets.

application/json

Object: Error

422Validation error: the body or parameters do not match the schema (`detail` is a list of validation errors), or a parameter value is out of range (`detail` is a message).

Response headers

  • RateLimit-Policy

    Limits in effect, in the format of the IETF draft draft-ietf-httpapi-ratelimit-headers: comma-separated items "<name>";q=<quota>;w=<window in seconds>. key is the request rate of the API key (the quota is the burst, the window is the time to refill it fully; for a session it is user, without credentials ip); minute, day and month are the organization's quotas for the calendar minute, day and month in UTC.

  • RateLimit

    What is left of each limit in RateLimit-Policy: "<name>";r=<remaining>;t=<seconds until reset>.

  • X-RateLimit-Limit

    Limit of the strictest entry in RateLimit-Policy (the one with the fewest requests left).

  • X-RateLimit-Remaining

    Requests left under the strictest limit.

  • X-RateLimit-Reset

    Seconds until the strictest limit resets.

application/json

Object: Error

429Too many requests (`api.rate_limited`), the organization's quota for the minute, day or month is used up (`api.quota_exceeded`; `error.details` holds `quota`, `limit` and `reset_at`), the organization's limit is reached, or the answer service is busy (`answers.engine_busy`). Wait for the time in the `Retry-After` header.

Response headers

  • Retry-After

    Number of seconds to wait before you retry the request.

  • RateLimit-Policy

    Limits in effect, in the format of the IETF draft draft-ietf-httpapi-ratelimit-headers: comma-separated items "<name>";q=<quota>;w=<window in seconds>. key is the request rate of the API key (the quota is the burst, the window is the time to refill it fully; for a session it is user, without credentials ip); minute, day and month are the organization's quotas for the calendar minute, day and month in UTC.

  • RateLimit

    What is left of each limit in RateLimit-Policy: "<name>";r=<remaining>;t=<seconds until reset>.

  • X-RateLimit-Limit

    Limit of the strictest entry in RateLimit-Policy (the one with the fewest requests left).

  • X-RateLimit-Remaining

    Requests left under the strictest limit.

  • X-RateLimit-Reset

    Seconds until the strictest limit resets.

application/json

Object: Error

Error codes

Codes this endpoint can return in error.code, besides the general codes of every request.

Rate limits

Responses carry the RateLimit and RateLimit-Policy headers and the earlier X-RateLimit-Limit, X-RateLimit-Remaining and X-RateLimit-Reset. A 429 response has Retry-After in seconds: wait and retry.

← groups · API reference