API v1
v1
View as Markdown

Get a key

GET /api/v1/api-keys/{apiKey}

Retrieve one of your keys: what you called it, when you made it, and when it last let something in.

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

Path parameters

Sent as JSON. Anything not listed here is ignored.

apiKey integer Required

The id of the key.

Returns

A key object. A key belonging to somebody else answers 404, which is also what a key that never existed answers.

data object

The 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.

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/3 \
-H "Authorization: Bearer $MONICA_TOKEN"
const response = await fetch('https://my.monicahq.com/api/v1/api-keys/3', {
headers: { Authorization: `Bearer ${token}` },
})
const data = await response.json()
$response = Http::withToken($token)->get('https://my.monicahq.com/api/v1/api-keys/3');
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"
}
}
}

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