API keys

Get the current API key

Returns the API key that sends the request, without its plaintext. Any key can read itself, whatever it holds, so a process can check what it was given.

GET
/keys/current

Authorization

bearerAuth
headerAuthorizationBearer <token>

Authenticate with an API key (marfa_k1_…) or an OAuth access token (marfa_at_…).

Header parameters

X-Marfa-Reach?string

The reach from a copy stream, for a working copy. Marfa reads the current data and checks the reach in one snapshot, and returns 409 reach_changed if it has changed. Leave it out for an ordinary read.

Match^[0-9a-f]{64}$
Length64 <= length <= 64

Response body

About errors

Returns your key.

application/json
  1. response

An API key, without its plaintext: what it may reach and when it was used.

id*string

Unique identifier for the key.

label*string

A name for the key, to tell it apart from your other keys.

source*string

The key's own source, stamped on the items it writes unless a write names a source it claims. No other key that hasn't been revoked or expired has it as its own, and it can't change.

sources*array<string>

Sources the key may also write under, besides its own source. Several keys may claim one source, so their writes share natural keys. Empty if the key claims none.

permissions*array<>

The permissions the key holds, such as audit.read. Empty if it holds none.

oauth_client_id?string

The app origin client ID, inherited by every descendant key but an owner's key (owner_key). Absent when no app is in the key's origin, and on an owner's key.

default_tier*string

The tier an item this key creates goes to when the write names none.

Value in"library""feed"
type_permissions*

Item types the key may read or write, by type ID or a wildcard such as core.* or *. none denies a type a wildcard covers.

extension_permissions*

Extension namespaces the key may read or write, by namespace or *.

edge_permissions*

Edge types the key may read or write, by edge type, a namespace wildcard such as user.*, or *.

metadata_permissions*

Registrations the key may make: types to register types and edge_types to register edge types, at write. * covers both.

profile_permissions*

Stored profile levels by field. Only the username entry permits writing the username; a wildcard reads it.

enforcement_override?

The key's own enforcement levers. Absent if the key sets none, so it follows the instance's.

created_at*string

When the key was created, in UTC.

expires_at*|

When the key stops working, in UTC, or null if it doesn't expire.

last_used_at*|

When the key's use was last recorded, in UTC, or null if none is recorded. Marfa records usage asynchronously at most once an hour; a busy or unavailable store can delay or drop a record.

  • validation_error: the query has a parameter this endpoint doesn't take.
application/json
  1. response

An error response.

error*

What went wrong.

unauthorized: the request has no credential, or its credential is not valid. For a key that has expired, details.expired_at says when it expired.

application/json
  1. response

An error response.

error*

What went wrong.

  • forbidden: your credential is a signed-in app's token, not a key.
application/json
  1. response

An error response.

error*

What went wrong.

reach_changed: the reach in X-Marfa-Reach has changed. Rebuild the working copy.

application/json
  1. response

An error response.

error*

What went wrong.

contract_mismatch: X-Marfa-Contract names another contract version than this instance speaks, or is not a whole number. Nothing was done.

application/json
  1. response

An error response.

error*

What went wrong.

rate_limited: you sent too many requests. Wait for the number of seconds in Retry-After, then try again.

application/json
  1. response

An error response.

error*

What went wrong.

internal_error: Marfa failed in a way it didn't expect, and the request may not have completed. Read what you changed before you repeat a write.

application/json
  1. response

An error response.

error*

What went wrong.

write_contention: the database was busy, and Marfa couldn't complete the request in time. Nothing changed. Try the request again. While a restore runs, details.reason is restore_running.

application/json
  1. response

An error response.

error*

What went wrong.

insufficient_storage: the disk that holds the instance's data has no room for the request, or the request would leave less free than the instance keeps in reserve. Nothing changed, unless details.write_outcome is unknown, which means the write may have landed: read what you changed before you repeat it. Free space on the disk, then try the request again.

application/json
  1. response

An error response.

error*

What went wrong.

curl -X GET 'http://localhost:8600/keys/current'
About errors
{  "id": "01a1011b-b5e5-7be6-8f3b-77492475b5a4",  "label": "CRM sync",  "source": "crm",  "sources": [],  "permissions": [    "schema.write",    "keys.mint",    "items.purge",    "webhooks.manage",    "config.manage",    "audit.read",    "grants.manage",    "instance.read",    "instance.maintain",    "connectors.manage",    "blobs.manage",    "keys.manage"  ],  "default_tier": "library",  "type_permissions": {    "*": "write"  },  "extension_permissions": {    "*": "write"  },  "edge_permissions": {    "*": "write"  },  "metadata_permissions": {    "*": "write"  },  "profile_permissions": {    "*": "read"  },  "created_at": "2026-10-03T09:35:25.394Z",  "expires_at": null,  "last_used_at": "2026-10-03T09:36:25.084Z"}