Tenant Signing Keys

Authentication: JWT | API Key

A tenant signing key is a P-256 public key registered in an environment. Your backend signs tenant tokens with the matching private key, one token per end user. The signing key sets the most a token can reach: its owner collections, the collections below them, shared collections, and the Flux APIs and actions of its parent Flux API key. Tokens read, create, update and upload within that. FoxNose stores only the public key and issues no tokens itself.

Endpoints live under /v1/:env/tenant-signing-keys/… and /v1/:env/tenant-limits/.

Path Parameters

  • Name
    :env
    Type
    string
    Description

    Environment key.

  • Name
    :kid
    Type
    string
    Description

    Signing key id, tsk_ followed by 12 characters.

Permissions

Signing keys use the tenant-signing-keys content type of a Management API role, scoped to the parent Flux API key. Creating a key needs create on it for the parent key, read on Flux API keys, and read on the content of every collection the key names and of every ancestor of its owner collections. Reading a key needs read, changing it or adding a revocation needs update, and deleting it needs delete. A list leaves out keys the caller cannot read. Tenant limits need read or update on environment settings.


Signing Key Object

  • Name
    kid
    Type
    string
    Description

    Signing key id, such as tsk_Q7m2xPz9aLwK. Tokens name it in their header.

  • Name
    status
    Type
    string
    Description

    active, revoked, or parent_deleted when the parent Flux API key has been deleted.

  • Name
    parent_key
    Type
    string
    Description

    Key of the parent Flux API key. A token never has more access than this key's role.

  • Name
    public_key
    Type
    string
    Description

    The public key, as base64 SPKI DER.

  • Name
    anchor_collections
    Type
    array<string>
    Description

    Owner collections. A token names its owner records (anchors) in these collections.

  • Name
    collections
    Type
    array<string>
    Description

    Collections a token can reach under its anchors: the owner collections and strict-reference collections below them.

  • Name
    shared_read
    Type
    array<string>
    Description

    Collections without an owner that a token reads whole, such as help articles.

  • Name
    apis
    Type
    object
    Description

    Actions per Flux API prefix, such as {"support": ["read"]}.

  • Name
    max_ttl_seconds
    Type
    integer
    Description

    Longest lifetime a token may have.

  • Name
    max_anchors
    Type
    integer
    Description

    Most anchors one token may name.

  • Name
    limits
    Type
    object | null
    Description

    Per-key overrides of rpm_per_subject and uploads_per_subject_per_hour, or null.

  • Name
    not_before
    Type
    datetime | null
    Description

    Tokens issued before this time are refused.

  • Name
    revocation_generation
    Type
    integer
    Description

    Increases with each change to the key's revocations.

  • Name
    description
    Type
    string
    Description

    Optional label.

  • Name
    created_at
    Type
    datetime
    Description

    When the key was created.

  • Name
    revoked_at
    Type
    datetime | null
    Description

    When the key was revoked.

  • Name
    revoked_by
    Type
    string | null
    Description

    Who revoked the key.

  • Name
    last_used_at
    Type
    datetime | null
    Description

    Approximate time a token of this key was last accepted.

  • Name
    oauth
    Type
    null
    Description

    Always null.

  • Name
    oauth_state
    Type
    string
    Description

    Always none.

Every field except description, limits and not_before is fixed at creation. To change what tokens can reach, create a key and move token signing to it.


GETapi.foxnose.net/v1/:env/tenant-signing-keys/

List Signing Keys

Lists the environment's signing keys, revoked ones included, oldest first. Supports limit/offset pagination.

Success Response: 200 OK

Query Parameters

  • Name
    parent_key
    Type
    string
    Description

    Only keys with this parent Flux API key.

  • Name
    limit
    Type
    integer
    Default
    default:100
    Description

    Number of keys per page.

  • Name
    offset
    Type
    integer
    Default
    default:0
    Description

    Number of keys to skip.

Request

GET
/v1/:env/tenant-signing-keys/
curl https://api.foxnose.net/v1/7c9h4pwu/tenant-signing-keys/ \
-H "Authorization: Bearer eyJhbGciOiJIUzI1NiI..."

POSTapi.foxnose.net/v1/:env/tenant-signing-keys/

Create Signing Key

Registers a public key, or generates a key pair. Send exactly one of public_key and generate: true. With generate, the response carries the private key once; it is not stored.

Success Response: 201 Created, with Cache-Control: no-store

