πŸ’‘API Doc - Auth

AllScale Third-Party API Version: v1 Last updated: 2026-01


Overview

AllScale APIs use HMAC-SHA256 request signing to authenticate and authorize third-party requests.

This mechanism provides:

  • Strong authentication (shared secret)

  • Replay-attack protection

  • Tamper-proof request integrity

  • Stateless verification

  • Enterprise-grade security

Every API request must be signed using:

  • API Key

  • API Secret


Credentials

When your store or integration is created, you receive:

Field
Description

api_key

Public identifier

api_secret

Secret key (shown once only)

Important:

  • The API secret is shown only once

  • It cannot be retrieved later

  • Store it securely

  • Treat it like a password or private key


Required Request Headers

Header
Required
Description

X-API-Key

Yes

Your API key

X-Timestamp

Yes

Unix timestamp (seconds)

X-Nonce

Yes

Random unique string

X-Signature

Yes

HMAC signature


Request Signing Logic

Canonical String Format

Joined using newline characters.

Example


Signature Algorithm

Algorithm:

Encoding:

Formula:

Header format:


JavaScript / Postman Example


Replay Protection

All requests are protected using timestamp and nonce validation.

Rules:

  • Timestamp must be within Β±5 minutes

  • Each nonce can be used only once

  • Replayed requests are rejected


IP Allowlist

If configured, requests must originate from approved IP ranges.

Examples:

Empty allowlist means all IPs are allowed.


Error Response Format

Error Codes

Code
Meaning

20001

Missing authentication headers

20002

Invalid signature

30001

Forbidden

40001

Rate limit exceeded

90000

Internal server error


Rate Limiting

Requests may be rate-limited.

Example response:


Debugging Tips

Issue
Fix

Body mismatch

Use raw JSON

Query mismatch

Ensure order matches

Wrong secret

Use original secret

Timestamp drift

Sync system clock

Nonce reused

Generate a new one

CryptoJS

Use Web Crypto API


Best Practices

  • Always use HTTPS

  • Use UTC timestamps

  • Store secrets securely

  • Rotate secrets regularly

  • Log request IDs

  • Never expose secrets in frontend code

  • Never reuse nonces


End of document.

Last updated