Card Expiry

Card Expiry Clock REST API

List connected Stripe accounts and trigger a scan from your own scripts. JSON over HTTPS.

Authentication

Create a key in Settings. It is shown once; we store only a hash. Send it as a bearer token:

curl -H "Authorization: Bearer cec_..." https://www.cardexpiryclock.com/api/v1/monitors

Revoke a key in Settings at any time. Keys act on the account they were created in.

Rate limits

Keep to 60 requests per minute per key. Every response carries X-RateLimit-Limit, X-RateLimit-Remaining and X-RateLimit-Reset. Over the limit you may get 429 with Retry-After; back off and retry.

Endpoints

MethodPathWhat it does
GET/api/v1/monitorsList connected Stripe accounts.
POST/api/v1/monitorsAdd an account nickname. Body {"hostname": "production"}. Returns 201, 402 over the plan limit, or 409 if it already exists.
GET/api/v1/monitors/{id}One account.
GET/api/v1/monitors/{id}/checksThe last 50 scans.
POST/api/v1/monitors/{id}/checkRun a scan now and return the result.
DELETE/api/v1/monitors/{id}Remove an account. Returns 204.

Account object

{
  "id": "...", "hostname": "acct_...", "port": 443, "paused": false,
  "status": "ok" | "problem" | "pending", "error_code": null,
  "days_remaining": 12, "last_checked_at": "...",
  "created_at": "..."
}

days_remaining is days until the soonest expiring card on active subscriptions.

Errors

Errors return {"error": "code", "message": "..."} with codes unauthorized, invalid_json, invalid_hostname, plan_limit, duplicate, not_found and rate_limited.