{"openapi":"3.1.0","info":{"title":"time2live API","version":"54950de8f51141c8f13d44ea0c4292ccb1f9b57a","description":"Scheduling and liveness (TTL) service for autonomous AI agents: cron/one-off webhook jobs and heartbeat monitors (dead man's switch).\n\nRegister with an EVM wallet (`/v1/auth/challenge` → sign → `/v1/auth/verify`) and send the API key as `Authorization: Bearer t2l_…`. Create calls accept `Idempotency-Key`. Calls beyond the free tier answer `402` with an x402 v2 `PAYMENT-REQUIRED` challenge (USDC on Base); retry with `PAYMENT-SIGNATURE`. The same API is available as a remote MCP server at `/mcp`; see also `/llms.txt`.\n\n**Network: Live — real payments on Base mainnet.**"},"servers":[{"url":"https://time2live.xyz"}],"externalDocs":{"description":"Agent guide (llms.txt)","url":"https://time2live.xyz/llms.txt"},"tags":[{"name":"auth","description":"Wallet sign-in (SIWE / EIP-4361); returns an API key"},{"name":"keys","description":"API key management"},{"name":"account","description":"Account, usage, webhook signing secret, Telegram link"},{"name":"jobs","description":"Scheduled (cron) and one-off webhook jobs and their runs"},{"name":"runs","description":"Individual job runs and their delivery attempts"},{"name":"monitors","description":"Heartbeat monitors (dead man's switch)"},{"name":"heartbeat","description":"Pings (no API key; the monitor id is the secret)"},{"name":"billing","description":"x402 payments: activation, credits, payment history"}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","description":"API key obtained from POST /v1/auth/verify (format: t2l_…)"}},"schemas":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","example":"validation_error"},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]},"NewApiKey":{"allOf":[{"$ref":"#/components/schemas/ApiKeyInfo"},{"type":"object","properties":{"key":{"type":"string","description":"The secret key. Shown only once; store it securely."}},"required":["key"]}]},"ApiKeyInfo":{"type":"object","properties":{"id":{"type":"string","example":"key_4Wq…"},"prefix":{"type":"string","example":"t2l_AbCd1234"},"name":{"type":"string"},"createdAt":{"type":"string","format":"date-time"},"lastUsedAt":{"type":["string","null"],"format":"date-time"}},"required":["id","prefix","name","createdAt","lastUsedAt"]},"WebhookSecret":{"type":"object","properties":{"secret":{"type":"string","example":"whsec_…"},"header":{"type":"string","enum":["T2L-Signature"]},"scheme":{"type":"string"}},"required":["secret","header","scheme"]},"Account":{"type":"object","properties":{"id":{"type":"string"},"address":{"type":"string"},"status":{"type":"string","enum":["active","frozen"]},"createdAt":{"type":"string","format":"date-time"},"activatedAt":{"type":["string","null"],"format":"date-time"},"tier":{"type":"object","properties":{"name":{"type":"string","enum":["unactivated","free"]},"limits":{"type":"object","properties":{"monitors":{"type":"integer"},"runsPerMonth":{"type":"integer"}},"required":["monitors","runsPerMonth"]}},"required":["name","limits"]},"usage":{"type":"object","properties":{"period":{"type":"string"},"runs":{"type":"integer"}},"required":["period","runs"]},"credits":{"type":"object","properties":{"balanceMicro":{"type":"integer"},"balanceUsd":{"type":"string"}},"required":["balanceMicro","balanceUsd"]},"telegram":{"type":"object","properties":{"linked":{"type":"boolean"}},"required":["linked"]}},"required":["id","address","status","createdAt","activatedAt","tier","usage","credits","telegram"]},"AccountOverview":{"type":"object","properties":{"account":{"type":"object","properties":{"id":{"type":"string"},"address":{"type":"string"},"status":{"type":"string","enum":["active","frozen"]},"activated":{"type":"boolean"},"tier":{"type":"string"},"credits":{"type":"object","properties":{"balanceMicro":{"type":"integer"},"balanceUsd":{"type":"string"}},"required":["balanceMicro","balanceUsd"]},"usage":{"type":"object","properties":{"period":{"type":"string"},"runs":{"type":"integer"}},"required":["period","runs"]}},"required":["id","address","status","activated","tier","credits","usage"]},"monitors":{"type":"object","properties":{"counts":{"type":"object","additionalProperties":{"type":"integer"}},"recent":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"status":{"type":"string"},"lastPingAt":{"type":["string","null"],"format":"date-time"},"expiresAt":{"type":["string","null"],"format":"date-time"},"billing":{"type":"string"}},"required":["id","name","status","lastPingAt","expiresAt","billing"]}}},"required":["counts","recent"]},"jobs":{"type":"object","properties":{"counts":{"type":"object","additionalProperties":{"type":"integer"}},"recent":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"status":{"type":"string"},"nextRunAt":{"type":["string","null"],"format":"date-time"}},"required":["id","name","status","nextRunAt"]}}},"required":["counts","recent"]},"payments":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"product":{"type":"string"},"amountUsd":{"type":"string"},"createdAt":{"type":"string","format":"date-time"}},"required":["id","product","amountUsd","createdAt"]}}},"required":["account","monitors","jobs","payments"]},"Job":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"status":{"type":"string","enum":["active","paused","completed"]},"schedule":{"anyOf":[{"type":"object","properties":{"type":{"type":"string","enum":["cron"]},"expression":{"type":"string"},"timezone":{"type":"string"}},"required":["type","expression","timezone"]},{"type":"object","properties":{"type":{"type":"string","enum":["once"]},"at":{"type":"string","format":"date-time"}},"required":["type","at"]}]},"target":{"type":"object","properties":{"url":{"type":"string"},"method":{"type":"string","enum":["GET","POST","PUT","PATCH","DELETE"]},"headers":{"type":"object","additionalProperties":{"type":"string"},"description":"Header names with redacted values","example":{"authorization":"[redacted]"}},"body":{"type":["string","null"]}},"required":["url","method","headers","body"]},"timeoutMs":{"type":"integer"},"maxAttempts":{"type":"integer"},"freshnessSeconds":{"type":["integer","null"]},"nextRunAt":{"type":["string","null"],"format":"date-time"},"lastRunAt":{"type":["string","null"],"format":"date-time"},"lastRunStatus":{"type":["string","null"]},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"required":["id","name","status","schedule","target","timeoutMs","maxAttempts","freshnessSeconds","nextRunAt","lastRunAt","lastRunStatus","createdAt","updatedAt"]},"CreateJob":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":100},"schedule":{"$ref":"#/components/schemas/Schedule"},"target":{"$ref":"#/components/schemas/Target"},"timeoutMs":{"type":"integer","minimum":1000,"maximum":30000,"default":10000},"maxAttempts":{"type":"integer","minimum":1,"maximum":10,"default":5},"freshnessSeconds":{"type":["integer","null"],"minimum":60,"maximum":31536000,"description":"Freshness cutoff. A scheduled occurrence that would fire more than this many seconds after its slot (e.g. a catch-up after downtime) is recorded `skipped` instead of delivered. Omit or null to deliver regardless of lateness."}},"required":["name","schedule","target"]},"Schedule":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["cron"]},"expression":{"type":"string","minLength":1,"maxLength":100,"example":"*/15 * * * *"},"timezone":{"type":"string","minLength":1,"maxLength":64,"default":"UTC","example":"Europe/Helsinki"}},"required":["type","expression"]},{"type":"object","properties":{"type":{"type":"string","enum":["once"]},"at":{"type":"string","format":"date-time","example":"2026-10-01T09:00:00Z"}},"required":["type","at"]}]},"Target":{"type":"object","properties":{"url":{"type":"string","maxLength":2048,"example":"https://agent.example.com/wake"},"method":{"type":"string","enum":["GET","POST","PUT","PATCH","DELETE"],"default":"POST"},"headers":{"type":"object","additionalProperties":{"type":"string","maxLength":2048},"default":{},"description":"Custom request headers (stored encrypted; values are never returned).","example":{"authorization":"Bearer my-agent-token"}},"body":{"anyOf":[{"type":"string"},{"type":"object","additionalProperties":{}},{"type":"array","items":{}},{"type":"null"}],"default":null,"description":"Request body: a string, or JSON (serialised).","example":{"task":"wake-up"}}},"required":["url"]},"UpdateJob":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":100},"schedule":{"$ref":"#/components/schemas/Schedule"},"target":{"type":"object","properties":{"url":{"type":"string","maxLength":2048},"method":{"type":"string","enum":["GET","POST","PUT","PATCH","DELETE"]},"headers":{"type":"object","additionalProperties":{"type":"string","maxLength":2048},"description":"Custom request headers (stored encrypted; values are never returned).","example":{"authorization":"Bearer my-agent-token"}},"body":{"anyOf":[{"type":"string"},{"type":"object","additionalProperties":{}},{"type":"array","items":{}},{"type":"null"}],"description":"Request body: a string, or JSON (serialised).","example":{"task":"wake-up"}}}},"timeoutMs":{"type":"integer","minimum":1000,"maximum":30000},"maxAttempts":{"type":"integer","minimum":1,"maximum":10},"freshnessSeconds":{"type":["integer","null"],"minimum":60,"maximum":31536000}}},"Run":{"type":"object","properties":{"id":{"type":"string"},"jobId":{"type":"string"},"trigger":{"type":"string","enum":["schedule","manual"]},"status":{"type":"string","enum":["pending","running","succeeded","failed","skipped","cancelled"]},"scheduledFor":{"type":"string","format":"date-time"},"attempts":{"type":"integer"},"maxAttempts":{"type":"integer"},"nextAttemptAt":{"type":["string","null"],"format":"date-time"},"lastHttpStatus":{"type":["integer","null"]},"lastError":{"type":["string","null"]},"createdAt":{"type":"string","format":"date-time"},"startedAt":{"type":["string","null"],"format":"date-time"},"finishedAt":{"type":["string","null"],"format":"date-time"}},"required":["id","jobId","trigger","status","scheduledFor","attempts","maxAttempts","nextAttemptAt","lastHttpStatus","lastError","createdAt","startedAt","finishedAt"]},"Attempt":{"type":"object","properties":{"attempt":{"type":"integer"},"startedAt":{"type":"string","format":"date-time"},"durationMs":{"type":"integer"},"httpStatus":{"type":["integer","null"]},"responseSnippet":{"type":["string","null"]},"errorKind":{"type":["string","null"]},"error":{"type":["string","null"]},"finalUrl":{"type":["string","null"]}},"required":["attempt","startedAt","durationMs","httpStatus","responseSnippet","errorKind","error","finalUrl"]},"Monitor":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"status":{"type":"string","enum":["new","alive","dead","paused"],"description":"new = never pinged; alive; dead = TTL + grace exceeded; paused."},"ttlSeconds":{"type":"integer"},"graceSeconds":{"type":"integer"},"mode":{"type":"string","enum":["heartbeat","active"]},"check":{"type":["object","null"],"properties":{"url":{"type":"string"},"intervalSeconds":{"type":"integer"},"expect":{"type":"object","properties":{"status":{"type":["integer","null"]},"bodyContains":{"type":["string","null"]},"jsonPath":{"type":["string","null"]},"maxAgeSeconds":{"type":["integer","null"]}},"required":["status","bodyContains","jsonPath","maxAgeSeconds"]}},"required":["url","intervalSeconds","expect"],"description":"The active-check configuration, or null for a heartbeat monitor."},"lastProbe":{"type":["object","null"],"properties":{"at":{"type":["string","null"],"format":"date-time"},"ok":{"type":["boolean","null"]},"detail":{"type":["string","null"]}},"required":["at","ok","detail"],"description":"Most recent active-check probe (active mode only)."},"pingUrl":{"type":"string","description":"POST here to report liveness (no auth needed)."},"lastPingAt":{"type":["string","null"],"format":"date-time"},"expiresAt":{"type":["string","null"],"format":"date-time"},"deadSince":{"type":["string","null"],"format":"date-time"},"alerts":{"type":"object","properties":{"webhookUrl":{"type":["string","null"]},"webhookUrl2":{"type":["string","null"]},"telegram":{"type":"boolean"},"email":{"type":["string","null"]}},"required":["webhookUrl","webhookUrl2","telegram","email"]},"billing":{"type":"object","properties":{"plan":{"type":"string","enum":["free","paid"]},"paidUntil":{"type":["string","null"],"format":"date-time"}},"required":["plan","paidUntil"],"description":"free = within the tier allowance; paid = charged from credits every 30 days (paused with reason `unpaid` when the balance runs out)."},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"required":["id","name","status","ttlSeconds","graceSeconds","mode","check","lastProbe","pingUrl","lastPingAt","expiresAt","deadSince","alerts","billing","createdAt","updatedAt"]},"CreateMonitor":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":100},"ttlSeconds":{"type":"integer","minimum":60,"maximum":2592000,"description":"Expected maximum time between pings (or successful probes, in active mode).","example":300},"graceSeconds":{"type":"integer","minimum":0,"maximum":604800,"default":60},"mode":{"type":"string","enum":["heartbeat","active"],"default":"heartbeat","description":"heartbeat: the agent pushes pings (default). active: we probe `check.url` from the outside, so the check travels the same path a real request does."},"check":{"type":["object","null"],"properties":{"url":{"type":"string","maxLength":2048,"description":"The agent's own URL we GET from the outside; a 2xx response counts as a ping.","example":"https://agent.example.com/health"},"intervalSeconds":{"type":"integer","minimum":30,"maximum":86400,"description":"How often we probe; must be shorter than ttlSeconds.","example":60},"expect":{"type":"object","properties":{"status":{"type":["integer","null"],"minimum":100,"maximum":599,"default":null,"description":"Required exact status; null = any 2xx."},"bodyContains":{"type":["string","null"],"minLength":1,"maxLength":512,"default":null,"description":"The response body must contain this substring (first ~4 KB), so a hollow 2xx from a front door that routes but does no real work fails the check.","example":"\"db\":\"ok\""},"jsonPath":{"type":["string","null"],"minLength":1,"maxLength":256,"default":null,"description":"Dotted JSON path to a timestamp field (e.g. `data.updatedAt`, `items[0].ts`). With maxAgeSeconds, a stale-but-correct 200 fails: the body must be JSON ≤ ~4 KB and the field within maxAgeSeconds of the probe. Accepts ISO-8601 or unix seconds/ms.","example":"data.updatedAt"},"maxAgeSeconds":{"type":["integer","null"],"minimum":1,"maximum":86400,"default":null,"description":"Max age of the jsonPath timestamp relative to the probe. Set with jsonPath.","example":120}},"default":{"status":null,"bodyContains":null,"jsonPath":null,"maxAgeSeconds":null},"description":"Optional response assertions beyond a 2xx."}},"default":null,"required":["url","intervalSeconds"],"description":"Required when mode is \"active\"; omit for heartbeat."},"alerts":{"$ref":"#/components/schemas/Alerts"}},"required":["name","ttlSeconds"]},"Alerts":{"type":"object","properties":{"webhookUrl":{"type":["string","null"],"maxLength":2048,"default":null,"description":"Signed POST on monitor.down / monitor.up (same signature scheme as jobs).","example":"https://ops.example.com/t2l-alerts"},"webhookUrl2":{"type":["string","null"],"maxLength":2048,"default":null,"description":"Optional independent secondary webhook, delivered separately — redundancy against one downstream endpoint being down."},"telegram":{"type":"boolean","default":false,"description":"Send alerts to the Telegram chat linked via POST /v1/account/telegram/link."},"email":{"type":["string","null"],"maxLength":254,"format":"email","default":null,"description":"Send alerts by email via an independent provider (different transport/infra from webhooks and Telegram). Requires email to be enabled on the server.","example":"oncall@example.com"}},"default":{"webhookUrl":null,"webhookUrl2":null,"telegram":false,"email":null}},"UpdateMonitor":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":100},"ttlSeconds":{"type":"integer","minimum":60,"maximum":2592000},"graceSeconds":{"type":"integer","minimum":0,"maximum":604800},"alerts":{"type":"object","properties":{"webhookUrl":{"type":["string","null"],"maxLength":2048},"webhookUrl2":{"type":["string","null"],"maxLength":2048},"telegram":{"type":"boolean"},"email":{"type":["string","null"],"maxLength":254,"format":"email"}}}}},"MonitorEvent":{"type":"object","properties":{"from":{"type":"string"},"to":{"type":"string"},"reason":{"type":"string","enum":["ping","timeout","pause","resume","unpaid"]},"at":{"type":"string","format":"date-time"}},"required":["from","to","reason","at"]},"Billing":{"type":"object","properties":{"x402":{"type":"object","properties":{"enabled":{"type":"boolean"},"network":{"type":["string","null"],"example":"eip155:84532"},"asset":{"type":"string","enum":["USDC"]},"payTo":{"type":["string","null"]}},"required":["enabled","network","asset","payTo"]},"activated":{"type":"boolean"},"activatedAt":{"type":["string","null"],"format":"date-time"},"tier":{"type":"object","properties":{"name":{"type":"string","enum":["unactivated","free"]},"limits":{"type":"object","properties":{"monitors":{"type":"integer"},"runsPerMonth":{"type":"integer"}},"required":["monitors","runsPerMonth"]}},"required":["name","limits"]},"credits":{"type":"object","properties":{"balanceMicro":{"type":"integer"},"balanceUsd":{"type":"string"}},"required":["balanceMicro","balanceUsd"]},"prices":{"type":"object","properties":{"activation":{"type":"string","example":"$0.10"},"extraRun":{"type":"string","example":"$0.0005"},"extraMonitorPer30Days":{"type":"string","example":"$0.25"},"creditPacks":{"type":"array","items":{"type":"string"},"example":["$1.00","$5.00","$20.00"]}},"required":["activation","extraRun","extraMonitorPer30Days","creditPacks"]}},"required":["x402","activated","activatedAt","tier","credits","prices"]}},"parameters":{}},"paths":{"/v1/auth/challenge":{"post":{"tags":["auth"],"summary":"Request a Sign-In with Ethereum (EIP-4361) message to sign","description":"Step 1 of wallet registration/login. Sign the returned `message` verbatim with the wallet (EIP-191 personal_sign) and submit it to /v1/auth/verify before `expiresAt`.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"address":{"type":"string","pattern":"^0x[0-9a-fA-F]{40}$","example":"0x9fB29AAc15b9A4B7F17c3385939b007540f4d791"},"chainId":{"type":"integer","exclusiveMinimum":0,"default":8453,"example":8453}},"required":["address"]}}}},"responses":{"200":{"description":"Challenge issued","content":{"application/json":{"schema":{"type":"object","properties":{"nonce":{"type":"string"},"message":{"type":"string"},"expiresAt":{"type":"string","format":"date-time"}},"required":["nonce","message","expiresAt"]}}}},"400":{"description":"Invalid request (`validation_error` lists the failing fields)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited; see `Retry-After`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/auth/verify":{"post":{"tags":["auth"],"summary":"Submit the signed challenge and receive an API key","description":"Step 2. Creates the account on first sign-in and issues a new API key. The key is returned only once.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","minLength":1,"maxLength":4000},"signature":{"type":"string","maxLength":20000,"pattern":"^0x[0-9a-fA-F]*$"},"keyName":{"type":"string","minLength":1,"maxLength":64,"default":"default"}},"required":["message","signature"]}}}},"responses":{"201":{"description":"Authenticated; API key issued","content":{"application/json":{"schema":{"type":"object","properties":{"accountId":{"type":"string"},"address":{"type":"string"},"created":{"type":"boolean","description":"True when the account was just created"},"apiKey":{"$ref":"#/components/schemas/NewApiKey"}},"required":["accountId","address","created","apiKey"]}}}},"400":{"description":"Invalid request (`validation_error` lists the failing fields)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Account frozen, or not allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict with the current state","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited; see `Retry-After`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/auth/session":{"post":{"tags":["auth"],"summary":"Exchange a signed challenge for a short-lived operator session","description":"Like /v1/auth/verify, but returns a short-lived bearer token for the browser dashboard instead of a persistent API key. The token is not stored (nothing to revoke or leak long term) and survives `revoke-all`, so a human can supervise while the agent’s keys are cut.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","minLength":1,"maxLength":4000},"signature":{"type":"string","maxLength":20000,"pattern":"^0x[0-9a-fA-F]*$"}},"required":["message","signature"]}}}},"responses":{"200":{"description":"Operator session issued","content":{"application/json":{"schema":{"type":"object","properties":{"accountId":{"type":"string"},"address":{"type":"string"},"token":{"type":"string","example":"t2ls_…"},"expiresAt":{"type":"string","format":"date-time"}},"required":["accountId","address","token","expiresAt"]}}}},"400":{"description":"Invalid request (`validation_error` lists the failing fields)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Account frozen, or not allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited; see `Retry-After`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/keys":{"get":{"tags":["keys"],"summary":"List active API keys","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Active keys (secrets are never returned)","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/ApiKeyInfo"}}},"required":["data"]}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Account frozen, or not allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited; see `Retry-After`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"tags":["keys"],"summary":"Create an additional API key","description":"Supports the Idempotency-Key header.","security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":64}},"required":["name"]}}}},"responses":{"201":{"description":"Key created; the secret is shown only once","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NewApiKey"}}}},"400":{"description":"Invalid request (`validation_error` lists the failing fields)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Account frozen, or not allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict with the current state","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Target URL rejected (blocked address or unresolvable host)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited; see `Retry-After`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/keys/{id}":{"delete":{"tags":["keys"],"summary":"Revoke an API key","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","pattern":"^key_[0-9A-Za-z]{22}$"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Key revoked","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"revokedAt":{"type":"string","format":"date-time"}},"required":["id","revokedAt"]}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Account frozen, or not allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited; see `Retry-After`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/account/webhook-secret":{"get":{"tags":["account"],"summary":"Get the secret used to sign webhook deliveries","description":"Deliveries carry `T2L-Signature: t=<unix>,v1=<hex>` where v1 = HMAC-SHA256(secret, `${t}.${rawBody}`). Reject timestamps older than 5 minutes.","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Signing secret","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookSecret"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Account frozen, or not allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited; see `Retry-After`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/account/webhook-secret/rotate":{"post":{"tags":["account"],"summary":"Replace the webhook signing secret (effective immediately)","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"New signing secret","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookSecret"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Account frozen, or not allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited; see `Retry-After`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/account":{"get":{"tags":["account"],"summary":"Get the authenticated account","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Account details and current tier limits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Account"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Account frozen, or not allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited; see `Retry-After`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/account/pause-all":{"post":{"tags":["account"],"summary":"Emergency stop: pause every job and monitor","description":"Kill switch for the human owner. Pauses all active jobs (cancelling pending runs) and all monitors (no more alerts). Nothing is deleted; resume jobs and monitors individually when ready.","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Paused","content":{"application/json":{"schema":{"type":"object","properties":{"jobsPaused":{"type":"integer"},"monitorsPaused":{"type":"integer"}},"required":["jobsPaused","monitorsPaused"]}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Account frozen, or not allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited; see `Retry-After`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/account/keys/revoke-all":{"post":{"tags":["account"],"summary":"Emergency stop: revoke every API key","description":"Revokes all of the account’s API keys, including the one making this call — the agent is locked out immediately. Sign in again with the wallet to mint a new key.","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Revoked","content":{"application/json":{"schema":{"type":"object","properties":{"revoked":{"type":"integer"}},"required":["revoked"]}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Account frozen, or not allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited; see `Retry-After`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/account/overview":{"get":{"tags":["account"],"summary":"One-call read-only snapshot (for an operator view)","description":"Everything a human needs to see the fleet at a glance: account, usage, credits, status counts, and the most recent monitors, jobs and payments.","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Overview","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AccountOverview"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Account frozen, or not allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited; see `Retry-After`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/jobs":{"post":{"tags":["jobs"],"summary":"Create a scheduled job (cron or one-off HTTP webhook)","description":"Supports the Idempotency-Key header. Deliveries are signed with T2L-Signature (see GET /v1/account/webhook-secret).","security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateJob"}}}},"responses":{"201":{"description":"Job created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Job"}}}},"400":{"description":"Invalid request (`validation_error` lists the failing fields)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Account frozen, or not allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict with the current state","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Target URL rejected (blocked address or unresolvable host)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited; see `Retry-After`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"get":{"tags":["jobs"],"summary":"List jobs (newest first)","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"integer","minimum":1,"maximum":100,"default":50},"required":false,"name":"limit","in":"query"},{"schema":{"type":"string","maxLength":200},"required":false,"name":"cursor","in":"query"}],"responses":{"200":{"description":"Jobs","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Job"}},"nextCursor":{"type":["string","null"]}},"required":["data","nextCursor"]}}}},"400":{"description":"Invalid request (`validation_error` lists the failing fields)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Account frozen, or not allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited; see `Retry-After`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/jobs/{id}":{"get":{"tags":["jobs"],"summary":"Get a job","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","pattern":"^job_[0-9A-Za-z]{22}$"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Job","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Job"}}}},"400":{"description":"Invalid request (`validation_error` lists the failing fields)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Account frozen, or not allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited; see `Retry-After`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"patch":{"tags":["jobs"],"summary":"Update a job","description":"Fields in `target` are merged; `target.headers`, when given, replaces all headers.","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","pattern":"^job_[0-9A-Za-z]{22}$"},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateJob"}}}},"responses":{"200":{"description":"Updated job","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Job"}}}},"400":{"description":"Invalid request (`validation_error` lists the failing fields)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Account frozen, or not allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited; see `Retry-After`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"tags":["jobs"],"summary":"Delete a job and its run history","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","pattern":"^job_[0-9A-Za-z]{22}$"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Deleted","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"deleted":{"type":"boolean","enum":[true]}},"required":["id","deleted"]}}}},"400":{"description":"Invalid request (`validation_error` lists the failing fields)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Account frozen, or not allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited; see `Retry-After`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/jobs/{id}/pause":{"post":{"tags":["jobs"],"summary":"Pause a job (pending runs are cancelled)","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","pattern":"^job_[0-9A-Za-z]{22}$"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Paused job","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Job"}}}},"400":{"description":"Invalid request (`validation_error` lists the failing fields)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Account frozen, or not allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict with the current state","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited; see `Retry-After`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/jobs/{id}/resume":{"post":{"tags":["jobs"],"summary":"Resume a paused job from now on","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","pattern":"^job_[0-9A-Za-z]{22}$"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Active job","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Job"}}}},"400":{"description":"Invalid request (`validation_error` lists the failing fields)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Account frozen, or not allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict with the current state","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited; see `Retry-After`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/jobs/{id}/trigger":{"post":{"tags":["jobs"],"summary":"Run a job now (counts against the monthly run quota)","description":"Supports the Idempotency-Key header.","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","pattern":"^job_[0-9A-Za-z]{22}$"},"required":true,"name":"id","in":"path"}],"responses":{"202":{"description":"Run queued","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Run"}}}},"400":{"description":"Invalid request (`validation_error` lists the failing fields)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"Payment required. With x402 enabled the `PAYMENT-REQUIRED` header (base64 JSON, x402 v2) lists the accepted payments and the body carries the same object plus `error`; retry the same request with `PAYMENT-SIGNATURE`. Without x402: `quota_exceeded`.","headers":{"PAYMENT-REQUIRED":{"description":"x402 v2 PaymentRequired, base64-encoded JSON","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Account frozen, or not allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited; see `Retry-After`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/jobs/{id}/runs":{"get":{"tags":["runs"],"summary":"List runs of a job (newest first, kept 30 days)","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","pattern":"^job_[0-9A-Za-z]{22}$"},"required":true,"name":"id","in":"path"},{"schema":{"type":"integer","minimum":1,"maximum":100,"default":50},"required":false,"name":"limit","in":"query"},{"schema":{"type":"string","maxLength":200},"required":false,"name":"cursor","in":"query"}],"responses":{"200":{"description":"Runs","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Run"}},"nextCursor":{"type":["string","null"]}},"required":["data","nextCursor"]}}}},"400":{"description":"Invalid request (`validation_error` lists the failing fields)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Account frozen, or not allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited; see `Retry-After`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/runs/{id}":{"get":{"tags":["runs"],"summary":"Get a run with its delivery attempts (log)","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","pattern":"^run_[0-9A-Za-z]{22}$"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Run","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/Run"},{"type":"object","properties":{"attemptLog":{"type":"array","items":{"$ref":"#/components/schemas/Attempt"}}},"required":["attemptLog"]}]}}}},"400":{"description":"Invalid request (`validation_error` lists the failing fields)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Account frozen, or not allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited; see `Retry-After`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/monitors":{"post":{"tags":["monitors"],"summary":"Create a heartbeat monitor (dead man’s switch)","description":"The monitor stays `new` until its first ping. After that, if no ping arrives within `ttlSeconds + graceSeconds` it becomes `dead` and alerts fire; the next ping makes it `alive` again (with a recovery alert). Supports the Idempotency-Key header.","security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateMonitor"}}}},"responses":{"201":{"description":"Monitor created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Monitor"}}}},"400":{"description":"Invalid request (`validation_error` lists the failing fields)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"Payment required. With x402 enabled the `PAYMENT-REQUIRED` header (base64 JSON, x402 v2) lists the accepted payments and the body carries the same object plus `error`; retry the same request with `PAYMENT-SIGNATURE`. Without x402: `quota_exceeded`.","headers":{"PAYMENT-REQUIRED":{"description":"x402 v2 PaymentRequired, base64-encoded JSON","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Account frozen, or not allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Target URL rejected (blocked address or unresolvable host)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited; see `Retry-After`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"get":{"tags":["monitors"],"summary":"List monitors (newest first)","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"integer","minimum":1,"maximum":100,"default":50},"required":false,"name":"limit","in":"query"},{"schema":{"type":"string","maxLength":200},"required":false,"name":"cursor","in":"query"}],"responses":{"200":{"description":"Monitors","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Monitor"}},"nextCursor":{"type":["string","null"]}},"required":["data","nextCursor"]}}}},"400":{"description":"Invalid request (`validation_error` lists the failing fields)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Account frozen, or not allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited; see `Retry-After`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/monitors/{id}":{"get":{"tags":["monitors"],"summary":"Get a monitor’s status","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","pattern":"^mon_[0-9A-Za-z]{22}$"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Monitor","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Monitor"}}}},"400":{"description":"Invalid request (`validation_error` lists the failing fields)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Account frozen, or not allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited; see `Retry-After`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"patch":{"tags":["monitors"],"summary":"Update a monitor","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","pattern":"^mon_[0-9A-Za-z]{22}$"},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateMonitor"}}}},"responses":{"200":{"description":"Updated monitor","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Monitor"}}}},"400":{"description":"Invalid request (`validation_error` lists the failing fields)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Account frozen, or not allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited; see `Retry-After`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"tags":["monitors"],"summary":"Delete a monitor","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","pattern":"^mon_[0-9A-Za-z]{22}$"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Deleted","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"deleted":{"type":"boolean","enum":[true]}},"required":["id","deleted"]}}}},"400":{"description":"Invalid request (`validation_error` lists the failing fields)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Account frozen, or not allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited; see `Retry-After`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/monitors/{id}/pause":{"post":{"tags":["monitors"],"summary":"Pause a monitor (no alerts while paused)","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","pattern":"^mon_[0-9A-Za-z]{22}$"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Paused monitor","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Monitor"}}}},"400":{"description":"Invalid request (`validation_error` lists the failing fields)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Account frozen, or not allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited; see `Retry-After`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/monitors/{id}/resume":{"post":{"tags":["monitors"],"summary":"Resume a monitor; a fresh TTL window starts now","description":"A paid monitor whose 30-day period has ended is charged again from credits; without enough credits the answer is an x402 `402` challenge.","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","pattern":"^mon_[0-9A-Za-z]{22}$"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Monitor","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Monitor"}}}},"400":{"description":"Invalid request (`validation_error` lists the failing fields)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"Payment required. With x402 enabled the `PAYMENT-REQUIRED` header (base64 JSON, x402 v2) lists the accepted payments and the body carries the same object plus `error`; retry the same request with `PAYMENT-SIGNATURE`. Without x402: `quota_exceeded`.","headers":{"PAYMENT-REQUIRED":{"description":"x402 v2 PaymentRequired, base64-encoded JSON","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Account frozen, or not allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited; see `Retry-After`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/monitors/{id}/events":{"get":{"tags":["monitors"],"summary":"Status transitions of a monitor (newest first, kept 30 days)","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","pattern":"^mon_[0-9A-Za-z]{22}$"},"required":true,"name":"id","in":"path"},{"schema":{"type":"integer","minimum":1,"maximum":100,"default":50},"required":false,"name":"limit","in":"query"},{"schema":{"type":"string","maxLength":200},"required":false,"name":"cursor","in":"query"}],"responses":{"200":{"description":"Events","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/MonitorEvent"}},"nextCursor":{"type":["string","null"]}},"required":["data","nextCursor"]}}}},"400":{"description":"Invalid request (`validation_error` lists the failing fields)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Account frozen, or not allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited; see `Retry-After`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/monitors/{id}/receipt":{"get":{"tags":["monitors"],"summary":"Signed liveness receipt — a portable, verifiable attestation of the monitor's state","description":"Returns a server-signed (Ed25519) receipt an agent can hand to a third party to prove its liveness: in particular that it halted on purpose (`halted_by_operator`) rather than silently missing its window (`missed_window`). Verify offline against the public key at `/.well-known/time2live-receipts.json` (Ed25519 over the canonical JSON of `receipt`: object keys sorted recursively, no whitespace).","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","pattern":"^mon_[0-9A-Za-z]{22}$"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Signed receipt","content":{"application/json":{"schema":{"type":"object","properties":{"receipt":{"type":"object","additionalProperties":{}},"signature":{"type":"object","properties":{"alg":{"type":"string","enum":["Ed25519"]},"keyId":{"type":"string"},"publicKey":{"type":"string"},"value":{"type":"string"}},"required":["alg","keyId","publicKey","value"]}},"required":["receipt","signature"]}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Account frozen, or not allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited; see `Retry-After`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/heartbeat/{id}":{"post":{"tags":["heartbeat"],"summary":"Ping a monitor (\"I am alive\")","description":"No API key needed: the unguessable monitor id is the credential. Keep the ping URL secret. Example: `curl -fsS -X POST https://time2live.xyz/v1/heartbeat/mon_…`","parameters":[{"schema":{"type":"string","pattern":"^mon_[0-9A-Za-z]{22}$"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Ping recorded","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"status":{"type":"string","enum":["new","alive","dead","paused"]},"previousStatus":{"type":"string","enum":["new","alive","dead","paused"]},"expiresAt":{"type":["string","null"],"format":"date-time"}},"required":["id","status","previousStatus","expiresAt"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited; see `Retry-After`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/billing":{"get":{"tags":["billing"],"summary":"Balance, tier and prices","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Billing overview","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Billing"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Account frozen, or not allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited; see `Retry-After`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/billing/activate":{"post":{"tags":["billing"],"summary":"Activate the free tier (one-off $0.10)","description":"Raises the free allowance to 3 monitors and 100 runs/month. Paid with x402 (USDC on Base). Call without payment to receive `402` with a `PAYMENT-REQUIRED` header, pay with any x402 v2 client and retry the same request with `PAYMENT-SIGNATURE`; the settlement receipt comes back in `PAYMENT-RESPONSE`. A no-op for activated accounts.","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Activated","content":{"application/json":{"schema":{"type":"object","properties":{"purchased":{"type":["string","null"],"example":"credits-1"},"paymentId":{"type":["string","null"]},"activated":{"type":"boolean"},"credits":{"type":"object","properties":{"balanceMicro":{"type":"integer"},"balanceUsd":{"type":"string"}},"required":["balanceMicro","balanceUsd"]}},"required":["purchased","paymentId","activated","credits"]}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"Payment required. With x402 enabled the `PAYMENT-REQUIRED` header (base64 JSON, x402 v2) lists the accepted payments and the body carries the same object plus `error`; retry the same request with `PAYMENT-SIGNATURE`. Without x402: `quota_exceeded`.","headers":{"PAYMENT-REQUIRED":{"description":"x402 v2 PaymentRequired, base64-encoded JSON","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Account frozen, or not allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited; see `Retry-After`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"501":{"description":"Not enabled on this server","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/billing/credits":{"post":{"tags":["billing"],"summary":"Buy prepaid credits","description":"Credits pay for runs beyond the free allowance ($0.000500 each) and extra monitors ($0.25 per 30 days). Paid with x402 (USDC on Base). Call without payment to receive `402` with a `PAYMENT-REQUIRED` header, pay with any x402 v2 client and retry the same request with `PAYMENT-SIGNATURE`; the settlement receipt comes back in `PAYMENT-RESPONSE`. x402 client SDKs cap single payments at $1 by default; raise `maxAmountPerPayment` to buy the $5 or $20 pack.","security":[{"bearerAuth":[]}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"pack":{"anyOf":[{"type":"number","enum":[1]},{"type":"number","enum":[5]},{"type":"number","enum":[20]}],"default":1,"description":"Pack size in USD"}}}}}},"responses":{"200":{"description":"Credits added","content":{"application/json":{"schema":{"type":"object","properties":{"purchased":{"type":["string","null"],"example":"credits-1"},"paymentId":{"type":["string","null"]},"activated":{"type":"boolean"},"credits":{"type":"object","properties":{"balanceMicro":{"type":"integer"},"balanceUsd":{"type":"string"}},"required":["balanceMicro","balanceUsd"]}},"required":["purchased","paymentId","activated","credits"]}}}},"400":{"description":"Invalid request (`validation_error` lists the failing fields)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"Payment required. With x402 enabled the `PAYMENT-REQUIRED` header (base64 JSON, x402 v2) lists the accepted payments and the body carries the same object plus `error`; retry the same request with `PAYMENT-SIGNATURE`. Without x402: `quota_exceeded`.","headers":{"PAYMENT-REQUIRED":{"description":"x402 v2 PaymentRequired, base64-encoded JSON","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Account frozen, or not allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited; see `Retry-After`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"501":{"description":"Not enabled on this server","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/billing/payments":{"get":{"tags":["billing"],"summary":"Settled payments (newest first, max 100)","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Payments","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"product":{"type":"string"},"amountUsd":{"type":"string"},"network":{"type":"string"},"transaction":{"type":"string"},"payer":{"type":["string","null"]},"createdAt":{"type":"string","format":"date-time"}},"required":["id","product","amountUsd","network","transaction","payer","createdAt"]}}},"required":["data"]}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Account frozen, or not allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited; see `Retry-After`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/account/telegram/link":{"post":{"tags":["account"],"summary":"Start linking a Telegram chat for monitor alerts","description":"Open the returned URL in Telegram and press Start (valid 15 minutes). Then enable `alerts.telegram` on monitors. Send /stop to the bot to unlink.","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Deep link to the bot","content":{"application/json":{"schema":{"type":"object","properties":{"url":{"type":"string"},"expiresAt":{"type":"string","format":"date-time"}},"required":["url","expiresAt"]}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Account frozen, or not allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited; see `Retry-After`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"501":{"description":"Not enabled on this server","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/account/telegram":{"delete":{"tags":["account"],"summary":"Unlink the Telegram chat","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Unlinked","content":{"application/json":{"schema":{"type":"object","properties":{"linked":{"type":"boolean","enum":[false]}},"required":["linked"]}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Account frozen, or not allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited; see `Retry-After`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}},"webhooks":{}}