Request Body

  • Name
    parent_key
    Type
    string
    Required
    required
    Description

    Key of a Flux API key in this environment.

  • Name
    public_key
    Type
    string
    Description

    A P-256 public key as base64 SPKI DER, or as a base64 33-byte compressed point. Maximum 4096 characters.

  • Name
    generate
    Type
    boolean
    Default
    default:false
    Description

    Generate a key pair. The response adds private_key, base64 PKCS#8 DER.

  • Name
    anchor_collections
    Type
    array<string>
    Required
    required
    Description

    1 to 100 collection key values (not aliases). Each is a strict-reference collection or the direct parent of one.

  • Name
    collections
    Type
    array<string>
    Default
    default:null
    Description

    1 to 100 collection keys: every anchor collection, plus strict-reference collections below them. Default: the anchor collections and every strict-reference collection below them at creation. A collection created later is not included.

  • Name
    shared_read
    Type
    array<string>
    Default
    default:[]
    Description

    Up to 100 keys of collections that are not strict-reference.

  • Name
    apis
    Type
    object
    Required
    required
    Description

    {api_prefix: [actions]} with at least one prefix and one action. Actions are read, create and update, within what the parent key's role grants on that API. A token writes in a collection only when the collection's connection to the API allows the method.

  • Name
    max_ttl_seconds
    Type
    integer
    Default
    default:900
    Description

    60 to 86400.

  • Name
    max_anchors
    Type
    integer
    Default
    default:1
    Description

    1 to 10.

  • Name
    limits
    Type
    object
    Default
    default:null
    Description

    {"rpm_per_subject": n, "uploads_per_subject_per_hour": n} to override the environment's limits for this key's tokens.

  • Name
    description
    Type
    string
    Default
    default:''
    Description

    Maximum 255 characters.

Errors

  • Name
    403 Forbidden
    Description
    • forbidden: the caller lacks a required permission, including read on a named collection, whether or not it exists.
    • organization_blocked: the organization is blocked.
  • Name
    404 Not Found
    Description
    • api_key_not_found: parent_key is not a Flux API key of this environment.
  • Name
    422 Unprocessable Entity
    Description
    • validation_error: a field is missing, of the wrong type, out of range, or unknown.
    • anchor_not_tenant: an anchor collection is neither strict-reference nor the direct parent of one. detail.collection names it.
    • collection_not_in_scope: a collections entry is not in the environment, an anchor collection is missing from collections, or an entry is not below an anchor collection.
    • shared_read_not_shared: a shared_read collection does not exist or is strict-reference.
    • apis_above_parent: apis asks for more than the parent key's role grants on an API. detail.api names it.
    • limit_above_ceiling: a limit is above its ceiling. detail carries limit, ceiling and bound (plan or platform).
    • invalid_public_key: public_key is not a P-256 public key in an accepted form.
    • duplicate_key_material: the public key is already registered as a signing key or an API key.
    • signing_key_limit_reached: the environment has 10 active signing keys.
    • oauth_not_available: oauth is not null.

Request

POST
/v1/:env/tenant-signing-keys/
curl -X POST https://api.foxnose.net/v1/7c9h4pwu/tenant-signing-keys/ \
-H "Authorization: Bearer eyJhbGciOiJIUzI1NiI..." \
-H "Content-Type: application/json" \
-d '{
  "parent_key": "dw2qC5qRwxuZ",
  "generate": true,
  "anchor_collections": ["a8Lq3vNm2xKp"],
  "shared_read": ["r4Tn7wQe1zBc"],
  "apis": {"support": ["read"]},
  "max_ttl_seconds": 900,
  "description": "Support portal"
}'

Response

{
    "kid": "tsk_Q7m2xPz9aLwK",
    "status": "active",
    "parent_key": "dw2qC5qRwxuZ",
    "public_key": "MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAE...",
    "private_key": "MIGHAgEAMBMGByqGSM49AgEGCCqGSM49AwEHBG0wawIBAQQg...",
    "anchor_collections": ["a8Lq3vNm2xKp"],
    "collections": ["a8Lq3vNm2xKp", "h2Vd9kMs5pXe"],
    "shared_read": ["r4Tn7wQe1zBc"],
    "apis": {"support": ["read"]},
    "max_ttl_seconds": 900,
    "max_anchors": 1,
    "limits": null,
    "oauth": null,
    "oauth_state": "none",
    "not_before": null,
    "revocation_generation": 0,
    "description": "Support portal",
    "created_at": "2026-11-29T10:00:00Z",
    "revoked_at": null,
    "revoked_by": null,
    "last_used_at": null
}

GETapi.foxnose.net/v1/:env/tenant-signing-keys/:kid/

Get Signing Key

Returns the signing key object. An unknown kid, or one of another environment, returns 404 with signing_key_not_found.


PATCHapi.foxnose.net/v1/:env/tenant-signing-keys/:kid/

Update Signing Key

Changes the label, the per-key limit, or the cutoff for older tokens. Send at least one field.

Success Response: 200 OK

