Gravv
/Docs
Search docs or ask a question⌘K
DocsAgent
ChangelogTry sandbox
Cards Get a card PIN

Get a card PIN

Returns the card PIN, encrypted to your RSA public key in the same way as the sensitive details. The decrypted text is `{"pin": "4821"}`. Only the first 6 characters of a PIN are returned.

GEThttps://api.gravv.xyz/v1/cards/{card_id}/pinTry it
Api-Key

Path parameters

NameDescription
card_id:stringRequired
ID of the card

Headers

NameDescription
X-Client-Public-Key:stringRequired
Your RSA public key in PEM form (PUBLIC KEY or RSA PUBLIC KEY), then base64-encoded with the standard alphabet. Use a key of 2048 bits or more.

Response

Returns 200 OK. The encrypted PIN

NameDescription
data:object
Decrypt encrypted_key with your RSA private key (RSA-OAEP, SHA-256) to get an AES-256 key. Then decrypt ciphertext with AES-256-GCM using nonce (12 bytes); the last 16 bytes of ciphertext are the tag. All three values are standard base64.
Show 3 child attributesobject
error:null

Errors

StatusMeaning
200The encrypted PIN
400The request failed. Every card error is a 400, including not-found. Read error.
Was this page helpful? Yes No
Request
cURLJavaScriptPythonGoRubyPHPJavaC#cURL
curl --request GET \
--url 'https://api.gravv.xyz/v1/cards/dce0192a-9b3d-440b-9500-33dc9ac8dc20/pin' \
--header 'Api-Key: <api-key>' \
--header 'X-Client-Public-Key: LS0tLS1CRUdJTiBQVUJMSUMgS0VZLS0tLS0K...'
Responseapplication/json
200400OK
{
"data": {
"encrypted_key": "string",
"nonce": "string",
"ciphertext": "string"
},
"error": {}
}