Skip to main content
POST
Spree Admin SDK

Authorizations

x-spree-api-key
string
header
required

Secret API key for admin access

Authorization
string
header
required

JWT token for admin user authentication

Headers

x-spree-api-key
string
required
Authorization
string
required

Body

application/json
name
string
required
key_type
enum<string>
required
Available options:
publishable,
secret
scopes
string[]

Required for secret keys. You can only grant scopes you hold yourself. Fixed once created: to change them, create a new key and revoke the old one.

Example:
channel_id
string

Binds a publishable key to one channel of the store (ch_...), so it rejects requests for other channels. Fixed once created; omit it for a store-wide key.

Response

secret key created — plaintext token returned once

id
string
required
name
string
required
key_type
enum<string>
required
Available options:
publishable,
secret
token_prefix
string | null
required
scopes
string[]
required
created_by_ip_address
string | null
required
created_at
string
required
updated_at
string
required
revoked_at
string | null
required
last_used_at
string | null
required
channel_id
string | null
required
plaintext_token
string | null
required
created_by_email
string | null
required
created_by_type
required

The values listed are the built-in ones; extensions may add more.

Available options:
admin_user,
api_key
created_by_label
string | null
required