Skip to main content

Authentication

The Macro by Mark API uses API key authentication. Every request must include your key in the X-API-Key HTTP header.

Getting your API key

  1. Sign in to your Macro by Mark dashboard.
  2. Navigate to Settings → API Keys.
  3. Click Create new key, give it a descriptive name, and copy the value.
API keys are shown only once at creation time. Store yours securely in a secrets manager or environment variable — never hard-code it in source code.

Using your API key

Pass the key in the X-API-Key request header on every API call:

SDK examples

Rate limits

Rate limits are enforced per API key on a rolling 60-second window.

Rate limit headers

Every response includes the following headers so you can track consumption:

Handling 429 errors

When you exceed the rate limit the API returns HTTP 429 with a Retry-After header indicating how many seconds to wait:
Implement exponential back-off in your client to avoid hammering the API after a 429:

Key rotation and revocation

  • Rotate keys from Settings → API Keys in the dashboard.
  • Revoked keys are invalidated immediately.
  • You may have up to 5 active keys per account; Enterprise accounts can request higher limits.

Security best practices

Load your key from os.environ (Python), process.env (Node.js), or equivalent — never embed it directly in source code.
Create one key per project or environment (dev/staging/prod) so you can revoke a single key without affecting other services.
Enterprise plan keys support IP allow-listing and scoped permissions. Contact support to enable these features.