Skip to content
Preview: the PushFleet API isn't live yet. Join the waitlist

Keys

POST /v1/keys

Creates a restricted key in the environment of the key you call with. Scopes not listed are none. Needs keys: write, and a restricted key can’t grant more than its own scopes.

await fleet.keys.create({
  name: "storefront-agent",
  scopes: { messages: "write", devices: "read" },
});

The response includes the key itself once. Store it then; it can’t be shown again.

{"id":"key_4k2q","name":"storefront-agent","token":"pf_rk_test_9s8d7f6g5h4j3k2q","scopes":{"messages":"write","devices":"read"}}

DELETE /v1/keys/{id}

Takes effect immediately.

await fleet.keys.delete("key_4k2q");