Monica
Log in
API v1
v1
View as Markdown

List the groups of a vault

GET QUERY /api/v1/vaults/{vault}/groups

List the groups of a vault, by name.

Deleted groups are left out.

Groups are not yet available to every account. Until they are available to yours, every endpoint here answers 404.

This endpoint answers GET and QUERY alike, and both return the same answer. GET sends the parameters in the address, QUERY in the request body. How QUERY works.

Parameters

Path parameters go in the address. GET sends the others in the address too, QUERY sends them as JSON in the request body. Anything not listed here is ignored.

vault string Required

The vault the groups live in, named either by the readable name it reports as slug or by its id.

page integer Optional default: 1

Which page to answer with.

per_page integer Optional default: 25

How many records one page holds, between 1 and 100. A number outside the range is brought back into it rather than refused.

Returns

A page of group objects, and how many there are in all. A vault of another account answers 404.

data array

The groups on this page. An empty list rather than an error when there are none.

data[] object

One group.

data[].type string

Always group. It names the kind of record, so a caller holding several kinds can tell them apart without looking at where they came from.

data[].id string

The id of this record, as a string even when it reads as a number. It is what every endpoint naming this record takes.

data[].attributes object

Everything the record holds.

data[].attributes.name string

What the group is called.

data[].attributes.description string

What was written about it, or null.

data[].attributes.started_on string

When it started, written as a year, a month and a day, or null.

data[].attributes.started_precision string

How much of the date is known: day, month, year or decade. Always unknown when there is no date.

data[].attributes.ended_on string

When it ended, written as a year, a month and a day, or null while it still exists.

data[].attributes.ended_precision string

How much of the date is known: day, month, year or decade. Always unknown when there is no date.

data[].attributes.current_member_count integer

How many people are in it today. Those who left are not counted.

data[].attributes.created_at timestamp

When it was created, as a count of seconds since 1970.

data[].attributes.updated_at timestamp

When it last changed, as a count of seconds since 1970, or null.

data[].attributes.deleted_at timestamp

When it was deleted, as a count of seconds since 1970, or null.

data[].links object

Where to find this record.

data[].links.self string

The absolute address this record is read from.

meta object

Where you are in the collection.

meta.page integer

The page this is, counting from 1.

meta.per_page integer

How many one page holds, which is the size that was asked for once it has been brought into the allowed range.

meta.total integer

How many groups there are in all, not how many are on this page.

Status codes

Every code the API answers with, and what the body holds when it does.

Code When Body
422 Unprocessable Content With QUERY, a parameter was sent both in the address and in the body. A message, and an errors object naming each parameter sent twice.

Rate limit

Sixty requests per minute, per user, shared by every key and device. Every answer carries the budget left in X-RateLimit-Remaining.

GET
curl https://people.hansyeoh.com/api/v1/vaults/dunder-mifflin/groups?page=2&per_page=10 \
-H "Authorization: Bearer $MONICA_TOKEN"
const response = await fetch('https://people.hansyeoh.com/api/v1/vaults/dunder-mifflin/groups?page=2&per_page=10', {
headers: { Authorization: `Bearer ${token}` },
})
const data = await response.json()
$response = Http::withToken($token)->get('https://people.hansyeoh.com/api/v1/vaults/dunder-mifflin/groups?page=2&per_page=10');
QUERY
curl https://people.hansyeoh.com/api/v1/vaults/dunder-mifflin/groups \
-X QUERY \
-H "Authorization: Bearer $MONICA_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"page": 2,
"per_page": 10
}'
const response = await fetch('https://people.hansyeoh.com/api/v1/vaults/dunder-mifflin/groups', {
method: 'QUERY',
headers: { Authorization: `Bearer ${token}`, 'Content-Type': 'application/json' },
body: JSON.stringify({
page: 2,
per_page: 10,
}),
})
const data = await response.json()
$response = Http::withToken($token)->query('https://people.hansyeoh.com/api/v1/vaults/dunder-mifflin/groups', [
'page' => 2,
'per_page' => 10,
]);
Response 200
{
"data": [
{
"type": "group",
"id": "5d2a7c91-3e48-4b06-9f1d-a83c60e2b4f7",
"attributes": {
"name": "Party planning committee",
"description": "Plans every birthday, retirement and holiday party of the Scranton branch.",
"started_on": "2005-01-01",
"started_precision": "year",
"ended_on": null,
"ended_precision": "unknown",
"current_member_count": 3,
"created_at": 1791547200,
"updated_at": 1791547200,
"deleted_at": null
},
"links": {
"self": "https://people.hansyeoh.com/api/v1/vaults/dunder-mifflin/groups/5d2a7c91-3e48-4b06-9f1d-a83c60e2b4f7"
}
}
],
"meta": {
"page": 1,
"per_page": 25,
"total": 1
}
}

Keys act as you, with exactly the access you have. Make one per integration so you can revoke it alone.