API v1
v1
View as Markdown

List keys

GET /api/v1/api-keys

List the keys you have minted, newest first, including the one you are calling with.

A key acts as one person, so what comes back is yours and nobody else's. The key itself is not in here, in any form: it is readable once, in the response that created it, and only a hash of it is kept.

This endpoint also answers QUERY, with the same parameters sent in the request body. How QUERY works.

Query parameters

Sent as JSON. Anything not listed here is ignored.

page integer Optional default: 1

Which page to answer with.

per_page integer Optional default: 25

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

Returns

A page of key objects, and how many there are in all.

data array

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

data[] object

One key.

data[].type string

Always api_key. 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 key is for, between 3 and 255 characters, as the person who minted it wrote it. Two keys may share a name; the id is what tells them apart.

data[].attributes.client string

What the key was minted for: script for something you wrote yourself, assistant for an assistant connecting over MCP. It tells the two apart on the security screen and in your account log, and it restricts nothing: a key of either kind reaches exactly what you reach.

data[].attributes.sensitive_fields boolean

Whether the key reaches the values of fields marked sensitive. False unless that was chosen when the key was minted, because a key is handed to a device and an address book on a phone can be read by the other applications on it.

data[].attributes.administration boolean

Whether the key reaches the support queue of the whole instance. Only an administrator of the instance can mint such a key, and only when it was chosen at that moment.

data[].attributes.last_used_at timestamp

When the key last let something in, as a count of seconds, or null if it never has. A key with null here has been minted and never used.

data[].attributes.expires_at timestamp

When the key stops working, as a count of seconds, or null when it never does. Every key issued today is null: expiry is not something this API sets yet.

data[].attributes.created_at timestamp

When the key was minted, as a count of seconds since 1970.

data[].attributes.updated_at timestamp

When the row last changed, as a count of seconds, or null. Using a key changes it, so in practice it tracks last_used_at.

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 keys there are in all, not how many are on this page.

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://my.monicahq.com/api/v1/api-keys \
-H "Authorization: Bearer $MONICA_TOKEN"
const response = await fetch('https://my.monicahq.com/api/v1/api-keys', {
headers: { Authorization: `Bearer ${token}` },
})
const data = await response.json()
$response = Http::withToken($token)->get('https://my.monicahq.com/api/v1/api-keys');
Response 200
{
"data": [
{
"type": "api_key",
"id": "3",
"attributes": {
"name": "Dundie awards bot",
"client": "assistant",
"sensitive_fields": false,
"administration": false,
"last_used_at": 1756339200,
"expires_at": null,
"created_at": 1756252800,
"updated_at": 1756252800
},
"links": {
"self": "https://my.monicahq.com/api/v1/api-keys/3"
}
},
{
"type": "api_key",
"id": "1",
"attributes": {
"name": "Deployment script",
"client": "script",
"sensitive_fields": false,
"administration": false,
"last_used_at": null,
"expires_at": null,
"created_at": 1756166400,
"updated_at": 1756166400
},
"links": {
"self": "https://my.monicahq.com/api/v1/api-keys/1"
}
}
],
"meta": {
"page": 1,
"per_page": 25,
"total": 2
}
}

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