Register a public key
const url = 'https://api.siprtc.io/v1/Accounts/AC000000000000000000/Credentials/PublicKeys';const options = { method: 'POST', headers: { Authorization: 'Basic <credentials>', 'Content-Type': 'application/x-www-form-urlencoded' }, body: new URLSearchParams({PublicKey: 'example', FriendlyName: 'example'})};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://api.siprtc.io/v1/Accounts/AC000000000000000000/Credentials/PublicKeys \ --header 'Authorization: Basic <credentials>' \ --header 'Content-Type: application/x-www-form-urlencoded' \ --data PublicKey=example \ --data FriendlyName=exampleRegisters an RSA public key for customer_key encryption. The key must be PEM “PUBLIC KEY” (SubjectPublicKeyInfo, as openssl rsa -pubout writes it), 2048 to 4096 bits; the response carries its SHA-256 fingerprint. Registering a key that is already registered answers 409. Registering does not turn encryption on: set EncryptionType=customer_key and EncryptionKeySid in RecordingSettings. Audited as public_key.created. Form or JSON (public_key / friendly_name) bodies are accepted; also served at PublicKeys.json. Only the account owner (Basic auth with the account’s Auth ID and Auth Secret) or a platform admin may call it; other logins get 403.
Authorizations
Section titled “ Authorizations ”Parameters
Section titled “ Parameters ”Path Parameters
Section titled “ Path Parameters ”Account Auth ID (AC followed by the account id) the request acts on
Example
AC000000000000000000Request Bodyrequired
Section titled “ Request Bodyrequired ”object
PEM encoded RSA public key (—–BEGIN PUBLIC KEY—– …), 2048 to 4096 bits
A name for the key, up to 64 characters
Example generated
PublicKey=example&FriendlyName=exampleResponses
Section titled “ Responses ”Created
object
Account the key belongs to.
When the key was registered, RFC 2822 date, e.g. “Thu, 26 Nov 2026 10:15:30 +0000”.
When the key was last renamed, RFC 2822 date, e.g. “Thu, 26 Nov 2026 10:15:30 +0000”.
SHA-256 fingerprint of the key.
Name given to the key, up to 64 characters.
The RSA public key, PEM “PUBLIC KEY”.
Public key SID: CR followed by 32 hex digits.
Absolute URL of this key.
Example
{ "account_sid": "AC000000000000000000", "date_created": "Thu, 26 Nov 2026 10:15:30 +0000", "date_updated": "Thu, 26 Nov 2026 10:15:30 +0000", "friendly_name": "Legal archive key 2026", "public_key": "-----BEGIN PUBLIC KEY-----\nMIIBIjANBg...\n-----END PUBLIC KEY-----\n", "sid": "CR0123456789abcdef0123456789abcdef", "url": "https://api.siprtc.io/v1/Accounts/AC000000000000000000/Credentials/PublicKeys/CR0123456789abcdef0123456789abcdef"}PublicKey missing, not a PEM RSA public key, wrong size, or FriendlyName too long (code 20001)
object
Error code: 20001 invalid parameter, 20403 forbidden, 20404 not found, 20409 conflict, 20503 unavailable, 64030 under legal hold, 64031 active encryption key.
Human readable explanation.
Link to more information; currently always empty.
HTTP status code of the response.
Example
{ "code": 20404, "message": "the requested resource was not found", "more_info": "", "status": 404}Authentication failed: missing or invalid credentials (JSON string from the API gateway)
Example generated
exampleOnly the account owner or an admin may do this, or the login does not belong to this account (code 20403)
object
Error code: 20001 invalid parameter, 20403 forbidden, 20404 not found, 20409 conflict, 20503 unavailable, 64030 under legal hold, 64031 active encryption key.
Human readable explanation.
Link to more information; currently always empty.
HTTP status code of the response.
Example
{ "code": 20404, "message": "the requested resource was not found", "more_info": "", "status": 404}This public key is already registered (code 20409)
object
Error code: 20001 invalid parameter, 20403 forbidden, 20404 not found, 20409 conflict, 20503 unavailable, 64030 under legal hold, 64031 active encryption key.
Human readable explanation.
Link to more information; currently always empty.
HTTP status code of the response.
Example
{ "code": 20404, "message": "the requested resource was not found", "more_info": "", "status": 404}Storage or account lookup unavailable (code 20503)
object
Error code: 20001 invalid parameter, 20403 forbidden, 20404 not found, 20409 conflict, 20503 unavailable, 64030 under legal hold, 64031 active encryption key.
Human readable explanation.
Link to more information; currently always empty.
HTTP status code of the response.
Example
{ "code": 20404, "message": "the requested resource was not found", "more_info": "", "status": 404}