Authentication
Challenge-response authentication. Request a message to sign with the wallet key, exchange the signature for a JWT pair, and refresh it.
Get sign-in challenge
https://api.gobtcpay.com/public/api/v1.2/instant/auth/get-data-to-signStarts the authentication challenge. Returns a one-time messageToSign and a challengeId bound to the supplied public key (valid until expiresAt, ~5 min). Sign messageToSign verbatim with the corresponding private key using Bitcoin message signing (secp256k1 ECDSA), then exchange it for tokens via Get access tokens.
Body required
application/jsonuserPubKeyHexstringrequiredPublic key of the user's Bitcoin wallet to authenticate, compressed secp256k1 key, hex (33 bytes / 66 chars).
02a1633cafcc01ebfb6d78e39f687a1f0995c62fc95f51ead10a02ee0be551b5dcResponses
idstringrequired3fa85f64-5717-4562-b3fc-2c963f66afa6resultobjectrequiredcurl -X POST "$BASE_URL/instant/auth/get-data-to-sign" \
-H "Content-Type: application/json" \
-d '{
"userPubKeyHex": "02a1633cafcc01ebfb6d78e39f687a1f0995c62fc95f51ead10a02ee0be551b5dc"
}'{
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"result": {
"$case": "success",
"success": {
"challengeId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"messageToSign": "instant-go login;pubkey=02a1633c;nonce=Zm9vYmFyYmF6;issuedAt=2026-06-11T10:00:00.000Z;expiresAt=2026-06-11T10:05:00.000Z",
"expiresAt": 1718012345
}
}
}Get access tokens
https://api.gobtcpay.com/public/api/v1.2/instant/auth/get-jwtCompletes the authentication challenge. Submit the challengeId from Get sign-in challenge together with the hex-encoded 64-byte compact signature of messageToSign. Returns a short-lived accessToken (send it as Authorization: Bearer <accessToken>) and a long-lived refreshToken.
Body required
application/jsonchallengeIdstringrequiredThe challengeId returned by Get sign-in challenge (/instant/auth/get-data-to-sign).
3fa85f64-5717-4562-b3fc-2c963f66afa6signaturestringrequiredHex-encoded 64-byte compact signature of the messageToSign from Get sign-in challenge.
4a5e1e4baab89f3a32518a88c31bc87f618f76673e2cc77ab2127b7afdeda33b4a5e1e4baab89f3a32518a88c31bc87f618f76673e2cc77ab2127b7a…Responses
idstringrequired3fa85f64-5717-4562-b3fc-2c963f66afa6resultobjectrequiredcurl -X POST "$BASE_URL/instant/auth/get-jwt" \
-H "Content-Type: application/json" \
-d '{
"challengeId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"signature": "4a5e1e4baab89f3a32518a88c31bc87f618f76673e2cc77ab2127b7afdeda33b4a5e1e4baab89f3a32518a88c31bc87f618f76673e2cc77ab2127b7afdeda33b"
}'{
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"result": {
"$case": "success",
"success": {
"accessToken": "eyJhbGciOiJFUzI1NiIsImtpZCI6ImFjY2VzcyJ9.eyJwa2giOiIwMmExNjMzYyIsImNpZCI6IjNmYTg1ZjY0IiwiaWF0IjoxNzE4MDEyMzQ1fQ.MEQCIE3aGoQk0vY9c5kq",
"refreshToken": "eyJhbGciOiJFUzI1NiIsImtpZCI6ImFjY2VzcyJ9.eyJwa2giOiIwMmExNjMzYyIsImNpZCI6IjNmYTg1ZjY0IiwiaWF0IjoxNzE4MDEyMzQ1fQ.MEQCIE3aGoQk0vY9c5kq"
}
}
}Refresh access tokens
https://api.gobtcpay.com/public/api/v1.2/instant/auth/refresh-jwtExchanges a valid refresh token for a fresh accessToken / refreshToken pair without repeating the signing challenge. Send the refresh token as Authorization: Bearer <refreshToken> with an empty body.
Authorization: walletAuth
Responses
idstringrequired3fa85f64-5717-4562-b3fc-2c963f66afa6resultobjectrequiredcurl -X POST "$BASE_URL/instant/auth/refresh-jwt" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $ACCESS_TOKEN"{
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"result": {
"$case": "success",
"success": {
"accessToken": "eyJhbGciOiJFUzI1NiIsImtpZCI6ImFjY2VzcyJ9.eyJwa2giOiIwMmExNjMzYyIsImNpZCI6IjNmYTg1ZjY0IiwiaWF0IjoxNzE4MDEyMzQ1fQ.MEQCIE3aGoQk0vY9c5kq",
"refreshToken": "eyJhbGciOiJFUzI1NiIsImtpZCI6ImFjY2VzcyJ9.eyJwa2giOiIwMmExNjMzYyIsImNpZCI6IjNmYTg1ZjY0IiwiaWF0IjoxNzE4MDEyMzQ1fQ.MEQCIE3aGoQk0vY9c5kq"
}
}
}