Skip to content
LogoLogo

API Keys

Contact the BLOX team to enable API key access for your account (sandbox and production). API keys authenticate your requests; each key is tied to your account and a registered signer public key.

[!IMPORTANT] When your API key is created, you must provide a signing public key. It is used to verify signatures on all state-changing requests (POST, PUT, PATCH, DELETE).

Key facts

FactDetail
FormatKeys start with blox_pk_
DisplayThe secret is shown once at creation — store it securely
Active keysUp to 5 active keys per account
Signer algorithmsed25519, ecdsa-p256-sha256, ecdsa-secp256k1-sha256

Environments

  • Sandbox keys — for development and testing against api.sandbox.blox.my
  • Production keys — for live traffic against api.blox.my

Contact the BLOX team for both.

Authentication Methods

Header Authentication

Prefer the blox-api-key header:

curl https://api.sandbox.blox.my/v1/health \
  -H "blox-api-key: YOUR_API_KEY"

Authorization: Bearer YOUR_API_KEY is also accepted.

Request Headers

HeaderRequiredDescription
blox-api-keyYes (or Bearer)Your API key secret
Content-TypeYes (for JSON bodies)application/json
Content-DigestYes (signed requests with body)sha-256=:BASE64: of canonicalized body
Signature-InputYes (POST/PUT/PATCH/DELETE)RFC 9421 signature metadata
SignatureYes (POST/PUT/PATCH/DELETE)RFC 9421 signature

GET requests need only the API key. Write methods require a signature — see Request Signature.

Testing Authentication

curl https://api.sandbox.blox.my/v1/health \
  -H "blox-api-key: YOUR_API_KEY"
{
  "success": true,
  "message": "API key is valid",
  "account": {
    "id": "9f21ab04-6c3e-4d90-b1a7-8e5f2c0d4416",
    "name": "Your Business Name",
    "type": "BUSINESS",
    "status": "ACTIVE"
  }
}