Skip to content
PaloNexus
Request access Request

Create Key

POST
/v1/keys
curl --request POST \
--url https://example.com/v1/keys \
--header 'Content-Type: application/json' \
--data '{ "name": "example", "env": "test", "scopes": [ "example" ], "tenantId": "example", "createdBy": "example" }'

Mint an SDK API key (pn_live_… / pn_test_…). Only the salted hash is stored — the plaintext is returned ONCE here and is unrecoverable after.

Media type application/json
CreateKeyRequest

Mint a new SDK API key. env selects the prefix (live -> pn_live_, test -> pn_test_). scopes is a free-form allowlist the SDK presents; deny-by-default — an empty list grants nothing. The plaintext is returned ONCE.

object
name
required
Name
string
env
Env
string
default: test
scopes
Scopes
Array<string>
tenantId
Any of:
string
createdBy
Any of:
string

Successful Response

Media type application/json
CreateKeyResponse

Create/rotate response. plaintext is shown EXACTLY ONCE — it is not stored (only its salted hash is) and can never be retrieved again.

object
key
required
ApiKeyRecord

The browser-/SDK-safe view of a key. The plaintext and its hash are NEVER in here — only a masked display string + the last four chars.

object
id
required
Id
string
name
required
Name
string
env
required
Env
string
prefix
required
Prefix
string
masked
required
Masked
string
last4
required
Last4
string
scopes
Scopes
Array<string>
status
required
Status
string
tenantId
Any of:
string
createdBy
Any of:
string
createdAt
required
Createdat
string
lastUsedAt
Any of:
string
revokedAt
Any of:
string
revokedBy
Any of:
string
rotatedAt
Any of:
string
rotatedFrom
Any of:
string
plaintext
required
Plaintext
string
Example generated
{
"key": {
"id": "example",
"name": "example",
"env": "example",
"prefix": "example",
"masked": "example",
"last4": "example",
"scopes": [
"example"
],
"status": "example",
"tenantId": "example",
"createdBy": "example",
"createdAt": "example",
"lastUsedAt": "example",
"revokedAt": "example",
"revokedBy": "example",
"rotatedAt": "example",
"rotatedFrom": "example"
},
"plaintext": "example"
}

Validation Error

Media type application/json
HTTPValidationError
object
detail
Detail
Array<object>
ValidationError
object
loc
required
Location
Array
msg
required
Message
string
type
required
Error Type
string
input
Input
ctx
Context
object
Example generated
{
"detail": [
{
"loc": [
"example"
],
"msg": "example",
"type": "example",
"input": "example",
"ctx": {}
}
]
}