Skip to content
AmplifierDocs
Esc
navigateopen⌘Jpreview
On this page

Account API

Set the account webhook and read remaining credits.

Configure a webhook to receive results by push instead of polling, and check remaining credits. API keys are created in the console (API KeysProvide Name for KeyCreate Key), not through this API.

Webhook delivery, request format, and signature verification: Jobs, Polling, and Webhooks. This page is the two endpoints.

Set account webhook

POST /v2/account/webhook

Set the webhook URL and secret for the account. Once configured, Amplifier POSTs the job object when the job reaches a terminal status: done, failed, or timed-out. Check status before reading result.

A single webhook applies to every job on the account. To send one job’s result elsewhere, pass webhook_url and webhook_secret_key on the analyze request instead — see Model API or Sign API.

Request Body

Requests use Content-Type: application/json.

Field Type Required Description
url string Yes Webhook URI (format: uri, 1–2083 characters). Must be publicly reachable. Production receivers must use HTTPS (see Production Checklist). The published schema accepts any URI, not HTTPS only.
secret_key string Yes Secret used to sign webhook payloads. Store securely and use only for signature verification on your server.

Response

Field Type Description
success boolean Whether the webhook was configured.
message string Confirmation message.

The delivered payload is the completed job object: job_id, status, model_name or sign_name, and result. Field definitions are in Response Schema; delivery behaviour, the X-Webhook-Signature header, and HMAC-SHA256 verification are in Jobs, Polling, and Webhooks.

Example

curl -X POST "https://api.amplifierhealth.com/v2/account/webhook" \
  -H "X-Account-ID: your-account-id" \
  -H "X-API-Key: your-api-key" \
  -H "Content-Type: application/json" \
  -d '{"url":"https://your-server.com/webhooks/amplifier","secret_key":"your-webhook-secret"}'
const response = await fetch("https://api.amplifierhealth.com/v2/account/webhook", {
  method: "POST",
  headers: {
    "X-Account-ID": process.env.AMPLIFIER_ACCOUNT_ID,
    "X-API-Key": process.env.AMPLIFIER_API_KEY,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    "url": "https://your-server.com/webhooks/amplifier",
    "secret_key": "your-webhook-secret"
  }),
});

const data = await response.json();
# Requires httpx: pip install httpx
import os
import httpx

response = httpx.post(
  "https://api.amplifierhealth.com/v2/account/webhook",
  headers={
      "X-Account-ID": os.environ["AMPLIFIER_ACCOUNT_ID"],
      "X-API-Key": os.environ["AMPLIFIER_API_KEY"],
  },
  json={
    "url": "https://your-server.com/webhooks/amplifier",
    "secret_key": "your-webhook-secret",
  },
)

data = response.json()

Errors

Validation errors return 422 with a detail array. For authentication (401), rate limiting (429), and other codes, see Errors.

Get remaining credits

GET /v2/account/credits

Check remaining credits for the account. The credits value is the remaining token balance (1 credit = 1 token). See Billing and Cost.

Response

Field Type Description
credits integer Remaining token balance. 1 credit = 1 token.

If the account has no remaining credits, analyze endpoints return 402 Payment Required. Check this endpoint before submitting jobs.

Example

curl -X GET "https://api.amplifierhealth.com/v2/account/credits" \
  -H "X-Account-ID: your-account-id" \
  -H "X-API-Key: your-api-key"
const response = await fetch("https://api.amplifierhealth.com/v2/account/credits", {
  headers: {
    "X-Account-ID": process.env.AMPLIFIER_ACCOUNT_ID,
    "X-API-Key": process.env.AMPLIFIER_API_KEY,
  },
});

const data = await response.json();
# Requires httpx: pip install httpx
import os
import httpx

response = httpx.get(
  "https://api.amplifierhealth.com/v2/account/credits",
  headers={
      "X-Account-ID": os.environ["AMPLIFIER_ACCOUNT_ID"],
      "X-API-Key": os.environ["AMPLIFIER_API_KEY"],
  },
)

data = response.json()

Errors

For 401 and other codes, see Errors.

Was this page helpful?