Skip to content

List API keys

GET
/v1/keys
curl --request GET \
--url https://api.metaphoric.io/v1/keys \
--header 'Authorization: Bearer <token>'

Needs keys:manage. A key held to one user lists that user’s keys. Revoked and expired keys are listed until their records are dropped.

The keys, oldest first.

Media typeapplication/json
object
data
required
Array<object>
object
id
required
string
/^[0-9a-f]{16}$/
name
required
string
scopes
required
Array<string>
Allowed values: memories:read memories:write memories:forget keys:manage users:erase
user_id
required

The one user the key may act for. Null for a key of the tenant’s own server, and for a key whose user was erased.

string | null
held_to_user
required

Whether the key was made for one user. A key whose user was erased is revoked and keeps true here, with user_id null and its name replaced, so nothing of the user’s ID is left in it.

boolean
created_at
required
string format: date-time
expires_at
required

Null for a key that never expires.

string | null format: date-time
revoked_at
required

Null for a key that is not revoked.

string | null format: date-time
last_used_at
required

When the key last passed its check, to within an hour, even if the route’s scopes then refused the request. Null for a key never used.

string | null format: date-time
made_by
required

The ID of the key that made this one. Null for a key Metaphor made for the tenant. Revoking a key does not revoke the keys it made.

string | null
/^[0-9a-f]{16}$/

Example

{
"data": [
{
"id": "9f2c4e6a8b0d1f35",
"scopes": [
"memories:read"
],
"created_at": "2027-01-31T09:30:00Z",
"expires_at": "2027-01-31T09:30:00Z",
"revoked_at": "2027-01-31T09:30:00Z",
"last_used_at": "2027-01-31T09:30:00Z",
"made_by": "9f2c4e6a8b0d1f35"
}
]
}

No valid API key was sent.

Media typeapplication/json
object
error
required
object
code
required

One of ErrorCode, or a code added since. Treat a code you do not know by its status.

string
message
required
string

Example generated

{
"error": {
"code": "example",
"message": "example"
}
}

The API key does not allow this.

Media typeapplication/json
object
error
required
object
code
required

One of ErrorCode, or a code added since. Treat a code you do not know by its status.

string
message
required
string

Example generated

{
"error": {
"code": "example",
"message": "example"
}
}

The API key sent more than 600 requests in a minute, the user’s keys together more than 2000, or the tenant’s keys together more than 6000. Wait the seconds Retry-After gives.

Media typeapplication/json
object
error
required
object
code
required

One of ErrorCode, or a code added since. Treat a code you do not know by its status.

string
message
required
string

Example generated

{
"error": {
"code": "example",
"message": "example"
}
}

Something went wrong. Try again.

Media typeapplication/json
object
error
required
object
code
required

One of ErrorCode, or a code added since. Treat a code you do not know by its status.

string
message
required
string

Example generated

{
"error": {
"code": "example",
"message": "example"
}
}

The request could not be checked. Try again.

Media typeapplication/json
object
error
required
object
code
required

One of ErrorCode, or a code added since. Treat a code you do not know by its status.

string
message
required
string

Example generated

{
"error": {
"code": "example",
"message": "example"
}
}