Request Body

  • Name
    description
    Type
    string
    Description

    Maximum 255 characters.

  • Name
    limits
    Type
    object | null
    Description

    The same object as on Create, or null to clear the overrides.

  • Name
    not_before
    Type
    string
    Description

    "now", or an ISO 8601 time with a UTC offset. Tokens with iat before it are refused. "now" means 60 seconds from now, and an explicit time must be at least that far ahead, so tokens signed in the next 60 seconds are refused too: sign new tokens with iat at or after the cutoff. The cutoff only moves forward.

Errors

  • Name
    409 Conflict
    Description
    • signing_key_revoked: the key is revoked.
  • Name
    422 Unprocessable Entity
    Description
    • cutoff_too_early: not_before is less than 60 seconds ahead.
    • not_before_not_monotonic: not_before is before the current cutoff. detail.current carries it.
    • limit_above_ceiling: see Create.

Request

PATCH
/v1/:env/tenant-signing-keys/:kid/
curl -X PATCH https://api.foxnose.net/v1/7c9h4pwu/tenant-signing-keys/tsk_Q7m2xPz9aLwK/ \
-H "Authorization: Bearer eyJhbGciOiJIUzI1NiI..." \
-H "Content-Type: application/json" \
-d '{"not_before": "now"}'

DELETEapi.foxnose.net/v1/:env/tenant-signing-keys/:kid/

Delete Signing Key

Revokes the key. Flux stops accepting its tokens once it reads the revoked key; it may use key state up to about 60 seconds old. The key stays in lists with status: "revoked" and does not count toward the limit of 10. Repeating the call also returns 204 No Content.

To rotate, create a second key, sign new tokens with it, and delete the first once its tokens have expired.


POSTapi.foxnose.net/v1/:env/tenant-signing-keys/:kid/revocations/

Add a Revocation

Refuses one token or one end user's tokens. Send exactly one of jti and sub.

Success Response: 201 Created, or 200 OK with the existing entry when the same entry is already in place.

Request Body

  • Name
    jti
    Type
    string
    Description

    The token's jti, 16 to 64 characters of A-Z a-z 0-9 - _. That token is refused.

  • Name
    sub
    Type
    string
    Description

    An end user's sub, 1 to 128 printable characters. Their tokens with iat at or before before are refused.

  • Name
    before
    Type
    string
    Default
    default:60 seconds from now
    Description

    With sub only. An ISO 8601 time with a UTC offset, at least 60 seconds ahead. For an existing entry it only moves forward.

Response

kind (jti or sub), value_hash, before, created_at, expires_at and revocation_generation. The jti or sub itself is not stored or returned, only a hash of it. An entry expires once every token it could refuse has expired.

Errors

  • Name
    409 Conflict
    Description
    • signing_key_revoked: the key is revoked.
  • Name
    422 Unprocessable Entity
    Description
    • cutoff_too_early: before is less than 60 seconds ahead.
  • Name
    429 Too Many Requests
    Description
    • revocation_list_full: the key has 100,000 live entries. Move not_before forward or rotate the key.

Request

POST
/v1/:env/tenant-signing-keys/:kid/revocations/
curl -X POST https://api.foxnose.net/v1/7c9h4pwu/tenant-signing-keys/tsk_Q7m2xPz9aLwK/revocations/ \
-H "Authorization: Bearer eyJhbGciOiJIUzI1NiI..." \
-H "Content-Type: application/json" \
-d '{"sub": "user-4821"}'

GET | PUTapi.foxnose.net/v1/:env/tenant-limits/

Tenant Limits

The environment's rate limits for tenant tokens, per minute. GET reads them; PUT replaces all three fields, so a field left out returns to its default.

Success Response: 200 OK

Request Body (PUT)

  • Name
    rpm_per_subject
    Type
    integer | null
    Description

    Requests per minute for one end user (sub). A signing key's limits overrides it.

  • Name
    rpm_per_anchor
    Type
    integer | null
    Description

    Requests per minute for one owner record, across every token that names it.

  • Name
    uploads_per_subject_per_hour
    Type
    integer | null
    Description

    Upload starts per hour for one end user (sub). A signing key's limits overrides it.

null means the default. The response adds defaults and ceilings. Defaults are 600 per user and 1,200 per owner record per minute and 100 upload starts per user per hour, ceilings 6,000, 12,000 and 1,000. The two per-minute limits are also capped at the organization's request rate limit. Above the ceiling, PUT returns 422 with limit_above_ceiling.

A signing key's tokens together are also limited to 120,000 requests per minute, and the environment's tenant traffic to 300,000.

Response

{
    "rpm_per_subject": 300,
    "rpm_per_anchor": null,
    "uploads_per_subject_per_hour": null,
    "defaults": {"rpm_per_subject": 600, "rpm_per_anchor": 1200, "uploads_per_subject_per_hour": 100},
    "ceilings": {"rpm_per_subject": 6000, "rpm_per_anchor": 12000, "uploads_per_subject_per_hour": 1000}
}

Was this page helpful?