Skip to main content
POST

Authorizations

x-api-key
string
header
required

Your ps_ API key

Path Parameters

id
string
required

The id of the number the key is bound to — the id (or instance id) GET /v1/numbers returns. It is CHECKED against the credential's own number, never used to look one up.

Body

application/json
confirm
enum<boolean>

Must be the boolean true, exactly. ⛔ NOT always required: it is required exactly when the call REPLACES A LIVE KEY — i.e. when a key of ours is already live at Meta (uploadedAt is not null) — and that rule holds for BOTH verbs, generating and importing alike. The first setup does not ask, and neither does retrying a pair Meta never accepted. What it acknowledges differs by verb: when generating, that the key registered at Meta is REPLACED and every data_exchange Flow of this number stops decrypting; when importing, that the private half stored here is REPLACED, which breaks decryption on our side if Meta cannot confirm the imported key.

Available options:
true
Example:

true

privateKey
string

The PEM of a private key you ALREADY own, whose public half Meta has registered for this number. ⛔ Its PRESENCE is what turns this POST from GENERATE into IMPORT: sent, nothing is registered with Meta and only the stored private half changes; omitted, a fresh pair is minted and its public half REGISTERED at Meta. Must be a non-empty string — privateKey: 42 is 400 FLOW_ENDPOINT_KEY_IMPORT_INVALID and is never coerced. Send the whole .pem file contents, -----BEGIN …----- and -----END …----- lines included. RSA, 2048 bits or more; a passphrase-protected PEM is accepted alongside passphrase. If its public half is not the one Meta holds, the answer is 400 FLOW_ENDPOINT_KEY_IMPORT_MISMATCH and nothing is written.

Minimum string length: 1
Example:

"-----BEGIN PRIVATE KEY-----\nMIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQ...\n-----END PRIVATE KEY-----\n"

passphrase
string

The passphrase that opens privateKey, when the PEM is encrypted. Optional, and only ever alongside privateKey: ⛔ sent on its own it is REFUSED with 400 FLOW_ENDPOINT_KEY_PASSPHRASE_ORPHAN rather than ignored, because a mistyped privateKey would otherwise fall through into GENERATE and replace the registration at Meta. Must be a string. An encrypted PEM with no passphrase is 400 FLOW_ENDPOINT_KEY_PASSPHRASE_REQUIRED; a passphrase that does not open it is 400 FLOW_ENDPOINT_KEY_PASSPHRASE_WRONG — two codes, because they are two different repairs.

Example:

"the-passphrase-that-opens-the-pem"

Response

A keypair now stands on the number. GENERATE also registered the public half with Meta; IMPORT registered NOTHING — there, uploadedAt: null with metaStatus UNKNOWN/NOT_SET means the key was STORED and Meta did not confirm it, which is the one thing a 200 alone does not tell you. replaced says whether a key that was LIVE has just been displaced — a 200 alone does not