List API keys
const url = 'https://api.metaphoric.io/v1/keys';const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}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.
Authorizations
Section titled “Authorizations”Responses
Section titled “Responses”The keys, oldest first.
object
object
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.
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.
Null for a key that never expires.
Null for a key that is not revoked.
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.
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.
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.
object
object
One of ErrorCode, or a code added since. Treat a code you do not know by its status.
Example generated
{ "error": { "code": "example", "message": "example" }}The API key does not allow this.
object
object
One of ErrorCode, or a code added since. Treat a code you do not know by its status.
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.
object
object
One of ErrorCode, or a code added since. Treat a code you do not know by its status.
Example generated
{ "error": { "code": "example", "message": "example" }}Something went wrong. Try again.
object
object
One of ErrorCode, or a code added since. Treat a code you do not know by its status.
Example generated
{ "error": { "code": "example", "message": "example" }}The request could not be checked. Try again.
object
object
One of ErrorCode, or a code added since. Treat a code you do not know by its status.
Example generated
{ "error": { "code": "example", "message": "example" }}