{"openapi":"3.1.0","info":{"title":"Agentline API","version":"1.2.1","description":"Email inboxes for AI agents: send and read email and wait for one-time codes. Texting is coming soon; the SMS, calls, voice and owner mobile endpoints are not available yet. Successful authenticated responses include RateLimit-Limit, RateLimit-Remaining and RateLimit-Reset. Every 429 includes Retry-After. A 429 from one of Agentline's own limits also includes the RateLimit headers for the limit that was reached; a 429 passed on from the mail provider doesn't. RateLimit-Reset and Retry-After are in seconds.","contact":{"email":"support@agentline.nz"},"x-logo":{"url":"https://agentline.nz/logo.png","altText":"Agentline"}},"servers":[{"url":"https://agentline.nz/api/v1"}],"security":[{"bearer":[]}],"components":{"securitySchemes":{"bearer":{"type":"http","scheme":"bearer","description":"API key (al_live_…)"}},"responses":{"Error":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"headers":{"RateLimit-Limit":{"description":"Requests allowed in the current window.","schema":{"type":"integer","minimum":0}},"RateLimit-Remaining":{"description":"Requests remaining in the current window.","schema":{"type":"integer","minimum":0}},"RateLimit-Reset":{"description":"Seconds until the current window resets.","schema":{"type":"integer","minimum":0}},"Retry-After":{"description":"Seconds to wait before retrying after a 429 response.","required":true,"schema":{"type":"integer","minimum":0}}},"schemas":{"Error":{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["code","message"],"properties":{"code":{"type":"string"},"message":{"type":"string"}}}}},"EmailSummary":{"type":"object","required":["id","direction","from","to","subject","snippet","code","status","read","hasAttachments","createdAt"],"properties":{"id":{"type":"string"},"direction":{"type":"string","enum":["in","out"]},"from":{"type":"string"},"to":{"type":"string"},"subject":{"type":["string","null"]},"snippet":{"type":["string","null"],"description":"First 280 characters of the text body."},"code":{"type":["string","null"],"description":"One-time code detected in the email, if any."},"status":{"type":"string"},"read":{"type":"boolean"},"hasAttachments":{"type":"boolean"},"createdAt":{"type":"string","format":"date-time"}}},"Email":{"allOf":[{"$ref":"#/components/schemas/EmailSummary"},{"type":"object","required":["text","html","messageId","inReplyTo","attachments"],"properties":{"text":{"type":["string","null"]},"html":{"type":["string","null"]},"messageId":{"type":["string","null"]},"inReplyTo":{"type":["string","null"]},"attachments":{"type":"array","items":{"type":"object","required":["filename","mimeType","size"],"properties":{"filename":{"type":"string"},"mimeType":{"type":"string"},"size":{"type":"integer"}}}}}}]},"Inbox":{"type":"object","required":["id","address","status","graceUntil"],"properties":{"id":{"type":"string"},"address":{"type":"string","format":"email"},"status":{"type":"string","enum":["active","grace","released"]},"graceUntil":{"type":["string","null"],"format":"date-time"}}},"Sms":{"type":"object","required":["id","direction","from","to","body","status","code","error","read","createdAt"],"properties":{"id":{"type":"string"},"direction":{"type":"string","enum":["in","out"]},"from":{"type":"string"},"to":{"type":"string"},"body":{"type":"string"},"status":{"type":"string"},"code":{"type":["string","null"]},"error":{"type":["string","null"]},"read":{"type":"boolean"},"createdAt":{"type":"string","format":"date-time"}}},"Call":{"type":"object","required":["id","direction","from","to","status","durationSeconds","transcript","hasRecording","createdAt"],"properties":{"id":{"type":"string"},"direction":{"type":"string","enum":["in","out"]},"from":{"type":"string"},"to":{"type":"string"},"status":{"type":"string"},"durationSeconds":{"type":["integer","null"]},"transcript":{"type":["string","null"]},"hasRecording":{"type":"boolean"},"createdAt":{"type":"string","format":"date-time"}}},"Signup":{"type":"object","required":["account_id","api_key","inbox","plan","agent_name","owner","verification","restrictions","mcp_url","mcp","upgrade","timings_ms"],"properties":{"account_id":{"type":"string"},"api_key":{"type":"string"},"inbox":{"type":["string","null"]},"plan":{"type":"string"},"agent_name":{"type":"string"},"owner":{"type":"object","required":["email","verified"],"properties":{"email":{"type":"string","format":"email"},"verified":{"type":"boolean"}}},"verification":{"type":"object","required":["email","expires_at"],"properties":{"email":{"type":"string","enum":["sent","failed"]},"expires_at":{"type":"string","format":"date-time"}}},"restrictions":{"type":"string"},"mcp_url":{"type":"string","format":"uri"},"mcp":{"type":"object","required":["url","headers","config"],"properties":{"url":{"type":"string","format":"uri"},"headers":{"type":"object","required":["Authorization"],"properties":{"Authorization":{"type":"string"}}},"config":{"type":"object","required":["mcpServers"],"properties":{"mcpServers":{"type":"object","required":["agentline"],"properties":{"agentline":{"type":"object","required":["url","headers"],"properties":{"url":{"type":"string","format":"uri"},"headers":{"type":"object","required":["Authorization"],"properties":{"Authorization":{"type":"string"}}}}}}}}}}},"upgrade":{"type":"string"},"timings_ms":{"type":"object","additionalProperties":{"type":"number"}}}},"VoiceSettings":{"type":"object","required":["numberId","number","voiceAvailable","mode","target","greeting","voicemailEnabled"],"properties":{"numberId":{"type":"string"},"number":{"type":"string"},"voiceAvailable":{"type":"boolean"},"mode":{"type":"string","enum":["message","forward_phone","forward_sip","stream"]},"target":{"type":["string","null"]},"greeting":{"type":["string","null"]},"voicemailEnabled":{"type":"boolean"}}},"ApiKey":{"type":"object","required":["id","name","prefix","createdAt","lastUsedAt","revoked"],"properties":{"id":{"type":"string"},"name":{"type":"string"},"prefix":{"type":"string"},"createdAt":{"type":["string","null"],"format":"date-time"},"lastUsedAt":{"type":["string","null"],"format":"date-time"},"revoked":{"type":"boolean"}}},"OwnerVerification":{"type":"object","required":["phoneVerified","ownerVerified","phone"],"properties":{"phoneVerified":{"type":"boolean"},"ownerVerified":{"type":"boolean"},"phone":{"type":"string"}}},"OwnerPhoneVerification":{"type":"object","required":["phone","textTo","expiresAt","instructions"],"properties":{"phone":{"type":"string"},"textTo":{"type":"string"},"expiresAt":{"type":"string","format":"date-time"},"instructions":{"type":"string"}}},"AuditEvent":{"type":"object","required":["id","actor","action","target","detail","createdAt"],"properties":{"id":{"type":"string"},"actor":{"type":"string"},"action":{"type":"string"},"target":{"type":["string","null"]},"detail":{},"createdAt":{"type":"string","format":"date-time"}}},"Billing":{"type":"object","required":["plan","planName","priceNzdPerMonth","status","trialEligible","trialEndsAt","currentPeriodEnd","allowances","comped","portalAvailable","availablePlans"],"properties":{"plan":{"type":"string"},"planName":{"type":["string","null"]},"priceNzdPerMonth":{"type":["number","null"]},"status":{"type":"string"},"trialEligible":{"type":"boolean"},"trialEndsAt":{"type":["string","null"],"format":"date-time"},"currentPeriodEnd":{"type":["string","null"],"format":"date-time"},"allowances":{"type":["object","null"],"required":["inboxes","emailsPerMonth","trial"],"properties":{"numbers":{"type":"integer"},"inboxes":{"type":"integer"},"smsLimit":{"type":"integer"},"smsWindow":{"type":"string","enum":["trial","month"]},"emailsPerMonth":{"type":"integer"},"voice":{"type":"boolean"},"voiceMinutesPerMonth":{"type":"integer"},"trial":{"type":"boolean"}}},"comped":{"type":"boolean"},"portalAvailable":{"type":"boolean"},"availablePlans":{"type":"array","items":{"type":"object","required":["id","name","priceNzdPerMonth","trialDays"],"properties":{"id":{"type":"string","enum":["free","starter","pro"]},"name":{"type":"string"},"priceNzdPerMonth":{"type":"number"},"trialDays":{"type":"integer"}}}}}},"BillingLink":{"type":"object","required":["url","sent_to"],"properties":{"url":{"type":"string","format":"uri"},"sent_to":{"type":"string","format":"email"}}},"Me":{"type":"object","required":["accountId","plan","status","createdBy","ownerVerified","sendingRestriction","inboxes","trial","usageThisMonth"],"properties":{"accountId":{"type":"string"},"plan":{"type":"string"},"status":{"type":"string"},"createdBy":{"type":"string","enum":["human","agent"]},"ownerVerified":{"type":"boolean"},"sendingRestriction":{"type":["string","null"],"description":"Set while the account can only send to the owner's verified contacts."},"inboxes":{"type":"array","items":{"$ref":"#/components/schemas/Inbox"}},"texting":{"type":"string","enum":["none","pending","has_number"],"description":"Texting is coming soon. Values other than none appear only on legacy accounts."},"trial":{"oneOf":[{"type":"null"},{"type":"object","required":["endsAt","limits"],"properties":{"endsAt":{"type":["string","null"],"format":"date-time"},"limits":{"type":"string"},"smsSegmentsUsed":{"type":"integer"},"smsSegmentsIncluded":{"type":"integer"}}}]},"numbers":{"type":"array","items":{"$ref":"#/components/schemas/Number"}},"numbersPending":{"type":"integer"},"numberPendingSince":{"type":["string","null"],"format":"date-time"},"usageThisMonth":{"type":"object","required":["emailsSent","emailsIncluded"],"properties":{"smsSent":{"type":"integer"},"smsIncluded":{"type":"integer"},"emailsSent":{"type":"integer"},"emailsIncluded":{"type":"integer"},"voiceMinutes":{"type":"integer"},"voiceMinutesIncluded":{"type":"integer"}}}}},"Number":{"type":"object","required":["id","number","status","capabilities","voiceMode","graceUntil","test"],"properties":{"id":{"type":"string"},"number":{"type":"string"},"status":{"type":"string","enum":["active","grace","released"]},"capabilities":{"type":"object","required":["sms","voice"],"properties":{"sms":{"type":"boolean"},"voice":{"type":"boolean"}}},"voiceMode":{"type":"string","enum":["message","forward_phone","forward_sip","stream"]},"graceUntil":{"type":["string","null"],"format":"date-time"},"test":{"type":"boolean"}}}}},"paths":{"/me":{"get":{"operationId":"getMe","summary":"Account, inboxes and usage","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Me"}}},"headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"}}},"401":{"description":"unauthorized: the API key is missing or invalid.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/Error"},{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["code","message"],"properties":{"code":{"type":"string","enum":["unauthorized"]},"message":{"type":"string"}}}}}]}}}},"403":{"description":"account_suspended: the account is suspended.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/Error"},{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["code","message"],"properties":{"code":{"type":"string","enum":["account_suspended"]},"message":{"type":"string"}}}}}]}}}},"429":{"description":"rate_limited: too many requests; retry after the Retry-After header's seconds.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/Error"},{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["code","message"],"properties":{"code":{"type":"string","enum":["rate_limited"]},"message":{"type":"string"}}}}}]}}},"headers":{"Retry-After":{"$ref":"#/components/headers/Retry-After"}}},"500":{"description":"internal_error: the request failed unexpectedly.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/Error"},{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["code","message"],"properties":{"code":{"type":"string","enum":["internal_error"]},"message":{"type":"string"}}}}}]}}}}}}},"/sms":{"get":{"operationId":"listSms","summary":"List SMS (coming soon: texting is not available yet)","parameters":[{"name":"direction","in":"query","schema":{"type":"string"}},{"name":"contact","in":"query","schema":{"type":"string"}},{"name":"unread_only","in":"query","schema":{"type":"string"}},{"name":"since_seconds","in":"query","schema":{"type":"string"}},{"name":"limit","in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","required":["messages"],"properties":{"messages":{"type":"array","items":{"$ref":"#/components/schemas/Sms"}}}}}},"headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"}}},"401":{"$ref":"#/components/responses/Error"},"409":{"description":"no_number: texting and calls are coming soon, so SMS, call and owner mobile requests need a legacy account that already has a number. Legacy accounts can also get other 409 codes.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"rate_limited: too many requests; retry after the Retry-After header's seconds.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/Error"},{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["code","message"],"properties":{"code":{"type":"string","enum":["rate_limited"]},"message":{"type":"string"}}}}}]}}},"headers":{"Retry-After":{"$ref":"#/components/headers/Retry-After"}}},"500":{"description":"internal_error: the request failed unexpectedly.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/Error"},{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["code","message"],"properties":{"code":{"type":"string","enum":["internal_error"]},"message":{"type":"string"}}}}}]}}}}}},"post":{"operationId":"sendSms","summary":"Send SMS (coming soon: texting is not available yet)","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["to","body"],"properties":{"to":{"type":"string"},"body":{"type":"string","maxLength":1600},"from":{"type":"string"}}}}}},"responses":{"201":{"description":"Sent","content":{"application/json":{"schema":{"type":"object","required":["message"],"properties":{"message":{"$ref":"#/components/schemas/Sms"}}}}},"headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"}}},"400":{"$ref":"#/components/responses/Error"},"402":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"409":{"description":"no_number: texting and calls are coming soon, so SMS, call and owner mobile requests need a legacy account that already has a number. Legacy accounts can also get other 409 codes.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"$ref":"#/components/responses/Error"},"429":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Retry-After":{"$ref":"#/components/headers/Retry-After"}}},"500":{"description":"internal_error: the request failed unexpectedly.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/Error"},{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["code","message"],"properties":{"code":{"type":"string","enum":["internal_error"]},"message":{"type":"string"}}}}}]}}}}}}},"/sms/{id}":{"get":{"operationId":"getSms","summary":"Read SMS (coming soon: texting is not available yet)","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","required":["message"],"properties":{"message":{"$ref":"#/components/schemas/Sms"}}}}},"headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"}}},"404":{"$ref":"#/components/responses/Error"},"409":{"description":"no_number: texting and calls are coming soon, so SMS, call and owner mobile requests need a legacy account that already has a number. Legacy accounts can also get other 409 codes.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"rate_limited: too many requests; retry after the Retry-After header's seconds.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/Error"},{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["code","message"],"properties":{"code":{"type":"string","enum":["rate_limited"]},"message":{"type":"string"}}}}}]}}},"headers":{"Retry-After":{"$ref":"#/components/headers/Retry-After"}}},"500":{"description":"internal_error: the request failed unexpectedly.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/Error"},{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["code","message"],"properties":{"code":{"type":"string","enum":["internal_error"]},"message":{"type":"string"}}}}}]}}}}}}},"/emails":{"get":{"operationId":"listEmails","summary":"List emails","parameters":[{"name":"direction","in":"query","schema":{"type":"string"}},{"name":"unread_only","in":"query","schema":{"type":"string"}},{"name":"since_seconds","in":"query","schema":{"type":"string"}},{"name":"limit","in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","required":["emails"],"properties":{"emails":{"type":"array","items":{"$ref":"#/components/schemas/EmailSummary"}}}}}},"headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"}}},"401":{"description":"unauthorized: the API key is missing or invalid.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/Error"},{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["code","message"],"properties":{"code":{"type":"string","enum":["unauthorized"]},"message":{"type":"string"}}}}}]}}}},"403":{"description":"key_not_confirmed: the owner hasn't opened the verification link we emailed them, so this key can't use this endpoint yet. account_suspended: the account is suspended.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/Error"},{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["code","message"],"properties":{"code":{"type":"string","enum":["key_not_confirmed","account_suspended"]},"message":{"type":"string"}}}}}]}}}},"429":{"description":"rate_limited: too many requests; retry after the Retry-After header's seconds.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/Error"},{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["code","message"],"properties":{"code":{"type":"string","enum":["rate_limited"]},"message":{"type":"string"}}}}}]}}},"headers":{"Retry-After":{"$ref":"#/components/headers/Retry-After"}}},"500":{"description":"internal_error: the request failed unexpectedly.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/Error"},{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["code","message"],"properties":{"code":{"type":"string","enum":["internal_error"]},"message":{"type":"string"}}}}}]}}}}}},"post":{"operationId":"sendEmail","summary":"Send email","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["to","subject","text"],"properties":{"to":{"oneOf":[{"type":"string"},{"type":"array","items":{"type":"string"},"maxItems":5}]},"subject":{"type":"string"},"text":{"type":"string"},"html":{"type":"string"},"from":{"type":"string"},"reply_to_id":{"type":"string"}}}}}},"responses":{"201":{"description":"Sent","content":{"application/json":{"schema":{"type":"object","required":["email"],"properties":{"email":{"$ref":"#/components/schemas/EmailSummary"}}}}},"headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"description":"unauthorized: the API key is missing or invalid.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/Error"},{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["code","message"],"properties":{"code":{"type":"string","enum":["unauthorized"]},"message":{"type":"string"}}}}}]}}}},"402":{"$ref":"#/components/responses/Error"},"403":{"description":"recipient_not_allowed: this account or key can only email the owner's verified address for now. account_suspended: the account is suspended.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/Error"},{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["code","message"],"properties":{"code":{"type":"string","enum":["recipient_not_allowed","account_suspended"]},"message":{"type":"string"}}}}}]}}}},"409":{"description":"no_inbox: the account has no active inbox yet.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/Error"},{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["code","message"],"properties":{"code":{"type":"string","enum":["no_inbox"]},"message":{"type":"string"}}}}}]}}}},"422":{"$ref":"#/components/responses/Error"},"429":{"description":"owner_unverified: an unconfirmed key has used its sends for the day. rate_limited: too many requests; retry after the Retry-After header's seconds.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/Error"},{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["code","message"],"properties":{"code":{"type":"string","enum":["owner_unverified","rate_limited"]},"message":{"type":"string"}}}}}]}}},"headers":{"Retry-After":{"$ref":"#/components/headers/Retry-After"}}},"500":{"description":"internal_error: the request failed unexpectedly.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/Error"},{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["code","message"],"properties":{"code":{"type":"string","enum":["internal_error"]},"message":{"type":"string"}}}}}]}}}}}}},"/emails/{id}":{"get":{"operationId":"getEmail","summary":"Read email (doesn't change read state)","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","required":["email"],"properties":{"email":{"$ref":"#/components/schemas/Email"}}}}},"headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"}}},"401":{"description":"unauthorized: the API key is missing or invalid.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/Error"},{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["code","message"],"properties":{"code":{"type":"string","enum":["unauthorized"]},"message":{"type":"string"}}}}}]}}}},"403":{"description":"key_not_confirmed: the owner hasn't opened the verification link we emailed them, so this key can't use this endpoint yet. account_suspended: the account is suspended.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/Error"},{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["code","message"],"properties":{"code":{"type":"string","enum":["key_not_confirmed","account_suspended"]},"message":{"type":"string"}}}}}]}}}},"404":{"$ref":"#/components/responses/Error"},"429":{"description":"rate_limited: too many requests; retry after the Retry-After header's seconds.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/Error"},{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["code","message"],"properties":{"code":{"type":"string","enum":["rate_limited"]},"message":{"type":"string"}}}}}]}}},"headers":{"Retry-After":{"$ref":"#/components/headers/Retry-After"}}},"500":{"description":"internal_error: the request failed unexpectedly.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/Error"},{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["code","message"],"properties":{"code":{"type":"string","enum":["internal_error"]},"message":{"type":"string"}}}}}]}}}}}}},"/mark-read":{"post":{"operationId":"markEmailRead","summary":"Mark emails read, or unread","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["ids"],"properties":{"ids":{"type":"array","items":{"type":"string"},"minItems":1,"maxItems":100},"read":{"type":"boolean","default":true}}}}}},"responses":{"200":{"description":"updated and notFound ids","content":{"application/json":{"schema":{"type":"object","required":["read","updated","notFound"],"properties":{"read":{"type":"boolean"},"updated":{"type":"array","items":{"type":"object","required":["id","kind"],"properties":{"id":{"type":"string"},"kind":{"type":"string","enum":["sms","email"],"description":"Legacy accounts that already have a number can also get sms."}}}},"notFound":{"type":"array","items":{"type":"string"}}}}}},"headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"description":"unauthorized: the API key is missing or invalid.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/Error"},{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["code","message"],"properties":{"code":{"type":"string","enum":["unauthorized"]},"message":{"type":"string"}}}}}]}}}},"403":{"description":"key_not_confirmed: the owner hasn't opened the verification link we emailed them, so this key can't use this endpoint yet. account_suspended: the account is suspended.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/Error"},{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["code","message"],"properties":{"code":{"type":"string","enum":["key_not_confirmed","account_suspended"]},"message":{"type":"string"}}}}}]}}}},"429":{"description":"rate_limited: too many requests; retry after the Retry-After header's seconds.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/Error"},{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["code","message"],"properties":{"code":{"type":"string","enum":["rate_limited"]},"message":{"type":"string"}}}}}]}}},"headers":{"Retry-After":{"$ref":"#/components/headers/Retry-After"}}},"500":{"description":"internal_error: the request failed unexpectedly.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/Error"},{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["code","message"],"properties":{"code":{"type":"string","enum":["internal_error"]},"message":{"type":"string"}}}}}]}}}}}}},"/emails/{id}/raw":{"get":{"operationId":"getRawEmail","summary":"Original RFC 822 message","description":"Original messages aren't stored in production, so this returns 404 not_found.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"message/rfc822","content":{"message/rfc822":{"schema":{"type":"string"}}},"headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"}}},"401":{"description":"unauthorized: the API key is missing or invalid.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/Error"},{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["code","message"],"properties":{"code":{"type":"string","enum":["unauthorized"]},"message":{"type":"string"}}}}}]}}}},"403":{"description":"key_not_confirmed: the owner hasn't opened the verification link we emailed them, so this key can't use this endpoint yet. account_suspended: the account is suspended.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/Error"},{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["code","message"],"properties":{"code":{"type":"string","enum":["key_not_confirmed","account_suspended"]},"message":{"type":"string"}}}}}]}}}},"404":{"description":"not_found: the original message isn't stored.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"rate_limited: too many requests; retry after the Retry-After header's seconds.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/Error"},{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["code","message"],"properties":{"code":{"type":"string","enum":["rate_limited"]},"message":{"type":"string"}}}}}]}}},"headers":{"Retry-After":{"$ref":"#/components/headers/Retry-After"}}},"500":{"description":"internal_error: the request failed unexpectedly.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/Error"},{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["code","message"],"properties":{"code":{"type":"string","enum":["internal_error"]},"message":{"type":"string"}}}}}]}}}}}}},"/wait-for-code":{"post":{"operationId":"waitForCode","summary":"Wait for a one-time code to arrive in the inbox","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"channel":{"enum":["sms","email","any"]},"timeout_seconds":{"type":"integer","maximum":55},"from_contains":{"type":"string"},"since_seconds":{"type":"integer"}}}}}},"responses":{"200":{"description":"{found:boolean, code?, channel?, from?, receivedAt?}","content":{"application/json":{"schema":{"type":"object","required":["found"],"properties":{"found":{"type":"boolean"},"code":{"type":"string"},"channel":{"type":"string","enum":["sms","email"],"description":"Legacy accounts that already have a number can also get sms."},"messageId":{"type":"string"},"from":{"type":"string"},"receivedAt":{"type":"string","format":"date-time"},"preview":{"type":"string"}}}}},"headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"}}},"401":{"description":"unauthorized: the API key is missing or invalid.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/Error"},{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["code","message"],"properties":{"code":{"type":"string","enum":["unauthorized"]},"message":{"type":"string"}}}}}]}}}},"403":{"description":"key_not_confirmed: the owner hasn't opened the verification link we emailed them, so this key can't use this endpoint yet. account_suspended: the account is suspended.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/Error"},{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["code","message"],"properties":{"code":{"type":"string","enum":["key_not_confirmed","account_suspended"]},"message":{"type":"string"}}}}}]}}}},"409":{"description":"no_number: texting and calls are coming soon, so SMS, call and owner mobile requests need a legacy account that already has a number.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/Error"},{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["code","message"],"properties":{"code":{"type":"string","enum":["no_number"]},"message":{"type":"string"}}}}}]}}}},"429":{"description":"rate_limited: too many requests; retry after the Retry-After header's seconds.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/Error"},{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["code","message"],"properties":{"code":{"type":"string","enum":["rate_limited"]},"message":{"type":"string"}}}}}]}}},"headers":{"Retry-After":{"$ref":"#/components/headers/Retry-After"}}},"500":{"description":"internal_error: the request failed unexpectedly.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/Error"},{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["code","message"],"properties":{"code":{"type":"string","enum":["internal_error"]},"message":{"type":"string"}}}}}]}}}}}}},"/calls":{"get":{"operationId":"listCalls","summary":"List calls (coming soon: calls are not available yet)","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","required":["calls"],"properties":{"calls":{"type":"array","items":{"$ref":"#/components/schemas/Call"}}}}}},"headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"}}},"409":{"description":"no_number: texting and calls are coming soon, so SMS, call and owner mobile requests need a legacy account that already has a number. Legacy accounts can also get other 409 codes.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"rate_limited: too many requests; retry after the Retry-After header's seconds.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/Error"},{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["code","message"],"properties":{"code":{"type":"string","enum":["rate_limited"]},"message":{"type":"string"}}}}}]}}},"headers":{"Retry-After":{"$ref":"#/components/headers/Retry-After"}}},"500":{"description":"internal_error: the request failed unexpectedly.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/Error"},{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["code","message"],"properties":{"code":{"type":"string","enum":["internal_error"]},"message":{"type":"string"}}}}}]}}}}}},"post":{"operationId":"placeCall","summary":"Place a call (coming soon: calls are not available yet)","responses":{"201":{"description":"Queued","content":{"application/json":{"schema":{"type":"object","required":["call"],"properties":{"call":{"$ref":"#/components/schemas/Call"}}}}},"headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"}}},"402":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"409":{"description":"no_number: texting and calls are coming soon, so SMS, call and owner mobile requests need a legacy account that already has a number. Legacy accounts can also get other 409 codes.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"rate_limited: too many requests; retry after the Retry-After header's seconds.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/Error"},{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["code","message"],"properties":{"code":{"type":"string","enum":["rate_limited"]},"message":{"type":"string"}}}}}]}}},"headers":{"Retry-After":{"$ref":"#/components/headers/Retry-After"}}},"500":{"description":"internal_error: the request failed unexpectedly.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/Error"},{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["code","message"],"properties":{"code":{"type":"string","enum":["internal_error"]},"message":{"type":"string"}}}}}]}}}}}}},"/signup":{"post":{"operationId":"signup","summary":"Agent self-signup (no auth, one call). Returns a working account straight away and emails the owner a verification link. Opening that link gives the key full use of the account. Until then it can only read GET /me and message the owner's verified email; every other endpoint returns 403 key_not_confirmed.","security":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"owner_email":{"type":"string","format":"email"},"agent_name":{"type":"string","maxLength":60}},"required":["owner_email"]}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Signup"}}}},"400":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Retry-After":{"$ref":"#/components/headers/Retry-After"}}},"500":{"description":"internal_error: the request failed unexpectedly.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/Error"},{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["code","message"],"properties":{"code":{"type":"string","enum":["internal_error"]},"message":{"type":"string"}}}}}]}}}}}}},"/voice":{"get":{"operationId":"getVoiceSettings","summary":"Call settings (coming soon: calls are not available yet)","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","required":["numbers"],"properties":{"numbers":{"type":"array","items":{"$ref":"#/components/schemas/VoiceSettings"}}}}}},"headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"}}},"401":{"$ref":"#/components/responses/Error"},"409":{"description":"no_number: texting and calls are coming soon, so SMS, call and owner mobile requests need a legacy account that already has a number. Legacy accounts can also get other 409 codes.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"rate_limited: too many requests; retry after the Retry-After header's seconds.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/Error"},{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["code","message"],"properties":{"code":{"type":"string","enum":["rate_limited"]},"message":{"type":"string"}}}}}]}}},"headers":{"Retry-After":{"$ref":"#/components/headers/Retry-After"}}},"500":{"description":"internal_error: the request failed unexpectedly.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/Error"},{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["code","message"],"properties":{"code":{"type":"string","enum":["internal_error"]},"message":{"type":"string"}}}}}]}}}}}}},"/voice/{number_id}":{"patch":{"operationId":"updateVoiceSettings","summary":"Update call settings (coming soon: calls are not available yet)","parameters":[{"name":"number_id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"mode":{"type":"string","enum":["message","forward_sip","stream","forward_phone"]},"target":{"type":"string"},"greeting":{"type":"string"},"voicemail_enabled":{"type":"boolean"}},"required":[]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","required":["settings"],"properties":{"settings":{"$ref":"#/components/schemas/VoiceSettings"}}}}},"headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"}}},"400":{"$ref":"#/components/responses/Error"},"402":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"description":"no_number: texting and calls are coming soon, so SMS, call and owner mobile requests need a legacy account that already has a number. Legacy accounts can also get other 409 codes.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"rate_limited: too many requests; retry after the Retry-After header's seconds.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/Error"},{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["code","message"],"properties":{"code":{"type":"string","enum":["rate_limited"]},"message":{"type":"string"}}}}}]}}},"headers":{"Retry-After":{"$ref":"#/components/headers/Retry-After"}}},"500":{"description":"internal_error: the request failed unexpectedly.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/Error"},{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["code","message"],"properties":{"code":{"type":"string","enum":["internal_error"]},"message":{"type":"string"}}}}}]}}}}}}},"/keys":{"get":{"operationId":"listApiKeys","summary":"List API keys","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","required":["keys"],"properties":{"keys":{"type":"array","items":{"$ref":"#/components/schemas/ApiKey"}}}}}},"headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"}}},"429":{"description":"rate_limited: too many requests; retry after the Retry-After header's seconds.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/Error"},{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["code","message"],"properties":{"code":{"type":"string","enum":["rate_limited"]},"message":{"type":"string"}}}}}]}}},"headers":{"Retry-After":{"$ref":"#/components/headers/Retry-After"}}},"500":{"description":"internal_error: the request failed unexpectedly.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/Error"},{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["code","message"],"properties":{"code":{"type":"string","enum":["internal_error"]},"message":{"type":"string"}}}}}]}}}}}},"post":{"operationId":"createApiKey","summary":"Create an API key (secret returned once)","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","maxLength":60}},"required":["name"]}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"type":"object","required":["key","secret"],"properties":{"key":{"$ref":"#/components/schemas/ApiKey"},"secret":{"type":"string"}}}}},"headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"}}},"400":{"$ref":"#/components/responses/Error"},"429":{"description":"rate_limited: too many requests; retry after the Retry-After header's seconds.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/Error"},{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["code","message"],"properties":{"code":{"type":"string","enum":["rate_limited"]},"message":{"type":"string"}}}}}]}}},"headers":{"Retry-After":{"$ref":"#/components/headers/Retry-After"}}},"500":{"description":"internal_error: the request failed unexpectedly.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/Error"},{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["code","message"],"properties":{"code":{"type":"string","enum":["internal_error"]},"message":{"type":"string"}}}}}]}}}}}}},"/keys/{id}":{"delete":{"operationId":"revokeApiKey","summary":"Revoke an API key","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Revoked","content":{"application/json":{"schema":{"type":"object","required":["revoked"],"properties":{"revoked":{"type":"boolean"}}}}},"headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"}}},"404":{"$ref":"#/components/responses/Error"},"429":{"description":"rate_limited: too many requests; retry after the Retry-After header's seconds.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/Error"},{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["code","message"],"properties":{"code":{"type":"string","enum":["rate_limited"]},"message":{"type":"string"}}}}}]}}},"headers":{"Retry-After":{"$ref":"#/components/headers/Retry-After"}}},"500":{"description":"internal_error: the request failed unexpectedly.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/Error"},{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["code","message"],"properties":{"code":{"type":"string","enum":["internal_error"]},"message":{"type":"string"}}}}}]}}}}}}},"/owner/verify":{"post":{"operationId":"verifyOwnerMobile","summary":"Confirm the owner's mobile with a code (coming soon: texting is not available yet; only the emailed link verifies the account)","description":"Accepts only a code Agentline texted to the owner's mobile after POST /owner/phone, relayed by the owner.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"}},"required":["code"]}}}},"responses":{"200":{"description":"Verified","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OwnerVerification"}}},"headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"}}},"400":{"$ref":"#/components/responses/Error"},"409":{"description":"no_number: texting and calls are coming soon, so SMS, call and owner mobile requests need a legacy account that already has a number. Legacy accounts can also get other 409 codes.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Retry-After":{"$ref":"#/components/headers/Retry-After"}}},"500":{"description":"internal_error: the request failed unexpectedly.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/Error"},{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["code","message"],"properties":{"code":{"type":"string","enum":["internal_error"]},"message":{"type":"string"}}}}}]}}}}}}},"/owner/phone":{"post":{"operationId":"startOwnerMobileVerification","summary":"Start owner mobile verification (coming soon: texting is not available yet)","description":"Agentline texts a 6-digit code to the mobile. The code is never in the response: the owner gives it to the agent for POST /owner/verify, or texts it from that phone to `textTo`. Returns 503 owner_sms_unavailable, and changes nothing, when Agentline can't text the owner. Each account can start at most 3 a day (UTC), whatever the mobile; 400 invalid_phone if the mobile is an Agentline number.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"phone":{"type":"string"}},"required":["phone"]}}}},"responses":{"201":{"description":"Started","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OwnerPhoneVerification"}}},"headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"}}},"400":{"$ref":"#/components/responses/Error"},"409":{"description":"no_number: texting and calls are coming soon, so SMS, call and owner mobile requests need a legacy account that already has a number. Legacy accounts can also get other 409 codes.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"owner_sms_daily_limit: Agentline has already texted this account's owner 3 codes today (UTC); retry after the Retry-After header's seconds. rate_limited: too many requests; retry after the Retry-After header's seconds.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/Error"},{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["code","message"],"properties":{"code":{"type":"string","enum":["owner_sms_daily_limit","rate_limited"]},"message":{"type":"string"}}}}}]}}},"headers":{"Retry-After":{"$ref":"#/components/headers/Retry-After"}}},"500":{"description":"internal_error: the request failed unexpectedly.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/Error"},{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["code","message"],"properties":{"code":{"type":"string","enum":["internal_error"]},"message":{"type":"string"}}}}}]}}}},"503":{"$ref":"#/components/responses/Error"}}}},"/audit":{"get":{"operationId":"listAuditLog","summary":"Recent audit log entries","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","required":["events"],"properties":{"events":{"type":"array","items":{"$ref":"#/components/schemas/AuditEvent"}}}}}},"headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"}}},"429":{"description":"rate_limited: too many requests; retry after the Retry-After header's seconds.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/Error"},{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["code","message"],"properties":{"code":{"type":"string","enum":["rate_limited"]},"message":{"type":"string"}}}}}]}}},"headers":{"Retry-After":{"$ref":"#/components/headers/Retry-After"}}},"500":{"description":"internal_error: the request failed unexpectedly.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/Error"},{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["code","message"],"properties":{"code":{"type":"string","enum":["internal_error"]},"message":{"type":"string"}}}}}]}}}}}}},"/billing":{"get":{"operationId":"getBilling","summary":"Plan, status, trial and allowances","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Billing"}}},"headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"}}},"429":{"description":"rate_limited: too many requests; retry after the Retry-After header's seconds.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/Error"},{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["code","message"],"properties":{"code":{"type":"string","enum":["rate_limited"]},"message":{"type":"string"}}}}}]}}},"headers":{"Retry-After":{"$ref":"#/components/headers/Retry-After"}}},"500":{"description":"internal_error: the request failed unexpectedly.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/Error"},{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["code","message"],"properties":{"code":{"type":"string","enum":["internal_error"]},"message":{"type":"string"}}}}}]}}}}}}},"/billing/checkout":{"post":{"operationId":"createCheckoutLink","summary":"Emails the owner a Stripe Checkout link to start a paid plan, and returns it","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"plan":{"type":"string","enum":["starter","pro"]}},"required":["plan"]}}}},"responses":{"200":{"description":"Checkout link","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BillingLink"}}},"headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"}}},"400":{"$ref":"#/components/responses/Error"},"429":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Retry-After":{"$ref":"#/components/headers/Retry-After"}}},"500":{"description":"internal_error: the request failed unexpectedly.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/Error"},{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["code","message"],"properties":{"code":{"type":"string","enum":["internal_error"]},"message":{"type":"string"}}}}}]}}}}}}},"/billing/portal":{"post":{"operationId":"createPortalLink","summary":"Stripe Customer Portal URL, also emailed to the owner. Plan changes or cancellation in the next 24 hours are emailed to the owner.","responses":{"200":{"description":"Portal link","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BillingLink"}}},"headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"}}},"400":{"$ref":"#/components/responses/Error"},"429":{"description":"rate_limited: too many requests; retry after the Retry-After header's seconds.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/Error"},{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["code","message"],"properties":{"code":{"type":"string","enum":["rate_limited"]},"message":{"type":"string"}}}}}]}}},"headers":{"Retry-After":{"$ref":"#/components/headers/Retry-After"}}},"500":{"description":"internal_error: the request failed unexpectedly.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/Error"},{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["code","message"],"properties":{"code":{"type":"string","enum":["internal_error"]},"message":{"type":"string"}}}}}]}}}}}}}}}